metasploit-framework
https://github.com/rapid7/metasploit-framework
Ruby
Metasploit Framework
Net::DNS::Resolver#srcport=
Set the local source port from which the resolver sends its queries. res.source_port = 40000 Note that if you want to set a port you need root priviledges, as raw sockets will be used to generate packets. The class will then generate the exception ResolverPermissionError if you're not root. The default is 0, which means that the port will be chosen by the underlaying layers.
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-srcport--for-pr
# Commit to gitgit add lib/net/dns/resolver.rbgit commit -m "better docs for Net::DNS::Resolver#srcport="
# 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-srcport--for-pr
hub pull-request
# Celebrate!