Skip to content

Instantly share code, notes, and snippets.

View Chan9390's full-sized avatar

Chandrapal Badshah Chan9390

View GitHub Profile
@Chan9390
Chan9390 / XafterY.py
Created March 23, 2021 12:16
Send X requests to target after Y seconds in Turbo Intruder
import time
def queueRequests(target, wordlists):
engine = RequestEngine(endpoint=target.endpoint,
concurrentConnections=1,
requestsPerConnection=100,
pipeline=False
)
requests = 0
for word in open('/usr/share/dict/words'):
Using this private key to access targetdomain.com
-----BEGIN RSA PRIVATE KEY-----
MIIEowIBAAKCAQEAusTUBfl1T9pypGqgTeUQJUZHk+4o6cVCnrcpYzReKx6X3QO0
fRLQlnbQ/yMF7C1m+CARS5AIMoowvBzlUZAf1bIc2xnX9b+EZSM+YNDExyaYMmO8
XKfLQBJaRKeqqDKFuP4zglDWBWYceUWCWzt2IQl+7tYxFpUjdO44QCe9A6xQI1BT
Xd0k+9c28y1y6Qn5XDNhORvMaLv1OL3+v1rMyYiYIwtR1YVwNSofKklvDFFpMCEH
q0/77azlYwZef8UzuyGsg9tcwEht0kRZTupOw+naTU6hxZCcQaeXezqtr3Z05/wM
SdNrSBY1iuwvpBunW7MMF5Tff9yPreOQKYaTqQIDAQABAoIBAHvQPBZx11lGobVp
kjfRYLC1NIJW4fyHbrC1D9TaRIslTtuPtzkrHeiBf++DkkuNlbNr3stPAoAuqDws
mkdir logs
cat gcp-project-ips.csv | cut -f1 -d, | sort -u | while read project; do mkdir logs/${project}; done
cat gcp-project-ips.csv | while IFS="," read -r project ip; do echo nmap -sT -T5 -Pn -p- -oG logs/${project}/${ip}.gnmap $ip; done > scan-all-ips.out
parallel --jobs 32 < scan-all-ips.out
@Chan9390
Chan9390 / gist:a3c69ca3a8c9a28d97aa1345f42599c8
Last active March 4, 2020 08:21
Faster nmap scanning with the help of GNU parallel - Part 2
for dirname in logs/*;
do
for filename in ${dirname}/*.gnmap;
do
project=`echo $filename | cut -d/ -f2`;
ip=`echo $filename | cut -d/ -f3`;
ip=${ip::-6};
cat $filename | cut -d' ' -f2,4- | sed -n -e 's/Ignored.*//p' | awk -v ip="$ip" -v project="$project" '{$1=""; for(i=2; i<=NF; i++) { a=a" "$i; }; split(a,s,","); for(e in s) { split(s[e],v,"/"); if (v[2] == "closed") { printf project "," ip ",%s,%s\n" , v[1], v[5]}}; a="" }';
done;
done
@Chan9390
Chan9390 / gist:d49c0024aa59edb455c0954ec7eefe37
Created February 23, 2020 06:27
One liner to get all the IP ranges of AWS Gov regions
curl -s https://ip-ranges.amazonaws.com/ip-ranges.json | jq -r '.prefixes[] | select(.region | contains("gov")) | .ip_prefix' | sort -u
{
"mode": "patterns",
"proxySettings": [
{
"address": "127.0.0.1",
"port": 8080,
"username": "",
"password": "",
"type": 1,
"title": "127.0.0.1:8080",
@Chan9390
Chan9390 / cloudflare.py
Created June 14, 2019 07:28
Python script to get all DNS records from all Cloudflare zones
import CloudFlare
cf = CloudFlare.CloudFlare()
zones = cf.zones.get()
for zone in zones:
for record in cf.zones.dns_records.get(zone['id'], params={'per_page':100}):
print record['name'] + ',' + record['type'] + ',' + record['content']
echo Project Name,Disk Name,Source Image
for projectname in `gcloud projects list --format json | jq -r '.[].projectId'`; do
gcloud compute disks list -q --project $projectname --format json | \
jq -r '.[] | ["\(.name)", "\(.sourceImage)"] | @tsv' | \
while IFS=$'\t' read -r diskname sourceimage; do
os=`echo $sourceimage | awk -F "/" '{print $NF}'`;
echo $projectname,$diskname,$os;
done;
done
@Chan9390
Chan9390 / manage_users.yml
Created October 23, 2018 13:39
Ansible script to manage Linux users and their authorized SSH keys
---
- hosts: production
gather_facts: no # This is helpful if a new EC2 instance is to be provisioned
become: yes
vars:
- default_users: ['nobody']
- required_users: ['badshah', 'bob', 'alice']
tasks:
@Chan9390
Chan9390 / mips-cross-compiler.sh
Created July 24, 2018 13:36
Creating MIPS cross compiler for ARM architecture
mkdir crossbuild
cd crossbuild
mkdir gcc
mkdir eglibc
mkdir binutils
mkdir install
mkdir sysroot
export prefix=/home/pi/crossbuild/install
export sysroot=/home/pi/crossbuild/sysroot