metasploit-framework
https://github.com/rapid7/metasploit-framework
Ruby
Metasploit Framework
Net::DNS::Resolver#srcaddr=
Set the local source address from which the resolver sends its
queries.
res.source_address = "172.16.100.1"
res.source_address = IPAddr.new("172.16.100.1")
You can specify +arg+ as either a string containing the ip address
or an instance of IPAddr class.
Normally this can be used to force queries out a specific interface
on a multi-homed host. In this case, you should of course need to
know the addresses of the interfaces.
Another way to use this option is for some kind of spoofing attacks
towards weak nameservers, to probe the security of your network.
This includes specifing ranged attacks such as DoS and others. For
a paper on DNS security, checks http://www.marcoceresa.com/security/
Note that if you want to set a non-binded source address you need
root priviledges, as raw sockets will be used to generate packets.
The class will then generate an exception if you're not root.
The default is 0.0.0.0, meaning any local address (chosen on routing
needs).Edit
git clone [email protected]:rapid7/metasploit-framework.git
cd metasploit-framework
open lib/net/dns/resolver.rb
Contribute
# Make a new branchgit checkout -b -your-name--update-docs-Net--DNS--Resolver-srcaddr--for-pr
# Commit to gitgit add lib/net/dns/resolver.rbgit commit -m "better docs for Net::DNS::Resolver#srcaddr="
# Open pull requestgem install hub # on a mac you can `brew install hub`
hub fork
git push <your name> -your-name--update-docs-Net--DNS--Resolver-srcaddr--for-pr
hub pull-request
# Celebrate!