Skip to content

Instantly share code, notes, and snippets.

View filiperfernandes's full-sized avatar

Filipe Ramalho Fernandes filiperfernandes

View GitHub Profile
# SOCKS Proxy (browser proxy config required)
ssh -D 8123 -f -C -q -N via_host
# Local Port Forwarding (-nNT --> only forwarding, don't get tty)
ssh -nNT -L s_port:forward_host:d_port via_host
# Remote Port Forwarding
ssh -R s_port:forward_host:d_port via_host
@filiperfernandes
filiperfernandes / Vagrantfile
Last active April 1, 2020 15:02
Sample Vagrantfile config
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.define "base" do |base|
#Set vagrant box to use
base.vm.box = "debian/buster64"
#Setup basic settings
@filiperfernandes
filiperfernandes / pingall.sh
Created August 26, 2019 10:27
Test Server conenctivity
#!/bin/bash
# Program name: pingall.sh
# Author: https://askubuntu.com/users/127327/souravc
# Source: https://askubuntu.com/questions/413367/ping-multiple-ips-using-bash
date
cat thesis-servers.txt | while read output
do
ping -c 1 "$output" > /dev/null
if [ $? -eq 0 ]; then
echo "node $output is up"
@filiperfernandes
filiperfernandes / load-openvswitch.sh
Created July 4, 2019 17:39
PiOVS - Setup Raspberry pi as OpenvSwitch
#!/bin/bash
# Usage:
# ./load-openvswitch [ip-address-of-eth0] [default-gateway-ip-address]
# Example:
# ./load-openvswitch 192.168.1.10 192.168.1.1
sudo ifconfig ovsbr0 up
sudo ifconfig eth1 up
sudo ifconfig eth2 up
@filiperfernandes
filiperfernandes / icat_recover.sh
Last active November 21, 2018 14:47
Recover multiple files with icat
# First get list of files:
# fls -f ext4 -o 2048 -p -r ./image_disk 573445 | grep -v '^..-' | grep -v '^... \*' > files.lst
IMAGE=image_disk
LIST=files.lst
DEST=/path/to/output/dir
cat $LIST | while read line; do
filetype=`echo "$line" | awk {'print $1'}`
filenode=`echo "$line" | awk {'print $2'}`
@filiperfernandes
filiperfernandes / setup_volatility.sh
Created November 11, 2018 19:33
Setup Custom Volatility Profile on Kali
# Set layout PT
setxkbmap pt
# Setup working directory
mkdir -p /volumes/storage1
mount /dev/sda1 -t ext4 /volumes/storage1
cd /volumes/storage1
# Download volatility repo
@filiperfernandes
filiperfernandes / acestream.sh
Created November 4, 2018 18:52
Acestream for MacOS and linux
#!/bin/sh
#Usage:
# To start: acestream start [acestream_id_only]
# To stop: acestream stop
#Dependencies:
# docker pull ikatson/aceproxy
# #docker run -t -p 8000:8000 --name aceproxy ikatson/aceproxy
# vlc
@filiperfernandes
filiperfernandes / namespaces.sh
Last active December 29, 2023 07:03
Script to create two namespaces and connection between them
#Install Openvswitch on ubuntu
sudo apt-get install qemu-kvm libvirt-bin ubuntu-vm-builder bridge-utils
sudo apt-get install openvswitch-switch
#Create Namespace
sudo ip netns add mario
sudo ip netns add luigi
#Create virtual switch
sudo ovs-vsctl add-br my-switch
@filiperfernandes
filiperfernandes / gist:540665ccbb0cafde25a938579be08d2e
Created September 26, 2018 11:08
Linux network namespaces sheet
# List all namespace, except for the default/global one.
ip netns
# Same as above, list all namespaces.
ip netns list
# Execute command inside a specific namespace
ip netns exec <namespace_name> <command>
# Sets specified interface in the specified namespace
@filiperfernandes
filiperfernandes / ns-inet.sh
Created September 26, 2018 10:39 — forked from dpino/ns-inet.sh
Setup a network namespace with Internet access
#!/usr/bin/env bash
set -x
NS="ns1"
VETH="veth1"
VPEER="vpeer1"
VETH_ADDR="10.200.1.1"
VPEER_ADDR="10.200.1.2"