Skip to content

Instantly share code, notes, and snippets.

View StoneSwine's full-sized avatar

Magnus StoneSwine

View GitHub Profile
#!/bin/bash -ex
ip=$1
outdir="out"
tmp=`pwd`/tmp
mkdir -p $outdir
nmap -p- --min-rate 10000 -oG $tmp $ip &>/dev/null
nmap -p `egrep -v "^#|Status: Up" $tmp | cut -d' ' -f4- | tr , "\n" | awk -F / '{print $1}' | tr "\n" ,| tr -d " " | sed 's/.$//'` -sCV -oA $outdir/$ip $ip &>/dev/null
rm $tmp
@StoneSwine
StoneSwine / regex_norwegian-street-address.txt
Last active January 20, 2021 09:12
Regular expression to get streetname, number and letter for Norwegian street addresses. Example: Streetname 1A
^([.'A-zøæéÉåÆØÅ]+\s)+(\d{1,3})([A-z]| [A-z]|$|)
@StoneSwine
StoneSwine / bruteforce-subdomains.py
Last active October 25, 2020 14:50
Bruteforce resolving subdomains of a domain. I think it ignores wildcard domains, not sure if it works though.
import urllib.request
import argparse
import shutil
import string
import random
from pathlib import Path
from json import JSONDecodeError
import json
import os
import subprocess
access
admin
api
auth
aws
bearer
bot
bucket
client
consumer
This file has been truncated, but you can view the full file.
*
***
*****
******
+*
_________
███
/
/%
/'
/)
/)))+
/*
/*****
/***************
/+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@StoneSwine
StoneSwine / recursive_linkcrawler.py
Last active October 15, 2020 08:31
Fast recursive link discovery, a bit like the spider in previous versions of Burp. Limits to content on the specified website. (Spawns a lot of processes and threads)
#!/usr/bin/env python3
from multiprocessing import Process, Manager
from threading import Thread
from urllib.parse import urlparse
import requests
from bs4 import BeautifulSoup
baseurl = input("ONE domain to crawl [must include scheme]: ").strip()
headers = {
@StoneSwine
StoneSwine / gasprice_calculation.py
Last active May 5, 2020 10:35
Have you ever wondered how expensive the gasprice must be before it is feasible to use a percentage discount instead of a static discount?
print([i/100 for i in range(1,20*100) if (i/100)*0.97<(i/100)-0.55][0]) # three percent vs. 0.55 kr
#!/usr/bin/env python3
import subprocess, time, os
import numpy as np
DIR = "out/"
if not os.path.exists(DIR):
os.makedirs(DIR)
"""