eJPT Junior Penetration Tester
ShopAuthorPatreonHTB Pro Labs
eCPPTv2 Certified Professional Penetration Tester
eCPPTv2 Certified Professional Penetration Tester
  • 🍕eCPPTv2 Study
  • Author
  • Certification
    • 🟢Exam Description
    • Register
  • RFS Tips
    • 🟢Before the Exam
    • 🟢Prepare your Setup
    • 🟢Questions?
    • 🎓Learn more... Get eCPPTv2
    • 🟢Start Hacking
  • Reports
    • PwnDoc Documentation
    • 🟢Templates
  • Methodology
    • 🟢To Scan a Network
    • 🟢To Attack a Linux Machine
    • 🟢To Attack a Windows Machine
    • 🟠Linux Privilege Escalation
    • Windows Privilege Escalation
    • Linux Post Exploitation
    • Windows Post Exploitation
    • Pivoting Methodology
  • Web Tools
    • Why these Tools
    • Rev Shells
    • MD5 Crack
    • CyberChef
    • SecLists
    • WADcoms
    • LOLBAS
    • GTFOBins
  • Network Security
    • Information Gathering
      • Intro
      • Passive / Active
      • OSINT
      • Social Media
      • Infrastructure
      • DNS
        • NSlookup
        • Dig
        • fierce
        • DNSenum
        • DNSmap
        • DNSrecon
      • Host Discovery
        • Fping
        • Hping
        • Nmap
      • Maltego
      • Foca
      • Breach Data
    • Scanning
      • Intro
      • Wireshark
        • Promiscuous Interface
        • 🟢Filters
        • Colors
        • Follow Stream
      • Scan Types
      • 🟢Hping3
      • Nmap
      • 💚eCPPTv2 - Firewall IDS Evasion
    • 🟢Enumeration
    • Sniffing & MitM Attacks
      • Passive
      • Active
      • MiTM
        • Local to Remote
        • DHCP Spoofing
        • LLMNR Poisoning
        • NBT-NS Poisoning
      • Tools
        • Dsniff
        • Wireshark
        • TCPDump
        • Ethercap
    • Exploitation
    • Post Exploitation
    • Social Engineering
    • Anonymity
  • Linux Exploitation
    • Introduction
    • Information Gathering
      • Remote Enumeration
        • Enum NFS
        • rpcbind
        • SMB
        • SMTP
      • Local Enumeration
        • Network Info
        • System Info
    • Exploitation over the Network
      • Samba
        • UserMap CVE-2007-2447
        • SymLink Directory Traversal
        • SambaCry CVE-2017-7494
        • Writeable Share to RCE
      • PHP CGI
      • Ruby DRB RMI port 8787
      • JAVA RMI Registry - port 1099
      • Exploiting Java Deserialization
      • TomCat
      • Password Spray Attack
      • Shellshock
      • Heartbleed
    • Post Exploitation
      • Intro
      • msfconsole scripts
      • Privilege Escalation
        • Docker
          • Unix Sockets Exploitation
        • Restricted Shells
        • Cracking Shadow File
        • 🟢Dump Memory Credentials
        • 🟢Dump SWAP Credentials
        • 🟢Shared Object Libraries
        • Kernel Exploits
          • Dirty Cow
          • Stack Clash
          • DCCP
          • Race Condition
          • msfconsole
      • Lateral Movement
        • Samba
          • Dump Samba Secrets
        • SSH
          • SSH Hijacking
          • Steal SSH credentials
        • VPNPivot
        • Dump Firefox Credentials
        • Sniffing
      • Data Exfiltration
      • Maintaining Access
        • HTTPS
        • Reverse Shells
        • Custom Services
  • Metasploit
    • Notes
    • 🟢Detect Live Hosts with Metasploit
    • 🟢Port Scanning with Metasploit
    • Network Services Scanning
    • Payloads
    • Exploitation with Metasploit
    • Post Exploitation with Metasploit
  • System Security
    • Page 5
  • Web App Security
    • Best Academy
    • HTTP
      • Basics
      • Encoding
      • Same Origin
      • Cookies
      • Sessions
      • Web Proxies
    • Enumerating
      • Infrastructure
      • Mapping Application
    • Tools
    • XSS
      • Free Courses
      • XSS Types
      • Attack Types
    • SQL Injection
    • CMSs
  • Powershell for Pentesters
    • Page 2
  • Wi-Fi Security
    • Page 6
  • Commands Notes
    • 🟢Information Gathering
    • 🟢Host Discovery
    • 🟢Scanning
    • 🟢Enumeration
    • 🟢MSFVenom
  • Pivoting
    • Tips
    • Socks4 vs Socks5
    • Pivoting Techniques
    • Meterpreter
    • SSH
    • Proxy Chains
    • 🟢Chisel
    • Socat
  • Buffer OverFlow
    • Tips for Bof in eCPPTv2
    • Computerphile - Buffer Overflow
    • The Cyber Mentor - BoF
  • 🟢TryHackMe Rooms
    • 🟢Privilege Escalation
      • LazyAdmin
      • LinuxPrivEsc
      • Empline
      • Windows 10 Privesc
    • 🟢Pivoting
      • Wreath Network
      • VulnNetInternal
    • 🟢Buffer Overflow
      • Gatekeeper
      • Buffer Overflow Prep
    • 🟢Metasploit
      • RP Metasploit
      • Metasploit Intro
  • Community Exam Tips
    • Exploits
    • Shells
    • PrivEsc
    • Report
    • BoF
    • Wordlists
    • 🟢Articles - Exam Reviews
    • 🟢Videos - Exam Reviews
  • Free Courses
    • Page 1
  • Paid Courses
    • Page 3
  • After Exam
    • Page 4
