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.

Source | Google | Stack overflow

Edit

git clone [email protected]:rapid7/metasploit-framework.git

cd metasploit-framework

open lib/net/dns/resolver.rb

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-Net--DNS--Resolver-srcport--for-pr


# Commit to git

git add lib/net/dns/resolver.rbgit commit -m "better docs for Net::DNS::Resolver#srcport="


# Open pull request

gem 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!