EG Information

Main Index
EG Manual
Disclaimer
Legal Information
Hall of Fame
Hall of Shame
Member Rankings
Members List
Meet the Staff

Training Missions

Read Me First New
Basic Skills
Realistic Scenarios
Cryptography
Software Cracking
Linux ELF Binary Cracking
Logical Thinking
Programming
Captcha Cracking New
Patching
Steganography
Deface This Wall
/dev/null
/dev/urandom
/dev/extra New

Knowledge Bank

Discussion Forums
Enigma Chat New
RSS Feeds RSS
Articles / Tutorials
Videos
Online EG MP3 Player Radio
Enigma Zine
Downloads
Tools New

Code Resources

Submit Code
Ajax
ASM
Bash
C
CPP
Csharp
Delphi
Haskell
Java
Javascript
Jython
Lisp
mIRC
MySQL
Perl
PHP
Python
QBASIC
VisualBasic

Hakipedia: An open collaborative for all your information security needs.

The Urinal

Click Here To Vote For EG!

Has Enigma Group Helped You? Then Help Us By Advertising For Us. Place One Of The Following Images On Your Site.

enigma group

enigma group

enigma group

enigma group

Enigma Group's Articles


The Hosts File - Submitted By: Xero 2008-08-19 11:55:54
WHAT IS THE HOSTS FILE?

The hosts file is your computer's first resort when it needs to translate a hostname into an IP address. An example of a hostname would be www.EnigmaGroup.org. The IP address that this hostname typically resolves to would be 72.232.251.174. We have hostnames so that we don't have to remember difficult strings of numbers (IP addresses). However, computers need to use this IP addresses to connect to each other. (IP addresses for hostnames can be obtained by 'ping'ing the hostname in your command prompt.)

When you type www.EnigmaGroup.org into your browser, your computer first consults your hosts file to see if you have designated an IP address to go with that name. Most likely, none of us have designated a custom IP address to match with the hostname www.EnigmaGroup.org. In this case, your computer doesn't know what "www.EnigmaGroup.org" means, so it goes to your Internet Service Provider, or ISP, and asks your ISP for the IP address of the hostname.

If you haven't guessed it yet, the hosts file is what matches the hostname "localhost" to the loopback IP address of "127.0.0.1."



WHERE IS THE HOSTS FILE?

On Windows your hosts file is located in C:\WINDOWS\system32\drivers\etc. (I believe the hosts file is in /etc for *nix machines, but I don't know for sure). When you view this folder, you'll see several files with no extensions (minus the .sam file). Look for the file named "hosts" and open it with Notepad to view it. You should see a brief explanation of the hosts file. After that, you'll see the first (and perhaps only) hosts file entry of "127.0.0.1localhost".



HOW DO I ADD AN ENTRY?

Adding a new entry to the hosts file is simple. You just need to make sure you're on a new line, and type the IP address [tab] hostname. Now whenever somebody enters that hostname in the browser on your computer, instead of going to the actual website, they will be redirected to the site with the IP address you entered.



WHAT GOOD IS THIS?

Get creative! Imagine you catch your computer continuously connecting to, for example, ads.server.com and it is causing annoying popups. A quick treatment would be to use your hosts file to redirect ads.server.com to your own machine (127.0.0.1). Now, anytime your computer attempts to connect to the ads server, it will attempt to connect to itself. The connection will time out and fail... no more popups!
Maybe you're more of the malicious type... set up a webserver on your home computer. On this, create a mock MySpace or Yahoo! webpage that logs a user's information (phishing). Now go to your local library, school, work, wherever! Edit their hosts file to connect to your home IP address when www.myspace.com is entered.

LIKE THIS:
your.ip.add.resswww.myspace.com



ONE FALLBACK

One fallback of using the hosts file is that, it can be bypassed if your victim types in http:// before the hostname. www.enigmagroup.org will consult the hosts file first, whereas http://www.enigmagroup.org will go straight to your ISP. But seriously, how many people always type http://?


The possibilities are endless with this. You just have to try new things!

Return to Misc category list

 

Who's Online

418 Guests, 95 Users
blink_212, klesco, vapour, Ausome1, _InSane_, hemiptera, LordHelmet, BnE, N4g4c3N, chrbarrol, ThaKeeper, dark_void, th3punish3r, locust, c0re, iwanlearn, Anderl, ghostraider100, Ghostrider, eliking510, harsha2hack, NotMyOwn, Calumoo, MajorDeath, Rex_Mundi, sabre725, bhoang93, r!v3rTw!ggz, jarlskov, invas10n, snozzberries, Nusquam-Redono-Sapientia, data, zeth, psychomarine, yuka, DnA-Ender, 454447415244, Ultraminor, T-Metal, antibubbles, raven001, aVoid, Psiber_Syn, sirEgghead, Protagoras, niggletandco, Vahakn, Chaplin, BinaryShinigami, zoegeorgica, hacker807, Red_beard, eviscerator, TheFender, InjectioN, totalnoob, Posix, obrigadoo, cul8er, Mcasdf, teehee, Ops, Protest123, Blizer, gabel, Marian, Edika, zofy, Nasrudin, dochaley, TheRetech, j0sh, kcaz, cool.nik, Sand, SaMTHG, fawk3s, rajabaja, avalor, hettoo, mat_2010, barbseven, daandeveloper33, tommy1092, Likantrop7, sajan619, Knuppel, Distorted, Bloodmaster25, buffer, apablo, d0cketts, Y34RZ3R0, freakazoid