Sun, 13 Oct 2013

Python3 and metasploit msgpack .:.permalink.:.

Last post was the basics of metasploit, python2 and msgpack. Getting this to work in python3 take a tweak or two

The biggest issue is python3's handling of strings as bytes (or the other way around if you like). So what was:

		resdata=msgpack.unpackb(response.read())
		if resdata['busy']==True and len(resdata['data'])==0:
Is now:
		resdata=msgpack.unpackb(response.read())
		if resdata[b'busy']==True and len(resdata[b'data'])==0:

For reference, here's a python 3 version of the msfconsole.py script from last time that opens a console, searches for rpc and exits: msfconsole.py

While I'm at it, here's some other reference scripts as well:

Hope those are useful to someone braving the way to metasploit and python3!

Posted at: Sun, 13 Oct 2013 | category: /itsec