-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDefense_Cheatsheet.txt
72 lines (72 loc) · 1.8 KB
/
Defense_Cheatsheet.txt
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
# Check No GUI Running
ls /usr/bin/*session
# Check UFW Service Running
sudo ufw status
sudo service ufw status
sudo systemctl ufw status
# Check SSH Service Running
sudo service ssh status
systemctl status ssh
# Check OS Name (CentOS/Debian)
uname -v
uname --kernel-version
# Check User Is In "sudo" & "user42" groups
getent group sudo
getent group user42
# Create New User & Show It Follows Passwords Policy
sudo adduser name_user
# Create New Group Named "evaluating"
sudo addgroup evaluating
# Add New User To New Group
sudo adduser name_user evaluating
# Check It Was Added Successfully
getent group evaluating
# Check Hostname
Hostname
# Change Hostname
sudo nvim /etc/hostname
# Change Hosts
sudo nvim /etc/hosts
# Reboot To Take The New Hostname
sudo reboot
# Check Partitions
lsblk
# Check Sudo Is Installed
which sudo (Worse Option)
dpkg -s sudo
# Add New User To The Sudo Group
sudo adduser name_user sudo
# Check It's In The Group
sudo getent group sudo
# Check Sudo Rules Told In Subject
sudo nvim /etc/sudoers.d/sudo_config
# Check sudo Log
/var/log/sudo/
/var/log/sudo/sudo_config
# Check UFW Is Installed
dpkg -s ufw
# Check UFW Service Is Running
sudo service ufw status
# Check UFW Active Rules
sudo ufw status numbered
# Create A New UFW Rule For Port 8080
sudo ufw allow 8080
# Check The Newly Created Rule
sudo ufw status numbered
# Delete The Just Created Rule
sudo ufw delete num_rule
# Check The Rule Has Been Successfully Deleted
sudo ufw status numbered
# Check SSH Is Installed In The VM
dpkg -s ssh
which ssh
# Check SSH Service/Daemon Is Active & Running
systemctl status ssh
# Modify Crontab Execution Time From 10 Minutes To 1
sudo crontab -u root -e
# Stop Script Execution When The Server Starts
sudo /etc/init.d/cron stop
sudo /etc/init.d/cron start
sudo systemctl stop cron
sudo systemctl start cron
#