From charlesreid1

Line 1: Line 1:
=Searching=
=Searching=


Searching for bind exploits, we find the (select) list below:
Searching for exploits of the DNS service that is running, ISC BIND 9.4.2, we find the following exploit: https://www.exploit-db.com/exploits/6122/
 
This exploit is labeled <code>auxiliary/spoof/dns/bailiwicked_domain</code>. It allows us to insert malicious DNS records into the DNS server.
 
More information:


<pre>
<pre>
msf > search bind
This exploit targets a fairly ubiquitous flaw in DNS implementations
which allow the insertion of malicious DNS records into the cache of the
target nameserver.  This exploit caches a single malicious nameserver
entry into the target nameserver which replaces the legitimate
nameservers for the target domain.  By causing the target nameserver to
query for random hostnames at the target domain, the attacker can spoof
a response to the target server including an answer for the query, an
authority server record, and an additional record for that server,
causing target nameserver to insert the additional record into the
cache.  This insertion completely replaces the original nameserver
records for the target domain.
</pre>


Matching Modules
To interpret:
================


  Name                                                              Disclosure Date  Rank      Description
Metasploit induces the target nameserver to ask for a bunch of hostnames at a target domain.
  ----                                                              ---------------  ----      -----------
 
  auxiliary/dos/dns/bind_tkey                                      2015-07-28      normal    BIND TKEY Query Denial of Service
Metasploit then sends fake responses from the target domain back to the target nameserver in an attempt to confuse the target nameserver.
  auxiliary/spoof/nbns/nbns_response                                                normal    NetBIOS Name Service Spoofer
 
  payload/aix/ppc/shell_bind_tcp                                                    normal    AIX Command Shell, Bind TCP Inline
When the attack/spoofing is successful, the target nameserver will receive a new authority server record (faked by Metasploit), and will insert this new record into its DNS cache.
  payload/bsd/sparc/shell_bind_tcp                                                  normal    BSD Command Shell, Bind TCP Inline
 
  payload/bsd/x64/shell_bind_ipv6_tcp                                                normal    BSD x64 Command Shell, Bind TCP Inline (IPv6)
