npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

uaad

v1.0.10

Published

User Agent Anomaly Detector

Downloads

3

Readme

User-Agent Anomaly Detection

This script will analyze a URL by loading all assets on the page with different user-agents showing differences in the response sizes and payloads delivered. This uses Chrome Headless + Puppeteer to mimick a real browser so we can see how a page would normally operate. This would then catch any other assets or api requests that get loaded after a page is ready.

Useful for finding suspicous assets located on a URL.

Install

$ npm install -g uaad

Usage

$ uaad -h
usage: uaad [-h] [-v] [-c URL] [-o FILE] target

User Agent Anomaly Detector

Positional arguments:
  target                Url with protocol. Ex: https://domain.com

Optional arguments:
  -h, --help            Show this help message and exit.
  -v, --version         Show program's version number and exit.
  -c URL, --capture URL
                        Catch only this asset on the target URL
  -o FILE, --output FILE
                        Output the JSON data structure to file instead of
                        showing anonmaly information

Example

Real life example showing some bad assets that included on a 'good' site.

Note the output shows the detected asset, the different user-agents that loaded those assets, along with the response size.

$ uaad hXXp://nsfwyoutube[.]com

-------------------------------
⚠️ User-Agent Anomaly Detected: http://aptantasp.site/fWyB1y7INFwnUPH2z/17740

 * Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/79.0.3945.0 Safari/537.36 => 5
 * Mozilla/5.0 (Linux; U; Android 4.4.2; en-us; SCH-I535 Build/KOT49H) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30 => 146112
 * Mozilla/5.0 (Linux; Android 9; SM-G955U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.93 Mobile Safari/537.36 => 145818
 * Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.79 Safari/537.36 Edge/14.14393 => 5
 * Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US) => 5
 * Mozilla/5.0 (compatible, MSIE 11, Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko => 5
 * Mozilla/5.0 (iPad; CPU OS 8_4_1 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12H321 Safari/600.1.4 => 145713
 * Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_1 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) Version/10.0 Mobile/14E304 Safari/602.1 => 145980
 * Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html) => 0
 * Mozilla/5.0 (Linux; Android 7.0; HTC 10 Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.83 Mobile Safari/537.36 => 145790
 * curl/7.35.0 => 5
 * Wget/1.15 (linux-gnu) => 5
-------------------------------
⚠️ User-Agent Anomaly Detected: http://beiven.pw/tKXtIIyGjuIpQ/14956

 * Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/79.0.3945.0 Safari/537.36 => 5
 * Mozilla/5.0 (Linux; U; Android 4.4.2; en-us; SCH-I535 Build/KOT49H) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30 => 136138
 * Mozilla/5.0 (Linux; Android 9; SM-G955U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.93 Mobile Safari/537.36 => 135967
 * Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.79 Safari/537.36 Edge/14.14393 => 5
 * Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US) => 5
 * Mozilla/5.0 (compatible, MSIE 11, Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko => 5
 * Mozilla/5.0 (iPad; CPU OS 8_4_1 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12H321 Safari/600.1.4 => 135994
 * Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_1 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) Version/10.0 Mobile/14E304 Safari/602.1 => 129418
 * Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html) => 0
 * Mozilla/5.0 (Linux; Android 7.0; HTC 10 Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.83 Mobile Safari/537.36 => 135626
 * curl/7.35.0 => 5
 * Wget/1.15 (linux-gnu) => 5

From this real life example we notice 2 suspicious anomalies. From the first anomaly we can see that the response size for real/mobile browsers is around 145k where as cURL/wget/google bot user-agents we get a very small response. What are they trying to hide from those user-agents?