Skip to content

Instantly share code, notes, and snippets.

View kafkaesqu3's full-sized avatar

David kafkaesqu3

View GitHub Profile
@kafkaesqu3
kafkaesqu3 / hashview-systemd-config.log
Last active April 19, 2018 19:09
Hashview systemd service files
crackerman@gpucracker:/etc/systemd/system$ foreman export systemd ~/services
# see http://stackoverflow.com/questions/33318107/how-do-i-start-foreman-server-on-background-on-production
crackerman@gpucracker:/etc/systemd/system$ mv ~/services/* /etc/systemd/system
crackerman@gpucracker:/etc/systemd/system$ find . -type f -name "app*.service" -print0 | xargs -0 -I % sh -c 'printf "\n\n"; echo %; cat %'
./app-redis@.service
[Unit]
@kafkaesqu3
kafkaesqu3 / repack-nessus-for-debian.log
Last active April 27, 2022 13:48
Fix for: Unable to locate package Nessus
root@kali:~/packages$ tail /root/live-build-config/build.log
P: Begin installing packages (install pass)...
Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package Nessus
P: Begin unmounting filesystems...
P: Saving caches...
Reading package lists...
Building dependency tree...
@kafkaesqu3
kafkaesqu3 / openvpn-with-systemd.log
Last active May 23, 2017 05:40
Configuring openvpn with systemd
root@kali:~$ cat /etc/systemd/system/vpn.service
[Unit]
Description=Start/stop VPN connection
[Service]
Type=oneshot
ExecStart=/bin/bash -c "/root/vpn.sh start"
ExecStop=/bin/bash -c "/root/vpn.sh stop"
RemainAfterExit=yes
@kafkaesqu3
kafkaesqu3 / pentesteracademy-content-scraping.sh
Last active August 25, 2018 20:23
pentesteracademy content scraping
#generate file containing video IDs
for i in {1051..1069}; do echo $i >> ids; done
#or
grep -oP "video\?id=\d{2,3}" tmp | sort -u | uniq | cut -d "=" -f 2 > ids
#get videos
for id in $(cat ids); do
wget --trust-server-names=on --no-clobber --header="User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:53.0) Gecko/20100101 Firefox/53.0" \
--header="Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" \
--header="Accept-Language: en-US,en;q=0.5" \
@kafkaesqu3
kafkaesqu3 / vpn.sh
Created June 2, 2017 02:16
OpenVPN connection management script
#!/bin/sh
if [ "$(id -u)" != "0" ]; then
echo "Run as root!" 1>&2
exit 1
fi
path=/etc/openvpn/pia-configs
locations=$(ls $path/*.ovpn | cut -d "/" -f 5)
@kafkaesqu3
kafkaesqu3 / expand-csv.py
Created December 4, 2017 20:31
Expands csv file from format key1,var1,var2 into key1,var1 \n key1,var2
file = open('title-cve.txt', 'r')
output = open('title-cve-out.txt', 'w')
for line in file:
tmp = line.split('|')
title = tmp[0]
cvelist = tmp[1].split(',')
for cve in cvelist:
output.write(tmp[0] + '|' + cve + '\n')
wget --spider --force-html -r -l2 $url 2>&1 \
| grep '^--' | awk '{ print $3 }' \
| grep -v '\.\(css\|js\|png\|gif\|jpg\)$'
@kafkaesqu3
kafkaesqu3 / Copy-AuthenticodeSignedFile.ps1
Created February 26, 2018 05:41 — forked from mattifestation/Copy-AuthenticodeSignedFile.ps1
When supplied with an Authenticode-signed PowerShell script, Copy-AuthenticodeSignedFile generates the same signed, validated file but with a different file hash.
function Copy-AuthenticodeSignedFile {
<#
.SYNOPSIS
Creates a copy of an Authenticode-signed PowerShell file that has a unique file hash but retains its valid signature.
.DESCRIPTION
Copy-AuthenticodeSignedFile creates a copy of an Authenticode-signed PowerShell file that has a unique file hash but retains its valid signature. This is used to bypass application whitelisting hash-based blacklist rules.
@kafkaesqu3
kafkaesqu3 / DeviceGuard_Driver_Strict_Enforcement_policy.xml
Created February 26, 2018 05:44 — forked from mattifestation/DeviceGuard_Driver_Strict_Enforcement_policy.xml
File-based driver enforcement Device Guard policy for my Surface Laptop w/ Windows 10 Enterprise.
<?xml version="1.0" encoding="utf-8"?>
<SiPolicy xmlns="urn:schemas-microsoft-com:sipolicy">
<VersionEx>10.0.0.0</VersionEx>
<PolicyTypeID>{A244370E-44C9-4C06-B551-F6016E563076}</PolicyTypeID>
<PlatformID>{2E07F7E4-194C-4D20-B7C9-6F44A6C5A234}</PlatformID>
<Rules>
<Rule>
<Option>Enabled:Unsigned System Integrity Policy</Option>
</Rule>
<Rule>
Const HKLM = &H80000002 'HKEY_LOCAL_MACHINE
strComputer = "."
strKey = "SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\Audit"
Set objLocator = CreateObject("WbemScripting.SWbemLocator")
Set objReg = objLocator.ConnectServer(strComputer, "root\cimv2").Get("StdRegProv")
objReg.EnumKey HKLM, strKey, arrSubKeys
objReg.GetDWORDValue HKLM, strkey, "ProcessCreationIncludeCmdLine_Enabled", isenabled
If IsNull(isenabled) Then