
Research
/Security News
npm Malware Campaign Uses Adspect Cloaking to Deliver Malicious Redirects
Malicious npm packages use Adspect cloaking and fake CAPTCHAs to fingerprint visitors and redirect victims to crypto-themed scam sites.
docker-exec-websocket-server
Advanced tools
## Purpose A server that serves the results of docker exec over websockets.
A server that serves the results of docker exec over websockets.
See docker-exec-websocket-client for a client that communicates with this server.
Server:
var DockerServer = require('../lib/server.js');
var dockerServer = new DockerServer({
port:8080, //automatically creates http server
//OR
server: //http.Serv object, can also be https, should already be listening
path: '/'+slugid.v4(), //Path to WebSocket
containerId: 'servertest', //Container to inject exec proccess into
dockerSocket: '/var/run/docker.sock' //location of docker remote API socket
maxSessions: 10 //maximum number of connected sessions
});
await dockerServer.execute();
By default, uses /var/run/docker.sock to communicate with Docker.
Messages are prepended with a single byte which contains information about the encoded message. The payload is a Buffer in node, or a UInt8Array in browserify.
// stream related message types (carries a payload)
stdin: 0,
stdout: 1,
stderr: 2,
// data-flow related message types (carries no payload)
resume: 100, // Process is now ready to receive data
pause: 101, // Process is processing current data, don't send more right now
// resolution related message types
stopped: 200, // Process exited, payload is single byte exit code
shutdown: 201, // Server shut down
error: 202 // Some internal error occurred, expect undefined behaviour
Ensure Docker is installed (docker -v).
To test locally:
yarn install to install the dependencies, including developer dependenciesyarn testDEBUG=* yarn test -f 'docker exec wc'To test with docker-compose, similar to CI:
docker-compose build --build-arg NODE_VERSION=16-bullseye, or change to the desired
Node.js image tagdocker-compose run --rm testdocker-compose build ... when the code changes or you want to try a different Node.js image.FAQs
## Purpose A server that serves the results of docker exec over websockets.
We found that docker-exec-websocket-server demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 9 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
Malicious npm packages use Adspect cloaking and fake CAPTCHAs to fingerprint visitors and redirect victims to crypto-themed scam sites.

Security News
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.

Security News
PyPI adds Trusted Publishing support for GitLab Self-Managed as adoption reaches 25% of uploads