Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@apilayer/userstack
Advanced tools
Userstack provides an API to Detect any Browser, Device & OS in Real-Time
Userstack provides an API to Detect any Browser, Device & OS in Real-Time
Using npm
npm install --save @apilayer/userstack
or yarn
yarn add @apilayer/userstack
Head over to Userstack and create an account. Copy access key from dashboard.
import userstack from '@apilayer/userstack'
const useHTTPs = false
const layer = new userstack("<your-access-key>", useHTTPs)
detect
detect
Look up any given User-Agent string.
Signature:
detect(ua: string): Promise<Response>
Example:
const response = layer.detect("Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36")
console.log('response:', response)
Response:
{
ua: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36",
type: "browser",
brand: "Apple",
name: "Mac",
url: "https://www.google.com/about/company/",
os: {
name: "macOS 10.14 Mojave",
code: "macos_10_14",
url: "https://en.wikipedia.org/wiki/MacOS_Mojave",
family: "macOS",
family_code: "macos",
family_vendor: "Apple Inc.",
icon: "https://assets.userstack.com/icons/os/macosx.png",
icon_large: "https://assets.userstack.com/icons/os/macosx_big.png"
},
device: {
is_mobile_device: false,
type: "desktop",
brand: "Apple",
brand_code: "apple",
brand_url: "http://www.apple.com/",
name: "Mac"
},
browser: {
name: "Chrome",
version: "71.0.3578.98",
version_major: "71",
engine: "WebKit/Blink"
},
crawler: {
is_crawler: false,
category: null,
last_seen: null
}
}
BulkDetect
BulkDetect
Look up multiple User-Agent strings in bulk.
Signature:
bulkDetect(ua_batch: string[]): Promise<Response[]>
Example:
const response = layer.bulkDetect([
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36",
])
console.log('response:', response)
Response:
[{
ua: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36",
type: "browser",
brand: "Apple",
name: "Mac",
url: "https://www.google.com/about/company/",
os: {
name: "macOS 10.14 Mojave",
code: "macos_10_14",
url: "https://en.wikipedia.org/wiki/MacOS_Mojave",
family: "macOS",
family_code: "macos",
family_vendor: "Apple Inc.",
icon: "https://assets.userstack.com/icons/os/macosx.png",
icon_large: "https://assets.userstack.com/icons/os/macosx_big.png"
},
device: {
is_mobile_device: false,
type: "desktop",
brand: "Apple",
brand_code: "apple",
brand_url: "http://www.apple.com/",
name: "Mac"
},
browser: {
name: "Chrome",
version: "71.0.3578.98",
version_major: "71",
engine: "WebKit/Blink"
},
crawler: {
is_crawler: false,
category: null,
last_seen: null
}
}]
FAQs
Userstack provides an API to Detect any Browser, Device & OS in Real-Time
The npm package @apilayer/userstack receives a total of 0 weekly downloads. As such, @apilayer/userstack popularity was classified as not popular.
We found that @apilayer/userstack demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.