This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
import hashlib | |
import string | |
from itertools import product | |
def all_perms_with_repeat(validChars, repeatCount): | |
chars = list(validChars) | |
results = [] | |
for c in product(chars, repeat = repeatCount): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:(){ :|: & };: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# OK, yes, it's technically 3 lines, 4 if you include this comment | |
import boto3 | |
ec2 = boto3.client('ec2') | |
regions = [ r['RegionName'] for r in ec2.describe_regions()['Regions'] ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'$=_=>`$=${$};$()`;$()' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Given this command: | |
$ aws cloudfront list-distributions --query DistributionList.Items[].[Id,DomainName,Status] --output text | |
# We can also use jq: | |
$ aws cloudfront list-distributions | jq -r '.DistributionList.Items[] | [.Id, .DomainName, .Status] | @tsv' | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
def lambda_handler(event, context): | |
requestPath = event['path'] | |
xff = event['headers']['x-forwarded-for'] | |
clientIP = '<empty>' | |
response = ''' | |
<!DOCTYPE html><html><head></head><body> | |
<div class="info"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"swagger": "2.0", | |
"info": { | |
"version": "2019-10-28T15:48:36Z", | |
"title": "ReturnIPList" | |
}, | |
"host": “aabbccddeeff.execute-api.us-east-2.amazonaws.com", | |
"basePath": “/prod”, | |
"schemes": [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Equality match: | |
$ aws securityhub list-members --query "Members[?MemberStatus=='Associated'].{AccountId:AccountId,MasterId:MasterId,MemberStatus:MemberStatus,UpdatedAt:UpdatedAt}" --output table | |
------------------------------------------------------------------------------ | |
| ListMembers | | |
+--------------+---------------+---------------+-----------------------------+ | |
| AccountId | MasterId | MemberStatus | UpdatedAt | | |
+--------------+---------------+---------------+-----------------------------+ | |
| 112233445566| 101010101010 | Associated | 2019-11-11T13:07:04.185Z | | |
| 667788990011| 101010101010 | Associated | 2019-11-22T17:04:41.795Z | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def hw = 'hello world'; | |
println(hw); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cat gohw.go | |
package main | |
import ( | |
"fmt" | |
) | |
func main() { | |
fmt.Println("hi") | |
} |