Convention Listings
                                                                                                                        About Us | Donate! | Contribute! | Report Problems
Howto: Faking User Agent with Wget (Page 1 of 1)

Written by Steve Lake
Posted on: Jan 27, 2010 at 07:49am
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

Shows and Cons Latest Additions

 1.  Solutions Linux Expo 2010
 2.  FOSDEM 2011
 3.  Linux Symposium 2010
 4.  Linux-Kongress 2010
 5.  OpenSource World 2010
More

Announcements

There are no current announcements.

How much danger do you feel FOSS/Linux is in right now?

We're invincible, baby!
Not much
Uncertain
A little
We're doomed!
Other

More Polls
Latest Releases
(courtesy of Distrowatch)

1. trixbox 2.8.0.4
Released: 03/10
2. Xange 2010 (x86_64)
Released: 03/10
3. VortexBox 1.2
Released: 03/10
4. GParted 0.5.2-1
Released: 03/10
5. Unity 2010-rc1
Released: 03/10
6. GeeXboX 2.0-alpha2
Released: 03/09

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.