This means the target nameserver has a new DNS record for the target domain, containing whatever DNS servers were set in the Metasploit attack.
  payload/bsd/x64/shell_bind_tcp                                                    normal    BSD x64 Shell Bind TCP
  payload/bsd/x64/shell_bind_tcp_small                                              normal    BSD x64 Command Shell, Bind TCP Inline
  payload/bsd/x86/metsvc_bind_tcp                                                    normal    FreeBSD Meterpreter Service, Bind TCP
  payload/bsd/x86/shell/bind_ipv6_tcp                                                normal    BSD Command Shell, Bind TCP Stager (IPv6)
  payload/bsd/x86/shell/bind_tcp                                                    normal    BSD Command Shell, Bind TCP Stager
  payload/bsd/x86/shell_bind_tcp                                                    normal    BSD Command Shell, Bind TCP Inline
  payload/bsd/x86/shell_bind_tcp_ipv6                                                normal    BSD Command Shell, Bind TCP Inline (IPv6)
  payload/bsdi/x86/shell/bind_tcp                                                    normal    BSDi Command Shell, Bind TCP Stager
  payload/bsdi/x86/shell_bind_tcp                                                    normal    BSDi Command Shell, Bind TCP Inline
  payload/cmd/unix/bind_awk                                                          normal    Unix Command Shell, Bind TCP (via AWK)
  payload/cmd/unix/bind_inetd                                                        normal    Unix Command Shell, Bind TCP (inetd)
  payload/cmd/unix/bind_lua                                                          normal    Unix Command Shell, Bind TCP (via Lua)
  payload/cmd/unix/bind_netcat                                                      normal    Unix Command Shell, Bind TCP (via netcat)
  payload/cmd/unix/bind_netcat_gaping                                                normal    Unix Command Shell, Bind TCP (via netcat -e)
  payload/cmd/unix/bind_netcat_gaping_ipv6                                          normal    Unix Command Shell, Bind TCP (via netcat -e) IPv6
  payload/cmd/unix/bind_nodejs                                                      normal    Unix Command Shell, Bind TCP (via nodejs)
  payload/cmd/unix/bind_perl                                                        normal    Unix Command Shell, Bind TCP (via Perl)
  payload/cmd/unix/bind_perl_ipv6                                                    normal    Unix Command Shell, Bind TCP (via perl) IPv6
  payload/cmd/unix/bind_ruby                                                        normal    Unix Command Shell, Bind TCP (via Ruby)
  payload/cmd/unix/bind_ruby_ipv6                                                    normal    Unix Command Shell, Bind TCP (via Ruby) IPv6
  payload/cmd/unix/bind_zsh                                                          normal    Unix Command Shell, Bind TCP (via Zsh)
  payload/generic/shell_bind_tcp                                                    normal    Generic Command Shell, Bind TCP Inline
  payload/java/jsp_shell_bind_tcp                                                    normal    Java JSP Command Shell, Bind TCP Inline
  payload/java/meterpreter/bind_tcp                                                  normal    Java Meterpreter, Java Bind TCP Stager
  payload/java/shell/bind_tcp                                                        normal    Command Shell, Java Bind TCP Stager
  payload/linux/armle/shell/bind_tcp                                                normal    Linux dup2 Command Shell, Bind TCP Stager
  payload/linux/armle/shell_bind_tcp                                                normal    Linux Command Shell, Reverse TCP Inline
  payload/linux/mipsbe/shell_bind_tcp                                                normal    Linux Command Shell, Bind TCP Inline
  payload/linux/mipsle/shell_bind_tcp                                                normal    Linux Command Shell, Bind TCP Inline
  payload/linux/ppc/shell_bind_tcp                                                  normal    Linux Command Shell, Bind TCP Inline
  payload/linux/ppc64/shell_bind_tcp                                                normal    Linux Command Shell, Bind TCP Inline
  payload/linux/x64/shell/bind_tcp                                                  normal    Linux Command Shell, Bind TCP Stager
  payload/linux/x64/shell_bind_tcp                                                  normal    Linux Command Shell, Bind TCP Inline
  payload/linux/x64/shell_bind_tcp_random_port                                      normal    Linux Command Shell, Bind TCP Random Port Inline
  payload/linux/x86/meterpreter/bind_ipv6_tcp                                        normal    Linux Meterpreter, Bind IPv6 TCP Stager (Linux x86)
  payload/linux/x86/meterpreter/bind_ipv6_tcp_uuid                                  normal    Linux Meterpreter, Bind IPv6 TCP Stager with UUID Support (Linux x86)
  payload/linux/x86/meterpreter/bind_nonx_tcp                                        normal    Linux Meterpreter, Bind TCP Stager
  payload/linux/x86/meterpreter/bind_tcp                                            normal    Linux Meterpreter, Bind TCP Stager (Linux x86)
  payload/linux/x86/meterpreter/bind_tcp_uuid                                        normal    Linux Meterpreter, Bind TCP Stager with UUID Support (Linux x86)
  payload/linux/x86/metsvc_bind_tcp                                                  normal    Linux Meterpreter Service, Bind TCP
  payload/linux/x86/shell/bind_ipv6_tcp                                              normal    Linux Command Shell, Bind IPv6 TCP Stager (Linux x86)
  payload/linux/x86/shell/bind_ipv6_tcp_uuid                                        normal    Linux Command Shell, Bind IPv6 TCP Stager with UUID Support (Linux x86)
  payload/linux/x86/shell/bind_nonx_tcp                                              normal    Linux Command Shell, Bind TCP Stager
  payload/linux/x86/shell/bind_tcp                                                  normal    Linux Command Shell, Bind TCP Stager (Linux x86)
  payload/linux/x86/shell/bind_tcp_uuid                                              normal    Linux Command Shell, Bind TCP Stager with UUID Support (Linux x86)
  payload/linux/x86/shell_bind_ipv6_tcp                                              normal    Linux Command Shell, Bind TCP Inline (IPv6)
  payload/linux/x86/shell_bind_tcp                                                  normal    Linux Command Shell, Bind TCP Inline
  payload/linux/x86/shell_bind_tcp_random_port                                      normal    Linux Command Shell, Bind TCP Random Port Inline
  payload/python/meterpreter/bind_tcp                                                normal    Python Meterpreter, Python Bind TCP Stager
  payload/python/meterpreter/bind_tcp_uuid                                          normal    Python Meterpreter, Python Bind TCP Stager with UUID Support
  payload/python/meterpreter_bind_tcp                                                normal    Python Meterpreter Shell, Bind TCP Inline
  payload/ruby/shell_bind_tcp                                                        normal    Ruby Command Shell, Bind TCP
  payload/ruby/shell_bind_tcp_ipv6                                                  normal    Ruby Command Shell, Bind TCP IPv6
  post/linux/gather/enum_configs                                                    normal    Linux Gather Configurations
  post/linux/gather/enum_network                                                    normal    Linux Gather Network Information
  post/linux/gather/enum_protections                                                normal    Linux Gather Protection Enumeration
  post/linux/gather/enum_system                                                      normal    Linux Gather System and User Information
  post/linux/gather/enum_users_history                                              normal    Linux Gather User History
</pre>


Now, anyone requesting the target domain from the target nameserver will actually be routed to your (malicious) nameserver, where you can tamper with the request before forwarding it along.


=Flags=
=Flags=


{{MSFlag}}
{{MSFlag}}

Revision as of 06:31, 26 March 2016

Searching

Searching for exploits of the DNS service that is running, ISC BIND 9.4.2, we find the following exploit: https://www.exploit-db.com/exploits/6122/

This exploit is labeled auxiliary/spoof/dns/bailiwicked_domain. It allows us to insert malicious DNS records into the DNS server.

More information:

This exploit targets a fairly ubiquitous flaw in DNS implementations
which allow the insertion of malicious DNS records into the cache of the
target nameserver.  This exploit caches a single malicious nameserver
entry into the target nameserver which replaces the legitimate
nameservers for the target domain.  By causing the target nameserver to
query for random hostnames at the target domain, the attacker can spoof
a response to the target server including an answer for the query, an
authority server record, and an additional record for that server,
causing target nameserver to insert the additional record into the
cache.  This insertion completely replaces the original nameserver
records for the target domain.

To interpret:

Metasploit induces the target nameserver to ask for a bunch of hostnames at a target domain.

Metasploit then sends fake responses from the target domain back to the target nameserver in an attempt to confuse the target nameserver.

When the attack/spoofing is successful, the target nameserver will receive a new authority server record (faked by Metasploit), and will insert this new record into its DNS cache.

This means the target nameserver has a new DNS record for the target domain, containing whatever DNS servers were set in the Metasploit attack.

Now, anyone requesting the target domain from the target nameserver will actually be routed to your (malicious) nameserver, where you can tamper with the request before forwarding it along.

Flags