Convention Listings
                                                                                                                        About Us | Donate! | Contribute! | Report Problems
   
Raiden's Realm is always in need of good, community generated articles and content for our site. So if you have a Linux, Open Source or Media Freedom related article, review, tutorial, or editorial you want to contribute, by all means please submit it to admin@raiden.net. Your contributions are always appreciated and will help us out immensely. Thanks.
   
Howto: Faking User Agent with Wget (Page 1 of 1)

Written by Steve Lake
Posted on: Jan 27, 2010 at 12:49pm
Section: Tutorials
Printer Friendly Version
Legacy URL

A good portion of the Linux community who are familiar with the command line are also very familiar with a powerful tool known as Wget.  It's sort of an FTP/web download program for grabbing files off the web.  Combined with other programs like screen, it's invaluable for a wide number of things.  But I bet those of you who use it didn't know that you cold also use it to fake the user agent information, did you?  

Well, you can, and the trick is amazingly simple, and yet both hugely practical, and life saving in some cases.  Case in point, there's a couple sites I go to where I need to download some stuff, but the site prevents downloads, save with their own proprietary software, or a specific browser.  (Internet Explorer for example.)

A simple way around this is to use Wget's header information feature.  Browsers and many 3rd party programs use a system called "User Agent", which is little more than a simple, short text string sent by the program to identify itself to the server.  Case in point, this is the user agent string for apt-get (Ubuntu APT-HTTP/1.3) and this is the string for Firefox 3.5. (Mozilla/5.0 (X11; U; OpenBSD i386; en-US; rv:1.9.1) Gecko/20090702 Firefox/3.5)  (A good list of most known user agent strings is available here)

To activate the user agent string in wget, you will need to type "-U" followed by the user agent string encapsulated in quotes.  Here's an example using the Apple Quicktime 7.6.2 user agent (for those of you who like to download and watch Apple trailers):

wget -U "QuickTime/7.6.2 (qtver=7.6.2;os=Windows NT 5.1Service Pack 3)"

After that, you simply include the rest of your command line, such as file to be downloaded, and any other pertinent information.  It's surprising how few people actually know and use this trick.  But with more sites excluding browsing and/or downloading by "unapproved" browsers or download agents, the user agent string is becoming an important part of thwarting those efforts, while continuing to maintain your freedom to choose what method you use to download or surf with.

I hope this helps. And give it a try sometime on an otherwise difficult site.  You might be surprised at how useful it turns out to be.  
Discuss this!  ( 3 comments )

Raiden's Realm Social Bookmarking
If you have any problems with any of these links, please let us know.  Thanks.

Digg it! Slashdot It! Del.icio.us Add to StumbleUpon Add to Technorati Reddit! Add to Google Bookmarks Add to FaceBook Share Add to Twitter

Average vistor rating: (Waiting on 3 more votes.)

Community Image Gallery

More Images
Submit new images to gallery

Announcements

There are no current announcements.

How often do you change distros?

Daily
Weekly
Monthly
Every 3-6 months
Every 6-12 months
Yearly
Only when forced to
NEVER!
Uncertain
Whenever Balmer bashes Linux
When Simon Says
Let me ask my magic 8 ball

More Polls
Latest Releases
(courtesy of Distrowatch)

1. Kubuntu 10.10-beta
Released: 09/02
2. Ubuntu 10.10-beta
Released: 09/02
3. openSUSE 11.4-milestone1...
Released: 09/02
4. Tiny Core 3.1-rc3
Released: 09/02
5. Kongoni 1.12.3
Released: 09/02
6. Kiwi 10.08
Released: 09/01

More
All original content on this site is copyright of Raiden's Realm via the Creative Commons license. All rights reserved.

Any non original content is the sole property of the respective owners.