
Research
/Security News
10 npm Typosquatted Packages Deploy Multi-Stage Credential Harvester
Socket researchers found 10 typosquatted npm packages that auto-run on install, show fake CAPTCHAs, fingerprint by IP, and deploy a credential stealer.
@zudoku/httpsnippet
Advanced tools
HTTP Request snippet generator for many languages & tools including:
cURL,HTTPie,Javascript,Node,C,Java,PHP,Objective-C,Swift,Python,Ruby,C#,Go,OCamland more!
Relies on the popular HAR format to import data and describe HTTP calls.
See it in action on ReadMe.
npm install --save @readme/httpsnippet
Required Type: object
The HAR request object to generate a snippet for.
import { HTTPSnippet } from '@readme/httpsnippet';
const snippet = new HTTPSnippet({
method: 'GET',
url: 'https://httpbin.org/anything',
});
Type: object
Available options:
harIsAlreadyEncoded (boolean): In the event of you supplying a source HAR that already contains escaped data (query and cookie parameters)strings, this allows you to disable automatic encoding of those parameters to prevent them from being double-escaped.Required Type: string
Name of conversion target
Type: object
Target options, see wiki for details
import { HTTPSnippet } from '@readme/httpsnippet';
const snippet = new HTTPSnippet({
method: 'GET',
url: 'https://httpbin.org/anything',
});
// generate Node.js: Native output
console.log(snippet.convert('node'));
// generate Node.js: Native output, indent with tabs
console.log(
snippet.convert('node', {
indent: '\t',
}),
);
Required Type: string
Name of conversion target
Type: string
Name of conversion target client library
Type: object
Target options, see wiki for details
import { HTTPSnippet } from '@readme/httpsnippet';
const snippet = new HTTPSnippet({
method: 'GET',
url: 'https://httpbin.org/anything',
});
// generate Shell: cURL output
console.log(
snippet.convert('shell', 'curl', {
indent: '\t',
}),
);
// generate Node.js: Unirest output
console.log(snippet.convert('node', 'unirest'));
Required Type: object
Representation of a conversion target. Can use this to use targets that are not officially supported.
import { customLanguageTarget } from 'httpsnippet-for-my-lang';
HTTPSnippet.addTarget(customLanguageTarget);
Required Type: string
Name of conversion target
Required Type: object
Representation of a conversion target client. Can use this to use target clients that are not officially supported.
import { customClient } from 'httpsnippet-for-my-node-http-client';
HTTPSnippet.addTargetClient('node', customClient);
Required Type: object
The client plugin to install.
addClientPlugin({
target: 'node',
client: {
info: {
key: 'custom',
title: 'Custom HTTP library',
link: 'https://example.com',
description: 'A custom HTTP library',
extname: '.custom',
},
convert: () => {
return 'This was generated from a custom client.';
},
},
});
The above example will create a new custom client snippet generator for the node target.
At the heart of this module is the HAR Format as the HTTP request description format, please review some of the sample JSON HAR Request objects in test fixtures, or read the HAR Docs for more details.
For detailed information on each target, please review the wiki.
kong/httpsnippetThere are some major differences between this library and the httpsnippet upstream:
HTTPSnippet export contains an options argument for an harIsAlreadyEncoded option for disabling escaping of cookies and query strings in URLs.
insecureSkipVerify option on go:native, node:native, ruby:native, and shell:curl as we don't want snippets generated for our users to bypass SSL certificate verification.#addClientPlugin, for quick installation of a target client.fetch
JSON.stringify(). We do this to keep those targets looking nicer with those kinds of payloads. This also applies to the JS fetch target as well.request
params argument due to complexities with query encoding.guzzle
require_once('vendor/autoload.php'); prefixed at the top.python3
requests
params argument due to complexities with query encoding.FAQs
HTTP Request snippet generator for *most* languages
The npm package @zudoku/httpsnippet receives a total of 2,704 weekly downloads. As such, @zudoku/httpsnippet popularity was classified as popular.
We found that @zudoku/httpsnippet demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 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
Socket researchers found 10 typosquatted npm packages that auto-run on install, show fake CAPTCHAs, fingerprint by IP, and deploy a credential stealer.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.