apt clean â cleans the packages and install script in /var/cache/apt/archives/ (removes all stored archives in your cache)
apt autoclean â cleans obsolete deb-packages, less than clean (removes all stored archives in your cache for packages that can not be downloaded anymore (thus packages that are no longer in the repo or that have a newer version in the repo))
apt autoremove â removes orphaned packages which are not longer needed from the system, but not purges them, use the --purge option together with the command for that.
apt --purge autoremove â remove config files and (more important as it cleans dead subdirectories from the documentation tree) entries from /usr/share/doc.
Create Aliases
Ubuntu:
nano~/.bashrc# Append the following text with personal commands. O.S. update in this case:alias updateos='sudo -- sh -c "sudo apt update && sudo apt -y upgrade && sudo apt -y autoremove"'# Load changes:source~/.bashrc# List all aliases:alias
Kali Linux:
nano~/.zshrc# Append the following text with personal commands. O.S. update in this case:alias updateos='sudo -- sh -c "sudo apt update && sudo apt -y upgrade && sudo apt -y autoremove"'# Load changes:source~/.zshrc# List all aliases:alias
sudoaptinstall-ychrony# You can configure which time servers you want to use by editing # nano /etc/chrony/chrony.confsudosystemctlenable--nowchronysudosystemctlstatuschrony--no-pagersudotimedatectlstatus# System clock synchronized: yes# NTP service: active
passwdrootpasswdkalisudoaptinstallterminator-ysudoupdate-alternatives--configx-terminal-emulator# gsettings set org.gnome.desktop.default-applications.terminal exec 'terminator'
Set grub boot menu timeout
sudonano/etc/default/grub# Set the seconds in the GRUB_TIMEOUT value, save and exit the fileGRUB_TIMEOUT=1sudoupdate-grub# Reboot to test the timeout# To instantly boot without the grub menu waiting, edit the file adding these lines:GRUB_HIDDEN_TIMEOUT=0GRUB_HIDDEN_TIMEOUT_QUIET=trueGRUB_TIMEOUT=0
Boot Partition Clean Up (Ubuntu/Debian)
# Check Current Kernel Versionsudouname-r# Example output: 5.4.0-64-generic# As you see on image in my case â 5.4.0-64-generic is current kernel. Other older kernel versions can be deleted.# List Old installed Kernel images:sudodpkg--list'linux-image*'|awk'{ if ($1=="ii") print $2}'|grep-v`uname-r`# Your output will something like:linux-image-5.4.0-39-genericlinux-image-5.4.0-42-genericlinux-image-5.4.0-54-genericlinux-image-5.4.0-64-generic# To cleanup boot partition in Ubuntu uninstall old kernels with apt command one by one:sudoapt-getpurgelinux-image-5.4.0-39-genericsudoapt-getpurgelinux-image-5.4.0-42-genericsudoapt-getpurgelinux-image-5.4.0-54-generic# Remove no longer used dependencies:sudoapt-getautoremove# Update GRUB:sudoupdate-grub
Change Console setup
# For italian keyboard:sudodpkg-reconfigureconsole-setup
Disable Ubuntu automatic updates
sudonano/etc/apt/apt.conf.d/20auto-upgrades# make sure all the directives are set to â0âsudosystemctldisableapt-daily-upgrade.timersudosystemctlmaskapt-daily-upgrade.servicesudosystemctldisableapt-daily.timersudosystemctlmaskapt-daily.service# For complete package uninstallsudoaptpurge--auto-removeunattended-upgrades
# Start the Pc# Press E in the grub menu# Find the "linux /...vmlinuz" kernel line# Add "init=/bin/bash" at the end of the line# Press CTRL+X to boot.# In root prompt, type mount-oremount,rw/# Set a new password for a user withpasswduser# or for the root user withpasswd# Rebootreboot-f
Check Hardware Temperatures
sudoaptinstalllm-sensorshddtempsudosensors-detect/etc/init.d/kmodstartsensors# Raspberry Pi Tempvcgencmdmeasure_temp
# orwget -qO - https://apt.packages.shiftkey.dev/gpg.key | gpg --dearmor | sudo tee /usr/share/keyrings/shiftkey-packages.gpg > /dev/null
sudo sh -c 'echo "deb [arch=amd64 signed-by=/usr/share/keyrings/shiftkey-packages.gpg] https://apt.packages.shiftkey.dev/ubuntu/ any main" > /etc/apt/sources.list.d/shiftkey-packages.list'
sudoaptupdate&&sudoaptinstallgithub-desktop
Install Telegram
# Via aptsudoaptinstalltelegram-desktop
# Via official Linux binarywgethttps://telegram.org/dl/desktop/linuxtar-xvflinuxsudomvTelegram//opt/opt/Telegram/./Telegram/opt/Telegram/./Updater
Install Anydesk
# Run the following commands as root user:# add repository key to Trusted software providers listwget-qO-https://keys.anydesk.com/repos/DEB-GPG-KEY|apt-keyadd-# add the repository:sudoecho"deb http://deb.anydesk.com/ all main">/etc/apt/sources.list.d/anydesk-stable.list# update apt cache:sudoaptupdate# install anydesk:sudoaptinstall-yanydesk
Install ForticlientVPN
sudoaptinstallfirefoxjqlz4jsonopenfortivpncdmkdirtoolscd~/toolsgitclonehttps://github.com/nonamed01/fuckForticlient.gitcd~/tools/fuckForticlient./fuckForticlient.sh-S<SERVER>:<PORT>-c# Login via browser and retry the command above after logged in
Install DnsLeakTest
cd /tmp
wget https://raw.githubusercontent.com/macvk/dnsleaktest/master/dnsleaktest.py
chmod +x dnsleaktest.py
./dnsleaktest.py
Install Tor
sudo apt install -y tor
service tor start
service tor status
# Start browser with proxychain:
proxychains firefox www.duckduckgo.com
(do not close terminal)
# search for: check dns leaks
Install Anonsurf
cd /tmp
git clone https://github.com/Und3rf10w/kali-anonsurf
cd kali-anonsurf/
./installer.sh
clear
cd
anonsurf --help
anonsurf start
anonsurf myip
cd /opt/
# Get the latest version link from https://github.com/gophish/gophish/releases/
sudo wget https://github.com/gophish/gophish/releases/download/v0.12.1/gophish-v0.12.1-linux-64bit.zip
sudo unzip -d gophish gophish-v0.12.1-linux-64bit.zip
sudo chmod +x gophish/gophish
cd /opt/gophish && sudo ./gophish
docker run -it --rm --name rustscan rustscan/rustscan:2.1.1
# Create a zsh/bash alias like this
alias rustscan='docker run -it --rm --name rustscan rustscan/rustscan:2.1.1'
sudo apt install -y golang-go
go install github.com/projectdiscovery/cvemap/cmd/cvemap@latest
# Based on your SHELL, add Go bin to system PATH
echo "export PATH=$PATH:$HOME/go/bin" >> $HOME/.bashrc
echo "export PATH=$PATH:$HOME/go/bin" >> $HOME/.zshrc
echo "export PATH=$PATH:$HOME/go/bin" >> $ZSH_CUSTOM/my_paths.zsh
source $HOME/.bashrc
source $HOME/.zshrc
Usage and Configuration
SSH Login
sudo systemctl enable ssh --now
Configure Git for Github
git config --global user.email "YOUR_EMAIL@gmail.com"
git config --global user.name"YOUR_USERNAME"
ssh-keygen -t ed25519 -C "YOUR_EMAIL@gmail.com"
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519
xclip -selection clipboard < ~/.ssh/id_ed25519.pub
# Add a new key on github.com and paste the one copied with xclip.
# Test it:
ssh -T git@github.com
git clone git@github.com:syselement/REPOSITORY.git
Proxychains
#Edit proxychains:
nano /etc/proxychains.conf
# uncoment dynamic_chain
# coment strict_chain
# uncoment Proxy DNS requests-no leak for DNS data
# add on proxylist: socks5 127.0.0.1 9050
OpenVpn
# TryHackme OpenVpn Cypher(Temporary) error fix
sed -i 's/cipher AES-256-CBC/data-ciphers AES-256-CBC/' yournickname.ovpn
# or
sudo nano yournickname.ovpn
# Substitute line 14 "cipher AES-256-CBC" with:
data-ciphers AES-256-CBC
# Launch openvpn connection in background as a daemon
sudo openvpn --config yournickname.ovpn --daemon
# Stop it
sudo pkill -f openvpn
#!/bin/bash
echo "[i] Updating and upgrading Kali (this will take a while)"
apt-get update
apt-get --yes --force-yes dist-upgrade
echo "[i] Installing Xfce4 & xrdp (this will take a while as well)"
apt-get --yes --force-yes install 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
Fix for Authentication Required to Create Managed Color Device, run
cat <<EOF | sudo tee /etc/polkit-1/localauthority/50-local.d/45-allow-colord.pkla
[Allow Colord all Users]
Identity=unix-user:*
Action=org.freedesktop.color-manager.create-device;org.freedesktop.color-manager.create-profile;org.freedesktop.color-manager.delete-device;org.freedesktop.color-manager.delete-profile;org.freedesktop.color-manager.modify-device;org.freedesktop.color-manager.modify-profile
ResultAny=no
ResultInactive=no
ResultActive=yes
EOF
sudo systemctl restart xrdp
Port to connect to is 3390
### TESTS - DO NOT CONSIDER ###
# sudo nano /etc/xrdp/startwm.sh
# # Add lines before test and execute
# unset DBUS_SESSION_BUS_ADDRESS
# unset XDG_RUNTIME_DIR
# . $HOME/.profile
# Backup VMs
sudo -s
# Now that the terminal is using root, run the virsh tool to create a backup of the VM definitions file.
echo '' > nameofvm.xml
virsh dumpxml nameofvm > /var/lib/libvirt/images/nameofvm.xml
# Use ls to find the name of the Qcow2 virtual hard drive in /var/lib/libvirt/images/. Copy the file name, and use mv to move it into a new sub-directory.
mkdir -p vm-backup
cd vm-backup
mv example.qcow2 vm-backup
mv nameofvm.xml vm-backup
# Using tar, create an archive of the VM disk and XML file.
tar jcvfp my-vm-backup.tar.bz2 vm-backup
mv my-vm-backup.tar.bz2 /home/username/
# Backing up VM disk images takes a long time. Depending on the file size, it could take an hour or more. Best to just let the PC do its thing. When the backup is complete, feel free to move my-vm-backup.tar.bz2 to another server, cloud backup and etc.
# Restoring backups
To restore a backup, youâll first need to extract it.
tar xvfp my-vm-backup.tar.bz2
cd vm-backup
# Use virsh to restore the XML file.
sudo -s
virsh define --file /home/username/location/of/exctracted/archive/vm-backup/nameofvm.xml
# Lastly, move the disk image to the images directory.
mv example.qcow2 /var/lib/libvirt/images/