Skip to content

Instantly share code, notes, and snippets.

@freb
freb / vol
Created April 28, 2021 21:48
#!/bin/env python3
import os
import time
import subprocess
import argparse
# Maps a string contained in name, description, or product_name to our custom name
custom_names = {
"Plantronics_Blackwire_5220": "PLT 5220",
@freb
freb / .zshrc
Last active March 22, 2022 05:19
Bash functions for pentest tool output
nmap-uphosts() {
FILE=`realpath $1`
echo "
from lxml import etree
t = etree.parse('$FILE')
if \"-Pn\" in t.xpath(\"string(@args)\"): # port scan
hosts = t.xpath(\"/*/host[ports/port/state[@state='open']]/address[@addrtype='ipv4']/@addr\")
else: # ping scan
hosts = t.xpath(\"/*/host[status[@state='up']]/address[@addrtype='ipv4']/@addr\")
print(' '.join(hosts))