forked from nmap/npcap
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0455b73
commit f9dcd31
Showing
2 changed files
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#Tests for Npcap. | ||
|
||
Requirements: | ||
|
||
* Npcap installed | ||
* Nmap installed | ||
* Some examples from the SDK | ||
|
||
##SDK examples required | ||
|
||
From `Examples-pcap`: | ||
|
||
* iflist.exe | ||
* pcap_filter.exe | ||
* sendpack.exe | ||
* readfile.exe | ||
|
||
From `Examples-remote`: | ||
|
||
* sendcap.exe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
echo Testing iflist... | ||
for /f "TOKENS=1,2" %%a in ('nmap --iflist') do @if %%a==lo0 set devname=%%b | ||
if not %devname:~0,12%==\Device\NPF_ goto :error | ||
.\iflist.exe | ||
|
||
echo Testing Loopback operations... | ||
echo Testing pcap_filter... | ||
del loopback.pcap | ||
start .\pcap_filter.exe -o loopback.pcap -s %devname% -f tcp | ||
for /F "TOKENS=1,2,*" %%a in ('tasklist /FI "IMAGENAME eq pcap_filter.exe"') do set SAVEPID=%%b | ||
|
||
echo Running nmap... | ||
nmap -F -O -d -n localhost || goto :error | ||
nmap -F -O -d -n -6 localhost || goto :error | ||
|
||
echo Testing sendpack... | ||
.\sendpack.exe %devname% || goto :error | ||
|
||
echo Killing pcap_filter... | ||
taskkill /PID %SAVEPID% || goto :error | ||
|
||
echo Reading dump file... | ||
.\readfile.exe loopback.pcap || goto :error | ||
|
||
echo Replaying dump file... | ||
.\sendcap.exe loopback.pcap %devname% || goto :error | ||
|
||
|
||
echo Running nmap... | ||
nmap -F -O -d -n scanme.nmap.org || goto :error | ||
|
||
pause | ||
exit | ||
|
||
:error | ||
echo Failed: %errorlevel% | ||
pause | ||
exit /b %errorlevel% |