Skip to content

Instantly share code, notes, and snippets.

View 0x3n0's full-sized avatar
🎯
Focusing

Eno Leriand 0x3n0

🎯
Focusing
View GitHub Profile
#!/bin/sh
# script to automate the creation of chroot jail
export CHROOT=/var/chroot
function copy_binary() {
for i in $(ldd $*|grep -v dynamic|cut -d " " -f 3|sed 's/://'|sort|uniq)
do
cp --parents $i $CHROOT
done
echo "https://www.example.com/?aaa=bbb&ccc=ddd" | tr '?' '&' | awk -F '&' '{for(i=2;i<=NF;i++){split($i,t,"=");print t[1]}}'
while read u; do echo $u | tr '?' '&' | awk -F '&' '{for(i=2;i<=NF;i++){split($i,t,"=");print t[1]}}'; done < plainurls.txt | sort -fu
From wayback json file:
cat waybackurls.json|jq -r '.[]'|grep 'http'|cut -d '"' -f 2 | while read u; do echo $u | tr '?' '&' | awk -F '&' '{for(i=2;i<=NF;i++){split($i,t,"=");print t[1]}}'; done | sort -fu
function oparam {
echo $1 | tr '?' '&' | awk -F '&' '{for(i=2;i<=NF;i++){split($i,t,"=");print t[1]}}'
}
while read h; do curl -siL https://$h|egrep -io "[0-9a-z_\-\.]+\.([0-9a-z_\-]+)?`echo $h|awk -F '.' '{print $(NF-1)}'`([0-9a-z_\-\.]+)?\.[a-z]{1,5}"|sort -fu ; done < hosts.txt
function osub {
curl -siL https://$h1egrep -io "[0-9a-z_\-\.]+\.([0-9a-z_\-]+)?`echo $h|awk -F '.' '{print $(NF-1)}'`([0-9a-z_\-\.]+)?\.[a-z]{1,5}"|sort -fu
}
function osubs {
while read h; do curl -siL https://$h|egrep -io "[0-9a-z_\-\.]+\.([0-9a-z_\-]+)?`echo $h|awk -F '.' '{print $(NF-1)}'`([0-9a-z_\-\.]+)?\.[a-z]{1,5}"|sort -fu ; done < $1
}
cat urls.txt | while read u;do echo "$(printf '%-100s' "$u")-> $((curl -I -s -m 5 -k "$u"||echo KO)|head -n 1 -)"; done
From a json file:
cat waybackurls.json|jq -r '.[]'|grep 'http'|cut -d '"' -f 2 | while read u;do echo "$(printf '%-100s' "$u")-> $((curl -I -s -m 5 -k "$u"||echo KO)|head -n 1 -)"; done
Using parallel to speed up the process:
cat plainurls.txt | parallel -j 20 -I# 'echo "$(printf "%-100s" "#") -> $((curl -I -s -m 5 -k "#"||echo KO)|head -n 1 -)"'
function otestu {
cat $1 | parallel -j 20 -I# 'echo "$(printf "%-100s" "#") -> $((curl -I -s -m 5 -k "#"||echo KO)|head -n 1 -)"'
firefox `cat urls.txt | awk '{if(index($1,"http")){print $1}else{print "http://"$1;print "https://"$1}}'
firefox `cat urls.txt | awk '{if(index($1,"http")){print $1}else{print "http://"$1;print "https://"$1}}' | tr "\n" " "`
chromium-browser `cat urls.txt | awk '{if(index($1,"http")){print $1}else{print "http://"$1;print "https://"$1}}'
chromium-browser `cat urls.txt | awk '{if(index($1,"http")){print $1}else{print "http://"$1;print "https://"$1}}' | tr "\n" " "`
function oopen() {
firefox `cat $1 | awk '{if(index($1,"http")){print $1}else{print "http://"$1;print "https://"$1}}'
}
#!/bin/bash
# mounts all needed mount points to change into another system from within a live-CD
if [ "$(whoami &2>/dev/null)" != "root" ] && [ "$(id -un &2>/dev/null)" != "root" ] ; then
echo "You must be root to run this script!"; echo "use 'sudo !!'"; exit 1
fi
if [ $1 = "-i" -o $1 = "--interactive" ]; then
#interactive
### The bashrcscript will then be executed when the root console is started. Ensure it's executable.
#!/usr/bin/env bash
cp bashrcscript chroot/root/
if [ -a chroot/root/.bashrc ]; then
cp chroot/root/.bashrc chroot/root/.bashrc.bak
fi
echo "./bashrcscript" >> chroot/root/.bashrc
chroot chroot/
rm chroot/root/.bashrc
#!/bin/bash
# script to enable monitor mode on wireless
# give the script a name and move it to /usr/bin somewhat executable anywhere
# for example: `start wlan0` to enable monitor mode
GREEN='\033[0;32m'
interface=${1:-wlan0}
if [ $? -eq 0 ]; then
ip link set $interface down
#!/bin/bash
###Declaring all the variables used####
infofile=infodump
macsfile=macs
wlan_interface=wlan2
monitor_interface=wlan2
target_station="Target router for dump"
ch="Target number channel"
user=`whoami`