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 / 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 / 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 / docker-auto-installer.sh
Last active June 13, 2023 20:22
[Docker Auto Installer] Docker automated installer #linux #docker #installer
#!/bin/bash
apt-get update
apt-get install -y \
linux-image-extra-$(uname -r) \
linux-image-extra-virtual
apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
@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 / find-non-commented.sh
Last active January 9, 2019 14:21
[Find non commented lines] Print lines that does not contain # or ; #linux #grep #comment #search
#!/bin/bash
if [ -z "$1" ]
then
echo -e "\nInfo : find non commented lines in file"
echo -e "and put results in /tmp/uncommented-filename"
echo -e "Usage : ./find-non-commented.sh <file to search>\n"
else
echo -e "\nSearching $1 file for non commented lines"
FILENAME=$(basename -- "$1")
#grep -v "^\s*[#\;]\|^\s*$" $1 > /tmp/uncommented-$FILENAME
@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'