Skip to content

Instantly share code, notes, and snippets.

@ddubson
Last active August 23, 2020 07:58
Show Gist options
  • Save ddubson/45d9ed28ba2cbd18ecfff893c9c50534 to your computer and use it in GitHub Desktop.
Save ddubson/45d9ed28ba2cbd18ecfff893c9c50534 to your computer and use it in GitHub Desktop.

Revisions

  1. ddubson revised this gist Jul 20, 2016. 1 changed file with 8 additions and 1 deletion.
    9 changes: 8 additions & 1 deletion nmap.sh
    Original file line number Diff line number Diff line change
    @@ -33,4 +33,11 @@ nmap -sF localhost
    # XMas Tree Scan - flags FIN, URG, and PUSH flags on a packet header
    nmap -sX localhost
    # Null scan - no flags on the packet header
    nmap -sN localhost
    nmap -sN localhost
    # Scan with operating system discovery mode
    nmap -O localhost
    # Verbosity flags
    # -v, -vv, -vvv
    nmap -v -sV localhost
    # Scan with packet tracing
    nmap --packet-trace 192.168.1.1
  2. ddubson revised this gist Jul 20, 2016. 1 changed file with 12 additions and 2 deletions.
    14 changes: 12 additions & 2 deletions nmap.sh
    Original file line number Diff line number Diff line change
    @@ -22,5 +22,15 @@ nmap -sn 192.168.1.0/24
    nmap -Pn -p1-1024 192.168.1.0/24
    # Scan range of hosts to get their DNS PTR entries (example IP address below, do not use as is) - zero-packet recon
    nmap 74.125.224.32-41 -sL
    # Scan using TCP SYN, pinging a specific port with a TCP SYN and seeing if that port responds
    nmap -PS 80 localhost
    # Scan using TCP SYN, pinging a specific port with a TCP SYN packet and seeing if that port responds
    nmap -PS 80 localhost
    # TCP Connect Scan
    nmap -sT localhost
    # SYN Stealth Scan
    nmap -sS localhost
    # FIN Scan
    nmap -sF localhost
    # XMas Tree Scan - flags FIN, URG, and PUSH flags on a packet header
    nmap -sX localhost
    # Null scan - no flags on the packet header
    nmap -sN localhost
  3. ddubson revised this gist Jul 20, 2016. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion nmap.sh
    Original file line number Diff line number Diff line change
    @@ -19,4 +19,8 @@ nmap --reason -sV localhost
    # Perform ping sweep on a local class C subnet to determine which hosts are up (or at least ACK ICMP)
    nmap -sn 192.168.1.0/24
    # Scan all hosts' top ports without an initial ping sweep
    nmap -Pn -p1-1024 192.168.1.0/24
    nmap -Pn -p1-1024 192.168.1.0/24
    # Scan range of hosts to get their DNS PTR entries (example IP address below, do not use as is) - zero-packet recon
    nmap 74.125.224.32-41 -sL
    # Scan using TCP SYN, pinging a specific port with a TCP SYN and seeing if that port responds
    nmap -PS 80 localhost
  4. ddubson revised this gist Jul 20, 2016. 1 changed file with 10 additions and 1 deletion.
    11 changes: 10 additions & 1 deletion nmap.sh
    Original file line number Diff line number Diff line change
    @@ -10,4 +10,13 @@ nmap -p1-1024 localhost
    nmap -p 80 localhost
    # e.g. Identify all network devices with port 80 open
    nmap -oA log.txt -p 80 192.168.1.0/24 && clear && cat log.txt.gnmap | grep "open"

    # Scan all 65,535 available ports of a given machine
    nmap -p- localhost
    # Scan a list of targets located in an external file
    nmap -iL targets.txt
    # Scan a target and show reason for its service discovery
    nmap --reason -sV localhost
    # Perform ping sweep on a local class C subnet to determine which hosts are up (or at least ACK ICMP)
    nmap -sn 192.168.1.0/24
    # Scan all hosts' top ports without an initial ping sweep
    nmap -Pn -p1-1024 192.168.1.0/24
  5. ddubson revised this gist Jul 19, 2016. 1 changed file with 6 additions and 2 deletions.
    8 changes: 6 additions & 2 deletions nmap.sh
    Original file line number Diff line number Diff line change
    @@ -1,9 +1,13 @@
    # Default nmap scan
    nmap localhost

    # Default service nmap
    nmap -sV localhost

    # Service scan with output logging
    nmap -sV -oA log.txt localhost
    # Scan specific ports
    nmap -p1-1024 localhost
    # e.g. Check if local port 80 is open
    nmap -p 80 localhost
    # e.g. Identify all network devices with port 80 open
    nmap -oA log.txt -p 80 192.168.1.0/24 && clear && cat log.txt.gnmap | grep "open"

  6. ddubson created this gist Jul 19, 2016.
    9 changes: 9 additions & 0 deletions nmap.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    # Default nmap scan
    nmap localhost

    # Default service nmap
    nmap -sV localhost

    # Service scan with output logging
    nmap -sV -oA log.txt localhost