Skip to content

Port Scanning

lethanhtung01011980 edited this page Jan 4, 2020 · 14 revisions

Notes

  • --min-parallelism, --max-parallelism

Quick scan ALL ports!!!

  • nmap -p- -T4 -A -v victim-ip <======= MUST DO THIS FIRST

Scanning

  • TCP Scanning: nc -nvv -w 1 -z x.x.x.x 3388-3390
  • UDP Scanning: nc -nv -u -z -w 1 x.x.x.x 160-162

Nmap scan

Scan all ports

  • nmap -p- victim_ip
  • nmap -p- -T4 -A -v victim-ip : All ports, OS, version detection with faster speed.

Get IPs

  • nmap -v -sn x.x.x.11-254 -oG ping-sweep.txt
  • grep Up ping-sweep.txt | cut -d" " -f2 > ping-sweep-ip.txt

Scan through IPs

  • #!/bin/bash
  • for ip in $(cat ping-sweep-ip.txt)
  • do
  • echo $ip
  • done

Scan ports

  • Port: nmap -p 80 x.x.x.x
  • OS: nmap -O x.x.x.x
  • Scan ports and get banners: nmap -sV -sT x.x.x.x

Scan SMB

  • nmap x.x.x.1-254 --script smb-os-discovery.nse
  • nmap -p 139,445 -script=smb-vuln* x.x.x.1-254 -oG smb-vul.txt

Sidebar

0. COMMON exploits

1. Scan Info

1.2 Passive Gathering

1.3 Active Gathering

2. Pre-attack

2.2 File transfer

3. Get Reverse Shell

4. Exploits

4.2 Windows Exploits

4.3 Linux Exploits

4.4 Password crack

4.5 Buffer Overflow

4.6 Web attacks

6. Escalate Privilege

6.1 Escalate in Windows

6.2 Escalate in Linux

7. Access and further attacks

8. Port redirection and Tunnelling

9. Metasploit

10. Kali

11. Thirdparty scripts

Clone this wiki locally