Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys
- import msfrpc
- import time
- if __name__ == '__main__':
- client = msfrpc.Msfrpc({})
- client.login(user='msf', password='mypass')
- res = client.call('console.create')
- console_id = res['id']
- print "res: %s" %res
- a = client.call('console.write', [console_id, "use auxiliary/scanner/snmp/snmp_loginn"])
- time.sleep(1)
- time.sleep(1)
- a = client.call('console.write', [console_id, "runn"])
- time.sleep(5)
- while True:
- res = client.call('console.read',[console_id])
- if len(res['data']) > 1:
- print res['data'],
- if res['busy'] == True:
- time.sleep(1)
- continue
- break
- cleanup = client.call('console.destroy',[console_id])
- print "Cleanup result: %s" %cleanup['result']
Add Comment
Please, Sign In to add comment