Scratches

Blinded by Science!

try and catch boto3 client exceptions

https://stackoverflow.com/questions/43354059/catching-boto3-clienterror-subclass If you're using the client you can catch the exceptions like this: import boto3 def exists(role_name): clien...

AWS CLI Filters and Queries

delete aws backup recovery points, so you can delete the vault #!/bin/bash set -e echo "Enter the name of the vault where all backups should be deleted." read VAULT_NAME for ARN in $(aws backu...

Reconnaissance Tools

get info about domains/websites There are hundreds of tools relevant to security assessments, network reconnaissance, vulnerability scanning, and penetration testing. Security distributions specia...

Password Crackers

PASSWORD CRACKERS Although there are some Windows tools, including the infamous Cain and L0phtcrack (l0phtcrack.com) tools, most password crackers run primarily on Linux. Additionally, John the Ri...

AWS CLI describe-images from describe-instances

aws ec2 describe-images --owner amazon --image-id $(aws ec2 describe-instances --instance-ids i-05e7e29b0d2d2a58c --query "Reservations[0].Instances[0].ImageId" --output text) --query "Images[0].Na...

Ansible playbooks and templates

ansible playbook to replace text in config file 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 --- - hosts: labservers become: yes handlers: - name: restart apache service: name=...

Ansible playbooks and templates - part two

Use a variable in a playbook 1 2 3 4 5 6 7 8 9 10 11 12 13 --- - hosts: localhost vars: inv_file: /home/ansible/vars/inv.txt tasks: - name: file: path: {{ inv_file }} sta...

Boom Load Tester Tips

Run Boom against localhost passing a custom header 30 concurrent requests, total requests of 3000 boom http://localhost/ --header Host:test-website.example.com -c 30 -n 3000 Server Software:...

MySql Tips

reset mysql root password 1. Stop Service 2. mysqld_safe --skip-grant-tables & mysql UPDATE mysql.user SET Password=PASSWORD('the-pw') WHERE User='root'; FLUSH PRIVILEGES; \q 3...

Nginx Tips

Create Self-Signed SSL Certificate for Nginx mkdir /etc/nginx/ssl openssl req -x509 -nodes -days 365 -newkey rsa:2048 \ -keyout /etc/nginx/ssl/private.key \ -out /etc/nginx/ssl/public....