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

25,465,587-Pentesting SMTP

Previous53-Pentesting DNSNext110,995-Pentesting POP

Last updated 1 year ago

Was this helpful?

SMTP (Simple Mail Transfer Protocol) şəbəkə üzərindən kompüterlər arasında elektron poçt (e-poçt) mesajlarını ötürmək üçün istifadə edilən rabitə protokoludur.

Qeyd edilən IP ünvanı və port 25-də SMTP-ni (Sadə Poçt Transfer Protokolu) hədəfləyən xüsusi skriptlərlə Nmap əmri:

nmap --script=smtp-commands,smtp-enum-users,smtp-vuln-cve2010-4344,smtp-vuln-cve2011-1720,smtp-vuln-cve2011-1764 -p 25 <target-ip>
  • smtp-commands : SMTP əmrlərini sınamaq üçün skript.

  • smtp-enum-users : e-poçt ünvanlarını listələmək üçün Nmap skripti.

  • smtp-vuln-cve2010-4344 : SMTP zəifliyini yoxlamaq üçün Nmap skripti (CVE-2010-4344).

  • smtp-vuln-cve2011-1720 : SMTP zəifliyini yoxlamaq üçün Nmap skripti (CVE-2011-1720).

  • smtp-vuln-cve2011-1764 : SMTP zəifliyini yoxlamaq üçün Nmap skripti (CVE-2011-1764).

Nmap versiya və skript skanı:

nmap -sV -script banner -p 25 <target-ip>

NetCat SMTP serverinə qoşulmaq üçün istifadə edilə bilər:

nc <target-ip>  25

Server haqqında məlumat toplamaq üçün SMTP banner’inin əldə edilməsi:

telnet <target> 25

Nmap ilə Banner Grabbing:

nmap --script smtp-commands -p 25 <target>

Msfconsole istifadə edərək SMTP istifadəçilərinin listələnməsi:

msfconsole
use auxiliary/scanner/smtp/smtp_enum
set RHOSTS <target>
run

Port 25 - SMTP (Simple Mail Transfer Protocol):

openssl s_client -starttls smtp -connect <target-ip>:25

Bu əmr 25-ci portdakı SMTP serverinə qoşulur, “-starttls smtp” openssl-ə təhlükəsiz əlaqə üçün TLS handshake başlatmağı əmr edir.

Port 465 - SMTP (SSL/TLS üzərindən)

openssl s_client -crlf -connect <target-ip>:465

Bu əmr 465 portundakı SMTP serverinə qoşulur. -crlf seçimi client’in CRLF sətir sonlarından istifadə etməli olduğunu göstərir.

Port 587 - STARTTLS ilə SMTP Submission:

openssl s_client -starttls smtp -crlf -connect <target-ip>:587

Bu əmr 587 portundakı SMTP serverinə qoşulur, hansı ki, bu port əsasən client-to-server əlaqəsi üçün istifadə olunur.

Hər hansı bir istifadəçi tapılarsa, bu istifadəçiyə brute force hücumu edə bilərik:

hydra -l <username> -P <password_list> -s 25 -vV <target> smtp

Enumeration mərhələsindən sonrakı mərhələ "explotation" mərhələsidir.

EHLO əmrinə cavab olaraq serverlərin imkanları (şifrələmə, autentifikasiya və s.) göndərilir.

EHLO attaker.com

EHLO outputun-da STARTTLS açar sözü görünəndə server şifrələməni dəstəkləyir.

Commands

8BITMIME - allow to send 8-bit data
8BITMIME - allow to send 8-bit data

AUTH - authentication for the SMTP connection

AUTH - authentication for the SMTP connection

CHUNKING - transfer chunks of data

CHUNKING - transfer chunks of data

DSN (Delivery Status Notifications) - notify delivery status

DSN (Delivery Status Notifications) - notify delivery status

ENHANCEDSTATUSCODES - allow to show more details of the status

ENHANCEDSTATUSCODES - allow to show more details of the status

ETRN - process remote queue

ETRN - process remote queue

EXPN - expand mailing list

EXPN - expand mailing list

HELP - help about commands

HELP - help about commands

PIPELINING - allow the multiple commands

PIPELINING - allow the multiple commands

SIZE - maximum message size that can be received

SIZE - maximum message size that can be received

STARTTLS - communicate with TLS

STARTTLS - communicate with TLS

SEND - send message to terminal

SEND - send message to terminal

Sending an Email from linux console

swaks --to $(cat emails | tr ' n' ',' | less) –from [email protected] --header "Subject: test" --body "please click here <http://10.10.14.42/>" --server 192.168.83.131

swaks: Bu, SMTP serverlərini sınaqdan keçirmək üçün yardım proqramı olan Swaks üçün icra olunan əmr xəttidir.

  • -to $(cat e-poçtları | tr ' n' ',' | az): Bu hissə "e-poçtlar" adlı fayldan e-poçt ünvanlarını oxuyur, onları vergüllə ayrılmış siyahıya formatlaşdırır və alıcı ünvanları kimi ötürür. e-poçt üçün.

$(cat emails): Bu əmr "e-poçt" faylının məzmununu oxuyur.

tr ' n' ',': Bu əmr yeni sətir simvollarını vergüllə əvəz edir, e-poçt ünvanlarının vergüllə ayrılmış siyahısını effektiv şəkildə yaradır.

  • -header "Mövzu: test": Bu, e-poçt mövzusunu "test" olaraq təyin edir.

  • -server 192.168.83.131: Bu, SMTP serverinin IP ünvanını "192.168.83.131" kimi müəyyən edir.

SPF, DKIM, DMARC

E-poçtlardan sui-istifadə hallarını azaltmaq üçün təqdim edilən üç əks tədbir var.

SPF

The Sender Policy Framework göndərən sistemin MAIL FROM sahəsində göstərilən domen üçün e-poçt göndərmək səlahiyyətinin olub olmadığını yoxlayır.

Bunu etmək üçün o, göndərən domenin DNS qeydlərində xüsusi SPF girişi olan TXT qeydinin olub olmadığını yoxlayır:

Aşağıdakı nümunədə siz millisec.org-un SPF siyasətini oxuya bilərsiniz. İlk SPF siyasətinə digər domenlərin SPF siyasətlərini necə daxil etdiyinə diqqət yetirin:

DKIM

DomainKeys Identified Mail, göndəricidən alıcıya keçid zamanı e-poçta heç bir müdaxilənin baş vermədiyinə əmin olmaq üçün nəzərdə tutulmuş təhlükəsizlik standartıdır.

DMARC

Domain-based Message Authentication, Reporting & Conformance başqa bir standartdır ki, bu da spamerlərin sizin icazəniz olmadan e-poçt göndərmək üçün domeninizdən istifadə etməsinə mane olur. SPF və DKIM üzərində qurulur.

To obtain the DMARC record, you need to query the subdomain _dmarc

-from : Bu, göndərənin e-poçt ünvanını "" olaraq təyin edir.

-body "zəhmət olmasa bura klikləyin ": Bu, e-poçtun əsas hissəsini "zəhmət olmasa " olaraq təyin edir.

[email protected]
[email protected]
http://10.10.14.42/
http://10.10.14.42/