Tunnel Everything through SSH

n this Tutorial I'll cover how you can tunnel any TCP traffic through an encrypted SSH connection or a SOCKS server, even if a certain program doesn't support proxying of connections natively.

The only requirement for SSH tunneling to work is a shell account on a machine connected to the internet (and, optionally, a HTTP Proxy server). I will refer to this account as your server (it doesn't matter if you may not become root).
Tunneling HTTP

In case you just want to tunnel HTTP traffic (to surf safely, to let the request appear to originate from a different IP and/or to not disclose HTTP clear text passwords to your LAN) best practise is to set up Privoxy on your server. By default, Privoxy binds to 127.0.0.1:8118 (thus only allowing connections from localhost), which is good for us. No configuration must be done for this.

The next step is to establish a tunnel from your computer to your server's Privoxy. That is done with the following SSH command:

ssh -NL 8118:localhost:8118 user@server

This command opens a tunnel on your computer: All connections to port 8118 will be forwarded (encrypted, of course) over the SSH connection and come out at your server's port 8118 (where Privoxy is running).

Once you have established the connection you will want to edit your browser's proxy settings accordingly. Just set the HTTP (and, with some browsers, the HTTPS) proxy to localhost, port 8118.
Advantages

The great advantage over SOCKS tunneling (see below) is, that even the DNS requests are made from your server. No-one on your LAN can gather information on what kind of site you're surfing. Another advantage is that Privoxy already filters out some advertisements and removes sensitive headers from your requests.
Tunneling Arbitrary Protocols (Dynamic Forward/SOCKS)

If you want to tunnel not just HTTP traffic but arbitrary other TCP protocols as well, a HTTP Proxy isn't adequate any more. Instead, you'll have to set up a SOCKS proxy. That also is possible with SSH:
Setting up the SSH proxy

Setting up the SSH SOCKS proxy is really easy. On your computer, just enter the following command:

ssh -ND 3333 user@server

That command establishes a connection to your server, logs in as user user (you'll have to enter your password though, of course) and then starts a little SOCKS proxy on your server.

On your computer, all connections to port 3333 will be forwarded over the secure SSH channel and will then be forwarded by the proxy to their destination.

Now you'll have to configure the program you want to connect through that tunnel to use localhost, port 3333 as it's SOCKS server (if you have the choice, select SOCKS version 5).

Not many programs support SOCKS proxy forwarding natively (hardly any CLI programs). But there is a workaround for that: tsocks. It enables arbitrary programs which don't support the SOCKS protocol natively to establish connections via a SOCKS server.
How tsocks works

On your computer, install the tsocks program.

I won't go into detail about how this program works, but it basically does the following:

* Before the actual program is loaded tsocks loads its own shared library.
* This library overwrites the kernel's connect() function and replaces it with its own.
* Whenever the program tries to send a request the request is forwarded through your proxy server (and then over the secure tunnel).

All this is done through setting the environment variable LD_PRELOAD to /usr/lib/libtsocks.so.

The tsocks program itself is just a simple shell wrapper script. All the actual redirecting stuff is done via the library.
Editing the /etc/tsocks.conf

Now you'll have to edit the file /etc/tsocks.conf to relay all connections through your proxy. Open the file and delete all lines. Then enter just the following two lines:

server = 127.0.0.1
server_port = 3333

If you may not become root ...

... just enter the two lines from above into a file called .tsocks.conf and place it in your home directory. Then, write a little shell script:

#!/bin/sh

TSOCKS_CONF_FILE=$HOME/.tsocks.conf
export TSOCKS_CONF_FILE
exec tsocks "$@"

I call this script viaservername. Place this script in a directory contained in your $PATH and make it executable.
Tunneling Connections

For programs who natively support proxying connections (e.g. Mozilla Firefox) you can now set the proxy address to localhost port 3333. I don't recommend to do that for browsers; instead, use HTTP tunneling (see above).

All other programs which's connections you want to tunnel through your server are prefixed with tsocks. This would look like some of the following program calls (if you wrote a shell script, use that instead of tsocks):

tsocks dog http://www.google.com
tsocks netcat example.com 80
tsocks irssi -c irc.freenode.net -p 6667

If you call tsocks without parameters it executes a shell witht the LD_PRELOAD environment variable already set and exported. That means that every program called from this shell will be redirected through the external server and every subsehll started from this shell will also have the LD_PRELOAD variable set. So if you started tsocks directly after logging in all your traffic would be redirected through your external server.
Example

$ cat =myip
#!/bin/sh
lynx -dump http://tnx.nl/ip

$ ssh -fND 3333 xxx@feh # -f: goes to background after prompting for password
xxx@feh.name's password:

$ IP=`myip`; host $IP
Name: p54XXXX8B.dip.t-dialin.net
Address: 84.143.XXX.XXX

$ IP=`tsocks myip`; host $IP
16:15:23 libtsocks(26802): Call to connect received on completed request 3
Name: feh.name
Address: 217.160.108.109

Have fun!

reference: http://www.plenz.com/tunnel-everything

Making your Home Computer / Dedicated Computer your own Web Server!!!

In this tutorial we will learn how to make your personal web server from a Home Computer or a Dedicated Computer using Windows 2000, Windows XP and Windows 2003. In the end we will have asp and php extensions installed. Also have a very commonly used program called mysql (Database Management) Lets get started!

1. Installing Internet Information Services (IIS)
Note: Have your Windows XP or Windows 2000 CD Inside the CD-Rom Drive. That way it just installs the software with out asking you to place it in.

Start > Settings > Control Panel > Add & Remove Programs
A window is going to pop-up, on the left hand side a button titled "Add/Remove Windows Components"
Another window should pop-up and look something like this:



Next to Application Server (Windows 2003) or Internet Information Services ( Windows XP)
Click so the check mark is showing. (Advanced Installation) Click on detail and select any other software you might want to use later on.
Now click Next and the installation should start.
Once IIS is installed on your machine you can view your home page in a web browser by typing http://localhost
You can also change localhost for the name of your computer or if a dedicated computer use IP address into the address bar of your web browser.



Note: Your default web directory to place your web site in is CInetpub\wwwroot (Place your website files there)

2. Installing PHP & Configuring
Note: Find the latest PHP-Installer at http://www.php.net/downloads I used PHP 5.0.3 installer [2,267Kb]
Note: First check what IIS# you have installed by going: Start > Settings > Administrative Tools > Internet Information Services (IIS) Manager



On the top right under "Version" Remember that! you will need it when installing php!

Now run the executable installer a pop-up window should come up:



Note: Windows 2003 IIS6, Windows XP IIS5.1, Windows 2000 Unknown
Browse to your desired directory ( I suggest keeping it default for the sake of this tutorial) > Next > Select IIS# > Next
The installation wizard gathers enough information to set up the php.ini file, and configure certain web servers to use PHP.
Once the installation has completed, the installer will inform you if you need to restart your system, restart the server, or just start using PHP.
Note: This istaller configures your Internet Information Services (IIS)

Make a php page "phpinfo.php" and dump this code inside:


// Show all information, defaults to INFO_ALL
phpinfo();

// Show just the module information.
// phpinfo(8) yields identical results.
phpinfo(INFO_MODULES);

?>


Save it to: CInetpub\wwwroot open browser to: http://localhost/phpinfo.php
PHP IS INSTALLED!

3. Download the latest Mysql Server install from: http://dev.mysql.com/downloads/ in my case I downloaded the Recommended version "MySQL 4.1 -- Generally Available (GA) release (recommended)"

Now run the exe and you should get a pop-up window similar to this:



Click Next > Next >
Now there's a section where it ask you to make a mysql.com account select third one down "Skip Sign-Up"
Click Finish! Now the Configuration Wizard should pop-up Click Next > Detailed Configuration
Now you should be here:



If your running it on your own pc "Select Developer Machine" If on a dedicated server chose "Dedicated MySQL Server Machine"
Click Next > Next > Next
Mysql Server Instance Configuration Section! If your going to run your test site on this chose "Manual Settings and put 10" for a couple of users "Decission Support" If a Dedicated server "Online Transaction Processing" Click Next
Next > Next > Should be here:



Make sure you select "Include Bin Dirrectory in Windows PATH" Click Next!
Now type in your Root Password. Now click Next and Execute.

If you want to go the mile dump something like phpmyadmin in your CInetpub\wwwroot for easy access of your databases.
Note: That's something we wont get into in this tutorial!

Done!

reference:http://www.youngcoders.com/

Create a Live Windows CD

Take a look at http://www.lachiesadicristo.it/w98cd/default.htm.

It guides you how to create a live, bootable CD with Windows on. Once the CD is created, you can use it on any PC (with enough RAM) to run Windows, without even touching the hard drive.

It's easy to do if you know Windows well. I have once of these CD's I made with tools to fix up my PC if it was to ever develop a problem. Very useful indeed.

It's recommended you use Windows 98, but if you have a powerful PC with more than 512MB RAM, you could use Windows Me easily.

Just take note that some of the tools listed in the tutorial have now disappeared from the net, making them hard to find. I will post links to the missing tools when I track them down or upload them to my site.