Skip to content

Instantly share code, notes, and snippets.

@manasmbellani
manasmbellani / setup_akamaicli.sh
Last active January 22, 2019 22:26
setup_akamaicli.sh - install akamai cli. Clone this repository, and run 'chmod +x setup_akamaicli.sh' to make this binary executable by all users. Then, run './setup_akamaicli.sh' to install akamai cli.
#!/bin/bash
###############################################################################
#
# Downloading akamai-cli
#
###############################################################################
filepath_to_download_to="akamai"
@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 / sample-sysmon-config.xml
Last active October 28, 2023 05:29
Sample sysmon config file for windows that works with old versions of sysmon in sysinternals from 2017
<!--
sysmon-config | A Sysmon configuration focused on default high-quality event tracing and easy customization by the community
Source version: 74 | Date: 2021-07-08
Source project: https://github.com/SwiftOnSecurity/sysmon-config
Source license: Creative Commons Attribution 4.0 | You may privatize, fork, edit, teach, publish, or deploy for commercial use - with attribution in the text.
Fork version: <N/A>
Fork author: <N/A>
Fork project: <N/A>
Fork license: <N/A>
@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")
@manasmbellani
manasmbellani / get_network_packets_in_windows.py
Created December 6, 2018 11:46
Record Network Packets in Windows using python
#!/usr/bin/python
import sys
import os
import socket
from struct import *
import argparse
NUM_PACKETS_TO_CHECK_DISK_USAGE = 1000
FREE_DISK_SPACE_TO_LEAVE = 1.0
@manasmbellani
manasmbellani / jsbeautify_file.py
Last active January 28, 2019 20:37
Beautify javascript file. Ensure that 'pip install jsbeautifier' is run so that jsbeautifier is installed. Then supply input JS file to beautify and an output JS file to beautify the output to.
#!/usr/bin/env python3
import jsbeautifier
from argparse import ArgumentParser
parser = ArgumentParser(description='Beautify input JS file to grep easily')
parser.add_argument("-f", "--file", action="store", dest="infile",
help="input jS file to beautify",
required=True)
parser.add_argument("-o", "--outfile", action="store", dest="outfile",
help="output jS file to beautify",
@manasmbellani
manasmbellani / veracode.py
Last active October 27, 2020 22:37
Script to perform multiple functions using Veracode including addition of users, reporting, listing users and teams. Make sure you populate the <SAML USER ID> which is a special ID prepended to users that use SAML for cleaner output when listing users. Also, required is the ability to ensure that Veracode API can be accessed from the IP address …
#!/usr/bin/env python3
import sys
import csv
import os
import json
import subprocess
import shlex
import requests
from xml.etree import ElementTree
@manasmbellani
manasmbellani / Get-DomainObjectPermissions.ps1
Last active February 4, 2019 06:37
Get-DomainObjectPermissions.ps1 - Gather the domain object permissions in a single file. Download the .ps1 file, and run as 'powershell -ep bypass .\Get-DomainObjectPermissions.ps1'
<# .SYNOPSIS
Get the Domain Object's Permissions in an AD deployed environment in a file called output.txt in the current folder
Requires ActiveDirectory module available through the "Remote Server Administration Toolset" in Windows user workstations.
Installed by default on a server.
On both the server and workstation, enable Active Directory Module for Windows Powershell from the control panel before
running the script below.
#>
Import-Module ActiveDirectory
$DC = Get-ADDomainController
$primaryDN = $DC.DefaultPartition
@manasmbellani
manasmbellani / argument_spoofing.cpp
Last active February 16, 2019 06:38
Modified version of the argument spoofing to execute arbitrary commands - based on the script by XPN @ https://gist.github.com/xpn/1c51c2bfe19d33c169fe0431770f3020#file-argument_spoofing-cpp. Compile the script using bash file which will write the output to a file called 'argument_spoofing_new.exe'. Escape backslash when specifying commands as a…
#include <iostream>
#include <windows.h>
#include <winternl.h>
#define CMD_TO_SHOW "powershell.exe -NoExit -c Write-Host 'This is just a friendly argument, nothing to see here'"
#define CMD_TO_EXEC L"powershell.exe -NoExit -c Write-Host Surprise, arguments spoofed\0"
typedef NTSTATUS(*NtQueryInformationProcess2)(
IN HANDLE,
IN PROCESSINFOCLASS,