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. Network Services Pentesting

139,445-Pentesting SMB

Previous110,995-Pentesting POPNext3306-Pentesting MySQL

Last updated 1 year ago

Was this helpful?

SMB, digər sistemlərlə əlaqə saxlamaq üçün kompüterdə və ya serverdə açıq port tələb edən şəbəkə fayl paylaşma protokoludur. SMB portları 139 və 445 portlarıdır. SMB protokolu şəbəkədəki fayllara, printerlərə, serial portlara və digər resurslara girişi paylaşmaq üçün istifadə edilən klient-server əlaqə protokoludur. Həmçinin o Windows, Linux və macOS kimi müxtəlif əməliyyat sistemləri ilə işləyən cihazlar arasında fayl və resurs mübadiləsinə imkan verən çarpaz platforma olmaq üçün nəzərdə tutulmuşdur.

SMB protokolunun bir çox versiyaları var, SMB1, SMB2 və SMB3 ən görkəmliləridir. Hər bir versiya təhlükəsizlik, performans və xüsusiyyətlər baxımından təkmilləşdirmələr gətirir. Bundan elave olaraq datani oturende məlumatları qorumaq və yalnız səlahiyyətli istifadəçilərin paylaşılan resurslara daxil ola bilməsini təmin etmək üçün şifrələmə və autentifikasiya mexanizmləri daxil olmaqla müxtəlif təhlükəsizlik funksiyalarini yerine yetirir.

SMBMap

smbmap -H <ip>

SMBMap faylları ötürmək və ya paylaşım adlarına baxmaq üçün istifadə edilə bilər.

smbclient -L 192.168.1.40
smbclient //192.168.1.40/guest
get file.txt

Indi isə gəlin SMB protokolunun exploitinə keçək. Ilk öncə metasploit üzərindən baxaq.

Linux termininda metasploit IP scan etdikdə görürük ki, SMB (445) portu açıqdır. Bizim ilk baxmalı olduğumuz yerlərdən biri onun versiyasıdir.

Burdan görürük ki metasploit də smb protocolu Samba smbd 3.0.20-Debian versiyasindan istifade edir. Biz internet üzərindən müxtəlif araşdırmalar edərək bu versiyanın exploitinin olub olmadığını araşdırırıq.

Araşdırmadan çıxan nəticələrə əsasən biz bu nəticəyə gəlirik ki, bu protocolu “username map script” ilə exploit edə bilərik. Artiq bizə lazım olacaq payloadı bilirik. Indi onu msfconsole vasitəsilə istifadə edəcəyik.

Msfconsole-da bu payloadı tapmaq üçün payload da bildiyimiz sözləri filterləyə bilərik.

search -p samba -p map

Biz modulu tapdıq indi isə sıra onu istifadə etmək və bəzi parametrleri ayarlayaraq exploit etməkdədir.

Burada options yazaraq teleb olunan parametrləri görə bilərik ( qarşılarında “yes” yazilib). Biz RHOSTS yerinə metasplitin IP sini, LHOST yerinə isə bizim oz IP mizi yazırıq. Ve son addım çalışdırmaq üçün ya run əmrindən ya da exploit əmrindən istifadə edirik.

Gördüyümüz kimi biz artiq içəridəyik, burada bizim üçün shell açıldı və indi istədiyimiz əmri çalışdıra bilərik.