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|sudotee/usr/share/keyrings/shiftkey-packages.gpg>/dev/nullsudosh-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
sudoaptinstall-ytorservicetorstartservicetorstatus# Start browser with proxychain:proxychainsfirefoxwww.duckduckgo.com (do not close terminal)# search for: check dns leaks
cd/opt/# Get the latest version link from https://github.com/gophish/gophish/releases/sudowgethttps://github.com/gophish/gophish/releases/download/v0.12.1/gophish-v0.12.1-linux-64bit.zipsudounzip-dgophishgophish-v0.12.1-linux-64bit.zipsudochmod+xgophish/gophishcd/opt/gophish&&sudo./gophish
# Download Burp Suite community edition for Linux 64 bits BURP_VER=$(curl-sihttps://portswigger.net/burp/releases/community/latest|grep-E"^location:"|grep-Eo"[0-9]+.[0-9]+.[0-9]+"|sed's/-/./g')wget-qO"/tmp/burpsuite_community_v"$BURP_VER"_install.sh""https://portswigger.net/burp/releases/startdownload?product=community&version="$BURP_VER"&type=Linux"chmod+x"/tmp/burpsuite_community_v"$BURP_VER"_install.sh"sudo/tmp/burpsuite_community_v"$BURP_VER"_install.sh-q# Default install dir is /opt/BurpSuiteCommunity# This will overwrite the command of the already installed Burpsuite (with apt)sudocp/opt/BurpSuiteCommunity/burpsuite_community.jar/usr/share/burpsuite/burpsuite.jarsudomv/usr/bin/burpsuite/usr/bin/burpsuite.bakecho-ne'#!/bin/sh\n"/opt/BurpSuiteCommunity/BurpSuiteCommunity" %U\n'|sudotee/usr/bin/burpsuite&&sudochmod+x/usr/bin/burpsuite# Start burspsuite from shell
dockerrun-it--rm--namerustscanrustscan/rustscan:2.1.1# Create a zsh/bash alias like thisalias rustscan='docker run -it --rm --name rustscan rustscan/rustscan:2.1.1'
sudoaptinstall-ygolang-gogoinstallgithub.com/projectdiscovery/cvemap/cmd/cvemap@latest# Based on your SHELL, add Go bin to system PATHecho"export PATH=$PATH:$HOME/go/bin">> $HOME/.bashrcecho"export PATH=$PATH:$HOME/go/bin">> $HOME/.zshrcecho"export PATH=$PATH:$HOME/go/bin">> $ZSH_CUSTOM/my_paths.zshsource $HOME/.bashrcsource $HOME/.zshrc
Usage and Configuration
SSH Login
sudosystemctlenablessh--now
Configure Git for Github
gitconfig--globaluser.email"YOUR_EMAIL@gmail.com"gitconfig--globaluser.name"YOUR_USERNAME"ssh-keygen-ted25519-C"YOUR_EMAIL@gmail.com"eval"$(ssh-agent-s)"ssh-add~/.ssh/id_ed25519xclip-selectionclipboard<~/.ssh/id_ed25519.pub# Add a new key on github.com and paste the one copied with xclip.# Test it:ssh-Tgit@github.comgitclonegit@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
Global Socket allows two workstations on different private networks to communicate with each other. Through firewalls and through NAT - like there is no firewall.
# Installbash-c"$(curl-fsSLhttps://gsocket.io/y)"# UninstallGS_UNDO=1bash-c"$(curl-fsSLhttps://gsocket.io/y)"# Access (from another place)S="ExampleSecretChangeMe"bash-c"$(curl-fsSLhttps://gsocket.io/y)"
#!/bin/bashecho"[i] Updating and upgrading Kali (this will take a while)"apt-getupdateapt-get--yes--force-yesdist-upgradeecho"[i] Installing Xfce4 & xrdp (this will take a while as well)"apt-get--yes--force-yesinstallkali-desktop-xfcexorgxrdpecho"[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|sudotee/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-profileResultAny=noResultInactive=noResultActive=yesEOFsudosystemctlrestartxrdp
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 VMssudo-s# Now that the terminal is using root, run the virsh tool to create a backup of the VM definitions file.echo''>nameofvm.xmlvirshdumpxmlnameofvm>/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-pvm-backupcdvm-backupmvexample.qcow2vm-backupmvnameofvm.xmlvm-backup# Using tar, create an archive of the VM disk and XML file.tarjcvfpmy-vm-backup.tar.bz2vm-backupmvmy-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 backupsTorestoreabackup,you’llfirstneedtoextractit.tarxvfpmy-vm-backup.tar.bz2cdvm-backup# Use virsh to restore the XML file.sudo-svirshdefine--file/home/username/location/of/exctracted/archive/vm-backup/nameofvm.xml# Lastly, move the disk image to the images directory.mvexample.qcow2/var/lib/libvirt/images/