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.
Transparent SOCKS v4 and SOCKS v5 support for TCPSocket
Seamlessly route all TCP traffic for you application through a SOCKS v4 or v5 server with nearly zero effort. Once require
'd and configured all traffic leveraging the TCPSocket
class will route via your configured SOCKS server.
This is especially useful for many cases; here are a couple:
Add this line to your application's Gemfile:
gem 'sockit'
And then execute:
$ bundle
Or install it yourself as:
$ gem install sockit
Then run the pry console to play with it:
$ bundle exec sockit
By loading the gem TCPSocket will get monkey patched adding seamless transparent SOCKS proxy support. I favor using SS5 for a SOCKS server, so at this point I'm uncertain of absolute compatibility with other SOCKS servers. I'm following the RFC here; so if (insert other SOCKS server flavor here) follows the RFC everything is in theory compatible.
You can configure on the singleton class or an instance of the class. The SOCKS configuration is stored in a class variable; so it is shared across all TCPSocket instances and the singleton, thus changing the configuration in one instance will also affect all other instances. The configuration is stored in an OpenStruct; you can reference socks
with a block as shown, where the configuration OpenStruct is yielded to the block; or without in which case the configuration OpenStruct itself is returned.
The defaults are as follows:
Sockit.config do |config|
config.version = 5
config.ignore = ["127.0.0.1"]
config.debug = false
end
Specify your SOCKS server and port:
Sockit.config do |config|
config.host = "127.0.0.1"
config.port = "1080"
end
If you want to use username/password authentication:
Sockit.config do |config|
config.username = "username"
config.password = "password"
end
Turn on debug output:
Sockit.config do |config|
config.debug = true
end
Ignore some more hosts:
Sockit.config do |config|
config.ignore << "192.168.0.1"
end
Once configured you can simply do something along these lines:
socket = TCPSocket.new('github.com', '22')
data = socket.gets
puts data.inspect
And everything will be magically routed via your configured SOCKS server.
I use SS5 for my SOCKS servers. It works well and is easy to configure. It is also the server which the specs run against on Travis CI. You can see how it is compiled, configured and started as well as more the the Travis before_install
script, https://github.com/zpatten/sockit/blob/master/spec/support/before_install.sh
I await your pull request.
IRC:
Documentation:
Source:
Issues:
SOCKIT - Transparent SOCKS 5 support for TCPSocket
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
FAQs
Unknown package
We found that sockit demonstrated a not healthy version release cadence and project activity because the last version was released 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.
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.