Skip to content

Instantly share code, notes, and snippets.

View ahadsheriff's full-sized avatar
👨‍🚀
in space

Ahad Sheriff ahadsheriff

👨‍🚀
in space
View GitHub Profile
@ahadsheriff
ahadsheriff / mapper_tutorial.py
Created March 28, 2019 21:28
Crawl and scrape URLs to map a website
from bs4 import BeautifulSoup
import requests
import requests.exceptions
from urllib.parse import urlsplit
from urllib.parse import urlparse
from collections import deque
import re
url = "https://scrapethissite.com"
# a queue of urls to be crawled
@ahadsheriff
ahadsheriff / test_cli.py
Created March 11, 2019 05:20
For CLI tutorial
import argparse
welcome = "Practicing creating interactive command-line interfaces"
parser = argparse.ArgumentParser(description=welcome)
parser.add_argument('--domain', '-d', required=True,
help='domain name of the website you want to scrape. i.e. "https://ahadsheriff.com"')
parser.add_argument('--ofile', '-o',
help='define output file to save results of stdout. i.e. "output.txt"')
parser.add_argument('--lines', '-l',
@ahadsheriff
ahadsheriff / rpc-vuln.c
Created March 3, 2019 20:41
Windows RPC Overflow Exploit Code
/*
DCOM RPC Overflow Discovered by LSD - Exploit Based on Xfocus's Code
Written by H D Moore <hdm [at] metasploit.com>
- Usage: ./dcom <Target ID> <Target IP>
- Targets:
- 0 Windows 2000 SP0 (english)
- 1 Windows 2000 SP1 (english)
- 2 Windows 2000 SP2 (english)
#include <errno.h>
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
extern int errno;
int
main(int argc, char **argv)
{
@ahadsheriff
ahadsheriff / keybase.md
Created February 11, 2019 18:23
Ahad's Keybase

Keybase proof

I hereby claim:

  • I am ahadsheriff on github.
  • I am ahadsheriff (https://keybase.io/ahadsheriff) on keybase.
  • I have a public key ASAs3GanCTaGcZnrtPEPr2BPFe6ZLDPc0IV9S70dyIBmxAo

To claim this, I am signing this object:

Verifying my Blockstack ID is secured with the address 1AKxxEkL6HV91Hrs24qvxEQECAkMYojzSL https://explorer.blockstack.org/address/1AKxxEkL6HV91Hrs24qvxEQECAkMYojzSL
@ahadsheriff
ahadsheriff / loadTestScript.py
Created April 8, 2017 20:24
Python script to load test a website, grab the important information from the load tester, and output the information to a text file.
import datetime
import os
# Local Website: http://127.0.0.1/var/website/html
website = str(input("Enter the URL of the website you want to test: "))
os.system('ab -n 1000 -c 5 '+ website + ' > LoadTest.txt')
infile = 'LoadTest.txt'
@ahadsheriff
ahadsheriff / pingScript.sh
Last active March 10, 2017 00:19
Ping script to test local, remote, and DNS connectivity, written in bash.
@ echo off
echo Testing local connectivity
ping 192.168.1.102 > nul
if errorlevel 1 goto :ERRORLocal
goto :LocalSuccess
:TRYRemote
echo Testing remote connectivity
ping 8.8.8.8 > nul
if errorlevel 1 goto :ERRORRemote
@ahadsheriff
ahadsheriff / addUsers.py
Last active December 14, 2022 03:49
Python script to add users to Linux groups.
"""
Author: Ahad Sheriff
Description:
Python script to add users to Linux groups. You can easily change the content
of this script to fit your needs.
Sample CSV file that I used to test is
included as `sampleAccounts.csv`
Data:
The data in the csv file must be of the form:
"Full Name", "Office Number", "Phone Extension #", "Department Name"