Powered by GitBook
On this page
  • Hping
  • Nmap
  • Nmap NSE
  • Idle Scan Hping Nmap
  • Advanced Port Scanning

Was this helpful?

  1. Commands Notes

Scanning

Hping

Perform a SYN scan for range of ports:

hping3 -S -p <port> <target>

Specify a port range:

hping3 -S --scan 1-1000 <target>

SYN scan all ports:

hping3 -S --scan all <target>

SYN scan a list of ports:

hping3 -S --scan 80,445,53,21 <target>

Nmap

Simple SYN scan:

nmap -sS <target>

Increase scan speed by disabling DNS resolution -n and treating parget as online -Pn:

nmap -sS <target> -n -Pn 

Execute TCP connect scan -sT in fast mode -F which scans fewer ports than the default scan:

nmap -sT <target> -F

Scan UDP ports:

nmap -sU <target>

TCP null scan:

nmap -sN <target>

Christmas scan:

nmap -sX <target>

FIN scan:

nmap -sF <target>

Nmap NSE

NSE scripts are located in:

/usr/share/nmap/scripts/

Execute default set of scripts:

nmap -c

Specify certain script:

nmap --script 

How to update scripts:

nmap --script-updatedb

Get help for certain script catagory (example help for SMB discovery scripts):

nmap --script-help “smb*” and discovery

Lookup whois information:

nmap --script whois-domain <website> -sn

SMB OS discovery:

nmap --script smb-os-discovery -p 445 <target>

Enumerate all SMB shares:

nmap --script smb-enum-shares <target> -p 445

Execute all authentication related scripts:

nmap --script auth <target>

Idle Scan Hping Nmap

Idle scan is stealthy because the target host will never know the real attacker's ip

Probes a zombie candidate:

hping3 -S -r -p <port> <zombie_ip>

Spoofs zombie’s IP and probes target:

hping3 -a <zombie_ip> -S -p <dst_port> <target>

Determines if IP ID is incremental:

nmap --script ipidseq <target> -p <port>

Performs Idle scan. (performs previous two steps simultaneously):

nmap -Pn -sI -p <dst_port> <zombie_ip>:<src_port> <target>

Advanced Port Scanning

Fragment packets:

nmap -f <target> -n --disable-arp-ping -Pn

Fragmented SYN scan:

nmap -sS -f <target>

Performs a scan using decoys:

nmap -p <port> -D <decoy1,ME,decoy2,etc..> <target>

Use random number of decays:

nmap -D RND:10 <target> -sS -p <port> -Pn --disable-arp-ping

Port scan using DNS as source port 53:

nmap --source-port 53 <target> -sS

Port scan well known ports using DNS as source port:

hping3 -S -s 53 --scan known <target>

Spoof MAC address (useful if firewall only accepts packets from specific MAC addresses):

nmap --spoof-mac <choose vendor MAC i.e. Apple or Intel etc..> <target> -p <port> -Pn --disable-arp-ping -n

Random MAC address:

nmap --spoof-mac 0 <target> -p <port> -Pn --disable-arp-ping -n

Delayed scan with randomized hosts from a list of hosts:

nmap -iL hosts.list -sS -p <port> --randomize-hosts -T 2

Spoof IP address of alive host:

hping3 -a <alive host on network> -S -p <port> <target>

Evade firewalls that use packet size to detect port scans:

nmap -sS --data-length 10 -p 21 <target>
PreviousHost DiscoveryNextEnumeration

Last updated 2 years ago

Was this helpful?

🟢