Navigation Menu

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 / gist:1375269
Created November 18, 2011 01:35
www::mechanize no cert ssl tls checking or verification
export PERL_LWP_SSL_VERIFY_HOSTNAME=0
use WWW::Mechanize;
my $mech = WWW::Mechanize->new(
ssl_opts => {
verify_hostname => 0,
},
);
@kost
kost / gist:1494305
Created December 18, 2011 20:05 — forked from avsej/gist:741722
build ruby for arm platform (e.g. for amazon kindle)
echo "deb http://emdebian.org/debian/ lenny main" >> /etc/apt/sources.list
apt-get update
apt-get install binutils-arm-linux-gnueabi gcc-4.3-arm-linux-gnueabi libc6-dev-armel-cross
cd /path/to/ruby/1.8.7/sources
autoconf
CFLAGS="--static" LDFLAGS="--static" CC="arm-linux-gnueabi-gcc" ac_cv_func_setpgrp_void=yes ac_cv_func_isinf=no ac_cv_func_isnan=no ac_cv_func_finite=no CROSS_COMPILING=1 ./configure --host="arm-linux-gnueabi" --prefix=/mnt/us/opt
make
make install
@kost
kost / datapipe6.c
Created January 22, 2012 06:13 — forked from feuvan/datapipe6.c
Datapipe6 - ipv6-aware fork of datapipe.c
/*
* Datapipe6 - ipv6-aware fork of datapipe.c
* Sample usage:
* datapipe6 localipv4addr 23 remoteipv6addr 23
*
*
* Written by feuvan <feuvan@feuvan.net>
* Original ipv4 version by Jeff Lawson <jlawson@bovine.net>
* See statement below
*
@kost
kost / uri.js
Created April 21, 2012 10:13 — forked from jlong/uri.js
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.host; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
@kost
kost / cisco-4-sha256.pl
Last active December 15, 2015 01:09
Cisco Password Type 4 - SHA256 implementation in Perl
#!/usr/bin/perl
# Basic Cisco type 4 - password encoder by Kost
# Base64 custom encoder taken from VOMS::Lite::Base64
# Example: ./cisco-4-sha256.pl password
use strict;
use Digest::SHA qw(sha256);
my %Alphabets = (
CISCO => "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
@kost
kost / webrick-https-server.rb
Created August 6, 2013 16:13
Basic HTTPS server using webrick
#!/usr/bin/env ruby
require 'openssl'
require 'webrick'
require 'webrick/https'
include WEBrick
port = 8443
server = HTTPServer.new(:Port=>port,:DocumentRoot=>Dir::pwd,
<html>
<head>
<!--
Amazon S3 Bucket listing.
Copyright (C) 2008 Francesco Pasqualini
This program is free software: you can redistribute it and/or modify
@kost
kost / syringe.c
Created April 26, 2014 05:00
A General Purpose DLL & Code Injection Utility
/*
*
* syringe.c v1.2
*
* Author: Spencer McIntyre (Steiner) <smcintyre [at] securestate [dot] com>
*
* A General Purpose DLL & Code Injection Utility
*
* Copyright 2011 SecureState
*
@kost
kost / shellcodeexec.cs
Created April 26, 2014 05:16
Use .NET csc.exe to create a malicious EXE on locked down systems
using System;
using System.Reflection;
using System.Runtime.InteropServices;
namespace ExecASMHardcoded
{
class Program
{
[DllImport("kernel32.dll", SetLastError = true)]
static extern bool VirtualProtect(IntPtr lpAddress, uint dwSize, uint flNewProtect, out uint lpflOldProtect);
public delegate uint Ret1ArgDelegate(uint address);
@kost
kost / i2c-dump.py
Created August 4, 2014 23:37
Script to dump I2C using pyBusPirateLite
#!/usr/bin/env python
# encoding: utf-8
"""
Adapted from i2c-test.py from Peter Huewe
"""
import sys
from pyBusPirateLite.I2C import *
import argparse