-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
50 lines (30 loc) · 1012 Bytes
/
main.py
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
#!/usr/bin/python3
import requests
import re
comments = "<\W*--.*?--\W*>"
#<!-- -->
def finder(f):
for url in f:
finds = []
a = re.sub("\n|%0a", "", url)
response = requests.get(a, allow_redirects=True)
for comment in re.findall(comments, response.text):
finds.append(comment)
if len(finds) > 0:
print("\n[+] " + str(response.status_code) + " " + url)
for find in finds:
if len(find) > 240:
print(find[:240])
print("[...]\n")
else:
print(find)
def main():
with open(arguments.file) as f:
finder(f)
if __name__ == '__main__':
import argparse
parser = argparse.ArgumentParser(
description='Bracket is a tool to find all html comments in a site for a given url.')
parser.add_argument('--file', '-f', action='store', dest='file', required=True)
arguments = parser.parse_args()
main()