01 - Introduction to Ethical Hacking Course
001 Introduction to ethical hacking course

004 Lab’s Architecture Diagram


006 Install & Run Oracle VM VirtualBox

007 Installing Kali using the VMware Image




010 Installing Kali using the ISO file for VMware - Step 1
022 Windows Systems as Victim

02 - Scan Types in Ethical Hacking
001 Scan Types Definitions Active Scan & Passive Scan

002 Passive Scan - Wireshark







003 Passive Scan - ARP Tables
ARP, 根据ip找mac地址








004 Active Scan


hping3 -h

hping3 --scan 0-500 -S 10.0.2.2
hping3 --scan 0-500 -X 10.0.2.2







hping3 --flood -S -V --rand-source [目标地址]



03 - Nmap Introduction & Basics
001 Nmap Introduction




002 TCPIP Basics - Layers and Protocols



003 TCPIP Basics - An Example DNS Query




004 TCPUDP Basics







04 - Nmap in Action - 1 Scan Types
001 Ping Scan


nmap -sn 子网
nmap -sn 子网 | grep "Nmap scan"
nmap -sn 子网 -n | grep "Nmap scan" # 上面那个命令可能扫出域名, 加上-n可以解析输出为ip
nmap -sn 子网 -n | grep "Nmap scan" | cut -d" " -f5




002 SYN Scan in ethical hacking




nmap -sS 10.0.2.0/24 --top-ports 50

# 扫描80端口
nmap -sS 10.0.2.15 -p80




003 Port Scan




# 扫描22,80,100-200端口
nmap sS 10.0.2.15 -p22,80,100-200
# UDP/TCP UDP 53,139-150 TCP 80,443
nmap -sS -sU 10.0.2.15 -pT:80,443,U:53,139-150
# top-ports 最多多少个端口
nmap -sS 10.0.2.15 --top-ports 20
# == nmap -sS 10.0.2.15 --top-ports 100
nmap -sS 10.0.2.15 -F
nmap -sS 10.0.2.15 -p1-65535














004 TCP Scan
SYN扫描中, 我们中断3次握手, 不发生最后的ACK包来完成握手, 必须是一个有特权的用户才能中断请求, 否则不能中断3次握手和执行SYN扫描
所以nmap不像其他大多数扫描类型那样, 写原始数据包, 那需要root权限, nmap调用底层操作系统发出本地连接系统调用和目标机器的端口建立连接,
nmap对SYN的控制比对TCP的多, 效率更高


ping 10.0.2.15
# -n 不进行DNS解析, -Pn 绕过防ping
nmap -sT -n -Pn 10.0.2.15 --top-ports 10
# TCP扫描目标80端口
nmap -sT -n -Pn 10.0.2.15 -p80





005 UDP Scan




UDP经常被安全审查员忽略, 但是UDP可利用的服务也很多






# -sV 版本检测, --reason 显示扫描的端口开放或关闭的原因
nmap -sU -n -Pn 10.0.2.15 --top-ports 10 -sV --reason


05 - Nmap in Action - 2 Detection & Management
001 Version Detection



# -sV 带版本检测, 但是速度会慢
nmap -sS -n -Pn 10.0.2.15 --top-ports 10 -sV
# 查看ssh服务
netstat -tnlp
service ssh stop
nano /etc/ssh/sshd_config
# 配置文件端口改为443后
service ssh start
nets
netstat -tnlp
nmap -n -sS 10.0.2.15 -p443





002 Operating System Detection


nmap -n -sS 10.0.2.15 --top-ports 100 -O
nmap -n -sS -Pn 10.0.2.15 --top-ports 10 --reason -O



003 Input-Output Management



nmap -n -Pn -sS --top-ports 3 10.0.2.15
nmap -n -Pn -sS --top-ports 3 10.0.2.0/24


nmap -n -Pn -sS --top-ports 3 10.0.2.100-150
nmap -n -Pn -sS --top-ports 3 10.0.2.0-50,120,200-220


# 先看有哪些ip可用
nmap -sn 10.0.2.0/24 | grep "Nmap scan" | cut -d" " -f5 > ips.txt
# 扫描ip
nmap -n -Pn -sS --top-ports 3 -iL ips.txt



nmap -n -Pn -sS 10.0.2.4,15 --top-ports 3 -oX resx.xml
nmap -n -Pn -sS 10.0.2.4,15 --top-ports 3 -oA resAll
ls resAll.*
less resAll.xml
004 Lab Exercise - 1

06 - Nmap in Action - 3 Script Scanning
001 Introduction to Script Scannig in Ethical Hacking



002 First Script Example


locate *.nse
# 如果报错
sudo updatedb.plocate
sudo apt install -y plocate -t bullseye-backports


cd /usr/share/nmap/scripts
ls script.db
less script.db

# 搜索带有ssh的脚本
ls -l | grep ssh
nmap --script-help ssh-hostkey
nmap -sS -n -Pn 10.0.2.15 -p22 -sC
nmap -sS -n -Pn 10.0.2.15 -p22 -sC -vvv





003 Second Script Example



netstat -tnlp
nmap 10.0.2.15 -p443
nmap 10.0.2.15 -p443 --script ssh*
nmap 10.0.2.15 -p443 --script ssh* -sV
nmap 10.0.2.15 -p443 --script=ssh* -sV


需要目标机器开启了ssh才能测试账密
apt-get install gedit
gedit sshd-config

