Skip to content

Instantly share code, notes, and snippets.

View ysangkok's full-sized avatar

Janus Troelsen ysangkok

View GitHub Profile
@ysangkok
ysangkok / gist:8411890
Last active January 3, 2016 04:49
hushfile encrypted upload
#!/usr/bin/env bash
cat INPUTFILE | \
openssl enc -aes-256-cbc -pass pass:BOSS123 | \
base64 | \
tr -d '\n' | \
curl --data-urlencode cryptofile@- --data-urlencode metadata=$(\
echo '{"filename":"lol","mimetype":"text/lol","filesize":"very big","deletepassword":"ITSWRONG"}' | \
openssl enc -aes-256-cbc -pass pass:BOSS123 | \
base64 | \
tr -d '\n'\
#!/bin/bash
FILEID=$(dd status=none if=/dev/urandom bs=1k count=1 | curl -s --data-urlencode cryptofile@- -d metadata=metadata -d deletepassword=passwd "https://hushfile.it/api/upload" | python3 -c "import sys; import json; print(json.loads(sys.stdin.read())['fileid'])")
curl -s "https://hushfile.it/api/file?fileid=$FILEID" | wc -c
#!/bin/bash
TMPNAM=$(mktemp)
rm $TMPNAM
mkfifo $TMPNAM
curl http://data.iana.org/TLD/tlds-alpha-by-domain.txt | sed -e 1d | parallel -j 24 host '{}' 8.8.8.8 | grep "has address" > $TMPNAM &
echo -en "
import requests
with open('$TMPNAM') as f:
for tld, has, address, addr in map(lambda x: x.strip().split(' '), f.readlines()):
if addr.startswith('127'): continue
@ysangkok
ysangkok / gist:deb293e0530fdc7075ac
Last active November 6, 2015 18:26
building irssi and dependencies without root
INST=/home/janus/or1k-inst
RUNPREFIX=/home/user
mkdir $INST
CC=/opt/cross/or1k-linux-musl/bin/or1k-linux-musl-gcc
wget -O - ftp://sourceware.org/pub/libffi/libffi-3.2.1.tar.gz | tar zx
cd libffi-3.2.1
./configure --prefix=$RUNPREFIX/libffi-build #--host=or1k-linux-musl CC=$CC
make -j2
make install DESTDIR=$INST

TYPISCHE ETHISCHE FRAGEN

  • log dateien

    logs müssen anonymisiert werden und darf nicht von jeder gelesen werden können.

    das leselabor ist nicht für jeden verfügbar. es ist auch leichter für die benutzer des leselabors die betreiber zu kontaktieren, um logs löschen zu lassen. deshalb ist das leselabor wesentlich privater als viele öffentliche web applikationen.

  • monitizing users (nutzer als produkte)

/*
* basE91 encoding/decoding routines
*
* Copyright (c) 2000-2006 Joachim Henke
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
; basE91 encoder for DOS
;
; Copyright (c) 2005-2006 Joachim Henke
; All rights reserved.
;
; Redistribution and use in source and binary forms, with or without
; modification, are permitted provided that the following conditions are met:
;
; - Redistributions of source code must retain the above copyright notice,
; this list of conditions and the following disclaimer.
@ysangkok
ysangkok / gist:31008718adced6608669
Last active August 29, 2015 14:15
longjmp over different process invocations
#include <setjmp.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
static char encoding_table[] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H',
'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P',
'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f',
@ysangkok
ysangkok / gist:5f45239c612e0056b9b4
Last active August 29, 2015 14:13
build weechat-1.1 and dependencies
wget -O - "ftp://ftp.gnupg.org/gcrypt/libgpg-error/libgpg-error-1.17.tar.bz2" | tar jx
cd libgpg-error-1.17
./configure --prefix=$HOME/libgpg-error-build
make -j4
make install
cd ..
wget -O - "ftp://ftp.gnupg.org/gcrypt/libgcrypt/libgcrypt-1.6.2.tar.bz2" | tar jx
cd libgcrypt-1.6.2
./configure --prefix=$HOME/libgcrypt-build PATH=$HOME/libgpg-error-build/bin:$PATH

Keybase proof

I hereby claim:

  • I am ysangkok on github.
  • I am janus (https://keybase.io/janus) on keybase.
  • I have a public key whose fingerprint is BDC6 2E7F A5C0 D19C 37EA EB4E E5BA B359 B6FC 16C4

To claim this, I am signing this object: