HakTip

Hosted by Darren Kitchen and Shannon Morse.

Whether you're a beginner or a pro, HakTip is essential viewing for current and aspiring hackers, computer enthusiasts, and IT professionals. With a how-to approach to all things Information Technology, HakTip breaks down the core concepts, tools, and techniques of Linux, Wireless Networks, Systems... Read More

Mirror Websites with HTTrack

Monday, September 12th, 2011 – running time 05:27

Download a copy of any website and host it locally with a one-line web server.

Today we're doing a little website mirroring and local web serving. Whether you're backing up a website, doing some prototyping or simple building a phishing site you'd be hard pressed to find an simpler mirroring tool than HTTrack.

Available for Windows, Mac and Linux this open source, multilingual mirroring tool sports multiple web targets, user selectable recursion levels, resume features and more. It'll even convert to 8.3 file naming incase you're still using DOS 6.22.

Getting started is simple. Begin by creating a directory to store the website mirror. I'll go ahead and mkdir websites in my home directory and move there. mkdir ~/websites and cd !$

Now with our directory make simple issue httrack. Once you get familiar with the tool you can automate the process with flags and such, but the straight forward interactive wizard is much appreciated.

We'll start by naming our project, then provide a directory to save the files and the URL of your website or websites separated by commas or spaces. Finally we'll choose how we'd like to download. I prefer option 2, mirroring the web site with the wizard.

Here we can specify if we're using a proxy, what filetypes we would like, and any additional options. Finally we're provided with a command line so that next time we can perform the same action without the prompts.

In my case the command would be httrack -W -O /path -%v

Hit Y for Yes and the process will complete in just a moment, or maybe longer depending on the size of the site and how recursive you want to get.

Finally we can see our finished work with ls. You'll notice HTTrack creates a a log and cache directory and all of the saved files will be found in your website directory.

Now in just a bit we're going to visit our newly mirrored website from our localhost with a very simple webserver, but first let's take a quick break.

With our site newly mirrored and the html files sitting happily in our directory we can actually browse to them with a webserver locally in one command. Yes, one command. How happy is that?

Issue python -m SimpleHTTPServer and a webserver will be spawned serving up your current working directory on port 8000. Now we can head over to our web browser and check out http://localhost:8000 to see our finished product.

Ok, so I want to hear your feedback. What apps do you use? Let me know what you think or what apps to check out by emailing me -- tips@hak5.org or send me a note in the comments below.

And be sure to check out our sister show, Hak5 for more great stuff just like this.


Midphase

Midphase is offering unlimited disk space & bandwidth with an exclusive discount for Hak5 viewers. Get free website builders, simple CMS installs, $100 in search engine credits from Google & Yahoo and 24 by 7 phone, chat and email support. Since 2003 Midphase has been providing simple, smart and reliable webhosting and if you visit midphase.com/hak5 they're ready to hook you up with 6 months free web hosting.

Connect with HakTip

About the Show

Details
Show Title:
HakTip
Description:
Whether you're a beginner or a pro, HakTip is essential viewing for current and aspiring hackers, computer enthusiasts, and IT professionals. With a how-to approach to all things Information Technology, HakTip breaks down the core concepts, tools, and techniques of Linux, Wireless Networks, Systems Administration, and more
Categories:
How-To & DIY, Technology & Gadgets
Launch Date:
May 23, 2011
Episodes: