This is a collection of code snippets used in my Pen Test Hackfest 2018 Presentation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import sys | |
import csv | |
import time | |
""" | |
PyCDR.py | |
Author: Steve Campbell, Github: https://github.com/sdcampbell/PyCDR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
PUSHD "%~dp0" | |
taskkill /im:ssonsvr.exe /f | |
taskkill /im:pnamain.exe /f | |
taskkill /im:wfcrun32.exe /f | |
taskkill /im:wfica32.exe /f | |
IF EXIST "%ALLUSERSPROFILE%\Citrix\Citrix online plug-in\TrolleyExpress.exe" ( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from burp import IScanIssue | |
class CustomIssue(IScanIssue): | |
def __init__(self, BasePair, Confidence='Certain', IssueBackground=None, IssueDetail=None, IssueName='Python Scripter generated issue', RemediationBackground=None, RemediationDetail=None, Severity='High'): | |
self.HttpMessages=[BasePair] # list of HTTP Messages | |
self.HttpService=BasePair.getHttpService() # HTTP Service | |
self.Url=BasePair.getUrl() # Java URL | |
self.Confidence = Confidence # "Certain", "Firm" or "Tentative" | |
self.IssueBackground = IssueBackground # String or None | |
self.IssueDetail = IssueDetail # String or None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import re | |
import sys | |
from multiprocessing.dummy import Pool | |
def robots(host): | |
r = requests.get( | |
'https://web.archive.org/cdx/search/cdx\ | |
?url=%s/robots.txt&output=json&fl=timestamp,original&filter=statuscode:200&collapse=digest' % host) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
basictable | |
Copyright (c) 2017 Rich Kelley | |
Contact: | |
@RGKelley5 | |
RK5DEVMAIL[A T]gmail[D O T]com | |
www.bytesdarkly.com | |
License: MIT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
"""search.py - Searches Google for a domain name and downloads PDF and Office files to search for document metadata.""" | |
import sys, os, wget | |
from pprint import pprint | |
from googleapiclient.discovery import build | |
API_KEY = "redacted" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#From here https://pen-testing.sans.org/blog/2017/10/13/scapy-full-duplex-stream-reassembly | |
def full_duplex(p): | |
sess = "Other" | |
if 'Ether' in p: | |
if 'IP' in p: | |
if 'TCP' in p: | |
sess = str(sorted(["TCP", p[IP].src, p[TCP].sport, p[IP].dst, p[TCP].dport],key=str)) | |
elif 'UDP' in p: | |
sess = str(sorted(["UDP", p[IP].src, p[UDP].sport, p[IP].dst, p[UDP].dport] ,key=str)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import sys | |
import time | |
from datetime import datetime | |
usage = "usage: python3 passwordSpray.py [/path/to/usernames.file] [/path/to/passwords.file] [minutes between each password loop] [output filename (csv)]" | |
if len(sys.argv) != 5: | |
sys.exit(usage) | |
usernames = [line.rstrip('\n') for line in open(sys.argv[1])] | |
passwords = [line.rstrip('\n') for line in open(sys.argv[2])] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
"""LinkedIn-Profile-Pic-Downloader.py - download LinkedIn profile picture""" | |
__author__ = "Steven Campbell (@lpha3ch0)" | |
__copyright__ = "Copyright 2018, Steven Campbell" | |
__credits__ = ["Steven Campbell"] | |
__license__ = "GPL" | |
__version__ = "1.0" | |
__maintainer__ = "Steven Campbell" |
OlderNewer