Created
June 9, 2012 22:27
-
-
Save steeve85/2902817 to your computer and use it in GitHub Desktop.
Nmap Dionaea http
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def list_directory(self, path): | |
#[..] | |
r = [] | |
displaypath = cgi.escape(self.header.path) | |
r.append('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">') | |
r.append("<html>\n<title>Directory listing for %s</title>\n" % displaypath) | |
r.append("<body>\n<h2>Directory listing for %s</h2>\n" % displaypath) | |
r.append("<hr>\n<ul>\n") | |
for name in list: | |
fullname = os.path.join(path, name) | |
displayname = linkname = name | |
if os.path.isdir(fullname): | |
displayname = name + "/" | |
linkname = name + "/" | |
if os.path.islink(fullname): | |
displayname = name + "@" | |
r.append('<li><a href="%s">%s</a>\n' % (urllib.parse.quote(linkname), cgi.escape(displayname))) | |
r.append("</ul>\n<hr>\n</body>\n</html>\n") | |
#[..] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment