another spoof domain

Spoof Domains
step by step..

(apply brakes here)

I was about to create a new spoof virtual domain for my LAN, and it occurred to me.. "I should write down the steps I take, save someone else doing it, save time".

So, here goes..

1: Create the fake host..

Every machine you wish to fool, needs to have host entry for your spoofy domain. Let's call this spoof domain "arc". The host file entry would simply be..

  192.168.1.100  arc

See here for details of how to add hosts to your particular machine.

I have one central hosts file that I import into all the different machines. I find this easier to maintain. A local DNS server is another option (or, as suggested by Druid; add the entry to your local nameserver's hosts file, if you have one).

Typing arc into any local browser will now point the it to the Apache server, which will completely ignore the request, until we..

2: Create a virtual host in apache config..

I keep mine in a vhosts.conf file, right next to the httpd.conf (I use an include statement to pull the directives in). The "arc" entry goes something like this..

	<VirtualHost *>
	  ServerName  arc
	  ServerAlias  arc.com arc.org
	  ServerAdmin  corz@corzoogle.com
	  DocumentRoot  "W:/tech/dev"
	  DirectoryIndex  index.html index.php
	  ServerSignature  Email
	</VirtualHost>
Note the aliases, (handy for testing rewrite rules and such). You can add as many aliases as you like, so long as you also create corresponding host entries for each (step 1). Also note, this entry is for a Windows® Apache server; I figured it was about time to do a Windows-orientated article. Really, only the DocumentRoot directive is different.

3: Restart apache..

Sadly I don't have the "corzweescriptpack" for windows, although I do have a righteous /unix subtree on my windows box! Aye, I mean emacs, tcsh, ls, tar, the works! That's right! I do ls to get directory listings on my peecee! Oh Joy of UNIX!

However, Apache for windows comes with a whole host of useful shortcuts, so restarting's a breeze; apache also installs as a system service, handy. On UNIX/Linux, your usual apachectl command will be fine. On Mac OS X, use corzweescriptpack! .. ra

We're done!

This is what we get typing arc into a web browser now..

fancy index of arc spoof domain

En-joy!

;o) corz.org

Welcome to the comments facility!


previous comments (four pages)   show all comments

Deikliw - 01.11.05 4:04 pm

Hi there
most impressed with your work on hacking the voyager 205. My issue is i want to view web space in my wwwroot folder (iis) from the Internet (through router) other than just being able to view this on an intranet basis (192.168.1.3/"foldername"/index.htm).

I have tried to follow your examples many times to no avail and feel I am getting confused to all the settings needed.

I am also aware you may recieve many requests on the things already covered in your tutorials but I can only ask. please help

Deikliw


corz - 02.11.05 9:41 am

Deikliw, it really depends what type of access you require. I know enough about IIs to avoid it, but I'll assume you mean regular filesystem access, these principles apply to any web server setup..

FTP. Why not setup an ftp server, put your www root folder into one of the accounts and login with a regular FTP client. Simple, robust, and if you use SFTP or similar, highly secure, too.

WebDAV. I'm fairly sure IIs can do webdav, Apache certainly can. WebDAV gives you a sort of filesystem access via the web server itself. Enabling webdav in your root has potential security issues, but I'll leave these for you to explore. All network access has potential security issues, of course.

Some other server. There are literally hundreds of different servers that will give you access to a filesystem over the internet. They don't have to be in any way connected to the webserver which just happens to also use the folder you want to access. Why not setup an SSH server?

Food for thought.

Whichever server you decide upon, it will probably need a port-forwarding rule setup on your router (though not WebDAV). If you have trouble with that, post a comment on the voyager page (after checking out the recipes, of course!)

;o)


Atul kumar Mishra - 28.04.06 8:42 am

plz send the all step of the DNS that how do create Domaim and etc.


corz - 28.04.06 5:15 pm

Isn't that THIS page? smiley for :eek:

;o)


bungle - 07.11.07 8:43 pm

ok pop quiz hot shot smiley for ;)

do u know how to do wild-cards in the hosts file (linux) for catching all sub-domains? so far I have had no luck finding the solution...

e.g. my host file is growing out of control:

127.0.0.1 sub1.domain.com sub2.domain.com sub3.domain.com (continued for a long time)

what i want to do is this:

127.0.0.1 *.domain.com

thing is - it don't work :(

now, yes - "why dont u just use one domain and folders within?" - well i need this for testing purposes. I have built a web app which gives users a subdomain when they sign-up... everytime i wanna test if the new sub domain works - yup, i have to edit my host file - which is a royal pain in the bottom

so - i could build a script to update it automagically - but surely there is a better way?

u have a really good informative site here so i hope u can shed some light - perhaps there is a nifty nix app which solves my problem?

may the force b with u - and keep up the good work smiley for :D

p.s. forgive me if u already have the solution on your site... if so, i suck lol


corz - 08.11.07 1:15 am

I'm always up for a pop quiz, bungle, let's do it..

do u know how to do wild-cards in the hosts file…?

No. Syat.

there is a better way?

Yes..

127.0.0.1 sub1.domain.com
127.0.0.1 sub2.domain.com
127.0.0.1 sub3.domain.com
etc.


At least now you can see what's going on. Much easier to run regex over it, too; make global changes, and so on.

As for manipulating this list in meaningful ways; on Linux, sed is your friend.

;o)

ps. you might also want to consider running BIND.


bungle - 08.11.07 8:49 am

nice one mate - one per line is better, i'll scope out BIND too - thanks for the quick response


SSG - 12.12.10 7:48 am

Great

smiley for :D



Magnar - 03.03.12 5:12 pm

Hi!
I'm trying to have more than one virtual domain, but I can't get it working!

Contents of hosts:
127.0.0.1       localhost
127.0.0.1       www.devdynaplan.com
127.0.0.1       www.devmyrtveitfoto.no

Contents in end of httpd.conf:
<VirtualHost *>
ServerName www.devdynaplan.com
DocumentRoot "C:\Users\Magnar\Prosjekt\Dynaplan\Nettside"
DirectoryIndex index.html index.php
</VirtualHost>

<VirtualHost *>
ServerName www.devmyrtveitfoto.no
DocumentRoot "C:\Users\Magnar\Prosjekt\Myrtveit foto\Nettside"
DirectoryIndex index.html index.php
</VirtualHost>

With this configurations, both www.devdynaplan.com and www.devmyrtveitfoto.no leads to the www.devdynaplan.com-site. If I change the order of them in httpd.conf, both of the urls leads to the www.devmyrtveitfoto.no-site. What am I doing wrong?

Thank you so much for your help and insight! smiley for :D

EDIT:
I found the solution through some googling, and posting it here in case anyone else needs it smiley for :)

Add this line to httpd.conf:
NameVirtualHost *

That's all! smiley for :D

Good catch. My current development configuration uses:
NameVirtualHost *:80
Listen 80

<VirtualHost *:80>
...
It's Ubuntu. Regardless, yes, you do need that somewhere. Thanks!

;o)



IamXPLiCiT - 25.12.12 12:18 pm

thanks, this really helped in combination with the host file on my linux server, now my game server should report locally and not to gamespy.


joli - 18.09.15 6:51 pm




First, confirm that you are human by entering the code you see..

(if you find the code difficult to decipher, click it for a new one!)


gd verification image

 

Welcome to corz.org!

I'm always messing around with the back-end.. See a bug? Wait a minute and try again. Still see a bug? Mail Me!