Theory Test 3 Flashcards
Port Scanning
A method of finding out which services/ports a host computer offers.
Port States
Open, Closed, Filtered
Open Port
Send a SYN, receive a SYN/ACK
Closed Port
Send a SYN, receive a RST
Filtered Port
(Presumably behind a firewall) Packet dropped, no response
Types of Port Scans
TCP SYN Scan, TCP FIN Scan, Connect Scan, NULL Scan
TCP SYN Scan
Half-open scanning. SYN is sent, if SYN/ACK recieved, port is listening, send a RST immediately to terminate connection. Few servers log this because no full connection is made. (nmap -s in root for SYN scan)
TCP FIN Scan
Attempt to close a connection that isn’t open. Closed ports reply with RST. Open ports ignore, so no response is a listening port.
Connect Scan
Opens a connection to every interesting port. Success if port is listening. Not stealthy but fastest scanning method.
NULL Scan
No flags, target doesn’t know how to handle, packet dropped, no response, port listening. Closed port sends a RST.
Common Scanning Types
Terminal/Command line ping sweeps, port scanner software
Terminal/Command Line Ping Sweeps
Look for echo replies. Recon looking for shares or accessibilities.
Port Scanning Software
Look for normal TCP connection response. Further recon looking for OS/Software vulnerabilities.
Windows File Sharing Ports
139 (NetBIOS), 445 (SMB)
Port scanning programs report what?
Port state, best guess OS, services likely running, ping reports, more.
Scanning Tools
Nmap, NetScan, Nessus, Fping, more.
Nmap
Command line tool for Win and Linux, GUI version is Zenmap. Determine open ports, services running, and OS.
Enumeration
Involves connecting to a system, not just identifying.
Windows FOR Command
FOR /L loops multiple iterations
FOR /F provides input from a file
FOR Syntax
FOR /L %i in (start,step,stop) do (command) %i
*@ used to hide words and show only result
FOR /F %i in (filename.txt) do (command) %i
CLI Output Options
Command>nul: sends err to nul so not shown on screen
Command > error.txt
Command»_space; error.txt: sends to txt and appends to existing content
Pipe output to other commmands using |
enter 2 commands in order using & (cls clears screen)
&& to only execute second command if first worked
Enum.exe
enum -d -u name -f password.txt
runs all passwords against the username on computer with given ip
Enumeration Commands
NBTStat, NBTScan, net view, net use
NBTStat
Shows computer names, workgroups, MAC addresses, assigned to a single ip address host.
Syntax: nbtstat -a
NBTScan
Shows sharing at ip targets through network ip address ranges.
Syntax: nbtscan / or - (ex. 10.80.10.2/24)
net view
Displays information of shared folders at a target ip address
Syntax: netview
netview /all shows all shares including admin shares
netview /domain: will list all of the sharing computers in the domain.
net use
Most powerful net command. Allows connections to network share. Can also map a network drive
Syntax: net use ///
fping
Ping multiple ip addresses simultaneously. Command: fping -g/-f option