
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
This library implements SNMP (the Simple Network Management Protocol). It is implemented in pure Ruby, so there are no dependencies on external libraries like net-snmp. You can run this library anywhere that Ruby can run.
This release supports the following:
See the SNMP::Manager, SNMP::TrapListener, and SNMP::MIB classes and the examples below for more details.
You can use RubyGems to install the latest version of the SNMP library.
gem install snmp
Retrieve a system description.
require 'snmp'
SNMP::Manager.open(:host => 'localhost') do |manager|
response = manager.get(["sysDescr.0", "sysName.0"])
response.each_varbind do |vb|
puts "#{vb.name.to_s} #{vb.value.to_s} #{vb.value.asn1_type}"
end
end
Create a varbind for setting the system name.
require 'snmp'
include SNMP
manager = Manager.new(:host => 'localhost')
varbind = VarBind.new("1.3.6.1.2.1.1.5.0", OctetString.new("My System Name"))
manager.set(varbind)
manager.close
Walk the ifTable.
require 'snmp'
ifTable_columns = ["ifIndex", "ifDescr", "ifInOctets", "ifOutOctets"]
SNMP::Manager.open(:host => 'localhost') do |manager|
manager.walk(ifTable_columns) do |row|
row.each { |vb| print "\t#{vb.value}" }
puts
end
end
A more difficult way to walk the ifTable.
require 'snmp'
include SNMP
Manager.open(:host => 'localhost') do |manager|
ifTable = ObjectId.new("1.3.6.1.2.1.2.2")
next_oid = ifTable
while next_oid.subtree_of?(ifTable)
response = manager.get_next(next_oid)
varbind = response.varbind_list.first
next_oid = varbind.name
puts varbind.to_s
end
end
Get interface description and admin status for 10 rows of the ifTable.
require 'snmp'
include SNMP
ifDescr_OID = ObjectId.new("1.3.6.1.2.1.2.2.1.2")
ifAdminStatus_OID = ObjectId.new("1.3.6.1.2.1.2.2.1.7")
MAX_ROWS = 10
Manager.open(:host => 'localhost') do |manager|
response = manager.get_bulk(0, MAX_ROWS, [ifDescr_OID, ifAdminStatus_OID])
list = response.varbind_list
until list.empty?
ifDescr = list.shift
ifAdminStatus = list.shift
puts "#{ifDescr.value} #{ifAdminStatus.value}"
end
end
Log traps to STDOUT.
require 'snmp'
require 'logger'
log = Logger.new(STDOUT)
m = SNMP::TrapListener.new do |manager|
manager.on_trap_default do |trap|
log.info trap.inspect
end
end
m.join
This SNMP Library is released under the terms of the MIT License.
FAQs
Unknown package
We found that snmp demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.