How to extract web browser and OS information for Apache access log - agent

I have configured Apache log for give user agent info and i am getting following information,
Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.76 Safari/537.36
It mentioned Mozilla, Chrome and Safari as well along with Windows NT OS.
Can some one clarify me how extract specific Browser information and OS info is correct ?

You can use website stat generator programs, like webalizer or any other newer one.
You will see same browser stats:
You need to run webalizer daily.
I hope it helps.

Related

Azure AD authentication error AADSTS50005 on Linux

I'm using Chromium and FireFox browser on Linux. Out of blue my application started throwing Azure Active Directory Authentication error AADSTS50005.
Error definition AADSTS50005 states:
DevicePolicyError -User tried to log in to a device from a platform that's currently not supported through Conditional Access policy.*
The message is clear Linux platform is not supported. How to fix it?
Solution for this problem was to run Chromium in supported platform (iOS, Android, Mac or Windows) firefox Add-On
Chromium:
Execute below steps in Chromium browser.
Press F12 key.
Press Esc key.
Click Network conditions tab, and unchecked User browser default checkbox. Choose Chrome on supported by Azure AD platform e.g. Windows. Choose Chrome --Windows
FireFox:
Execute below steps in FireFox browser, or install User-Agent Switcher and Manager add-on.
Press Ctl+l, type about:config and click Accept the Risk and Continue button.
In search type general.useragent.override make sure String radio button is selected, next click Add button (plus icon).
From User Agent by OS list click OS that you want to emulate, e.g. Windows. and select agent that interests you the most. I chose Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36. Copy it, and paste it to general.useragent.override and click Save button.

Why chrome sends all agent names as part of user-agent header

Is there any reason why chrome browser (71 probably earlier version too) sends all browser names as part of its user agent parameter ?
This is what i see in the console. Is this expected, Will this affect the client information if the server wants to know/log the agent names ?
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36
They all have Mozilla in beginning of their Useragent because they follow standard mozilla rendering back in 2000 era. Most browsers share some of each other rendering engines, that's why their useragent often consist of similar values.
Browsers have came a long way to reach their current state. Current user-agents have to do with a little bit of browsers history. When there was a fight between Firefox and Internet Explorer, Chrome appeared. Some websites would ask Firefox users to switch to Internet Explorer for better rendering (because their website was old and not compatible with Firefox) and some would advice Internet Explorer users to switch to Firefox for modern rendering and better performance.
There was some forks of Firefox which also used similar user agent, "Gecko/####" which say this browser is using Gecko engine.
Websites check if a browser have "Gecko" in its user agent and decide to show modern design. Chrome is using Apple WebKit engine to render HTML, but in order to avoid those websites show recommendation for Internet Explorer, added "Like Gecko" to it's useragent.
Now that Chrome is top browser, have a look at Microsoft Edge 14: 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.14931
As Internet Explorer reputation got very bad, Microsoft could not use any user agent string that could make websites think Edge is Internet Explorer. therefor, by putting Chrome, Safari, AppleWebKit, "Like Gecko" is satisfy websites that are looking for this strings to avoid showing a message to switch to Chrome. Microsoft is using "AppleWebKit" in it's useragent even when they are not using AppleWebKit yet. (They will start using in next versions of Edge)

Detecting “Tablet/Touch Mode” in Edge using JavaScript on Windows 10?

