Skip to content

Instantly share code, notes, and snippets.

@takeshixx
takeshixx / 33C3
Created December 27, 2016 13:27
33C3 WPA2 802.1X config for netctl
Description='33C3 WPA2 802.1x WiFi'
Interface=wlp4s0
Connection=wireless
Security=wpa-configsection
IP=dhcp
Essid=33C3
WPAConfigSection=(
'ssid="33C3"'
'proto=RSN WPA'
'key_mgmt=WPA-EAP'
@takeshixx
takeshixx / wtf.md
Last active September 19, 2016 09:31
CSAW CTF 2016 wtf.sh Writeup

CSAW CTF 2016 wtf.sh Writeup

wtf.sh was a challenge that included two flags, one for 150pts and one for 400pts.

wtf.sh (1) (150pts)

In the first part we needed to call the function get_flag1 in order to receive the flag. The post parameter of post.wtf was vulnerable to a path traversal:

GET /profile.wtf?user=../posts HTTP/1.1
@takeshixx
takeshixx / github.sh
Created July 6, 2016 09:55
Clone all OpenStack repositories from GitHub
for i in $(curl -s "https://api.github.com/orgs/openstack/repos?per_page=999" |jq -r '.[] .clone_url');do git clone $i;done
#include <stdio.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <pty.h>
#include <termios.h>
#include <fcntl.h>
#include <sys/select.h>
#!/usr/bin/env python3
import socket
import ssl
import sys
try:
from pyasn1.codec.der import decoder
from pyasn1_modules import rfc2459
except ImportError:
print('Run: pip install pyasn1 pyasn1-modules')
sys.exit(1)
@takeshixx
takeshixx / byebyebsd.py
Last active January 22, 2016 20:06
FreeBSD SCTP ICMPv6 error message vulnerability (FreeBSD-SA-16:01.sctp / CVE-2016-1879) PoC
# FreeBSD SCTP ICMPv6 error message vulnerability (FreeBSD-SA-16:01.sctp / CVE-2016-1879) PoC
# https://www.freebsd.org/security/advisories/FreeBSD-SA-16:01.sctp.asc
# https://github.com/freebsd/freebsd/commit/51f55053b6565d2fe9b61f63460dddc23284a103
import sys
from scapy.all import *
if len(sys.argv) is not 3:
print('{} target_ip interface'.format(sys.argv[0]))
exit(1)
@takeshixx
takeshixx / gist:8493530
Created January 18, 2014 17:26
Set proxy in a shell.
function proxy () {
UNSET=""
PROXY="http://127.0.0.1:8080"
PROXY_ENV=(http_proxy https_proxy ftp_proxy HTTP_PROXY HTTPS_PROXY FTP_PROXY)
if [ $1 == on ]; then
for i in $PROXY_ENV; do
export $i=$PROXY
done
echo "proxy set"
elif [ $1 == off ]; then
@takeshixx
takeshixx / gist:7683667
Last active December 29, 2015 14:28
Update FreeBSD ports inside jails.
for jail in $(jails);do jexec $(jid $jail) portmaster -ay;done
@takeshixx
takeshixx / gist:7486990
Last active December 28, 2015 10:29
Check for port updates in FreeBSD jails
for jail in $(jails);do print $jail;jexec $(jid $jail) portmaster -L --index-only|egrep '(ew|ort) version|total install';print;done
@takeshixx
takeshixx / xwrap.sh
Created November 15, 2013 10:57
xrandr wrapper script; switch between single/extended/cloned view (e.g. configure external display/projector)
#!/bin/zsh
# xrandr wrapper; switch between single/extended/cloned desktop;
CONFIGURED_DEVICES=($(xrandr|egrep -o '[[:alnum:]]+ [dis]{0,3}connected [0-9]{3,}x[0-9]{3,}'|awk '{print $1}'))
CONNECTED_DEVICES=($(xrandr|grep ' connected '|awk '{print $1}'))
PRIMARY=${CONFIGURED_DEVICES[1]}
RES_PRIMARY=$(xrandr|grep ${PRIMARY} -A1|tail -n1|egrep -o '[0-9]{3,}x[0-9]{3,}')
if [ ${#CONFIGURED_DEVICES[*]} -eq 1 ]; then
[ ${#CONNECTED_DEVICES[*]} -lt 2 ] && { print 'only one display conencted';exit; }
CUR_MODE='single'