Skip to content

Instantly share code, notes, and snippets.

View dreizehnutters's full-sized avatar

dreizehnutters

View GitHub Profile

Automating the First Hours of My Internal Vulnerability Assessments

In this post, I'll share how I automated the first hour of my internal vulnerability assessment using several handy scripts which i crafted over the years and try to demonstrate the power of automation in streamlining the initial phase of the assessment process.

The Need for Automation

Internal vulnerability assessments are crucial for identifying weaknesses within network infrastructure before they can be exploited by malicious actors. However, the manual effort required to initiate scans, gather results, and perform preliminary analysis can be time-consuming, resource-intensive and are mostly repetitive. Automation offers a solution to this challenge, allowing me to kickstart the assessment process and focus my attention on critical analysis and remediation tasks.

Automating offers several benefits:

@dreizehnutters
dreizehnutters / nessus_report_exporter.py
Last active February 26, 2024 14:01
export nessus reports via CLI
#!/usr/bin/env python3
__version__ = "1.0"
__about__ = "nessus report exporter"
from time import sleep
from os import environ
import requests
from requests.packages.urllib3.exceptions import InsecureRequestWarning
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
@dreizehnutters
dreizehnutters / nmap2service.py
Created February 26, 2024 13:17
Extract host that run specifc services from nmap scan results (XML)
#!/usr/bin/python3
from os import listdir, path
from argparse import ArgumentParser
import xml.etree.ElementTree as ET
__version__ = 1.0
def scan(in_file, search_pattern):
systems = {}
@dreizehnutters
dreizehnutters / snmap.sh
Last active April 8, 2024 08:13
staggered nmap scan
#!/bin/bash
NET=$1
bold=$(tput bold)
normal=$(tput sgr0)
error="${bold}[!]${normal}"
if [ -z "${1}" ]; then
echo "${0} <NET_IN_CIDR>|<FILE> [--check]"
exit 1
fi
@dreizehnutters
dreizehnutters / nmap2csv.sh
Last active February 26, 2024 13:34
export nmap xml data to csv via msfdb
#!/bin/bash
if [ -z "$1" ]; then
echo "$0 <PATH TO NMAP SCAN RESULTS>"
exit 1
fi
AUDIT_RESULTS=$1
PREFIX=$2
DB_HOST="127.0.0.1"
@dreizehnutters
dreizehnutters / certipy_json2csv.py
Created June 29, 2023 12:50
convert certipy json to csv
import json
import csv
from sys import argv
def flatten_dict(dictionary, parent_key='', sep='.'):
items = []
for key, value in dictionary.items():
new_key = f"{parent_key}{sep}{key}" if parent_key else key
if isinstance(value, dict):
if "Permissions" in key:
@dreizehnutters
dreizehnutters / prepX.sh
Created May 28, 2023 22:24
my little CTF bootstrap script
#!/bin/bash
# ./prepX.sh <IP> <BOX_PATH> <INTERFACE>
bold=$(tput bold);
normal=$(tput sgr0);
NMAP_MIN_RATE=500;
convert_xml_to_csv() {
XMLS=/usr/bin/xmlstarlet
NMAP_PATH="$1/nmap"
@dreizehnutters
dreizehnutters / interactsh_purge.sh
Last active March 26, 2023 00:55
# This script generates nuclei templates for out-of-band testing using a local server in the same network as the target. (no Interactsh needed)
#!/bin/bash
# This script generates nuclei templates for out-of-band
# testing using a local server in the same network as the target.
# (no Interactsh needed)
template_dir="$1"
oob_server="$2"
if [ -z "$template_dir" ] || [ -z "$oob_server" ]; then
@dreizehnutters
dreizehnutters / p5_scrapper.py
Last active November 5, 2021 13:46
p5.js webeditor scrapper
"""
what:
download all sketches (as .zip) from a given user on p5.js
how:
python <TARGET> [<OUT_DIR>]
who:
@13utters
"""
from sys import argv, exit
from pathlib import Path
@dreizehnutters
dreizehnutters / templade.pde
Last active February 5, 2020 14:31
processing template made by @beesandbombs
//template by @beesandbombs edited by @13utters
int[][] result;
float t, c;
float ease(float p) {
return 3*p*p - 2*p*p*p;
}
float ease(float p, float g) {
if (p < 0.5)