This question was asked before, but the answers are not exactly what I need.
I need to distinguish in Microsoft Edge if it's a tablet or not (Desktop).
1) The following thread:
Can you detect "Tablet Mode" in Edge and IE11 using JavaScript on Windows 10?
worked indeed, but I'm afraid that in the next version Microsoft will change the behavior.
How can I be sure that they won't?
Answers with if condition of window.PointerEvent do not work at all, since it's defined in Desktop.
I can't use CSS Media Queries Interaction media features as suggested here:
Is there any way to detect if user has launched microsoft edge tablet or desktop browser?
Here are the hardware specific differences in the Edge browser capabilities:
The only differences are due to certain device-specific qualities – for example, codec support may be different on phones due to missing hardware acceleration, and Flash is not supported on Windows 10 Mobile. Because Windows 10 Mobile has a different background model, RTC (Real-Time Communications) APIs are also currently not supported. Finally, Windows 10 Mobile does not support Flash in order to provide a modern, touch-focused, and power-efficient experience appropriate for a mobile device. Because of this, Flash is not supported in Microsoft Edge in Continuum.
To detect RTC capabilities, use the following code:
if (RTCRtpCapabilities)
{
initRTC();
}
function initRTC()
{
var recvAudioCaps = RTCRtpReceiver.getCapabilities("audio");
var recvVideoCaps = RTCRtpReceiver.getCapabilities("video");
var sendAudioCaps = RTCRtpSender.getCapabilities("audio");
var sendVideoCaps = RTCRtpSender.getCapabilities("video");
}
Embedding a Flash movie which uses an ExternalInterface call would be the easiest way to detect Flash.
The properties of the navigator object should be able to distinguish tablet from phone. For example:
navigator.cpuClass
should return x86 for Surface devices, but other for phones.
Also, the user agent changes when casting a phone display to a TV. It goes from:
Microsoft Edge UA (Mobile)
Mozilla/5.0 (Windows Phone 10.0; Android 6.0.1; Microsoft; <Device>) AppleWebKit/<Rev (KHTML, like Gecko) Chrome/<Rev> Mobile Safari/<Rev> Edge/<Rev>
to:
Microsoft Edge UA (Continuum)
Mozilla/5.0 (Windows NT 10.0; ARM) AppleWebKit/<Rev> (KHTML, like Gecko) Chrome/<Rev> Safari/<Rev> Edge/<Rev>
compared to the desktop:
Microsoft Edge UA (Desktop)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/<Rev> (KHTML, like Gecko) Chrome/<Rev> Safari/<Rev> Edge/<Rev>
References
Microsoft Edge and Continuum: Your desktop browser on Mobile
Microsoft Edge Dev Guide: Object RTC API
ORTC Specification: dictionary RTCRtpCapabilities
Flash Player guidance for Internet Explorer 11 and Microsoft Edge
Minimum Hardware Requirements: Windows 10
Continuum for Phones FAQ
clientInformation object
Device Fingerprint Help
Security Error when trying to call ActionScript function from JS
The Windows 10 Browser Conundrum
how to tell if android user came from home screen app
Configuring Web Applications

iOS8 Simulator user agent

While investigating why I have a bug on iOS8 webview I discovered that WebView's User-Agent is:
Mozilla/5.0 (iPhone; CPU iPhone OS 10_9_5 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Mobile/12A365 (2072607680)
Whereas since I'm running for iOS8, it rather should be:
Mozilla/5.0 (iPhone; CPU iPhone OS 8_0_2 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Mobile/12A405kalturaNativeCordovaPlayer (350612576)
Of Course there's no iPhone running version 10.10 as yet, so Xcode6 is somehow picking up version from Mac OS X. For iOS < iOS8 simulators, it works just fine.
So do you have a solution for me how to discover if it's iOS8 simulator or not
For now this is my javascript method:
isIOS8 = function(){
return ( /OS 8_/.test( userAgent ) || /Version\/8/.test( userAgent ) ) && isIOS();
};
This issue was fixed in the iOS 8.3 Simulator Runtime. That version and newer versions do not suffer from this issue any more.
I suggest you look for the "iPhone OS" and "AppleWebKit/600.1.4" substrings if you really need to determine that you're running on iOS 8, but you should probably not be approaching the problem this way. Instead, you're probably better off making a determination based on capabilities rather than version numbers.

What is user agent string for "Internet Download Manager"?

Would you please let me know that what is user agent string for "Internet Download Manager"?
I want use it in .htaccess.
Just sniff it. With wireshark, for example. Or make apache to write User-Agent to log file.
Answer of mine to another question:
Blocking by user agent is not a good way to go since every decent download manager will send the request with a browser's user-agent header.
For example, IDM 6.06 (current version) send the following user agent for chrome:
Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.57 Safari/534.24
Then again for IE it uses:
Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; InfoPath.3)
Guess what IE sends without IDM:
Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; InfoPath.3)
Reason is that IDM captures information using a network driver, so basically it 'steals' the request from your web browser and sends the exact information it sends.
From the description on the product's web site, my strong guess is that this program adopts whatever host browser it works with, so it's likely not to have a user agent string of its own.
To make sure, you could do a download using this program, and then look into your log files for the User Agent string.
I did a check for IDM 6.18 and I found its user-agent string to be:
Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0)
Here's a snapshot to support the same.

Resources