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
import os | |
import requests | |
import subprocess | |
import tempfile | |
def _top_repositories(url=None): | |
if not url: | |
url = "https://api.github.com/search/repositories?q=language:go&sort=stars&order=desc" | |
r = requests.get(url) | |
results = r.json() |
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 <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <unistd.h> | |
#include <limits.h> | |
#include <sys/mount.h> | |
char * | |
ramdisk(const char *ns, const char *sz) | |
{ |
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
# Example using libnacl based encryption engine | |
(venv)[gm@localhost libnacl]$ python demo.py | |
username = fred, password = secret | |
username = mary, password = secret | |
(venv)[gm@localhost libnacl]$ sqlite3 /tmp/demo.db 'select * from user;' | |
1|fred|b2997d0bf6634b6472881f7c40dab2f5e880f03fdeca340aea977500441479ed04637fae0d5f49bd0c9ab4bdcd9a | |
2|mary|abb99fe819e861b105eae670741360cf3a51e414a0670d87e20432166bafa859d4733092c14a602fb76f58264fb6 | |
(venv)[gm@localhost libnacl]$ pip freeze | |
You are using pip version 6.0.8, however version 8.0.2 is available. |
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
#define _GNU_SOURCE | |
#include <stddef.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <sys/types.h> | |
#include <keyutils.h> | |
void vulnerable(const char *key){ | |
FILE *f = fopen("/proc/keys", "rb"); |
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
/* $ gcc cve_2016_0728.c -o cve_2016_0728 -lkeyutils -Wall */ | |
/* $ ./cve_2016_072 PP_KEY */ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <sys/types.h> | |
#include <keyutils.h> | |
#include <unistd.h> | |
#include <time.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
import re | |
import sys | |
import os | |
import stat | |
def search(directory): | |
pattern = re.compile("(?i)pass|secret|key") | |
for rootdir, subdirs, files in os.walk(directory): | |
for filename in files: | |
path = os.path.join(rootdir, filename) |
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
import distlib | |
import distlib.index | |
import distlib.version | |
import requests | |
import pip.req | |
import pip.download | |
import os | |
import sys | |
import urlparse |
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 <stdio.h> | |
#include <sys/capability.h> | |
int main(){ | |
char *txt = NULL; | |
cap_t caps = cap_get_proc(); | |
txt = cap_to_text(caps, NULL); | |
printf("caps = %s\n", txt); | |
if (caps) cap_free(caps); |
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 python | |
# -*- coding: utf-8 -*- | |
import sys | |
import paramiko | |
import itertools | |
import multiprocessing | |
to_csv = lambda x: ', '.join(x) | |
allowed = lambda x: x == 'publickey' |
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
#!/bin/bash | |
for IP in `cat servers.txt`; do ssh $USER@$IP 'bash -s' < $@; done |