-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathnetnoob
306 lines (263 loc) · 6.55 KB
/
netnoob
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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
#!/bin/bash
clear
GREEN="\033[32m"; YELLOW="\033[1;33m"; RED="\033[0;31m"; REDL="\e[101m"; BLINK="\e[5m"; END="\033[0m"
printf $YELLOW
printf " _| _| _|_|_|_| _|_|_|_|_| _| _| _|_| _|_| _|_|_| \n"
printf " _|_| _| _| _| _|_| _| _| _| _| _| _| _|\n"
printf " _| _| _| _|_|_| _| _| _| _| _| _| _| _| _|_|_| \n"
printf " _| _|_| _| _| _| _|_| _| _| _| _| _| _|\n"
printf " _| _| _|_|_|_| _| _| _| _|_| _|_| _|_|_| \n"
printf "\n"
printf "============================== NETNOOB--2018 ==============================\n"
printf "============================= GITHUB/NARCOTIC =============================\n"
printf $END
printf "\n"
if [[ $EUID -ne 0 ]]
then
printf $RED
printf $BLINK
printf "Running as Root!\n\n"
printf $END
sleep 2
sudo netnoob
fi
printf "1. Get information about your computer and network\n"
printf "2. Get information about another computer or a network\n"
printf "3. Network Settings and Shared Drives\n"
printf "\n"
printf "0. Exit ->\n"
printf "\n"
read -p "NETNOOB : " sel1
if [ $sel1 = 0 ]
then
exit
fi
while [ $sel1 = 1 ]; do
printf "=========================*==========*=========================\n"
printf "\n"
printf "1. Your IP & MAC address\n"
printf "2. Your Network Statistics\n"
printf "3. Your Ethernet Devices\n"
printf "\n"
printf "0. Exit ->\n"
printf "\n"
read -p "NETNOOB : " sel2
if [ $sel2 = 1 ]
then
printf $YELLOW
arp -e
printf "\n"
printf $END
fi
if [ $sel2 = 2 ]
then
printf $YELLOW
netstat
printf "\n"
printf $END
fi
if [ $sel2 = 3 ]
then
printf $YELLOW
printf "\n"
sudo ethtool eth0
printf $END
fi
if [ $sel2 = 0 ]
then
exit
fi
done
if [ $sel1 = 2 ]
then
read -p "Domain name or IP Address : " webaddr
fi
while [ $sel1 = 2 ]; do
printf "=========================*==========*=========================\n"
printf "\n"
printf "1. IP Address\n"
printf "2. Scan all ports\n"
printf "3. Scan a specific port\n"
printf "4. Scan most common 100 ports\n"
printf "5. Find [CNAMES] Alias Domain Names\n"
printf "6. Domain Information Groper\n"
printf "7. Records\n"
printf "\n"
printf "0. Exit ->\n"
printf "\n"
read -p "NETNOOB : " sel2
if [ $sel2 = 1 ]
then
printf $YELLOW
sudo host $webaddr
printf "\n"
printf $END
fi
if [ $sel2 = 2 ]
then
printf $YELLOW
sudo nmap $webaddr
printf "\n"
printf $END
fi
if [ $sel2 = 3 ]
then
read -p "Port Number : " port
printf $YELLOW
sudo nmap -p $port $webaddr
printf "\n"
printf $END
fi
if [ $sel2 = 4 ]
then
printf $YELLOW
sudo nmap -F $webaddr
printf "\n"
printf $END
fi
if [ $sel2 = 5 ]
then
printf $YELLOW
sudo host -t CNAME $webaddr
printf "\n"
printf $END
fi
if [ $sel2 = 6 ]
then
printf $YELLOW
sudo dig $webaddr any
printf $END
fi
if [ $sel2 = 7 ]
then
printf $YELLOW
sudo whois $webaddr
printf $END
fi
if [ $sel2 = 0 ]
then
exit
fi
done
if [ $sel1 = 3 ]
then
printf "\n"
printf $REDL
printf "Changing network settings might cause problems in connectivity.\n"
printf "Do not use this tool without proper understanding!\n"
printf $END
printf "\n"
read -p "Continue ? [Y/N] : " yesno
fi
if [[ $yesno = 'y' || $yesno = 'Y' ]]; then
while [ $sel1 = 3 ]; do
printf "=========================*==========*=========================\n"
printf "\n"
printf "1. Change IP address\n"
printf "2. Change MAC address\n"
printf "3. Create a Networked Drive\n"
printf "4. Mount a Networked Drive\n"
printf "\n"
printf "0. Exit ->\n"
printf "\n"
read -p "NETNOOB : " sel2
if [ $sel2 = 1 ]
then
printf $YELLOW
printf "Your current IP address is : \n\n"
arp -e
printf "\n"
printf $END
read -p "Your new IP address should be, XXX.XXX.XXX.XXX : " newip
read -p "Your new Default Gateway should be, XXX.XXX.XXX.XXX : " newgateway
printf "\n"
ifconfig eth0 down
ifconfig eth0 inet $newip
route add default gw $newgateway
printf "\n"
printf $YELLOW
printf "Your IP address has been changed to $newip"
printf "\n"
printf "Your Default Gateway has been changed to $newgateway"
printf "\n\n"
printf $END
fi
if [ $sel2 = 2 ]
then
printf $YELLOW
printf "Your current MAC address is : \n\n"
arp -e
printf "\n"
printf $END
read -p "Your new MAC address should be, XX:XX:XX:XX:XX:XX : " newmac
printf "\n"
ifconfig eth0 down
macchanger -m $newmac eth0
ifconfig eth0 up
sleep 2
printf $YELLOW
printf "\n"
printf "Your new MAC address is : $newmac"
printf "\n\n"
printf $END
fi
if [ $sel2 = 3 ]
then
printf $YELLOW
printf "Installing Samba...\n\n"
printf $END
sudo apt-get install samba
printf "\n"
printf $YELLOW
printf "Done...\n\n"
printf $END
read -p "Your Current Username : " uid
read -p "Share Name : " folder
printf "\n"
printf $YELLOW
printf "Creating Share '$folder'...\n"
printf $END
mkdir /home/$uid/$folder
printf "Location : /home/$uid/$folder\n\n"
sudo smbpasswd -a $uid
printf "\n"
printf $YELLOW
printf "Appending Changes to /etc/samba/smb.conf...\n"
printf $END
sudo bash -c "echo [$folder] >> /etc/samba/smb.conf"
sudo bash -c "echo path = /home/$uid/$folder >> /etc/samba/smb.conf"
sudo bash -c "echo valid users = $uid >> /etc/samba/smb.conf"
sudo bash -c "echo read only = no >> /etc/samba/smb.conf"
printf $YELLOW
printf "Restarting Samba...\n"
printf $END
sudo service smbd restart
printf $YELLOW
printf "Done...\n"
printf $END
fi
if [ $sel2 = 4 ]
then
read -p "Give a Name for the Mount Folder : " mountname
read -p "Path of the Networked Drive (//192.168.1.10/nas/files) : " naspath
read -p "Login Username : " username
printf "Mounting...\n"
sleep 2
cd ~/Desktop
mkdir $mountname
sudo mount.cifs $naspath ~/Desktop/$mountname -o user=$username
printf $YELLOW
printf "\n"
printf "Your Networked Drive is Mounted at /Desktop/$mountname"
printf "\n\n"
printf $END
fi
if [ $sel2 = 0 ]
then
exit
fi
done
else
exit
fi
#END OF THE PROGRAM