Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
echo "SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjU3LjgzLjEwMAAAAAAAAAAAAAAA//tQAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAASW5mbwAAAA8AAALKAASOhgADBQgKDQ8SFBcZHB4hJCYp
Ky4wMzU4Oz1AQkVHSk1PUlRXWVxfYWRmaWtucXN2eHt9gIOFiIqNj5KVl5qcn6Gkp6msrrGztrm7
vsDDxcjKzc/S1dfa3N/h5Obp6+7w8/X4+v0AAAAATGF2YzU3LjEwAAAAAAAAAAAAAAAAJAMAAAAA
AAAEjoZ7ltZvAAAAAAAAAAAAAAAAAAAAAP/7kGQAAALAR8aYwxYQMUKoYxhpdBDBiR6MJFjA2Qmk
dDeUcAAQVJaQPJ7FthiB6bY5OgGuC9IEFAMILHgiAOP7JxhkgNYIoAU/9zAz4lNOBEznO5BfpyMd
yfQk5+//9CKdlcjb56EnyKjBxaAAAJhis4f8u8of9gf8QCcAMtp7mKJptJMoLMUToEGW4AXu7mhw
n2oIIhQxPbRgQZ743Od/UN//7j//rewaO0f6QCCBAAksBiAZDWVfO49rJ2cP8tAMBL6i517xxwwM
@nv1t
nv1t / struct.js
Created March 15, 2020 14:16
Simple angular module deconstruct binary data in JavaScript to a readable dictionary
angular.module('struct',[]);
angular.module('struct')
.service('struct',[function(){
vm = this;
vm.parse = function(stream,header) {
var temp = [];
for(var i in stream) {
temp[i] = ("00000000"+(stream[i] >>> 0).toString(2)).slice(-8);
}
@nv1t
nv1t / dvb.sh
Created December 18, 2019 22:24
function liest die naechsten Abfahrten an einer Station von der DVB in Dresden aus.
# Usage: dvb <station>
# Default for <station> is "Hauptbahnhof"
function dvb() {
station=${@:-Hauptbahnhof}
http --body "widgets.vvo-online.de/abfahrtsmonitor/Abfahrten.do?ort=Dresden&hst=${station}" | jq -r '.[] | [.[2],.[0],.[1]] | @tsv'
}
@nv1t
nv1t / rmvirtualenv.sh
Created December 17, 2019 14:30
I work with pipenv a lot. Sometimes a delete or move a directory and forget to delete the virtualenv and so it lingers around in .local. this is a small wrapper to delete all the orphaned virtualenv directories :)
function rmvirtualenv() {
for i in ~/.local/share/virtualenvs/*/.project; do
venv=$(dirname "${i}")
directory=$(cat "${i}")
echo "${venv}"
if [ -d "${directory}" ] && [ -f "${directory}/Pipfile" ]; then
echo -n "[+] "
else
echo -n "[-] "
@nv1t
nv1t / share.sh
Created November 14, 2019 22:28
Shares internet from wlp3s0 through enp0s25
#!/bin/bash
# Shares internet from wlp3s0 through enp0s25
case "$1" in
start)
ifconfig enp0s25 up
ifconfig enp0s25 192.168.0.1
iptables --table nat --append POSTROUTING --out-interface wlp3s0 -j MASQUERADE
iptables --append FORWARD --in-interface enp0s25 -j ACCEPT
echo 1 > /proc/sys/net/ipv4/ip_forward
@nv1t
nv1t / enumhosts.html
Created November 14, 2019 22:19
enumerating local lan IP HTML5 WebRTC and enumerating potentially live hosts
<html>
<head>
<style>
body {
font-family: 'Open Sans', Helvetica, Arial;
font-size: 12pt;
color: #666;
margin-top: 40px;
text-align: center;
}
@nv1t
nv1t / memory_of_pid.py
Created November 14, 2019 22:12
Print the memory of a process, python implementation
#!/usr/bin/env python
import re
import sys
def print_memory_of_pid(pid, only_writable=True):
"""
Run as root, take an integer PID and return the contents of memory to STDOUT
"""
memory_permissions = 'rw' if only_writable else 'r'
@nv1t
nv1t / zero_pad_gen.py
Last active October 26, 2019 15:10
padding of smaller array to match bigger one with values
# output:
# [2.88, 2.88, 2.88, 2.88, 3.2, 3.2, 3.2, 3.2, 3.2, 3.52]
# [2.88, 2.88, 2.88, 3.2, 3.2, 3.2, 3.2, 3.52]
# [2.88, 2.88, 2.88, 0, 3.2, 3.2, 3.2, 3.2, 0, 3.52]
a = [2.88,2.88,2.88,2.88,3.2,3.2,3.2,3.2,3.2,3.52]
b = [2.88,2.88,2.88,3.2,3.2,3.2,3.2,3.52]
def zero_pad_gen(a, b, _sentinel=object()):
a = iter(a)
@nv1t
nv1t / pydns.py
Last active August 28, 2018 14:19
It opens up a DNS Server which answers for all domains with your own IP. Nice for fast intercepting of DNS queries :)
import socket
import sys
class DNSQuery:
def __init__(self, data):
self.data=data
self.domain=''
typ = (ord(data[2]) >> 3) & 15 # Opcode bits
if typ == 0: # Standard query
@nv1t
nv1t / niu.cobbles.download.kiosk.py
Last active August 9, 2018 21:06
Takes the ID (param) from a Kiosk Magazin from the media.niu.de Entertainment Center as first Argument (https://media.niu.de/magazine.html?param=42281), downloads the pages of this magazine and generates a pdf with imagemagicks convert.
import sys
import os
import requests
import subprocess
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
param=sys.argv[1]
baseUrl = "https://media.niu.de/magazines/%s" % (param)