LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-05-2022, 06:33 PM   #1
JASlinux
Member
 
Registered: Oct 2020
Posts: 385

Rep: Reputation: Disabled
Question How is a custom user agent overridden?


Brave is stuck in my user agent when it's not visible is the string.

The browser is Brave, but how does it stick in the middle when it's not present in the custom string?
 
Old 02-05-2022, 07:52 PM   #2
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,380
Blog Entries: 28

Rep: Reputation: 6163Reputation: 6163Reputation: 6163Reputation: 6163Reputation: 6163Reputation: 6163Reputation: 6163Reputation: 6163Reputation: 6163Reputation: 6163Reputation: 6163
It might help to know just how you created your custom user agent. In Firefox, I use an add-on called "User Agent Switcher and Manager" which generally has worked very nicely for me.
 
Old 02-06-2022, 03:57 AM   #3
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
The custom user agent already is the "override".

That said, OP had a previous thread that shows they're a bit hazy on what a user agent actually is, and I got the impression they weren't convinced at the end of it:
https://www.linuxquestions.org/quest...el-4175705017/
 
1 members found this post helpful.
Old 02-06-2022, 06:16 AM   #4
JASlinux
Member
 
Registered: Oct 2020
Posts: 385

Original Poster
Rep: Reputation: Disabled
Question

2 points:

Chromium-based browsers have a builtin developer feature for changing agents. I would not expect a Firefox extension to have a different result, however it might be worth a try. Still, if it worked differently than the developer tool, we'd need a Chromium equivalent.

The missing public knowledge is the esoteric means of populating the agent.

My old post ondoho brings up was on Android. In that case, the phone model is included in the string. How? In this desktop case, it's "Brave" in spite of an overridden string. How?
 
Old 02-06-2022, 10:26 AM   #5
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,750

Rep: Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983
Quote:
Originally Posted by JASlinux View Post
2 points:
Chromium-based browsers have a builtin developer feature for changing agents. I would not expect a Firefox extension to have a different result, however it might be worth a try. Still, if it worked differently than the developer tool, we'd need a Chromium equivalent.

The missing public knowledge is the esoteric means of populating the agent.

My old post ondoho brings up was on Android. In that case, the phone model is included in the string. How? In this desktop case, it's "Brave" in spite of an overridden string. How?
Sorry, there's no 'missing public knowledge' about how browser agents work, or how they're populated/read. Open the source code for any browser and you can find it. Read the docs on any browser too:
https://developer.mozilla.org/en-US/...ers/User-Agent
https://github.com/brave/brave-browser

If this is 'missing public knowledge', how exactly do you think many programmers write user-agent switching plugins, without actually knowing how these things work?? Many of your threads seem to trend towards paranoia and supposedly 'hidden knowledge', and when you receive answers that don't match what you think, it's not good:
https://www.linuxquestions.org/quest...ata-4175705618
https://www.linuxquestions.org/quest...ux-4175705546/
https://www.linuxquestions.org/quest...ze-4175705961/
https://www.linuxquestions.org/quest...am-4175705451/
 
1 members found this post helpful.
Old 02-06-2022, 04:08 PM   #6
JASlinux
Member
 
Registered: Oct 2020
Posts: 385

Original Poster
Rep: Reputation: Disabled
Lightbulb

New discrepancy: Different sources report different user agents.

The site that knows I'm using Brave despite my agent string is duckduckgo.com.

whatismybrowser.com thinks I'm using Chrome with no mention of Brave:

whatmyuseragent.com
whatsmyua.info
webbrowsertools.com/useragent
google.com

same (Google!)

Duckduckgo knows something the others do not, or are not reporting in the user agent string.
 
Old 02-06-2022, 11:02 PM   #7
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Quote:
Originally Posted by JASlinux View Post
The site that knows I'm using Brave despite my agent string is duckduckgo.com.
What are you seeing that makes you think that duckduckgo.com "knows" you are using Brave?

Evo2.
 
Old 02-07-2022, 02:19 AM   #8
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Cookies and javascript are a much bigger "problem" than UA strings.
Disable both, see what happens then.
 
1 members found this post helpful.
Old 02-08-2022, 05:49 PM   #9
JASlinux
Member
 
Registered: Oct 2020
Posts: 385

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by evo2 View Post
What are you seeing that makes you think that duckduckgo.com "knows" you are using Brave?

Evo2.
I am on a 32-bit machine not supported by Brave at-the-moment, but when I am back on 64-bit I will post a graphic.

If you type "What is my user agent?" duckduckgo.com will display your string without a need for links (like "weather" on Google, etc.). Not sure what that is called, but there are a lot of search questions answered by the engine itself.

Duckduckgo yesterday knew I was using Brave despite my string.
 
