Skip to content

Instantly share code, notes, and snippets.

@xaitax
xaitax / bgrab.sh
Last active December 19, 2015 18:49
bgrab is a bash-written script to scan single hosts or network ranges for webserver banners. Those banners will be highlighted with BEL or color if matches a pregiven array of strings. It just makes use of `netcat' and includes logging functionalities. It was designed to scan for CVE-2013-2028 (nginx stack-based buffer overflow) vulnerability.
#!/bin/bash
#
# @author: Alexander 'xaitax' Hagenah <ah@primepage.de>
# http://primepage.de
#
# @desc: HTTP Banner Grabber + Highlighting
#
# @created: 05/14/2013
#
@xaitax
xaitax / fix_vmware_3.10.sh
Created July 15, 2013 17:06
mnet/vmblock patch for Kernel 3.10 caused by create_proc_entry() removal in favor of proc_create().
#!/bin/bash
cd /tmp
curl -O http://primepage.de/stuff/vmware/vmblock-9.0.2-5.0.2-3.10.patch
curl -O http://primepage.de/stuff/vmware/vmnet-9.0.2-5.0.2-3.10.patch
cd /usr/lib/vmware/modules/source
cp vmblock.tar vmblock_backup.tar
cp vmnet.tar vmnet_backup.tar
tar -xvf vmblock.tar
tar -xvf vmnet.tar
patch -p0 -i /tmp/vmblock-9.0.2-5.0.2-3.10.patch
@xaitax
xaitax / x360tool.sh
Created July 15, 2013 17:08
x360tool is designed for anyone who wants to check your(!) XBOX 360 game ISO with abgx360 for validity and to burn your(!) XBOX 360 game ISO to a DL DVD.
#!/bin/bash
#
# @desc: Check http://primepage.de/x360tool/
#
# @name: x360tool(.sh)
#
# @author: Alexander Hagenah <ah@primepage.de>
# http://primepage.de
#
# @created: 09/29/2009
@xaitax
xaitax / rbconfig.rb.diff
Created July 17, 2013 14:13
BackTrack 5 R3 Patch for Metasploit to work again
root@bt:/opt/metasploit/ruby/lib/ruby/1.9.1/i686-linux# diff -Nur rbconfig.rb_old rbconfig.rb
--- rbconfig.rb_old 2013-04-14 19:58:02.394668232 +0400
+++ rbconfig.rb 2013-04-14 19:52:59.742676593 +0400
@@ -53,7 +53,7 @@
CONFIG["DLDLIBS"] = " -lc"
CONFIG["SOLIBS"] = ""
CONFIG["LIBRUBYARG_SHARED"] = "-Wl,-R -Wl,$(libdir) -L$(libdir) "
- CONFIG["LIBRUBYARG_STATIC"] = "-Wl,-R -Wl,$(libdir) -L$(libdir) -l$(RUBY_SO_NAME)-static"
+ CONFIG["LIBRUBYARG_STATIC"] = "-Wl,-R -Wl,$(libdir) -L$(libdir) "
CONFIG["LIBRUBYARG"] = "$(LIBRUBYARG_STATIC)"
@xaitax
xaitax / fix_vmware_kernel_3.11.sh
Created September 3, 2013 14:58
Linux Kernel 3.11: With it comes a kernel-level API change related to VFS. Specifically, struct file_operations no longer contains the function pointer readdir and vfs_readdir() which was defined in fs/readdir.c is now gone. They are both superseded by iterate and iterate_dir() respectively. Linux Kernel 3.10: mnet/vmblock patch for Kernel 3.10 …
cd /tmp
curl -O http://www.primepage.de/stuff/vmware/vmblock-9.0.2-5.0.2-3.10.patch
curl -O http://www.primepage.de/stuff/vmware/vmnet-9.0.2-5.0.2-3.10.patch
curl -O http://www.primepage.de/stuff/vmware/vmblock.3.11.patch
cd /usr/lib/vmware/modules/source
tar -xvf vmblock.tar
tar -xvf vmnet.tar
patch -p0 -i /tmp/vmblock-9.0.2-5.0.2-3.10.patch
patch -p0 -i /tmp/vmnet-9.0.2-5.0.2-3.10.patch
cd vmblock-only
@xaitax
xaitax / gist:8689191
Created January 29, 2014 14:31
Amount of swear words in current stable/longterm Linux kernels? Here you go! :)
xaitax@w00t:~/usr/src$ for i in $(ls -d */); do egrep -iro '(fuck|shit|crap|bastard)' ${i%%/} | wc -l | xargs echo "Total matches in ${i%%/}:"; done
Total matches in linux-2.6.32.61: 398
Total matches in linux-2.6.34.14: 454
Total matches in linux-3.10.28: 392
Total matches in linux-3.11.10: 404
Total matches in linux-3.12.9: 404
Total matches in linux-3.13.1: 418
Total matches in linux-3.2.54: 388
Total matches in linux-3.4.78: 381
@xaitax
xaitax / mitmsslstrip2.sh
Last active January 30, 2021 22:26
MitM combined with SSLStrip2 defeating HSTS
#!/bin/bash
#
# @desc: MitM (Ettercap) & SSLStrip2 & dns2proxy
#
# Tool runs if sslstrip2 & dns2proxy have subfolders from
# where the script is run
#
# @required:
#
# - SSLStrip2 (https://github.com/LeonardoNve/sslstrip2)
#!/usr/bin/env python
import logging
import sys
logging.getLogger("scapy.runtime").setLevel(logging.ERROR)
if len(sys.argv) != 5:
print ''
print 'arp.py Alexander Hagenah - ah@primepage.de'
print ''
@xaitax
xaitax / Krack Attack (WPA2) Sample Code
Last active May 20, 2021 17:23
Krack Attack (WPA2) Sample Code
#!/usr/bin/env python2
import logging
logging.getLogger("scapy.runtime").setLevel(logging.ERROR)
from scapy.all import *
import sys, socket, struct, time, subprocess, atexit, select
from datetime import datetime
IEEE_TLV_TYPE_RSN = 48
IEEE_TLV_TYPE_FT = 55
@xaitax
xaitax / default
Last active January 9, 2020 14:22
Nginx SSL/TLS + LetsEncrypt Configuration For "A+" Qualys SSL Labs Rating
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name mysite.com www.mysite.com;
rewrite ^ https://$host$request_uri? permanent;
}
server {
listen 443 ssl default_server http2;