-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscheck.sh
More file actions
executable file
·46 lines (40 loc) · 1.12 KB
/
scheck.sh
File metadata and controls
executable file
·46 lines (40 loc) · 1.12 KB
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
#!/usr/bin/env bash
if [[ $# != 1 ]]
then
echo -e "\e[31mERR\e[0m :: This script takes 1 argument containing target domain."
exit
fi
dom=$1
reg4="Address: ([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})"
reg6="Address: (([0-9a-f]{0,4}:){2,7}(:|[0-9a-f]{1,4}))$"
lookup=$(nslookup $dom)
if [[ $lookup =~ $reg4 ]]
then
ipv4="${BASH_REMATCH[1]}"
echo -e "\e[93mINFO\e[0m :: Domain ipv4 is \e[1m${ipv4}\e[0m."
else
echo -e "\e[93mINFO\e[0m :: Domain does not have a IPV4 IP address."
fi
if [[ $lookup =~ $reg6 ]]
then
ipv6="${BASH_REMATCH[1]}"
echo -e "\e[93mINFO\e[0m :: Domain ipv6 is \e[1m${ipv6}\e[0m."
else
echo -e "\e[93mINFO\e[0m :: Domain does not have a IPV6 IP address."
fi
echo -ne "\e[93mINFO\e[0m :: Checking CMS.\r"
page=$(curl -ssL $dom)
regw=".*wp-*"
if [[ $page =~ $regw ]]
then
echo -e "\e[93mINFO\e[0m :: Domain is using \e[1mWordPress\e[0m."
else
echo -e "\e[93mINFO\e[0m :: Could not determine CMS."
fi
who=$(whois $dom)
if [[ $? != 0 ]]
then
echo -e "\e[31mERR\e[0m :: Could ot get whois data on this domain."
exit
fi
echo -e "\e[93mINFO\e[0m :: Whois data:\n${who}"