-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest.bash
executable file
·61 lines (36 loc) · 1.93 KB
/
test.bash
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/bash
###############################################################################
# nb_build_test.bash
#
# outputs env + exercises netbang functionality via invocation.
# This should compliment _test.go unit testing stuff.
# OMG DO NOT USE THIS IN LIEU OF GO TESTING.
#
# Run only in build directory. Won't find anything otherwise
#
# CTG "chux0r"
# 25MAR2024
#
###############################################################################
echo "Build test by: ${USER}@${HOSTNAME}:${PWD}"
echo -n "Date:" && date
echo -n " -- GO version: " && go version
echo -n " -- Platform OS/arch details: " && uname -a
printf "\n\n=============BUILD: go build ./netbang.go ./recon.go ./resolver.go"
go build ./netbang.go ./recon.go ./resolver.go
printf "\nNETBANG TEST CASES:\n"
echo "./netbang"
./netbang
printf "\n=============BASIC SCAN-BY-HOSTNAME: ./netbang scanme.org\n"
./netbang scanme.org #default tcp scan, using portlist "tcp_short"
printf "\n=============UDP SCAN, PORTS DEFINED IN FILE, CUSTOM TIMEOUT ./netbang --proto udp --portsfile ../netbang_ports.tmp -t 500 127.0.0.1\n"
echo -n "53,161,10000" > ../netbang_ports.tmp && printf "\n\tFILE INJECT ../netbang_ports.tmp:" && cat ../netbang_ports.tmp && printf "\n"
./netbang --proto udp --portsfile ../netbang_ports.tmp -t 500 127.0.0.1 && rm ../netbang_ports.tmp ## tcp scan, ports defined in file
printf "\n=============EXECUTE: ./netbang --recon list\n"
./netbang --recon list # list recon modes
printf "\n=============EXECUTE: ./netbang --recon dns amazon.com\n"
./netbang --recon dns amazon.com # get dns info
printf "\n=============EXECUTE: ./netbang --recon dns --ns 8.8.8.8 github.com\n"
./netbang --recon dns --ns 8.8.8.8 github.com #get dns info, use custom resolver
printf "\n=============EXECUTE: ./netbang --recon shodan hostip 1.1.1.1\n"
./netbang --recon shodan hostip 1.1.1.1 # query shodan data using host ip NOTE: this test only works when $SHODAN_KEY is defined/valid