-
Notifications
You must be signed in to change notification settings - Fork 1
/
isitup.sh
139 lines (122 loc) · 4.92 KB
/
isitup.sh
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
#!/bin/bash
# # # # # # # # # # # # # # # # # # # # # # # #
# made by hitemSec
# purpose:
# More reliant checks for domains and ip-lists!
# github: https://github.com/hitem
# mastodon: @[email protected]
# # # # # # # # # # # # # # # # # # # # # # # #
#COLORS
BLUE='\033[94m'
RED='\033[91m'
GREEN='\033[92m'
ORANGE='\033[93m'
IRED='\033[0;91m'
IGREEN='\033[0;92m'
RESET='\e[0m'
#PATHS
TARGET="$1"
CURRENT_PATH=$(pwd)
#DEPENDENCIES
sudo apt-get -y install lolcat hping3 prips parallel
clear
hitemsec () {
echo -e " ▄ .▄▪ ▄▄▄▄▄▄▄▄ .• ▌ ▄ ·. .▄▄ · ▄▄▄ . ▄▄· \n ██▪▐███ •██ ▀▄.▀··██ ▐███▪▐█ ▀. ▀▄.▀·▐█ ▌▪ \n ██▀▐█▐█· ▐█.▪▐▀▀▪▄▐█ ▌▐▌▐█·▄▀▀▀█▄▐▀▀▪▄██ ▄▄ \n ██▌▐▀▐█▌ ▐█▌·▐█▄▄▌██ ██▌▐█▌▐█▄▪▐█▐█▄▄▌▐███▌ \n ▀▀▀ ·▀▀▀ ▀▀▀ ▀▀▀ ▀▀ █▪▀▀▀ ▀▀▀▀ ▀▀▀ ·▀▀▀ " | lolcat
echo -e ""
echo -e "$ORANGE ~:ISITUP:~"
echo -e "$ORANGE Improve your reconnaissance by$RED hitemSec"
echo -e ""
}
hitemsecc () {
echo -e "$GREEN [+] @[email protected]"
echo -e "$GREEN [+] https://github.com/hitem"
}
# Function to check if a host is up
check_host() {
local host="$1"
if hping3 -S -p 80,443,8080 -c 1 -w 1 $host > /dev/null 2>&1; then
echo -e "$IGREEN [+] $host $RESET"
echo "$host" >> "$CURRENT_PATH/tmp/valid-iplist.txt"
else
echo -e "$RED [-] $host $RESET"
echo "$host" >> "$CURRENT_PATH/tmp/notvalid-iplist.txt"
fi
}
export -f check_host
export CURRENT_PATH
export IGREEN
export RED
export RESET
#CODE
if [ -z $TARGET ]; then
hitemsec
hitemsecc
echo -e "$GREEN [-] Usage: isitup.sh [-h --help] [-s --scope] [<targetlist>]"
echo -e "$ORANGE __________________________________________"
exit
fi
if [[ $TARGET == "--help" ]] || [[ $TARGET == "-h" ]]; then
hitemsec
hitemsecc
echo -e "$GREEN [-]$BLUE Usage: isitup.sh [-h --help] [-s --scope] [targetlist]"
echo -e "$GREEN [-]$BLUE Usage: Modify script to include other ports, default:$RESET 80$BLUE,$RESET 443$BLUE,$RESET 8080"
echo -e "$GREEN [-]$ORANGE Example ./isitup.sh myiplist.txt"
echo -e "$GREEN [-]$ORANGE Example ./isitup.sh -s"
echo -e "$GREEN [-]$ORANGE Example ./isitup.sh --help"
echo -e "$ORANGE __________________________________________"
exit
fi
CREATEDIR=$(mkdir -p "$CURRENT_PATH/tmp/")
if [[ $TARGET == "--scope" ]] || [[ $TARGET == "-s" ]]; then
hitemsec
hitemsecc
echo -e "$BLUE Enter a valid IP scope, example$RESET 192.168.0.0/24$BLUE ,$RESET 10.0.1.0/16"
echo -e "$BLUE If you have selected a large scope, this process will take time! $RESET"
echo -e "$ORANGE __________________________________________$RESET"
echo -e ""
echo -e " Enter your scope and press $IGREEN[ENTER]$RESET to begin"
read SCOPE
prips $SCOPE > $CURRENT_PATH/tmp/ManualScope.txt
echo -e ""
echo -e " ################################################## [INITIATING] " | lolcat
echo -e ""
parallel -j 10 check_host ::: $(cat $CURRENT_PATH/tmp/ManualScope.txt)
echo -e ""
echo -e "$BLUE Valid domains saved to: $ORANGE tmp/valid-ips.txt $RESET"
echo -e "$BLUE Invalid domains saved to: $ORANGE tmp/notvalid-ips.txt $RESET"
echo -e ""
ALIVEC=$(cat $CURRENT_PATH/tmp/valid-ips.txt | sort -u | wc -l)
DOWNC=$(cat $CURRENT_PATH/tmp/notvalid-ips.txt | sort -u | wc -l)
TOTALC=$(cat $CURRENT_PATH/tmp/ManualScope.txt | sort -u | wc -l)
echo -e "$BLUE [TOTAL]: ${TOTALC} $RESET $IGREEN[ALIVE]: ${ALIVEC} $RESET $IRED[DOWN]: ${DOWNC}"
echo -e " ################################################## [COMPLETED] " | lolcat
exit
fi
if [ ! -f $TARGET ]; then
hitemsec
hitemsecc
echo -e ""
echo -e "$IRED ----------:[FILE NOT FOUND]:----------"
echo -e ""
echo -e "$GREEN [+]$BLUE Usage: isitup.sh [targetlist]"
echo -e "$GREEN [-]$ORANGE Example ./isitup.sh myiplist.txt"
exit
fi
REMOVEDIR=$(rm -r "$CURRENT_PATH/tmp/")
CREATEDIR=$(mkdir -p "$CURRENT_PATH/tmp/")
FILENAME=$(basename $TARGET)
hitemsec
hitemsecc
echo -e ""
echo -e " ################################################## [INITIATING] " | lolcat
echo -e ""
parallel -j 10 check_host ::: $(cat $TARGET)
echo -e ""
echo -e "$BLUE Valid domains saved to: $ORANGE tmp/valid-$FILENAME $RESET"
echo -e "$BLUE Invalid domains saved to: $ORANGE tmp/notvalid-$FILENAME $RESET"
echo -e ""
ALIVEC=$(cat $CURRENT_PATH/tmp/valid-$FILENAME | sort -u | wc -l)
DOWNC=$(cat $CURRENT_PATH/tmp/notvalid-$FILENAME | sort -u | wc -l)
TOTALC=$(cat $TARGET | sort -u | wc -l)
echo -e "$BLUE [TOTAL]: ${TOTALC} $RESET $IGREEN[ALIVE]: ${ALIVEC} $RESET $IRED[DOWN]: ${DOWNC}"
echo -e " ################################################## [COMPLETED] " | lolcat