本文讲的是
渗透技巧:Windows平台运行Masscan和Nmap,
0x00 前言
#if defined(_MSC_VER) && (_MSC_VER == 1700) /*Visual Studio 2012*/ # include <stdio.h> # include <string.h> # define strcasecmp _stricmp # define memcasecmp _memicmp # ifndef PRIu64 # define PRIu64 "llu" # define PRId64 "lld" # define PRIx64 "llx" # endif
adapter[DeviceNPF_{71D19B82-0818-4685-A8E7-A6C7C812F2EA}].init: failed
sc qc npf
[SC] QueryServiceConfig 成功 SERVICE_NAME: npf TYPE : 1 KERNEL_DRIVER START_TYPE : 3 DEMAND_START ERROR_CONTROL : 1 NORMAL BINARY_PATH_NAME : system32driversnpf.sys LOAD_ORDER_GROUP : TAG : 0 DISPLAY_NAME : NetGroup Packet Filter Driver DEPENDENCIES : SERVICE_START_NAME :
sc query npf
SERVICE_NAME: npf TYPE : 1 KERNEL_DRIVER STATE : 4 RUNNING (STOPPABLE, NOT_PAUSABLE, IGNORES_SHUTDOWN) WIN32_EXIT_CODE : 0 (0x0) SERVICE_EXIT_CODE : 0 (0x0) CHECKPOINT : 0x0 WAIT_HINT : 0x0
HKEY_LOCAL_MACHINESYSTEMControlSet001Servicesnpf HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesnpf
copy packet.dll %SystemRoot%system32 copy wpcap.dll %SystemRoot%system32 copy npf.sys %SystemRoot%system32drivers
sc create npf binPath= system32driversnpf.sys type= kernel start= demand error= normal tag= no DisplayName= "NetGroup Packet Filter Driver"
sc start npf
masscan.exe -p80 192.168.81.143
@echo off cd %~dp0 if "%PROCESSOR_ARCHITECTURE%"=="x86" move npf_x86.sys %SystemRoot%system32driversnpf.sys if "%PROCESSOR_ARCHITECTURE%"=="AMD64" move npf_x64.sys %SystemRoot%system32driversnpf.sys if exist %SystemRoot%system32driversnpf.sys (echo move success!) else (echo move error!) sc create npf binPath= system32driversnpf.sys type= kernel start= demand error= normal tag= no DisplayName= "NetGroup Packet Filter Driver" sc start npf
masscan.exe -p80 192.168.81.1/24
Discovered open port 80/tcp on 192.168.81.143
masscan.exe -p0-65535 192.168.81.143
masscan.exe -p80,443 192.168.81.143
masscan.exe -p80,443,3306 192.168.81.143 --banners
masscan.exe -p80,443,3306 192.168.81.143 --banners --echo>1.conf
masscan.exe -c 1.conf
--rate 100000
-oX <filespec> (XML) -oB <filespec> (Binary) -oG <filespec> (Grep) -oJ <filespec> (Json) -oL <filespec> (List) -oU <filespec> (Unicornscan format)
-sS: this does SYN scan only (currently, will change in the future) -Pn: doesn't ping hosts first, which is fundamental to the async operation -n: no DNS resolution happens --randomize-hosts: scan completely randomized --send-eth: sends using raw libpcap
libeay32.dll msvcp120.dll msvcr120.dll nmap-mac-prefixes nmap-os-db nmap-payloads nmap-services nmap.exe ssleay32.dll
nmap.exe -p80 192.168.81.1-255
nmap.exe -p80 192.168.81.1/24
nmap.exe iL IP.txt
nmap.exe 192.168.81.143
nmap.exe -p80,443 192.168.81.143
nmap.exe -O 192.168.81.143
nmap.exe -sV 192.168.81.143
nse_main.lua nmap-service-probes nselib文件夹及文件夹内的文件 scripts文件夹及文件夹内的文件
nmap.exe --traceroute 192.168.81.143
nmap.exe -A 192.168.81.143
-sS/sT/sA/sW/sM: TCP SYN/Connect()/ACK/Window/Maimon scans -sU: UDP Scan -sN/sF/sX: TCP Null, FIN, and Xmas scans --scanflags <flags>: Customize TCP scan flags -sI <zombie host[:probeport]>: Idle scan -sY/sZ: SCTP INIT/COOKIE-ECHO scans -sO: IP protocol scan -b <FTP relay host>: FTP bounce scan
<zombie host[:probeport]>
nmap.exe -sI 192.168.81.1:1234 192.168.81.143 PING Scan(-sP)
-oN <filespec> (标准) -oX <filespec> (XML) -oS <filespec> (ScRipT KIdd|3 oUTpuT) nmap默认输出均为大写格式,使用-oS会随机改写字母大小写 -oG <filespec> (Grep) -oA <basename> (输出至所有格式) 设置文件名称,一次性输出标准(.nmap)、XML(.xml)和Grep(.gnmap)三种格式的文件
原文发布时间为:2017年7月16日
本文作者:3gstudent
本文来自云栖社区合作伙伴嘶吼,了解相关信息可以关注嘶吼网站。