Skip to content

Collection of scripts, snippets, etc, that I find useful

Notifications You must be signed in to change notification settings

jonathanbglass/tips_n_tricks

Repository files navigation

tips_n_tricks

Collection of scripts, snippets, etc, that I find useful

Open Source Security Tool Lists

Cloud mapping

AWSLogs

awslogs is a simple command line tool for querying groups, streams and events from Amazon CloudWatch logs. One of the most powerful features is to query events from several streams and consume them (ordered) in pseudo-realtime using your favourite tools such as grep:

awslogs groups --aws-region us-west-2 --profile profile_name

awk

  • removing the last character in field 2 {print substr($2, 1, length($2)-1)}
  • Checking a field for a value awk '$9 ~ 400 { print $0;}'

AWS

Security Pillar - AWS Well-Architected Framework

AWS Security Checklist

Generate an IAM Credentials Report

aws --profile PROFILE iam generate-credential-report
aws --profile PROFILE iam get-credential-report > PROFILE_creds_rep.json
jq '.Content' -r PROFILE_creds_rep.json | base64 -D > PROFILE_cred_report.csv

Credential Report Headers

user,arn,user_creation_time,password_enabled,password_last_used,password_last_changed,password_next_rotation,mfa_active,access_key_1_active,access_key_1_last_rotated,access_key_1_last_used_date,access_key_1_last_used_region,access_key_1_last_used_service,access_key_2_active,access_key_2_last_rotated,access_key_2_last_used_date,access_key_2_last_used_region,access_key_2_last_used_service,cert_1_active,cert_1_last_rotated,cert_2_active,cert_2_last_rotated

cut -f 1,10,11,12,13,14,15,16 -d, PROFILE_cred_report.csv | head -1
user,access_key_1_last_rotated,access_key_1_last_used_date,access_key_1_last_used_region,access_key_1_last_used_service,access_key_2_active,access_key_2_last_rotated,access_key_2_last_used_date

ANTIOPE from Turner Labs

Parallelizing Scripts

for i in $(awk '/PATTERN/ { print substr($2, 1, length($2)-1)}' ~/.aws/config); 
do 
    parallel 'echo {}; \ 
    python3.7 ~/GitHub/PMapper/pmapper.py --profile {} graph; \
    python3.7 ~/GitHub/PMapper/pmapper.py --profile {} visualize; \
    python3.7 ~/GitHub/PMapper/pmapper.py --profile {} query "preset priv_esc *";' ::: $i; 
done

Tools

SIEM Tools

IAM Probing Tools

AWS Escalate from Rhino Security Labs

python3.7 aws_escalate.py --all-users --access-key-id $ACCESS_KEY--secret-key $SECRET_KEY --session-token $TOKEN

SkyArk from CyberArk

PMapper from NCCGroup

  • https://github.com/nccgroup/PMapper
  • Supports PROFILES.
  • Has a standard query for to search for privilege escalation paths.
  • Catches some things that aws_escalate misses, and vice versa.
python3.7 ~/GitHub/PMapper/pmapper.py --profile PROFILE graph
python3.7 ~/GitHub/PMapper/pmapper.py --profile PROFILE visualize
python3.7 ~/GitHub/PMapper/pmapper.py --profile PROFILE query "preset priv_esc *"

Azure

Azure AD Entitlement Management

Benchmark Tools

S3 Benchmarking

PenTesting / Offensive Security Tools

MitM via Modlishka

BloodHoundAD

  • https://github.com/BloodHoundAD/BloodHound (BloodHound uses graph theory to reveal the hidden and often unintended relationships within an Active Directory environment. Attackers can use BloodHound to easily identify highly complex attack paths that would otherwise be impossible to quickly identify. Defenders can use BloodHound to identify and eliminate those same attack paths. Both blue and red teams can use BloodHound to easily gain a deeper understanding of privilege relationships in an Active Directory environment.)
  • https://github.com/vysecurity/ANGRYPUPPY

FakeNet-NG

  • https://github.com/mandiant/flare-fakenet-ng - FakeNet-NG is a next generation dynamic network analysis tool for malware analysts and penetration testers. It is open source and designed for the latest versions of Windows (and Linux, for certain modes of operation). FakeNet-NG is based on the excellent Fakenet tool developed by Andrew Honig and Michael Sikorski. The tool allows you to intercept and redirect all or specific network traffic while simulating legitimate network services. Using FakeNet-NG, malware analysts can quickly identify malware's functionality and capture network signatures. Penetration testers and bug hunters will find FakeNet-NG's configurable interception engine and modular framework highly useful when testing application's specific functionality and prototyping PoCs.

inetsim

Malware Zoo

GCP

Cartography

MacOS

Bash Tricks

  • sed -i.bak $'s/\t/ /' file.txt

Windows Security

ADS Tricks

About

Collection of scripts, snippets, etc, that I find useful

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages