Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am averagesecurityguy on github.
  • I am avgsecguy (https://keybase.io/avgsecguy) on keybase.
  • I have a public key ASCjg5tFrtp6al20MtWXbXWD63c3Q-UQ4VzDKjaxI5XR-Ao

To claim this, I am signing this object:

email@example.com:Password1
@averagesecurityguy
averagesecurityguy / nessusd_message_parser.py
Created April 1, 2021 20:29
Find launch messages in nessusd.messages file.
#!/usr/bin/env python3
import sys
import re
# Define regular expressions for the nessusd.messages format.
#
# Launching
# [Wed Mar 31 09:19:34 2021][5372.0][user=nessususer][name= scan name FULL DEBUG][JOB_UUID=94613384-4ad4-655a-6f52-00e87dc0f9a8a640e3918796fe3d][target=10.210.1.10][plugin=vmware_multiple_vmsa_2008_0008.nasl][plugin_id=32503] : Launching
@averagesecurityguy
averagesecurityguy / rename_pics_date.sh
Created November 16, 2020 23:55
Extract the creation date from an image and add the date to the filename. Only works on Mac.
#!/bin/bash
#
# Extract the creation date from an image and add the date to the filename.
# Only works on Mac.
#
DUMP_DIR="/Users/family/pics/dump"
CP_DIR="/Users/family/pics/dated"
cd "$DUMP_DIR"
@averagesecurityguy
averagesecurityguy / spmc.rs
Created October 22, 2020 18:02
Simpler, generic Single Producer, Multiple Consumer pattern
use std::sync::mpsc;
use std::sync;
pub struct Spmc<T> {
count: usize,
chans: Vec::<mpsc::Sender::<Option<T>>>,
}
impl<T> Spmc<T> {
pub fn send(&mut self, item: T) {
@averagesecurityguy
averagesecurityguy / lib.rs
Created October 21, 2020 22:48
Multi-threaded File Reader
use std::fs::File;
use std::io::{self, BufRead};
use std::sync::mpsc;
use std::sync;
pub struct MultiReader {
fname: String,
count: sync::Arc<sync::Mutex<usize>>,
chans: sync::Arc<sync::Mutex<Vec::<mpsc::Sender::<Option<String>>>>>,
}
@averagesecurityguy
averagesecurityguy / parse_nessus.go
Created November 9, 2018 02:47
Concurrently parse a Nessus file.
/*
Copyright (c) 2018, AverageSecurityGuy
# All rights reserved.
Created: 2018-11-08
Modified: 2018-11-08
Author: Stephen Haywood
Sources: http://blog.davidsingleton.org/parsing-huge-xml-files-with-go/
*/
package main
import (
"context"
"flag"
"fmt"
"io/ioutil"
"net"
"os"
"strings"
This file has been truncated, but you can view the full file.
function Invoke-Mimikatz
{
<#
.SYNOPSIS
This script leverages Mimikatz 2.0 and Invoke-ReflectivePEInjection to reflectively load Mimikatz completely in memory. This allows you to do things such as
dump credentials without ever writing the mimikatz binary to disk.
The script has a ComputerName parameter which allows it to be executed against multiple computers.
This script should be able to dump credentials from any version of Windows through Windows 8.1 that has PowerShell v2 or higher installed.
@averagesecurityguy
averagesecurityguy / ctxns_enum.py
Created March 27, 2018 16:04
Citrix NetScaler Enumeration
#!/usr/bin/env python
import requests
requests.packages.urllib3.disable_warnings()
passwords = ['Spring2018', 'Password1']
url = 'https://<server_ip>/p/u/doAuthentication.do'
users = []
with open('usernames.txt') as f: