
Research
Malicious Go “crypto” Module Steals Passwords and Deploys Rekoobe Backdoor
An impersonated golang.org/x/crypto clone exfiltrates passwords, executes a remote shell stager, and delivers a Rekoobe backdoor on Linux.
mock-backend-rest
Advanced tools
#Fork and improve
npm install -SD mock-backend-rest
const FakeServer = require('mock-backend-rest');
const fakeServer = new FakeServer(8085);
fakeServer.port = 8085; //default port is 4000
fakeServer.get('/foo', './index.json'); //path to json file what will be response
fakeServer.post('/bar', {LOL: 'LOL'}); //
fakeServer.get('http://lol.com', { WEBLIUM_HTTP: 'WEBLIUM_HTTP' });
fakeServer.del('/foo', {LOL: 'LOL'});
fakeServer.put('/bar', {LOL: 'LOL'});
fakeServer.post('/xxx', { LOL: 'LOL' }, {error: 'SUPER CUSTOM ERROR'}, true, {a: 'a'});
fakeServer.start();
console.log(fakeServer.getGetResult('/foo'));
//output { called: false, callCount: 0, method: 'GET' }
//curl -d '{"key1":"value1", "key2":"value2"}' -H "Content-Type: application/json" -X POST http://localhost:8085/bar
//two times use curl and after
//curl -d '{"a": "a"}' -H "Content-Type: application/json" -X POST http://localhost:8085/xxx
//response will be {"LOL":"LOL"}
//curl -d '{"a": "1"}' -H "Content-Type: application/json" -X POST http://localhost:8085/xxx
//response will be {"error":"SUPER CUSTOM ERROR"}
//curl -d '{"a": "1"}' -H "Content-Type: application/json" -X POST http://localhost:8085/xxx
//response will be {"error":"SUPER CUSTOM ERROR"}
setTimeout(() => {
console.log(fakeServer.getPostResult('/bar'));
const callResult = fakeServer.getPostResult('/bar')
callResult.calledWithArg({key1:"value1", key2:"value2"}) // true
callResult.calledWithArg({key1:"value1"}) // false
fakeServer.stop();
fakeServer.restore();
}, 15000);
//{ calledArgs:
// [ { key1: 'value1', key2: 'value2' },
// { key1: 'value1', key2: 'value2' } ],
// called: true,
// callCount: 2,
// method: 'POST' }
| methods | args |
|---|---|
constructor(port, responseFormat) | port, any or number, default is 4000 , string 'text' or 'json' (default json) |
get(path, response, errorResponse, assertRequestBody, requestBody) | path: string example: '/foo'; response: object or string - path to json file or string response, three last args is optiona, if you want own response error errorResponse object, assertRequestBody bool if true your response body will be assert equal with last arg requestBody object |
post(path, response, errorResponse, assertRequestBody, requestBody) | path: string example: '/foo'; response: objector string - path to json file or string response, three last args is optiona, if you want own response error errorResponse object, assertRequestBody bool if true your response body will be assert equal with last arg requestBody object |
del(path, response, errorResponse, assertRequestBody, requestBody) | path: string example: '/foo'; response: object or string - path to json file or string response, three last args is optiona, if you want own response error errorResponse object, assertRequestBody bool if true your response body will be assert equal with last arg requestBody object |
put(path, response, errorResponse, assertRequestBody, requestBody) | path: string example: '/foo'; response: object or string - path to json file or string response, three last args is optiona, if you want own response error errorResponse object, assertRequestBody bool if true your response body will be assert equal with last arg requestBody object |
start() | any args |
getDelResult(path) | path: string example '/foo', if server dont have action for this path return empty obj |
getPutResult(path) | path: string example '/foo', if server dont have action for this path return empty obj |
getGetResult(path) | path: string example '/foo', if server dont have action for this path return empty obj |
getPostResult(path) | path: string example '/foo', if server dont have action for this path return empty obj |
stop() | any args, if server not started - will get message, after stop you can get actions results etc |
restore() | any args, server to initial conditions, if server runned it method stop it |
calledWithArg(arg) | called from result of action, arg object return true if you call this path with arg |
FAQs
simple pure node http server
We found that mock-backend-rest 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
An impersonated golang.org/x/crypto clone exfiltrates passwords, executes a remote shell stager, and delivers a Rekoobe backdoor on Linux.

Security News
npm rolls out a package release cooldown and scalable trusted publishing updates as ecosystem adoption of install safeguards grows.

Security News
AI agents are writing more code than ever, and that's creating new supply chain risks. Feross joins the Risky Business Podcast to break down what that means for open source security.