Skip to content

Instantly share code, notes, and snippets.

@wogho
Forked from AnoRebel/Kali-WSL.sh
Last active August 17, 2022 07:21
Show Gist options
  • Save wogho/ec56a34cdba3f55de7bd2ece0added7c to your computer and use it in GitHub Desktop.
Save wogho/ec56a34cdba3f55de7bd2ece0added7c to your computer and use it in GitHub Desktop.
Oracle Cloud set up kali Linux
sudo -i
free -m
sudo dd if=/dev/zero of=/mnt/swap.0 bs=5024 count=1048576 && sudo mkswap /mnt/swap.0 && echo "/mnt/swap.0 swap swap defaults 0 0" >> /etc/fstab && swapon /mnt/swap.0 && sudo swapon -s
apt update && DEBIAN_FRONTEND=noninteractive apt install -y wget kali-linux-headless
vi xfce4.sh
#!/bin/sh
#echo "[i] Updating and upgrading Kali (this will take a while)"
#apt-get update
#apt-get dist-upgrade -y
echo "[i] Installing Xfce4 & xrdp (this will take a while as well)"
apt-get install -y kali-desktop-xfce xorg xrdp
echo "[i] Configuring xrdp to listen to port 3390 (but not starting the service)"
sed -i 's/port=3389/port=3390/g' /etc/xrdp/xrdp.ini
chmod +x xfce4.sh
sudo ./xfce4.sh
sudo systemctl enable xrdp --now
sudo /etc/init.d/xrdp start
=| Kali Linux on OCI |=
https://www.minextuts.com/installing-kali-linux-for-virtual-machine-xfce-kali-rdp/
sudo -i
apt update && DEBIAN_FRONTEND=noninteractive apt install -y wget kali-linux-headless
apt install -y dbus-x11
/etc/init.d/xrdp start
systemctl enable xrdp --now
adduser kali
[First Install]
cat /etc/issue
apt-get update
apt-get dist-upgrade (y)
apt-get install webshells [you may need to allow access via defender / smartscreen]
apt-get clean
apt-get install webshells [re-do if first time blocked by defender / smartscreen]
ls -l /usr/share/webshells/
free -m
sudo dd if=/dev/zero of=/mnt/swap.0 bs=5024 count=1048576 && sudo mkswap /mnt/swap.0 && echo "/mnt/swap.0 swap swap defaults 0 0" >> /etc/fstab && swapon /mnt/swap.0 && sudo swapon -s
wget https://kali.sh/xfce4.sh && chmod +x xfce4.sh
cat xfce4.sh
sh xfce4.sh
/etc/init.d/xrdp start #Enable RDP Port
# /etc/init.d/xrdp stop (ogni qualvolta non si dovrà utilizzare la GUI di Kali Linux)
apt-get install xrdp lxde-core lxde tigervnc-standalone-server -y # update xfce4
update-alternatives --config x-session-manager # choose xfce4-session
# edit xrdp.ini
sudo nano /etc/xrdp/xrdp.ini
autorun=sesman-any
max_bpp=16
[sesman-any]
ip=127.0.0.1
# changed username and password to the kali user
# Mod access permission
sudo nano /etc/X11/Xwrapper.config
allowed_users=anybody
# edit sesman.ini
sudo nano /etc/xrdp/sesman.ini
[Globals]
ListenAddress=127.0.0.1
ListenPort=3390
EnableUserWindowManager=true
UserWindowManager=startwm.sh
DefaultWindowManager=startwm.sh
# start services
sudo service xrdp start
sudo service xrdp-sesman start
# conf services
sudo update-rc.d xrdp enable
sudo systemctl enable xrdp-sesman.service
[First GUI Start]
Open terminal
sudo cat /etc/issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment