This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import argparse | |
import base64 | |
import dnslib # https://github.com/paulc/dnslib | |
import requests | |
parser = argparse.ArgumentParser(description='script to look up DNS records using DNS over HTTPs') | |
parser.add_argument('-s', '--server', help='the server to query', required=False) | |
parser.add_argument('-q', '--question', help='usually a hostname', required=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
from glob import glob | |
import os | |
session_files = glob(os.environ["HOME"] + "/.putty/sessions/*") | |
out_file = open("putty-sessions.reg", "w") | |
header = '''Windows Registry Editor Version 5.00 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title></title> | |
<style> | |
body { | |
background-color: #2E2E2E; | |
color: #E2E2E2; | |
font-size: 1.3em; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
''' | |
thanks https://ben.akrin.com/?p=1347 | |
To convert from an IPv6 link-local address to a MAC address: | |
- the 1st 64 bits go away (the fe80:: part) | |
- bit 71 gets flipped (after fe80:: is gone this would be the 7th bit) | |
- bits 89 through 112 go away (the ff:fe) | |
''' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"log" | |
"os" | |
"github.com/pkg/xattr" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
if [ -z ${1+x} ]; then | |
echo "Usage: $0 <source.go>" | |
echo | |
echo "Or in order to also publish:" | |
echo " $0 <source.go> <function name>" | |
exit 2 | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"github.com/aws/aws-lambda-go/events" | |
"github.com/aws/aws-lambda-go/lambda" | |
) | |
type Response events.APIGatewayProxyResponse | |
func Handler() (Response, error) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from os import listdir | |
from pydbus import SystemBus | |
import socket | |
nics = listdir("/sys/class/net/") | |
nics.remove("lo") | |
for idx, nic in enumerate(nics): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// A fake SSH server that logs passwords | |
// tweaked from https://gist.github.com/jpillora/b480fde82bff51a06238 | |
// | |
// # generate server keypair with | |
// ssh-keygen -t rsa | |
// the server expects to find id_rsa in the PWD | |
package main | |
import ( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"log" | |
"net" | |
"os" | |
"strconv" | |
"strings" | |
"time" |
OlderNewer