Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
A simple Ruby wrapper for accessing network interface information
Add this line to your application's Gemfile:
gem 'network_interface'
And then execute:
$ bundle
Or install it yourself as:
$ gem install network_interface
require 'network_interface'
puts NetworkInterface.interfaces
puts NetworkInterface.addresses('eth0')
Compiling:
bundle install
bundle exec rake clean
bundle exec rake compile
Running the test suite, requires ifconfig
/ipconfig
to be installed:
bundle exec rspec
To debug with GDB:
asm("int3");
into the C code that you wish to have a breakpoint for:VALUE rb_cNetworkInterface;
void
Init_network_interface_ext()
{
asm("int3");
// ...
}
bundle exec rake compile
gdb run --args ruby -e '$LOAD_PATH.unshift(File.join(Dir.pwd, "lib")); require("network_interface"); puts NetworkInterface.interfaces'
(gdb) add-symbol-file ./lib/network_interface_ext.so
Reading symbols from ./lib/network_interface_ext.so...
(gdb) break Init_network_interface_ext
Breakpoint 1 at 0x1850: file ../../../../ext/network_interface_ext/netifaces.c, line 825.
(gdb) run
Starting program: /usr/bin/ruby -e \$LOAD_PATH.unshift\(File.join\(Dir.pwd,\ \"lib\"\)\)\;\ require\(\"network_interface\"\)\;\ puts\ NetworkInterface.interfaces
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Breakpoint 1.2, Init_network_interface_ext () at ../../../../ext/network_interface_ext/netifaces.c:825
825 rb_cNetworkInterface = rb_define_module("NetworkInterface");
(gdb)
To use a development build of this gem in another project, add this to the target project's Gemfile
:
gem 'network_interface', path: '../network_interface'
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that network_interface demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.