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. Post-Explotation
  2. Linux Post-Explotation

Linux Local Enumeration

Linux Local Enumeration

Linux Local Enumeration, sistemə daxil olan bir hücumçunun əsas addımıdır və mövcud məlumatları, prosesləri, quraşdırılmış proqramları, istifadəçiləri və şəbəkə konfiqurasiyasını aşkar etmək üçün istifadə olunur.

  • Kernel, Əməliyyat Sistemi və Cihaz Məlumatı:

uname -a             # Bütün mövcud sistem məlumatlarını çap edir
uname -r             # Kernel versiyası
uname -n             # Sistem hostname göstərir
hostname             # Sistem hostname göstərir
cat /proc/version    # Kernel məlumatı
df -a                # Fayl sistemi haqqında məlumat məlumatı
lsb_release -a       # sistem məlumatları
  • İstifadəçilər və Qruplar

whoami               # Cari istifadəçi adı
id                   # Cari istifadəçi məlumatları
cat /etc/passwd      # Sistemdəki bütün istifadəçiləri sadalayın
cat /etc/group       # Sistemdəki bütün qrupları sadalayın
cat /etc/shadow      # İstifadəçi hashlərini göstər(**Privileged command**)
finger               # Hazırda hansı userin daxil olduqunu göstərir
pinky                # Hazırda hansı userin daxil olduqunu göstərir
users                # Hazırda hansı userin daxil olduqunu göstərir
who -a               # Hazırda hansı userin daxil olduqunu göstərir
w                    # Daxil olan userin nə etdiyini göstərir
last                 # Əvvəl daxil olan userlərin siyahası və
lastlog              # Bütün istifadəçilərin sonuncu dəfə nə vaxt daxil olduğu barədə məlumat
  • İşləyan servis haqqda məlumat:

ps aux               # İşləyən servis və proqramlar haqqda məlumat verir
top                  # ps aux-dan fərqli olaraq dinamiq formada göstərir
  • Digərləri:

pwd                  # Hans qovluqda olduqunu və həmən qoluqun yolunu göstərir
history              # Cari istifadəcinin termial kecmişini göstərir
systemctl
  • Lazım ola biləcək əmrlər