Old 02-08-2022, 05:54 PM   #10
JASlinux
Member
 
Registered: Oct 2020
Posts: 385

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by ondoho View Post
Cookies and javascript are a much bigger "problem" than UA strings.
Disable both, see what happens then.
I agree on threats, but my question isn't for Two Wrongs or a Red Herring.

I just want to know why duckduckgo.com displays information not reported elsewhere.

Unfortunately most of the Internet does not work without cookies and Javascript.

Please don't feel obligated to address issues not of interest.

Go after the terror of cookies and Javascript!
 
Old 02-08-2022, 06:24 PM   #11
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Hi,
Quote:
Originally Posted by JASlinux View Post
I am on a 32-bit machine not supported by Brave at-the-moment, but when I am back on 64-bit I will post a graphic.

If you type "What is my user agent?" duckduckgo.com will display your string without a need for links (like "weather" on Google, etc.). Not sure what that is called, but there are a lot of search questions answered by the engine itself.
Sounds like you messed up your browser settings. When I do what you describe above, duckduckgo.com regurgitates whatever user agent string I send it.

Evo2.
 
Old 02-08-2022, 07:29 PM   #12
enigma9o7
Senior Member
 
Registered: Jul 2018
Location: Silicon Valley
Distribution: Bodhi Linux
Posts: 1,400

Rep: Reputation: 561Reputation: 561Reputation: 561Reputation: 561Reputation: 561Reputation: 561
There is lots of info can be determined besides useragent. I personally think the eff's page does a good job of showing what sites can know:

https://coveryourtracks.eff.org/

If your user agent isn't showing brave, but duckduckgo knows you're using brave, its probably something from what is shown there, or a best guess based on what it can determine.
 
1 members found this post helpful.
Old 02-09-2022, 09:18 AM   #13
boughtonp
Senior Member
 
Registered: Feb 2007
Location: UK
Distribution: Debian
Posts: 3,627

Rep: Reputation: 2556Reputation: 2556Reputation: 2556Reputation: 2556Reputation: 2556Reputation: 2556Reputation: 2556Reputation: 2556Reputation: 2556Reputation: 2556Reputation: 2556
Quote:
Originally Posted by JASlinux View Post
If you type "What is my user agent?" duckduckgo.com will display your string without a need for links
With JS enabled, DuckDuckGo - quite clearly - outputs the value of the HTTP User-Agent request header, along with other headers.

For the non-JS version, it doesn't list the other headers, but still provably outputs the HTTP User-Agent request header:

Code:
$ curl 'https://duckduckgo.com/?q=what+is+my+user+agent' -isS -A 'potato' | grep -o 'Your user agent:[^<]*'
Your user agent: potato

$ curl 'https://html.duckduckgo.com/html?q=what+is+my+user+agent' -isS -A 'tomato' | grep -o 'Your user agent:[^<]*'
Your user agent: tomato

To understand how websites can get information not sent via HTTP headers, press F12 and examine the output of "console.dir(navigator)" then read the documentation of those properties.

 
1 members found this post helpful.
Old 02-09-2022, 09:55 AM   #14
teckk
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,152
Blog Entries: 6

Rep: Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835
@JASlinux
If you want to see the header that your web browser or script is reporting...

Open a terminal and enter
Code:
ncat -klp 8000 -v
#or
netcat -l -p 8000 -v
Then http://127.0.0.1:8000 in your web browser or script. The header/user agent that it reports will be in the terminal. You can change use agents in your browser and reload as many times as you wish.
And that will be exactly what your browser is sending.
 
Old 02-09-2022, 10:01 AM   #15
teckk
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,152
Blog Entries: 6

Rep: Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835
You could also do that with

First terminal
netcat -l -p 8100 -v

Second terminal
curl -H'xxx' http://127.0.0.1:8100

etc

Edit:
or

netcat -l -p 8100 -v

Code:
agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:95.0) Gecko/20100101 Firefox/95.0"

curl -A "$agent" -H'xxx' http://127.0.0.1:8100

Last edited by teckk; 02-09-2022 at 10:04 AM.
 
  


Reply

Tags
brave, browsers, customization, user agent



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
bash: all --user-agent for "wget --user-agent " frenchn00b Programming 1 07-07-2009 05:25 AM
Properties in kdmrc being overridden. suhaib Ubuntu 4 01-12-2008 05:12 PM
dual eth port settings being overridden? ltgreen Linux - Networking 1 02-27-2007 05:01 PM
why do settings in /etc/profile.d/lang.sh get overridden? echowarpt Slackware 3 02-19-2007 08:13 PM
Hostnames Being Overridden RWild Linux - Networking 0 12-16-2002 09:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:10 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration