metasploit-framework
https://github.com/rapid7/metasploit-framework
Ruby
Metasploit Framework
Msf::Payload#substitute_vars
Substitutes variables with values from the module's datastore in the supplied raw buffer for a given set of named offsets. For instance, RHOST is substituted with the RHOST value from the datastore which will have been populated by the framework. Supported packing types: - ADDR (foo.com, 1.2.3.4) - ADDR6 (foo.com, fe80::1234:5678:8910:1234) - ADDR16MSB, ADD16LSB, ADDR22MSB, ADD22LSB (foo.com, 1.2.3.4) Advanced packing types for 16/16 and 22/10 bits substitution. The 16 bits types uses two offsets indicating where the 16 bits pair will be substituted, while the 22 bits types uses two offsets indicating the instructions where the 22/10 bits pair will be substituted. Normally these are offsets to "sethi" and "or" instructions on SPARC architecture. - HEX (0x12345678, "\x41\x42\x43\x44") - RAW (raw bytes)
Edit
git clone [email protected]:rapid7/metasploit-framework.git
cd metasploit-framework
open lib/msf/core/payload.rb
Contribute
# Make a new branchgit checkout -b -your-name--update-docs-Msf--Payload-substitute_vars-for-pr
# Commit to gitgit add lib/msf/core/payload.rbgit commit -m "better docs for Msf::Payload#substitute_vars"
# Open pull requestgem install hub # on a mac you can `brew install hub`
hub fork
git push <your name> -your-name--update-docs-Msf--Payload-substitute_vars-for-pr
hub pull-request
# Celebrate!