find / -perm -4000 -type f 2>/dev/null     # SUID faylarını tapır
find / -uid 0 -perm -4000 -type f 2>/dev/null     # root-a məxsus SUID faylarını tapır
find / -perm -2000 -type f 2>/dev/null     # GUID faylarını tapır
find / -perm -2 -type f 2>/dev/null     # Yazmaq(**world-writeable)** icazəsi olan fayları tapır
find / ! -path "*/proc/*" -perm -2 -type f -print 2>/dev/null 	  # /proc qovluqunun icində olan istina olmaqla yazma icazəsi olan fayları tapır
find / -perm -2 -type d 2>/dev/null    # Yazmaq icazəsi olan qovluqları tapır
find /home –name *.rhosts -print 2>/dev/null     # Rhost konfiqurasiya fayllarını tapır
find /home -iname *.plan -exec ls -la {} ; -exec cat {} 2>/dev/null ; 	# *.plan faylarını tapır,icazələri sıralayır və faylın kontentini oxuyur
find /etc -iname hosts.equiv -exec ls -la {} 2>/dev/null ; -exec cat {} 2>/dev/null ; 	# hosts.equiv faylını tapır, icazələri sıralayır və faylın kontentini oxuyur
ls -ahlR /root/ 	# Digər userlərin qovluqunda baxa biləcəyi fayları tapır
cat ~/.bash_history 	# Cari istifadəcinin əmr tarixcəsini götərir
ls -la ~/.*_history 	# Userin başqa history faylarını axtarır
ls -la /root/.*_history 	# root-un history faylarını tapır
ls -la ~/.ssh/ 	# cari istifafəcinin dovluqunda ssh faylarını axtarır
find / -name "id_dsa*" -o -name "id_rsa*" -o -name "known_hosts" -o -name "authorized_hosts" -o -name "authorized_keys" 2>/dev/null |xargs -r ls -la 	# SSH keys/host haqqda məlumat
ls -la /usr/sbin/in.* 	# inetd servic-lərinin konfiqrasiyasını yoxlayır
grep -l -i <example> /var/log/*.log 2>/dev/null 	# Açar sözlərinə uyğun log faylarını tapır
find /var/log -type f -exec ls -la {} ; 2>/dev/null 	#Secilmiş qovluqu icindəki fayların siyahası (/var/log)
find /var/log -name *.log -type f -exec ls -la {} ; 2>/dev/null 	# Müəyən edilmiş qovluqda .log fayların siyahasın (/var/log)
ls -la /etc/*.conf 	#As above
head /var/mail/root 	# root mail-lərini oxumaq üçün
  • Networking, Routing & Communications:

ifconfig -a       	               # Bütün şəbəkə interfeyslərini sıralayır
iwconfig                           #
cat /etc/network/interfaces        # Bütün şəbəkə interfeyslərini sıralayır
arp -a 	                           # ARP cədvəlini göstərir
route 	                           # rout məlumatlarını göstərir
cat /etc/resolv.conf               # Konfiqurasiya edilmiş DNS server ünvanlarını göstərin
netstat -antp                      # Bütün TCP sockets və əlaqəli PID-ləri sıralayır (-p Privileged command)
netstat -anup 	                   # Bütün UDP sockets və əlaqəli PID-ləri sıralayır (-p Privileged command)
iptables -L 	                     # Qaydalar siyahası – Privileged command
cat /etc/services                  # Port nömrələrinin/servisləri xəritələşdirilməsinə baxır
  • SMB Enumeration

Enum4linux Windows və Samba sistemlərindən məlumatları sadalamaq üçün bir vasitədir.

enum4linux <tagetIP>
enum4linux -a <targetIP>   # Hər şeyə Enumeration
enum4linux -v <targetIP>   # Enumeration zamanı istifadə etdiyi əmrləri göstərir
enum4linux -o <targetIP>   # əməliyat sistemi barədə məlumat verir
enum4linux -r <targetIP>   # Userləri sıralayır
enum4linux -G <tagetIP>    # Qrupları sıralayır
  • ***nmap-****də smb enumeration

nmap --script smb-enum-shares -p 139,445 <targetIP>
**--script smb-enum-shares**    # nmap-də smb paylaşılmış fayları tapmaq üçün hazır script-di
**-p 139,445**                  # yalnız 139 və 445 portlarını skan etsin

smbmap ilə smb enumeration

smbmap -H <targetIP>   # Mövcud icazələri olan bütün paylaşım fayların siyahısı
smbmap -u <username> -p <password> -H <targetIP>

smbclient ilə smb enumeration

smbclient -L \\\\\\\\<targetIP>\\\\          # paylşılmış fayları göstərir
smbclient \\\\\\\\<targetIP>\\\\filename     # paylaşılmış qovluqla əlaqə qurur(icazi olmayana password isteyir)
  • Əməliyat sisteminin nə qədər müddət aktiv olduqunu göstərir

uptime
uptime -p
  • NFS Paylaşımlarını görmek

showmount -e <host>
  • LinPEAS

linPEAS sistemi enumeration edir və Privileges etmənin yolarını göstərir.

linPEAS kali linuxun özündə olur.Tapmaq üçün bu əmri istifadə edin:

find / 2>/dev/null |grep linpeas.sh

Sistemə daxil olduqdan sonra oranı linpeas ile enumeration etmək üçün birinci o sistemə linpeası yükləməliyik.Öz sisteminizdə linpeas olan yerde python server qaldırırıq.

python -m http.service 8080

Sonra wget əmri ilə /tmp faylının daxilinə yükləyirik.Tmp faylina yükləmə səbəbi o qovluqda hər bir user fayl yuklemə silmə və runlama içazəsi var.Yüklədikdən sonra ./linpeas.sh yazıb linpeas işə saliriq.

PreviousLinux Post-ExplotationNextLinux Privilege Escalation

Last updated 1 year ago

Was this helpful?