-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsas
More file actions
80 lines (55 loc) · 2.84 KB
/
sas
File metadata and controls
80 lines (55 loc) · 2.84 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
#!/bin/bash
# SAS
# Scan Analyser Set
# License: GPL v3
# Author: Aurelien DESBRIERES - aurelien@hackers.camp
sas() # make the software run as a function
{
tput clear # clear the terminal
printf "\n\033[1;32mWelcome to Scan Analyser Set\033[0m\n"
printf "\n\033[1;32mSAS need you to use the sudo command to run\033[0m\n"
the_user=`whoami`
the_machine=`hostname`
ip=`ip a | grep inet | grep 192`
truncate -s 0 /home/$the_user/SAS/sas-report-* # clear all old log file of SAS
printf "\n\033[1;32mSAS will write all scan analysis scheme in your /home/$the_user/SAS/ directory\033[0m\n\n"
# Print sensors information
printf "\n"
echo "Here is the level of your RAM use and temperature of your system $the_user"
printf "\n\t" ; echo "RAM ---total-------used---------free------shared--buff/cache---available----"
free -mt | grep Mem | tee -a /home/$the_user/SAS/sas-report-memory
printf "\t" ; echo "Temperature ---------------------------------------------------------------"
sensors | grep Core | grep 0: | grep °C | tee -a /home/$the_user/SAS/sas-report-temperature
printf "\n"
printf "\n\033[1;32mHere is the wifi network arround your $the_user\033[0m\n\n"
# catching wifi network arround
sudo iwlist wls2 s | grep 'ESSID\|IEEE' | tee -a /home/$the_user/SAS/sas-report-wifi-network-arround-$the_user
# scan part
printf "\n\033[1;32mSAS load now the scan of your network\033[0m\n\n"
echo "That operation could get more than 5 minutes please wait $the_user"
# load scan of the network
sudo nmap -Pn -A 192.168.0.0/24 | grep -v Starting | tee -a /home/$the_user/SAS/sas-report-network-scan
# searching name of the active interface
network=`ip addr show | awk '/inet.*brd/{print $NF; exit}'`
printf "\n\033[1;32mHere is your network interface: $network\033[0m\n\n"
# load traffic analysis
echo "Analysing now your traffic that will take 20 seconds"
sudo iftop -i $network -ts 20 | tee -a /home/$the_user/SAS/sas-report-traffic-analysis
# 20 number of second of analyse
# print hostname of the current machine
printf "\n\033[1;32mYour hostname is: $the_machine\033[0m\n\n" | tee -a /home/$the_user/SAS/sas-report-$the_user-hostname
# print IP of the machine
printf "\n\033[1;32mYour IP is: $ip\033[0m\n\n" | tee -a /home/$the_user/SAS/sas-report-$the_user-IP
# scan active connection
printf "\n\033[1;32mscanning active Internet connections from $the_user\033[0m\n\n"
sudo netstat -natpe | tee -a /home/$the_user/SAS/sas-report-$the_user-active-Internet-connections
# print neighborwood
printf "\n\033[1;32mThere is different machine arround you:\033[0m\n"
ip neighbor | tee -a /home/$the_user/SAS/sas-report-$the_user-neighborwood
printf "\n"
# scan a server
printf "\n\033[1;32mgive me the name or ip of a machine you want to scan deeper:\033[0m\n"
read name
scan=`sudo nmap -p- -Pn -v -O --osscan-guess $name`
printf "\n$scan\n\n" | tee -a /home/$the_user/SAS/sas-report-scan-on-$name
}