Skip to content

Instantly share code, notes, and snippets.

@blark
blark / llmnr-listen.py
Last active December 24, 2015 20:49
Simple LLMNR listener.
import socket
ALL = "0.0.0.0"
LLMNR_ADDR = "224.0.0.252"
LLMNR_PORT = 5355
def hexPretty(firstB, lastB):
return ''.join('%02x' % b for b in data[firstB:lastB])
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP)
@blark
blark / llmnr-improved.py
Last active December 25, 2015 20:39
LLMNR listener round 2
import socket
import struct
import datetime
ALL = "0.0.0.0"
LLMNR_ADDR = "224.0.0.252"
LLMNR_PORT = 5355
# Setup network stuff
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP)
@blark
blark / rpi-test-sram.py
Last active September 24, 2023 19:07
A quick and dirty Python script to test Raspberry Pi SPI communication with a Microchip 23LCV512 SRAM (512kbit). See comments for requirements.
#!/usr/bin/python2
#
# requires SPI kernel module (sudo modprobe spi_bcm2708)
# requires spi.so from https://github.com/lthiery/SPI-Py
#
from __future__ import print_function
import spi
import os
from random import randint
@blark
blark / vmware-fingerprint.nse
Last active December 5, 2017 20:41
Nmap script that returns VMWare version info
local http = require "http"
local shortport = require "shortport"
local stdnse = require "stdnse"
description = [[
Uses an HTTP PUT request to VMware's SOAP API in order to elicit a server response that contains ESX version information.
]]
---
--@usage
@blark
blark / poet.rb
Last active August 29, 2015 14:06
smbexec poet.rb replacement with bug fix for UTF-8
require 'lib_smb'
require 'thread'
require 'timeout'
require 'logger'
require 'open3'
class Poet
include Utils
# Error classes for account issues
@blark
blark / error.php
Created December 14, 2015 20:23
Phishing error page
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="10; url=welcome.php" />
<meta charset="utf-8">
<title>Password Error</title>
<style>
::-moz-selection {
background: #b3d4fc;
text-shadow: none;
@blark
blark / phishing.ipynb
Created December 14, 2015 22:25
Phishing with iPython Notebook
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@blark
blark / completer.py
Last active April 2, 2020 02:53
A really basic completer for prompt_toolkit
from __future__ import print_function, unicode_literals
from prompt_toolkit.completion import Completer, Completion
class PwnCompleter(Completer):
cmds = {'quit': None,
'exit': None,
'use': ['/foo/bar', '/herp/derp', '/baz/qux'],
@blark
blark / BLEKey.ipynb
Created July 29, 2016 02:12
A quick and dirty Jupyter notebook to convert BLEKey data to cards.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@blark
blark / gist:e8f125e402f576bdb7e2d7b3428bdba6
Last active January 3, 2023 03:29
HID Preamble Bits
# from http://www.proxmark.org/forum/viewtopic.php?pid=5415#p5415
0000 0010 0000 0000 01xx xxxx xxxx xxxx xxxx xxxx xxxx 26-bit
0000 0010 0000 0000 1xxx xxxx xxxx xxxx xxxx xxxx xxxx 27-bit
0000 0010 0000 0001 xxxx xxxx xxxx xxxx xxxx xxxx xxxx 28-bit
0000 0010 0000 001x xxxx xxxx xxxx xxxx xxxx xxxx xxxx 29-bit
0000 0010 0000 01xx xxxx xxxx xxxx xxxx xxxx xxxx xxxx 30-bit
0000 0010 0000 1xxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx 31-bit
0000 0010 0001 xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx 32-bit
0000 0010 001x xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx 33-bit