Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am nv1t on github.
  • I am nv1t (https://keybase.io/nv1t) on keybase.
  • I have a public key whose fingerprint is 083F 9BF3 7C3B 3262 62AF 397D 09CF F87B 70EC 6E70

To claim this, I am signing this object:

#!/usr/env python
###############################################################################################################
## [Title]: linuxprivchecker.py -- a Linux Privilege Escalation Check Script
## [Author]: Mike Czumak (T_v3rn1x) -- @SecuritySift
##-------------------------------------------------------------------------------------------------------------
## [Details]:
## This script is intended to be executed locally on a Linux box to enumerate basic system info and
## search for common privilege escalation vectors such as world writable files, misconfigurations, clear-text
## passwords and applicable exploits.
import sys
import time
import usb.core
import usb.util
class pyMouse(object):
def __init__(self,vendor,product):
self.device = usb.core.find(idVendor=vendor, idProduct=product)
if self.device is None:
raise Exception("Couldn't find device %sx%s" %(vendor,product))
@nv1t
nv1t / check_einhornschoki.sh
Created November 9, 2016 04:49
Einhorn Schokolade Icinga Check
#!/bin/bash
URL="http://shop.ritter-sport.de/b2c/schokolade/social-media-limited-edition/einhorn.html"
SITE=$(curl -s "${URL}")
if echo "${SITE}" | grep "out-of-stock" > /dev/null 2> /dev/null; then
echo "OK: Sckokolade ist immer noch ausverkauft";
exit 0;
fi;
@nv1t
nv1t / sort.py
Created January 9, 2018 07:01
Sort Picture with OpenCV as Display (not automaticaly)
import numpy as np
import sys
import os
import cv2
import shutil
log = open('log.txt','a')
img = cv2.imread(sys.argv[1],1)
origimg = img
height, width, channels = img.shape
@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)
@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 / 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 / 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 / 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;
}