Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@0xa
0xa / lastcrack.py
Created July 10, 2012 21:21
Minecraft lastlogin decrypt
import Crypto.Random
from Crypto.Cipher import DES
import hashlib
import struct
password = "passwordfile";
salt = "\x0c\x9d\x4a\xe4\x1e\x83\x15\xfc";
iteration_count = 5;
def decrypt(ciphertext):
@0xa
0xa / brainfuuu.cpp
Created July 24, 2012 23:18
BrainFUUU
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <exception>
#define LOOP_STACK_SIZE 64
#define DATA_BUFFER_SIZE 1024
class BrainFUUU {
public:
<?php
function encode($data) {
global $format;
array_unshift($data, $format);
$raw = call_user_func_array("pack", $data);
$encoded = bin2hex($raw);
return $encoded;
}
function decode($encoded) {
@0xa
0xa / Message.py
Created September 4, 2012 20:08
IRC message encoding/decoding
import re
class BadMessageInput(Exception):
pass;
class Message:
buffer = "";
prefix = "";
@0xa
0xa / gist:3686309
Created September 9, 2012 18:32
Download Infected Mushroom discography in one line
curl http://infected-mushroom.com/music/ | sed 's/.*href\=\"([a-zA-Z0-9/=]+)\" title="([a-zA-Z0-9 ]+)".*/wget $(echo "\1"|base64 -d) -O "\2.mp3"/pg' -rn | bash
@0xa
0xa / pwmgr.sh
Created November 5, 2012 23:29
GPG password manager
#!/bin/bash
# Where to store passwords
DATAFILE="./pwmgr_data.gpg"
# Your GPG key
RECIPIENT="xa@xomg.net"
# Command used to generate passwords
# (pwgen is nice)
#include <X11/Xlib.h>
#include <X11/keysym.h>
#include <unistd.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
const char* text = "le avoir savoir nuit leur ton je avant qui pays te se homme chez entrer tout leur encore heure regard "
"jour elle ne au savoir entrer appeler ton revenir fille pied enfant contre ame chambre "
"toujours ce parler coup ne rendre noir pied donc quelque sans peu ciel vie ici mille tres "
@0xa
0xa / check_openvpn.py
Created March 8, 2013 16:44
OpenVPN ping plugin for Nagios
#!/usr/bin/env python
# OpenVPN plugin for Nagios
from optparse import OptionParser
import socket
from datetime import datetime
def main():
senddata= "\x38\x01\x00\x00\x00\x00\x00\x00\x00"
enum Opcodes {
OP_PING = 0x1337
}
class Packet {
public:
Packet(int32_t opcode);
virtual bool encode(std::string& buffer) = 0;
virtual bool decode(const std::string& buffer) = 0;
#ifndef COMMON_SINGLETON_H
#define COMMON_SINGLETON_H
#include <cstdlib>
template<typename T>
class Singleton {
public:
Singleton() {
m_Instance = static_cast<T*>(this);