Skip to content

Instantly share code, notes, and snippets.

View glenux's full-sized avatar
Being happy

Glenn Y. Rolland glenux

Being happy
View GitHub Profile

Faking DNS from userland

To give false DNS responses from userland we need to handle different type of syscalls : gethostbyname(), gethostbyname2(), getaddrinfo(), getnameinfo(), etc. To cover all these cases, and to prevent leaks to real dns servers, we will use two libraries : libresolv_wrapper and libnss_wrapper.

Installation

Install resolv_wrapper and nss_wrapper, either from sources or from your favorite Linux distribution.

#!/usr/bin/env ruby
# vim: set ts=2 sw=2 et:
require 'find'
require 'colorize'
require 'fileutils'
class Merger
def initialize
@ind = 0
@glenux
glenux / gnux_pdfnovector.sh
Created January 23, 2017 11:47
Script to compress large bitmap PDFs
#!/bin/sh
INPUT="$1"
TMPDIR=`mktemp -d`
# TODO: READ ALSO https://gist.github.com/yura/670974
echo "Input file: $INPUT"
echo "Converting PDF to images"
Verifying that +glenux is my blockchain ID. https://onename.com/glenux
@glenux
glenux / gnux_wp-security-hammer.sh
Last active December 2, 2017 12:20
A simple script to secure wordpress installations
#!/bin/sh
set -u
set -e
echo "WP Security Hammer v0.1"
echo "======================="
echo "Target directory: $TARGET"
echo "Looking for files leading to information disclosure..."
while read -r FILE ; do