
Research
/Security News
Toptal’s GitHub Organization Hijacked: 10 Malicious Packages Published
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
native-sync-request
Advanced tools
http-sync is a compiled Node.js extension that provides syncronous http calls.
You must have libcurl installed in order to compile this extension.
On Ubuntu, you can run: sudo apt-get install libcurl4-openssl-dev
On CentOS, you can run: sudo yum install libcurl libcurl-devel
// example with default options
httpSync = require('http-sync');
var request = httpSync.request({
method: 'GET',
headers: {},
body: '',
protocol: 'http',
host: '127.0.0.1',
port: 80, //443 if protocol = https
path: '/'
});
var timedout = false;
req.setTimeout(10, function() {
console.log("Request Timedout!");
timedout = true;
});
var response = request.end();
if (!timedout) {
console.log(response);
console.log(response.body.toString());
}
If you require the use of a private CA or client certificate authentication, the following options are available:
// example with a private CA and client cert authentication
httpSync = require('http-sync');
var request = httpSync.request({
method: 'GET',
headers: {},
body: '',
protocol: 'https',
host: '127.0.0.1',
port: 443, // protocol = https
path: '/',
ca: '/path/to/CA',
cert: '/path/to/crt',
key: '/path/to/key',
rejectUnauthorized: true
});
var timedout = false;
req.setTimeout(10, function() {
console.log("Request Timedout!");
timedout = true;
});
var response = request.end();
if (!timedout) {
console.log(response);
console.log(response.body.toString());
}
node-gyp configure && node-gyp build
You will need:
Building:
node-waf configure && node-waf build
Run the test.js file:
node test.js
FAQs
A synchronous HTTP Client library for node.js
The npm package native-sync-request receives a total of 1 weekly downloads. As such, native-sync-request popularity was classified as not popular.
We found that native-sync-request 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
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
Research
/Security News
Socket researchers investigate 4 malicious npm and PyPI packages with 56,000+ downloads that install surveillance malware.
Security News
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.