metasploit-framework
https://github.com/rapid7/metasploit-framework
Ruby
Metasploit Framework
SNMP::Manager#trap_v1
Sends an SNMPv1 style trap.
enterprise: The enterprise OID from the IANA assigned numbers
(http://www.iana.org/assignments/enterprise-numbers) as a String or
an ObjectId.
agent_addr: The IP address of the SNMP agent as a String or IpAddress.
generic_trap: The generic trap identifier. One of :coldStart,
:warmStart, :linkDown, :linkUp, :authenticationFailure,
:egpNeighborLoss, or :enterpriseSpecific
specific_trap: An integer representing the specific trap type for
an enterprise-specific trap.
timestamp: An integer respresenting the number of hundredths of
a second that this system has been up.
object_list: A list of additional varbinds to send with the trap.
For example:
Manager.open(:Version => :SNMPv1) do |snmp|
snmp.trap_v1(
"enterprises.9",
"10.1.2.3",
:enterpriseSpecific,
42,
12345,
[VarBind.new("1.3.6.1.2.3.4", Integer.new(1))])
endEdit
git clone [email protected]:rapid7/metasploit-framework.git
cd metasploit-framework
open lib/snmp/manager.rb
Contribute
# Make a new branchgit checkout -b -your-name--update-docs-SNMP--Manager-trap_v1-for-pr
# Commit to gitgit add lib/snmp/manager.rbgit commit -m "better docs for SNMP::Manager#trap_v1"
# Open pull requestgem install hub # on a mac you can `brew install hub`
hub fork
git push <your name> -your-name--update-docs-SNMP--Manager-trap_v1-for-pr
hub pull-request
# Celebrate!