📄 index.py
字号:
import honeydimport timeimport supportfrom htmltmpl import TemplateManager, TemplateProcessorglobal counterself.send_response(200)self.send_header("Content-Type", "text/html")self.send_nocache()self.end_headers()# Compile or load already precompiled template.template = TemplateManager().prepare(self.root+"/templates/index.tmpl")tproc = TemplateProcessor(0)# Process commands given to usmessage = support.parse_query(self.query)# Set the title.tproc.set("title", "Honeyd Administration Interface")# Testtry: counter += 1except: counter = 1greeting = ("Welcome to the Honeyd Administration Interface." "You are visitor %d.<p>") % countercontent = support.interface_table()content += "<p>" + support.stats_table(self.root) + "</p>\n"content += "<p>" + support.status_connections(self.root, "tcp") + "</p>\n"content += "<p>" + support.status_connections(self.root, "udp") + "</p>\n"side_content = ("<div class=graphs>" "<img height=155 width=484 src=/graphs/traffic_hourly.gif><br>" "<img height=155 width=484 src=/graphs/traffic_daily.gif>" "</div>")support.security_check(tproc)if message: tproc.set("message", message)tproc.set("greeting", greeting)tproc.set("content", content)tproc.set("side_content", side_content)tproc.set("uptime", support.uptime())# Print the processed template.self.wfile.write(tproc.process(template))
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -