Skip to content

Instantly share code, notes, and snippets.

@wirepair
wirepair / 16to24.html
Created November 30, 2017 05:02
convert 24 bit to 16 bit and vice versa via an html page
<!DOCTYPE html>
<html>
<head>
<title>24bit 16bit color converter</title>
<script>
window.addEventListener('load', function()
{
let i24 = document.getElementById('in24');
let i16 = document.getElementById('in16');
@wirepair
wirepair / gist:5720064
Created June 6, 2013 08:14
IDAPython script to get Data Ref's for a variable and print out function, address ref'd and whether read/write,
from idautils import *
from idc import *
from idaapi import *
ea = ScreenEA()
for xref in XrefsTo(ea, 0):
ref_type = ""
if xref.type == dr_W:
ref_type = "W"
elif xref.type == dr_R:
@wirepair
wirepair / ff os cmd exec
Created October 9, 2013 05:05
Run a OS command from a firefox plugin or from Error Console
Either put into a plugin or open error console to test: (Ctrl+Shift+J) -> paste -> click 'Evaluate'
Enjoy,
@_wirepair
linux:
var file=Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);file.initWithPath("/usr/bin/gcalctool");var process=Components.classes["@mozilla.org/process/util;1"].createInstance(Components.interfaces.nsIProcess);process.init(file);process.run(false, null, 0);
Windows:
var file=Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsIFile);file.initWithPath("C:\\windows\\system32\\calc.exe");file.launch();
or
@wirepair
wirepair / example.spec.js
Created December 31, 2019 09:45
Debug Mocha, vue-cli 3 es module tests, in vscode (requires debugger statements)
import { expect } from 'chai'
import { shallowMount } from '@vue/test-utils'
import HelloWorld from '@/components/HelloWorld.vue'
describe('HelloWorld.vue', () => {
it('renders props.msg when passed', () => {
const msg = 'new message'
debugger
const wrapper = shallowMount(HelloWorld, {
propsData: { msg }
@wirepair
wirepair / banned.go
Created April 19, 2019 06:45
http client ban ip on request
package main
import (
"context"
"crypto/tls"
"errors"
"log"
"net"
"net/http"
"net/http/httputil"
@wirepair
wirepair / attackvectorchecklist.txt
Created March 20, 2019 22:54
super old pen-testing checklist
Attack Vector Checklist v1.2 Mar 23rd 2010
-----------------------------------
target site: [ ]
user accounts: [ ]
/*****************************************************************************/
/* AUTHENTICATION */
/*****************************************************************************/
@wirepair
wirepair / worker.go
Created October 9, 2018 13:57
re-sizable execution worker pool
// Super simple re-sizable execution worker pool that allows you to add/remove workers easily
// obviously the doWork function should use context or something to cancel any 'work' being done if necessary.
// author: https://twitter.com/_wirepair
package main
import (
"fmt"
"sync"
"sync/atomic"
"time"
@wirepair
wirepair / demo_scene_shellcode.c
Created January 24, 2015 05:19
old ass shellcode that would spawn a demo and take over the screen.
/* UNOPTIMIZED shellcode with horrible notes that probably don't make any sense because i've effed with the */
/* code so much. I'll fix it in v2 :D */
/* -wirepair & galt */
#include <stdio.h>
#include <winsock.h>
#define my_hash(a,b) __asm _emit a __asm _emit b
#define my_winst(a,b,c,d,e,f,g,h) __asm _emit a __asm _emit b __asm _emit c __asm _emit d __asm _emit e __asm _emit f __asm _emit g __asm _emit h
#define my_app(a,b,c,d,e,f) __asm _emit a __asm _emit b __asm _emit c __asm _emit d __asm _emit e __asm _emit f
@wirepair
wirepair / basicudp.go
Last active May 14, 2017 08:22
A udp client & server where clients send packets at 10hz. can this be optimized further?
// An attempt at an optimized udp client/server implementation that has clients sending 10pps.
// run the server: go build && main -server -num 5000
// run the client: go build && main -num 5000
// i was only able to get 9000 clients sending for 30 seconds with 0 packet loss in windows
// after that i started get drops
//
// author: isaac dawson @ https://twitter.com/_wirepair
package main
@wirepair
wirepair / chacha_mem.out
Created April 25, 2017 01:43
modified chacha20 to do inline enc/dec with slice results.
original:
go test -count 1 -bench=Original -benchmem -memprofilerate=1 -memprofile=memoriginal.pprof
BenchmarkOriginal-8 1000000 25551 ns/op 41038.30 MB/s 592 B/op 13 allocs/op
(pprof) top10
565.58MB of 565.64MB total ( 100%)
Dropped 85 nodes (cum <= 2.83MB)
Showing top 10 nodes out of 11 (cum >= 565.58MB)
flat flat% sum% cum cum%
274.66MB 48.56% 48.56% 274.66MB 48.56% github.com/wirepair/chachazero/vendor/github.com/codahale/chacha20.NewWithRounds