forked from bl4de/security-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutils.py
More file actions
62 lines (49 loc) · 1.85 KB
/
Copy pathutils.py
File metadata and controls
62 lines (49 loc) · 1.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/usr/bin/python
"""HTML source analyzer
bl4de | bloorq@gmail.com | Twitter: @_bl4de | H1: bl4de
This tool goes through HTML document and shows all interesting places,
like inline JavaScript calls, commented paths, 'debug' and similar
words occurences, possible DOM Injection points, references to
resources like images or iframes
utils.py contains functions to display results, banners, helps and all
other information presented by HTML analyzer
"""
from console_output_beautifier import ConsoleOutputBeautifier
summary = {
"comment": [],
"script": [],
"resources": [],
"javascript": [],
"debug": [],
"admin": []
}
def print_banner():
print ConsoleOutputBeautifier.getColor("green"), \
"=" * 20, "HTML source code Analyzer", "=" * 20, "\n", \
" https://github.com/bl4de | https://twitter.com/_bl4de \n" \
" https://hackerone.com/bl4de | bloorq@gmail.com ", \
"\n\n", \
ConsoleOutputBeautifier.getSpecialChar("endline")
def print_output_line(i, col, msg, msg_args, type="DEFAULT"):
"""printing line of output"""
msg = "{} line {}: {} {}".format(
ConsoleOutputBeautifier.getColor("white"),
i,
col,
str(msg % msg_args)
)
print msg
def create_summary(_type, _message):
"""stores output line message in summary"""
if _type.lower() in summary.keys() and _message != "":
summary[_type].append(_message)
def show_stats(_file, i, _ident, _fw):
"""showing summary stats about HTML file"""
print ConsoleOutputBeautifier.getColor(
"green"), "\n------ SUMMARY -------\n"
print "total lines of code: %d" % (i)
print "identified CMS: %s" % (_ident)
print "identified framework: %s" % (
_fw), ConsoleOutputBeautifier.getSpecialChar("endline")
# end of summary
print "\n"