Skip to content

Instantly share code, notes, and snippets.

Avatar

Vpnwall Services vpnwall-services

View GitHub Profile
@vpnwall-services
vpnwall-services / kali-repository
Last active Apr 20, 2018
[Kali-Repo] Adds Kali Repository on Linux #linux #repo
View kali-repository
#!/bin/bash
apt-get update ; apt-get install -y dirmngr
grep -q -F 'deb http://http.kali.org/kali kali-rolling main contrib non-free' /etc/apt/sources.list || echo 'deb http://http.kali.org/kali kali-rolling main contrib non-free' >> /etc/apt/sources.list
apt-key adv --keyserver pgp.mit.edu --recv-keys ED444FF07D8D0BF6
apt-get update
apt-get install -y -t kali-rolling
@vpnwall-services
vpnwall-services / template.service
Created Apr 20, 2018
[Systemd Service Template] Skeleton for a new Systemd service #linux #systemd # service
View template.service
#Put me in /lib/systemd/system/
[Unit]
Description=My Miscellaneous Service
After=network.target
[Service]
Type=simple
User=nanodano
WorkingDirectory=/home/nanodano
ExecStart=/home/nanodano/my_daemon --option=123
@vpnwall-services
vpnwall-services / clean-old-kernels.sh
Last active Apr 23, 2018
[Clean old kernels] Script to deleted unused kernels and free disk space
View clean-old-kernels.sh
#!/bin/bash
dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | xargs sudo apt-get purge -y
@vpnwall-services
vpnwall-services / findbigfiles.sh
Last active Oct 9, 2018
[Find big files] Help to find biggest files to free some space #linux #space
View findbigfiles.sh
#!/bin/bash
#du -a / | sort -n -r | head -n 5
du -Sh / | sort -rh | head -5
find -type f -exec du -Sh {} + | sort -rh | head -n 5
apt-get install -y ncdu
ncdu /
@vpnwall-services
vpnwall-services / find-multi-args.sh
Created Apr 20, 2018
[Find with multi arguments] Search with two or more arguments #linux #search
View find-multi-args.sh
find . -regextype posix-egrep -regex ".*\.(html|scan)"
@vpnwall-services
vpnwall-services / generate-self-cert.sh
Last active Dec 4, 2019
[Generate self-signed certificate] Create a self-signed certificate #linux #certificate #ssl
View generate-self-cert.sh
#!/bin/bash
# Generate key and certificate
openssl genrsa -out privkey.pem 4096
openssl req -new -x509 -key privkey.pem -out cert.pem -days 1826
# Generate full self-signed certificate chain
# Create root key
openssl genrsa -des3 -out rootCA.key 4096
@vpnwall-services
vpnwall-services / gen-rand-pass.sh
Last active Jan 23, 2020
[Generate random password] Generate a password randomly #linux # generate #password
View gen-rand-pass.sh
#!/bin/bash
# Echo three passwords
cat /dev/urandom| tr -dc 'a-zA-Z0-9-_!@#$%+'|fold -w 28| head -n 3
# Echo one password and put it in clipboard
# Requirements: apt-get install -y xclip
cat /dev/urandom| tr -dc 'a-zA-Z0-9-_!@#$%+'|fold -w 28| head -n 1|xclip"
openssl rand 60 | openssl base64 -A
@vpnwall-services
vpnwall-services / public_ip.sh
Last active May 14, 2018
[Get public IP] Retrieve public IP address #linux #ip
View public_ip.sh
#!/bin/bash
curl https://icanhazip.com
@vpnwall-services
vpnwall-services / metasploit-installer.sh
Last active May 24, 2020
[Metasploit Installer] Automated compilation installer for Metasploit #metasploit #linux #installer
View metasploit-installer.sh
#!/bin/bash
add-apt-repository -y ppa:webupd8team/java
apt-get update
apt-get -y install gpg2
apt-get -y install oracle-java8-installer
apt-get install build-essential libreadline-dev libssl-dev libpq5 libpq-dev libreadline5 libsqlite3-dev libpcap-dev git-core autoconf postgresql pgadmin3 curl zlib1g-dev libxml2-dev libxslt1-dev vncviewer libyaml-dev curl zlib1g-dev
curl -sSL https://rvm.io/mpapis.asc | gpg2 --import -
curl -L https://get.rvm.io | bash -s stable
source ~/.rvm/scripts/rvm
echo "source ~/.rvm/scripts/rvm" >> ~/.bashrc
@vpnwall-services
vpnwall-services / askvar.sh
Last active May 14, 2018
[Ask parameter in Bash] Function for asking var to user and check if it's empty or not #bash #variable #loop #example
View askvar.sh
echo -e "\nEnter your var :"
VAR=$1
if [ -z $VAR ]
then
clear
echo -e "\nvar is empty, try again ..."
else
echo -e "\nvar is okay, lets do this ..."
fi
You can’t perform that action at this time.