Skip to content

Instantly share code, notes, and snippets.

View vpnwall-services's full-sized avatar

Vpnwall Services vpnwall-services

View GitHub Profile
@vpnwall-services
vpnwall-services / find-multi-args.sh
Created April 20, 2018 03:53
[Find with multi arguments] Search with two or more arguments #linux #search
find . -regextype posix-egrep -regex ".*\.(html|scan)"
@vpnwall-services
vpnwall-services / show-tmux-tty-names.sh
Created April 23, 2018 00:41
[Get TTY name of Tmux pane] Print the TTY to output directly to Tmux pane #linux # tmux #info
tmux list-panes -F "#{pane_tty}"
@vpnwall-services
vpnwall-services / saltautocompletion.sh
Last active April 23, 2018 01:23
[Salt Autocompletion] Enable auto completion for saltstack commandline #linux #saltstack #configuration
#!/bin/bash
wget https://raw.githubusercontent.com/saltstack/salt/develop/pkg/salt.bash
cp salt.bash /etc/bash_completion.d/
source /etc/bash_completion.d/salt.bash
@vpnwall-services
vpnwall-services / clean-old-kernels.sh
Last active April 23, 2018 18:14
[Clean old kernels] Script to deleted unused kernels and free disk space
#!/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 / zsh-auto-install.sh
Last active April 23, 2018 18:15
[Zsh Auto Installer] Zsh automated installer #linux #zsh #installer
#!/bin/bash
apt-get update ; apt-get upgrade -y
apt-get install tmux zsh htop git -y
wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh
chmod +x install.sh
sed -i 's/env zsh//g'
./install.sh
cat << EOF > /root/.oh-my-zsh/themes/robbyrussell.zsh-theme
local ret_status="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ )"
@vpnwall-services
vpnwall-services / fwif.sh
Last active April 23, 2018 18:18
[Find word in files] Search for a specific word in a set of folders and files #linux #search #grep
#!/bin/bash
if [ -z "$1" ]
then
echo -e "\nInfo : find word in files from specified folder"
echo -e "\nUsage : cd into target folder and then"
echo -e "\n ==> : ./find-word-in-files.sh <word to search>"
else
echo -e "\n Searching $1 in $PWD"
# grep -R {"$1"} {"$PWD"}
grep -rnw $PWD -e "$1"
@vpnwall-services
vpnwall-services / block-non-tor-traffic.sh
Last active May 8, 2018 11:45
[Block non-Tor traffic] Block all traffic except on port 9050 to avoid leaks #linux #iptables #tor #security #leak
#!/bin/bash
touch /tmp/reset.iptables
iptables-restore < reset.iptables
#Reset OUTPUT table
iptables -F OUTPUT
#Enable related traffic to go through
iptables -A INPUT -m state --state ESTABLISHED, RELATED -j ACCEPT
#Enable traffic related to debian-tor user
iptables -A OUTPUT -j ACCEPT -m owner --uid-owner debian-tor
#Enable traffic from loopback
@vpnwall-services
vpnwall-services / rotor.sh
Last active May 8, 2018 12:48
[Rotor] Multi-instance Tor configurator #linux #pentest #tor #hack
#!/bin/bash
#apt-get install tor lsof tmux -y --force-yes
NAME="Rotor Daemon"
killall tor
mv /etc/tor/torrc /etc/tor/torrc.bak
mv /etc/proxychains.conf /etc/proxychains.conf.bak
tmux kill-session -t "$NAME"
tmux new-session -s "$NAME" -n "Tor daemons" -d
cat << EOF > /etc/proxychains.conf
@vpnwall-services
vpnwall-services / multitor.sh
Last active May 8, 2018 13:24
[MultiTor] Run 4 instances of Tor with Docker #linux #tor #docker #pentest
#!/bin/bash
docker run --rm -d --name tor_instance1 -p 127.0.1.1:9150:9150 nagev/tor
docker run --rm -d --name tor_instance2 -p 127.0.1.1:9151:9151 nagev/tor
docker run --rm -d --name tor_instance3 -p 127.0.1.1:9152:9152 nagev/tor
docker run --rm -d --name tor_instance4 -p 127.0.1.1:9153:9153 nagev/tor
cat << EOF > /etc/proxychains.conf
random_chain
proxy_dns
tcp_read_time_out 15000
tcp_connect_time_out 8000
@vpnwall-services
vpnwall-services / create-splitted-tmux.sh
Last active May 14, 2018 17:08
[Create Splitted Tmux] Create splitted tmux session for several applications #linux #shell #tmux #create
#!/bin/bash
tmux new-session -s 'tmuxed-1' -n 'app1' -d
tmux split-window -t 0 -v
tmux resize-pane -t 1 -U -y 10
tmux send -t 0 'ping -c 4 localhost' ENTER
tmux send -t 1 'hostname' ENTER
tmux at -t 'tmuxed-1'