Skip to content

Instantly share code, notes, and snippets.

@n3k
n3k / c0w.c
Created January 2, 2017 08:26 — forked from KrE80r/c0w.c
PTRACE_POKEDATA variant of CVE-2016-5195
/*
* A PTRACE_POKEDATA variant of CVE-2016-5195
* should work on RHEL 5 & 6
*
* (un)comment correct payload (x86 or x64)!
* $ gcc -pthread c0w.c -o c0w
* $ ./c0w
* DirtyCow root privilege escalation
* Backing up /usr/bin/passwd.. to /tmp/bak
* mmap fa65a000
@n3k
n3k / setup-theos-linux.sh
Created April 28, 2017 20:21 — forked from supermamon/setup-theos-linux.sh
A single script to setup github.com/theos/theos in Linux. Includes sdks and toolchain.
# Script is available at https://github.com/supermamon/install-theos
# Or if you trust me run
curl -LO https://git.io/install-theos && bash install-theos
@n3k
n3k / heartbleed.py
Created May 15, 2017 00:32 — forked from eelsivart/heartbleed.py
Heartbleed (CVE-2014-0160) Test & Exploit Python Script
#!/usr/bin/python
# Modified by Travis Lee
# Last Updated: 4/21/14
# Version 1.16
#
# -changed output to display text only instead of hexdump and made it easier to read
# -added option to specify number of times to connect to server (to get more data)
# -added option to send STARTTLS command for use with SMTP/POP/IMAP/FTP/etc...
# -added option to specify an input file of multiple hosts, line delimited, with or without a port specified (host:port)
@n3k
n3k / enableDCI.txt
Created August 15, 2018 02:01 — forked from eiselekd/enableDCI.txt
Enable DCI debugging on Gigabyte-BKi5HA-7200
Enable DCI debugging on Gigabyte-BKi5HA-7200
--------------------------------------------
The Gigabyte-BKi5HA-7200 (Kabylake i5-7200 processor) can be debugged with only a USB debug cable, a
special cable that crosses only the data signals and has the power signals
removed. You can buy these cables at i.e. https://www.datapro.net/products/usb-3-0-super-speed-a-a-debugging-cable.html
The hurdle you have to overcome before you can access DCI however is that you
need to set some bits in hardware that first enable DCI and also enable the debug port so that DCI can control the cores.
There are lots of guides in howto patch the BIOS but only these two really describes all the steps using only freely accessible tools:
@n3k
n3k / all.txt
Created November 26, 2018 12:27 — forked from jhaddix/all.txt
all wordlists from every dns enumeration tool... ever. Please excuse the lewd entries =/
This file has been truncated, but you can view the full file.
.
..
........
@
*
*.*
*.*.*
🐎
@n3k
n3k / content_discovery_all.txt
Last active November 28, 2018 13:26 — forked from jhaddix/content_discovery_all.txt
a masterlist of content discovery URLs and files (used most commonly with gobuster)
This file has been truncated, but you can view the full file.
`
~/
~
ים
___
__
_
@n3k
n3k / copy_in_chunks.py
Created January 6, 2019 07:44
copy files in chunks
import os
import sys
g_step = 1024*1024
source_file = sys.argv[1]
source_size = os.path.getsize(source_file)
target_file = sys.argv[2]
skip = int(sys.argv[3])
bytes_remaining = source_size - skip
print("Source Size: %.02f" % (source_size / float(g_step)))
#include <iostream>
#include <Windows.h>
int main(int argc, char **argv)
{
if (argc < 2) {
printf("Usage: %s <pid>", argv[0]);
return 0;
}
std::cout << "Attempt to control the CPU Rate of target process...\n";
// ThreadPrimes.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <stdio.h>
#include <intrin.h>
#include <math.h>
#include <windows.h>
#define BLOCK 1000
@n3k
n3k / HookInvokationAndExecuteParentMethod.js
Created August 14, 2020 09:10
An example of a frida script to hook a method and execute the implementation of a parent method (generateKeyPair), via Java.cast()
setTimeout(function() {
Java.perform(function() {
var className = "com.example.wlclient.auth.XLAuthorizationManagerInternal";
var instance = Java.use(className);
instance.invokeTokenRequest.implementation = function (a, b, c) {
console.log("[*] onEnter invokeTokenRequest...");
var XLOAuthCertManager = Java.use("com.example.common.security.XLOAuthCertManager");
var XLCertManager = Java.use("com.example.common.security.XLCertManager");