Skip to content

Instantly share code, notes, and snippets.

View Silur's full-sized avatar
💭
Please understand nobody uses textbook Shor anymore

Silur

💭
Please understand nobody uses textbook Shor anymore
View GitHub Profile
@Silur
Silur / grinch.js
Created December 24, 2016 18:38
pls no christmas spam
// _ _ _
// (_) | | (_)
// __ _ _ __ _ _ __ ___| |__ _ ___
// / _` | '__| | '_ \ / __| '_ \ | / __|
//| (_| | | | | | | | (__| | | |_| \__ \
// \__, |_| |_|_| |_|\___|_| |_(_| |___/
// __/ | _/ |
// |___/ |__/ by Silur
// removes all christmas related shit from facebook wall
var list = document.getElementsByTagName("p");
@Silur
Silur / wpscan.sh
Created September 7, 2017 10:10
wordpress vuln scanner
#!/bin/bash
usage() {
cat <<EOF
Usage: $0 [options]
Options:
-h print this usage
-u url to check
-p proxy to use
@Silur
Silur / yt.sh
Created September 20, 2017 10:24
youtube viewer in bash
# usage ./yt.sh <https://youtube.com/watch?v=....>
urldecode() {
local url_encoded="${1//+/ }"
printf '%b' "${url_encoded//%/\\x}"
}
video_url="$1"
raw_url=$(curl \
-H 'Upgrade-insecure-requests: 1' \
-H 'Cache-control: max-age=0' \
-H 'Accept-language: en-US,en;q=0.8,bn;q=0.6' \
@Silur
Silur / edisasm.pl
Created September 22, 2017 20:55
ethereum bytecode disassembler
$file = $ARGV[0];
open my $fh, '<:raw', $file or die "Could not open $file: $!";
%opcodes = (0x00, 'STOP', 0x01, 'ADD', 0x02, 'MUL', 0x03, 'SUB', 0x04, 'DIV', 0x05, 'SDIV', 0x06, 'MOD', 0x07, 'SMOD', 0x08, 'ADDMOD', 0x09, 'MULMOD', 0x0a, 'EXP', 0x0b, 'SIGNEXTEND', 0x10, 'LT', 0x11, 'GT', 0x12, 'SLT', 0x13, 'SGT', 0x14, 'EQ', 0x15, 'ISZERO', 0x16, 'AND', 0x17, 'OR', 0x18, 'XOR', 0x19, 'NOT', 0x1a, 'BYTE', 0x20, 'SHA3', 0x30, 'ADDRESS', 0x31, 'BALANCE', 0x32, 'ORIGIN', 0x33, 'CALLER', 0x34, 'CALLVALUE', 0x35, 'CALLDATALOAD', 0x36, 'CALLDATASIZE', 0x37, 'CALLDATACOPY', 0x38, 'CODESIZE', 0x39, 'CODECOPY', 0x3a, 'GASPRICE', 0x3b, 'EXTCODESIZE', 0x3c, 'EXTCODECOPY', 0x40, 'BLOCKHASH', 0x41, 'COINBASE', 0x42, 'TIMESTAMP', 0x43, 'NUMBER', 0x44, 'DIFFICULTY', 0x45, 'GASLIMIT', 0x50, 'POP', 0x51, 'MLOAD', 0x52, 'MSTORE', 0x53, 'MSTORE8', 0x54, 'SLOAD', 0x55, 'SSTORE', 0x56, 'JUMP', 0x57, 'JUMPI', 0x58, 'PC', 0x59, 'MSIZE', 0x5a, 'GAS', 0x5b, 'JUMPDEST', 0x60, 'PUSH1', 0x61, 'PUSH2', 0x62, 'PUSH3', 0x63, 'PUSH4', 0x64,
@Silur
Silur / torify
Created September 23, 2017 09:22
transparent system-wide Tor iptables config
*nat
:PREROUTING ACCEPT [6:2126]
:INPUT ACCEPT [0:0]
:OUTPUT ACCEPT [17:6239]
:POSTROUTING ACCEPT [6:408]
-A PREROUTING ! -i lo -p udp -m udp --dport 53 -j REDIRECT --to-ports 5353
-A PREROUTING ! -i lo -p tcp -m tcp --tcp-flags FIN,SYN,RST,ACK SYN -j REDIRECT --to-ports 9040
-A OUTPUT -o lo -j RETURN
--ipv4 -A OUTPUT -d 192.168.0.0/16 -j RETURN
@Silur
Silur / server.pl
Created September 28, 2017 22:50
non-blocking, non-forking, single thread perl tcp server
use IO::Socket::INET;
use IO::Select;
use POSIX;
print "starting on $ARGV[0]\n";
$| = 1;
my $select = new IO::Select;
my $socket = new IO::Socket::INET(
LocalAddr => '0.0.0.0',
LocalPort => $ARGV[0],
@Silur
Silur / keygen.c
Last active July 13, 2018 11:19
cli curve25519 keygen
// gcc -o keygen keygen.c -lcrypto
#include <stdio.h>
#include <string.h>
#include <openssl/ec.h>
#include <openssl/err.h>
unsigned long
main(int argc, char **argv)
{
@Silur
Silur / gimli.c
Last active November 4, 2018 10:21
Even-Mansour block cipher using GIMLI in CTR mode
#include <stdint.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <assert.h>
#define MIN(x,y) y ^ ((x ^ y) & -(x < y))
#define rateInBytes 16
@Silur
Silur / makefile
Created March 25, 2019 15:24
my template makefile
.POSIX:
.SUFFIXES:
CC = gcc
LIB_CFLAGS = -pedantic -Wall -Wextra -fPIC
LIB_CFLAGS += -DFORTIFY_SOURCE=2 -fstack-protector-strong
LIB_LDFLAGS = -shared -fPIC -Wl,-z,relro,-z,now
BIN_CFLAGS = -pedantic -Wall -Wextra -fPIE
BIN_CFLAGS += -DFORTIFY_SOURCE=2 -fstack-protector-strong
@Silur
Silur / tlp.c
Created April 2, 2019 11:48
timelock puzzle solver
#include <gmp.h>
#include <stdio.h>
int main(int argc, char **argv)
{
mpz_t ret;
mpz_t exp;
mpz_t n;
mpz_t two;
mpz_inits(ret, exp, n, two, 0);
mpz_set_str(n, "147710164742839770105418389512240074997644188475824187928019488659050860608555713845140958979292386801844424266229240090284454968761835586483815852946875368053537745817800552096030151193719613985791148827776019150556575150066500426995204859737360411566322825773501601724033282407354916391853693576174163273259", 10);