# TCP Port Scanningnmap192.168.43.164--reason-v-n# UDP Port Scanningnmap8.8.8.8-Pn-sU-p53,161-v-n# MIX Port Scanningnmap192.168.1.1-sS-sU-pU:53,111,161,T:21-25,80,445# Wireshark Filterip.addr==192.168.43.164andtcp.flags.ack==1andtcp.flags.syn==1ip.addr==192.168.43.164andtcp.port==80
# Print Top 10 Portssort-r-k3/usr/share/nmap/nmap-services|grep"/tcp"|head-n10# Scan Top 10 Portsnmap8.8.8.8--reason-v-n--top-ports10
# Version Scanningnmap192.168.43.164--reason-v-n-sV
Vulnerability Scanning
# Scripts Locationls-l/usr/share/nmap/scripts/catscript.db|grep-E"vuln|exploit"nmap192.168.43.164--reason-v-n-sV--scriptvuln,exploitnmap192.168.43.164--reason-v-n-sV--scriptdefault# Or -sCnmap192.168.43.164--reason-v-n--scriptsmb-vuln*
Enumeration
FTP (21)
nc10.0.2.921> USER anonymous> PASS anonymousftp10.0.2.921> help> ascii |binary> pwd # print current directory on remote host> ls # list files on remote host> lcd # print current directory on local host>!ls# list files on local host> get /home/test/file.txt /home/msfadmin/file.txt # download files> put /home/msfadmin/file.txt /home/test/file2.txt # upload files
telnet192.168.1.105110> USER pelle@192.168.1.105> PASS admin# List all emailslist# Retrive email number 5, for exampleretr5
RPCbind (111)
rpcinfo-p10.0.2.9
SMB (139,445)
# Who Run SMBnbtscan-r192.168.100.0/24# NULL Sessionrpcclient-U""-N10.0.2.4> enumdomusers> queryuser 0x3e8# Session with username and passwordrpcclient-U"test"10.0.2.4# Enum4Linuxenum4linux-{U|S|P|G}10.0.2.4enum4linux-{U|S|P|G}-uTestUser-pTestPass192.168.100.200# List Sharessmbmap-H192.168.0.34smbmap-uTestUser-pTestPass-H192.168.0.34smbclient-L192.168.0.76smbclient-UTestUser-L192.168.0.70# Access Sharessmbclient//192.168.0.70/tmpsmbclient-UTestUser//192.168.0.70/tmp
NFS (2049)
# Show mounted partitionsshowmount-e192.168.1.109# Connect to specific partitionmount192.168.1.109://tmp/NFS# Disconnnectumount/tmp/NFS
MySQL (3306)
# try default passwords root OR toor OR emptymysql-h192.168.1.101-uroot-p
# Lookup & Zone Transferhostdomain.name8.8.8.8host1.1.1.18.8.8.8host-taxfrdomain.namedns-server# Information Disclosuredig@41.217.225.50hostname.bindtxtchaosdig@41.217.225.50version.bindtxtchaos
# Brute Forcenmap-sU--open-p161192.168.1.0/24onesixtyone-ccommunity.txt192.168.1.244onesixtyone-ccommunity.txt-iips.txt# SNMP walk & setsnmpwalk-v1-cpublic-t10192.168.1.244>snmp.txtsnmpwalk-v1-cpublic192.168.1.244iso.3.6.1.2.1.6.13.1.3//Openportssnmpset-v1-cprivate10.0.2.10iso.3.6.1.2.1.1.5.0sHacked# Metasploitmsfconsole> use auxiliary/scanner/snmp/snmp_enum> set rhosts 192.168.1.244> run