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
#include <sys/stat.h> | |
#include <stdio.h> | |
#include <stdint.h> | |
int main() { | |
printf("struct stat: %lu\n", sizeof(struct stat)); | |
printf("struct stat->st_dev %lu\n", sizeof(unsigned long)); | |
printf("struct stat->ctime_nsec: %lu\n", sizeof(unsigned long)); | |
printf("unsigned long: %lu\n", sizeof(unsigned long)); | |
printf("uint64_t: %lu\n", sizeof(uint64_t)); |
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
// Compiled on BSD with cc shatest.c -o shatest -lmd | |
#include <sys/types.h> | |
#include <string.h> | |
#include <stdio.h> | |
#include <sha.h> | |
#define HEX_DIGEST_LENGTH 257 | |
int |
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
#!/usr/sbin/dtrace -qs | |
/* | |
* Run with sudo ./tap_function.d -q | |
*/ | |
struct ieee80211_channel { | |
uint32_t ic_flags; /* see below */ | |
uint16_t ic_freq; /* primary centre frequency in MHz */ | |
uint8_t ic_ieee; /* IEEE channel number */ |
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
#!/usr/bin/env python3 | |
''' | |
Recursively downloads Debian/Ubuntu/Kali packages and all associated dependencies | |
By: Farhan Khan ([email protected]) ([email protected]) | |
You MUST run this on the same distribution AND version of the target system. | |
This only downloads the latest version of the package available within the | |
target distribution. | |
Download a single package: |
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
#!/usr/sbin/dtrace -qs | |
/* | |
* Run with sudo ./tap_function.d -q | |
*/ | |
dtrace:::BEGIN | |
{ | |
self->start = 0; | |
printf("Start on\t%s\n", "r92c_scan_start"); |
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
#include <stdint.h> | |
#include <stdio.h> | |
#define IEEE80211_ADDR_LEN 6 | |
uint8_t rom[] = { | |
0x29, 0x81, 0x0, 0x6c, 0xb, 0x0, 0x0, 0x0, | |
0x0, 0xc, 0x40, 0x0, 0x10, 0x0, 0x0, 0x0, | |
0x26, 0x25, 0x24, 0x23, 0x22, 0x21, 0x2c, 0x2b, | |
0x2a, 0x29, 0x29, 0x2, 0xff, 0xff, 0xff, 0xff, |
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
// Compile as follows: | |
// cc -Wno-everything ioctls.c -o ~/ioctls && echo Wow it actually compiled! | |
#include <net/if.h> | |
#include <sys/types.h> | |
#include <stdint.h> | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <net/if_var.h> | |
#include <netinet/in.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
SRCS=taskqueue_example.c | |
KMOD=taskqueue_example | |
.include <bsd.kmod.mk> |
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
#!/usr/bin/env python3 | |
import copy | |
import sys | |
lines = { | |
1:[2,3], | |
2:[1,3,4,6,7], | |
3:[1,2,5,6,7], | |
4:[2,5,6,7], |
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
# Just a little bit of code to prove to myself that I could actually write in assembly | |
# To run this, do: | |
# as code.s -o code.o ; ld code.o -o code ; ./code | |
# If you want to debug, run it with strace: strace ./code | |
# Setup a netcat listener on port 31337 | |
# How to do a syscall: http://cs.lmu.edu/~ray/notes/linuxsyscalls/ | |
# List of syscalls: https://filippo.io/linux-syscall-table/ | |
.data |
NewerOlder