Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
@progresskinvey/tls-tunnel
Advanced tools
A Server and client for proxying local ports through public interfaces.
A Node.js client/server implementation of a secure tunnel over TLS/SSL. Useful for exposing local servers on public hosts. Initially implemented to expose a local server to browsers provided by BrowserStack to integrate their beta API with test scripts.
The idea is simple.
npm install tls-tunnel
To instantiate and start a server
var fs = require('fs');
var Server = require('tls-tunnel').Server;
var server = new Server({
port: 8080, // port to listen for client connections
key: fs.readFileSync('./keys/server-key.pem'), // server's private key
cert: fs.readFileSync('./keys/server-cert.pem'), // server's SSL certificate
ca: [fs.readFileSync('./keys/client-cert.pem')], // list of authorized client SSL certificates
forwardedPorts: {
start: 8081, // Start of port range to assign to connecting clients
count: 10 // maximum number of ports and hence clients that can be supported
}
});
server.start(function() {
// server should be listening on port 8080 now
server.stop(function() {
// server should have ended all connections and stopped
});
});
To instantiate and connect a client
var fs = require('fs');
var http = require('http');
var Client = require('tls-tunnel').Client;
var client = new Client({
tunnel: {
host: 'mytlstunnel.com', // the host where the server is running
port: 8080, // the port on which the server is running
key: fs.readFileSync('./keys/client-key.pem'), // client's private key
cert: fs.readFileSync('./keys/client-cert.pem'), // client's SSL certificate
ca: [fs.readFileSync('./keys/server-cert.pem')] // list of authorized server SSL certificates
},
target: {
host: 'localhost', // the target host to expose through the tunnel
port: 8000, // the target port to expose through the tunnel
},
timeout: 5000 // Timeout in milliseconds to use when waiting for a server to assign a public port (default is 2000)
});
client.connect(function(error, port) {
if (error) {
// errors could include not having enough ports available on
// the server to support another
} else {
// only if no errors were encountered will the <port> parameter
// contain the public port that was assigned for the tunnel
http.get('http://mytlstunnel.com:' + port, function(res) {
res.on('data', function() {
// should receive the response from localhost:8000 here
// (if it's listening of course)
});
res.on('end', function() {
client.disconnect(function() {
// client should have ended all connections
});
});
});
}
});
See the test/keys
folder for certificates used by the tests. These can be regenerated at anytime using either keys.sh
(OSX, Linux) or keys.bat
(Windows). These scripts use OpenSSL. OSX and Linux most likely already ship with OpenSSL. If using Windows you will need to install OpenSSL first.
It should be noted that for the client to authorize server certificates they need to have the correct hosts listed as altnames in the v3 extensions (although this doesn't seem to be required on Windows).
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using ./grunt.sh
or .\grunt.bat
.
(Nothing yet)
Copyright (c) 2016, Kinvey, Inc. All rights reserved.
This software is licensed to you under the Kinvey terms of service located at
http://www.kinvey.com/terms-of-use. By downloading, accessing and/or using this
software, you hereby accept such terms of service (and any agreement referenced
therein) and agree that you have read, understand and agree to be bound by such
terms of service and are of legal age to agree to such terms with Kinvey.
This software contains valuable confidential and proprietary information of
KINVEY, INC and is subject to applicable licensing agreements.
Unauthorized reproduction, transmission or distribution of this file and its
contents is a violation of applicable laws.
FAQs
A Server and client for proxying local ports through public interfaces.
The npm package @progresskinvey/tls-tunnel receives a total of 0 weekly downloads. As such, @progresskinvey/tls-tunnel popularity was classified as not popular.
We found that @progresskinvey/tls-tunnel demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 16 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
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.