-
Notifications
You must be signed in to change notification settings - Fork 2
/
enum-ninja.sh
59 lines (55 loc) · 2.4 KB
/
enum-ninja.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
#!/bin/bash
RED="31"
GREEN="32"
BOLDRED="\e[1;${RED}m"
BOLDGREEN="\e[1;${GREEN}m"
ENDCOLOR="\e[0m"
echo -e "----------------------------------------------------------"
echo -e "${BOLDGREEN}EnumNinja a tiny lil script to ennumerate basic stuff in Linux for Privilege Escalation.${ENDCOLOR}"
echo -e "${BOLDGREEN}Made by : Nickapic${ENDCOLOR}"
echo -e "----------------------------------------------------------"
if [ $1 = '-h' ]; then
echo "Usage: Just run the script and it should do basic enum script"
exit 1
fi
varpython=`which python`
if [ -z "$varpython" ]
then
echo "${BOLDRED}Yo my dude python isnt on this box hold up lemme check for some other one!${ENDCOLOR}"
varpython=`which python3`
else
echo -e "${BOLDGREEN}We all good here we have $varpython on this box ${ENDCOLOR}"
fi
echo "--------------------------------------------------"
echo -e "${BOLDRED}Checking for SUID/GUID bits and printing them out${ENDCOLOR}"
echo "--------------------------------------------------"
find / -perm -u=s -type f 2>/dev/null
echo "--------------------------------------------------"
echo -e "${BOLDRED}Checking permissions on passwd/shadow files${ENDCOLOR}"
echo "--------------------------------------------------"
ls -la /etc/passwd
ls -la /etc/shadow
echo "--------------------------------------------------"
echo -e "${BOLDRED}Checking some basic crontabs and if there are crontabs running${ENDCOLOR}"
echo "--------------------------------------------------"
cat /etc/crontab
echo "--------------------------------------------------"
echo -e "${BOLDRED}Checking what stuff is running internally on which ports${ENDCOLOR}"
echo "--------------------------------------------------"
netstat -aln
echo "--------------------------------------------------"
echo -e "${BOLDRED}Checking some basic stuff thats running using ps aux${ENDCOLOR}"
echo "--------------------------------------------------"
ps aux
echo "--------------------------------------------------"
echo -e "${BOLDRED}Checking Internal network interfaces${ENDCOLOR}"
ifconfig
echo -e "${BOLDRED}Checking ARP ${ENDCOLOR}"
arp -a
echo "--------------------------------------------------"
echo -e "${BOLDRED} See Writable Files by the user ${ENDCOLOR}"
find /etc -type f -writable 2> /dev/null
echo "--------------------------------------------------"
echo -e "${BOLDRED} Kernel Version ${ENDCOLOR}"
uname -a
echo "--------------------------------------------------"