-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.sh
131 lines (125 loc) · 4.5 KB
/
init.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
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
#!/bin/bash
START_TIME=$(date +%s)
# - - - - - - - - - -
### *** Access Config ***
echo "[*] Access Configuration Setup"
### Remove comment on commands to enable Access configurations
### Change root password
echo "root:$1" | chpasswd && echo "Setting root pass to: $1"
### Create new User
useradd -rm -d /home/player -s /bin/bash -g root -G sudo -u 1001 player
### Change User Password
echo "player:$2" | chpasswd && echo "Setting player pass to: $2"
# - - - - - - - - - -
# - - - - - - - - - -
### *** SSH Config ***
echo "[*] SSH Configuration Setup"
### Remove comment on commands to enable SSH configurations
### Configure Message of the Day
echo '
___ __ ________ ___ ___ ________ ________ ___ ___
|\ \|\ \ |\ __ \|\ \ |\ \|\ __ \|\ __ \ |\ \ / /|
\ \ \/ /|\ \ \|\ \ \ \ \ \ \ \ \|\ /\ \ \|\ \ \ \ \/ / /
\ \ ___ \ \ __ \ \ \ \ \ \ \ __ \ \ \\\ \ \ \ / /
\ \ \\ \ \ \ \ \ \ \ \____\ \ \ \ \|\ \ \ \\\ \ / \/
\ \__\\ \__\ \__\ \__\ \_______\ \__\ \_______\ \_______\/ /\ \
\|__| \|__|\|__|\|__|\|_______|\|__|\|_______|\|_______/__/ /\ __\
|__|/ \|__|
' > /etc/motd
### Configure SSH to run persistently
update-rc.d -f ssh remove
update-rc.d -f ssh defaults
### Backup and move default Kali Keys to new directory
cd /etc/ssh/
mkdir kali_defaults
mv ssh_host_* kali_defaults/
### Generate new SSH keys
dpkg-reconfigure openssh-server
### Disable PermitRoot Login for SSH
sed -i 's/prohibit-password/no/' sshd_config
### Start SSH server
service ssh start
### Show services status
service --status-all
# - - - - - - - - - -
# - - - - - - - - - -
### *** Language Config ***
echo "[*] Language Configuration Setup"
### System wide check for new updates
apt-get update
### Remove comment on commands to enable Language support
# *
### Native Tools Development
# apt-get install gcc g++ make
# *
### Install Node.js v19.x
curl -fsSL https://deb.nodesource.com/setup_19.x | bash - && sudo apt-get install -y nodejs
# *
### Install Python
# apt -y install python python-pip python3-pip # Python 2
# apt -y install python3 python3-pip # Python 3
### Install Java
# apt -y install default-jdk
# *
### Install Rust
# curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -y
# *
# - - - - - - - - - -
# - - - - - - - - - -
### *** Tools Config ***
echo "[*] Tool Configuration Setup"
### Remove comment on commands to enable Tool installation
# *
### Install Nmap tool in the Box (Network Scanning)
apt -y install nmap
# *
### Install Scapy tool in the Box (Network Scanning) {Requires Python}
# pip install --pre scapy[basic]
# *
### Install Netcat tool in the Box (Network Scanning)
# apt -y install netcat-traditional
# *
### Install MOSINT in the Box (Intel Gathering) {Requires Python3}
# apt install python3-pypdf2
# pip3 install tabula
# git clone https://github.com/alpkeskin/mosint.git
# cd mosint/
# pip3 install -r requirements.txt
# *
### Install Ettercap in the Box (Man-in-the-Middle)
# apt -y install ettercap-common
# *
### Install Bettercap in the Box (Man-in-the-Middle)
# apt -y install bettercap
# *
### Install Medusa tool in the Box (Brute Force)
# apt -y install medusa
# *
### Install Hashcat tool in the Box (Password Cracking)
# apt -y install hashcat
# *
### Install John the Riper in the Box (Password Cracking)
#apt -y install john
# *
### Install sqlmap in the Box (SQL Injection)
# apt -y install sqlmap
# *
# - - - - - - - - - -
# - - - - - - - - - -
## *** Keep Alive Config ***
END_TIME=$(date +%s)
echo '
___ __ ________ ___ ___ ________ ________ ___ ___ ___
|\ \|\ \ |\ __ \|\ \ |\ \|\ __ \|\ __ \ |\ \ / /|\ \
\ \ \/ /|\ \ \|\ \ \ \ \ \ \ \ \|\ /\ \ \|\ \ \ \ \/ / | \ \
\ \ ___ \ \ __ \ \ \ \ \ \ \ __ \ \ \\\ \ \ \ / / \ \ \
\ \ \\ \ \ \ \ \ \ \ \____\ \ \ \ \|\ \ \ \\\ \ / \/ \/ /|
\ \__\\ \__\ \__\ \__\ \_______\ \__\ \_______\ \_______\/ /\ \ / //
\|__| \|__|\|__|\|__|\|_______|\|__|\|_______|\|_______/__/ /\ __\ /_ //
Follow the white rabbit |__|/ \|__||__|/
' > /etc/motd
echo "Initialized in $(($END_TIME - $START_TIME)) seconds"
echo 'KaliBox ready, have fun hacking :)'
## Keep Kalibox running after init.sh
tail -f /dev/null
# - - - - - - - - - -