SEC-335: Eth. Hacking & Pen. Testing
HomeTech JournalsPersonal ProjectsSysadmin Wiki
  • SEC-335: Eth. Hacking & Pen. Testing
  • Breakdown
    • Course Overview
  • Activities/Assignments
    • Assignment 1.2: The Kali Virtual Machine
    • Activity 2.1: Host Discovery
    • Activity 3.1: DNS Enumeration
    • Activity 4.1: Exploiting Cupcake
    • Assignment 5.1: Breaking into Kali
  • Labs
    • Lab 2.1: Port Scanning 1
    • Lab 2.2: Port Scanning 2
    • Lab 3.1: Powershell and DNS
    • Lab 3.2: DNS uses TCP and UDP
    • Lab 5.1: Password Guessing
    • Lab 6.1: Cracking Linux Passwords with JtR and Hashcat
    • Lab 7.1: Exploiting pippin.shire.org (10.0.5.25)
    • Lab 8.1: Weevely
    • Lab 8.2: Reverse Shell
    • Lab 9.1: Exploit Gloin
    • Lab 10.1: Linux - Permission Vulnerabilities
    • Lab 10.2: Exploiting nancurunir
    • Lab 11.1: Metasploit
    • Final: Bree
  • Tools/Recon
    • Metasploit
    • NMAP
    • Active/Passive Reconnaissance
    • Shodan
    • The Harvester
    • Netcraft
    • Metagoofil
    • DNS-Enumeration
    • CEWL
    • rsmangler
    • Hydra
    • DIRB
    • John the Ripper
    • Hashcat
    • Passwords
    • TMP
Powered by GitBook
On this page
  • Usage:
  • Syntax:
  • Resources:
  1. Tools/Recon

NMAP

PreviousMetasploitNextActive/Passive Reconnaissance

Last updated 2 years ago

Usage:

Command line:

sudo nmap <ip> <options> 

If you don't run with sudo results will vary.

Syntax:

Extra:

  • -A

    • OS detection, Version detection, script scanning

  • DNS

Find dns server in a network:

sudo nmap -Pn --open <network ID>/<subnet #> -p T:53 -oG <file-name>.txt

Clean output of dns server

cat <file-name>.txt | grep -v Nmap | grep -v / | awk '{print $2}'

Ports:

  • -p

    • Will scan specifed port

    • T: TCP only

    • U: UDP only

    • Can do a range and protocol specification:

      • nmap <ip> -p T:22,U:4000

  • -sP or -sn

    • No port scan

Host Discovery:

  • -Pn

    • no ping / no host discovery

  • -sL

    • use the list of targets instead of dicovery

  • --traceroute

    • Enables traceroute functionality

Timing:

  • T0-T5

    • The lower the slower T5 means you don't care if you set off alarms

    • T0 makes 1 request ~5 minutes

Services:

  • -sV

    • perform the serice detection

Scan Types:

  • -sT

    • TCP Connect

    • Completes 3 way handshake

  • -sU

    • UDP Scan

    • Fast

  • -O

    • Enables OS Detection

Output:

  • -oG -

    • Makes the nmap output 'grepable'

  • --script

    • Allows you to specify the scripts

Resources:

Scripts:

https://www.redhat.com/sysadmin/nmap-scripting-engine
https://nmap.org/book/man-host-discovery.html