-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDKScanner.py
More file actions
98 lines (84 loc) · 5.07 KB
/
DKScanner.py
File metadata and controls
98 lines (84 loc) · 5.07 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
import requests
from bs4 import BeautifulSoup
import openai
# Initializing the ChatGPT API
openai.api_key = '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'
class DKScanner:
def __init__(self):
self.target_url = ""
self.vulnerabilities = []
def banner(self):
ascii_art = """
,.................,,,,..................,,.....................................,,,........
..................,,..................,,,...:?*+:,.............................,..........
...................................,:;:,,..,S@###S?+:,....................,,..............
..............,.................,,:**::?:..+#######%%S*,.................,,:,.............
..............................,,,;S+.;#*..:#########??@S;.................................
............................,,,.:#?.:##:.,?%%SS######*S##;...........,,...................
............................,...%#:.*#+.:+**??%%S####%S##S,.......,,,.....................
...,,,..................::,....:##:.:+*%%??*??%%SS########+.....,,,..................,....
...,,,..................,,.....*##:;??+;+*%%SSS%%?%S######%,.,,,..........................
..............................,#S***;+?S###########S%S##S#S;.,............................
.............................,%%;;;*S##########SS%*+;+?%SS%%,.............................
.............................++,;%%S#########+:,,.....,*S%%#%.............,,..............
............................,::%#@+,%%%%S####;....:;+*+:##%%#+............,,,.............
.............................+S###+:;S#SS%*?#;:*%S##@#;,###%%#:...........................
........,,,.................:%S###+S%%S###??#;.:?%%?+,,:S###?S*..........................,
......,,.................,,,:####S*S###SS####;....,,:+?+S###%%?.......................,,,.
...,,,................,,,,,..*####S*%%SS#####+....,;***S##S?*#+.::,................,,,....
,,,,................,,,,......*####S#%%S#####%:..::+S####S++%?..,,...............,,,......
,.................,,,,.........;%###SS;*####%?+,:;,;SS##S:;%*,................,,,,........
..................,.......,:+?+:,+###S+,+###%?+.,..*###%,;%%*;:,..........................
.............,,,......,:+?S####*+::%###%;?S##%,..;%###*:*%%####S?+:,......................
.............,,,.....,*#@@######?**:+####*+S#;,+%#S#%*?SSS#######@#?:.....................
......................,:+%###SS##%*%+;S##S*##%S##S??*SS%########%*:,......................
..........................:+?%%###S+%?;#%%?###%#S??%#?S###%+:.....,,...................
.............................,;*%#@#+?**%%?%S#*S#+%#?S###%*;,....,,,................,,....
....,..................,,,.......:+%#;+;?%???+*S#+#?##%+:......,,,.................,::,...
.....................,,,............:+.:??***+*S#*%?*:.......,,,..........................
,.................,,,..................:??+**++:?;:,......,,,.............................
.......................................:??;+*;;.+:........................................
.............,,,.................,,,,..,*?:;*...+:........................................
.............,,,..................,,....,?.,;...:,........................................
..............................,.........,;................................................
............................,,,...........................................................
"""
print(ascii_art)
print("################################")
print("# DK Scanner v2.0 #")
print("# Ethical Cart Vulnerability #")
print("################################")
print()
def set_target(self):
self.target_url = input("Enter target shopping cart URL: ")
def chat_gpt_query(self, query):
response = openai.Completion.create(prompt=query, max_tokens=150)
return response.choices[0].text.strip()
def price_manipulation_test(self):
response = requests.get(self.target_url)
soup = BeautifulSoup(response.text, 'html.parser')
price_inputs = [inp for inp in soup.find_all('input') if 'price' in inp.attrs.get('name', '').lower()]
for price_input in price_inputs:
manipulated_price = {'value': '0.00'}
price_input.attrs.update(manipulated_price)
manipulated_page = str(soup)
if "0.00" in manipulated_page:
self.vulnerabilities.append("Possible price manipulation vulnerability detected.")
def cross_reference_cve(self):
cve_matches = []
for vuln in self.vulnerabilities:
response = self.chat_gpt_query(f"Find CVEs related to: {vuln}")
cve_matches.append(response)
return cve_matches
def run(self):
self.banner()
self.set_target()
self.price_manipulation_test()
matches = self.cross_reference_cve()
print("\nPotential Vulnerabilities and CVE Matches:")
for i, vuln in enumerate(self.vulnerabilities):
print(f"{i+1}. {vuln}")
print(f" CVE Match: {matches[i]}\n")
if __name__ == "__main__":
scanner = DKScanner()
scanner.run()