-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
63 lines (40 loc) · 2.32 KB
/
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
51
52
53
54
55
56
57
58
59
60
61
62
63
import requests
from bs4 import BeautifulSoup
banner = """ \u001b[1;91m
\t\t ██████╗████████╗███████╗ █████╗ ██╗ ██╗████████╗ ██████╗
\t\t██╔════╝╚══██╔══╝██╔════╝██╔══██╗██║ ██║╚══██╔══╝██╔═══██╗
\t\t██║ ███╗ ██║ █████╗ ███████║██║ ██║ ██║ ██║ ██║
\t\t██║ ██║ ██║ ██╔══╝ ██╔══██║██║ ██║ ██║ ██║ ██║
\t\t╚██████╔╝ ██║ ██║ ██║ ██║╚██████╔╝ ██║ ╚██████╔╝
\t\t╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═════╝
\t\t\t\t\t\t\033[92m- By l3v1ath4n
"""
print(banner)
print("\u001b[1;93m[~] \u001b[1;92mEnter which binary to find : ")
print(" \u001b[1;97m|")
print(" \u001b[1;97m|------------",end='')
what_to_find = input("")
page = requests.get(
f"https://gtfobins.github.io/gtfobins/{what_to_find}")
soup = BeautifulSoup(page.content, 'html.parser')
all_h1_tags = []
all_code_tags = []
for element in soup.select('h2'):
all_h1_tags.append(element.text)
remove_code = []
for element in soup.select('.highlighter-rouge'):
remove_code.append(element.text)
for element in soup.select('code'):
all_code_tags.append(element.text)
for element in range(len(remove_code)):
if remove_code[element] in all_code_tags:
all_code_tags.remove(remove_code[element])
else:
pass
for element in range(len(all_code_tags)):
print(" \u001b[92;1m|--\u001b[1;94m[*] "+all_h1_tags[element])
print(" \u001b[92;1m|")
print(" \u001b[92;1mv")
print("\u001b[1;97m"+ all_code_tags[element])
print("\u001b[1;97m")
print("\u001b[1;97m")