Friday, August 31, 2007

Can't see a PC's Shared Files on a Windows Network?

Ever have one PC on your home windows network that you just can seem to access the shares? Well here's some things to check:
  1. Make sure the Windows Firewall is off
  2. On the Exceptions Tab of the Window Firewall, make sure "File and Printer Sharing" has a check.
  3. Disable UPnP. This is found in Add/Remove Programs >> Add/Remove Windows Components >> Networking Services
  4. In the registry: "HKey_Local Machine/System/CurrentControlSet/Control/LSA" change "restrictanonymous" from 1 to 0
After you've done all that you should be able to access all the shares on the previously unsharable machine.

Wednesday, August 15, 2007

SSH and DNS Tunneling with DD-WRT (SOCKS Proxy)

In my previous article "Punch through your corporate firewall..." I showed you how to leverage a server on the internet to forward your web traffic. I've found another way to tunnel your HTTP traffic using a cheap router and a firmware upgrade called DD-WRT. If you are interested you can check out their site and see if your router is supported by their firmware.

In any case this is what you have to do, I'm assuming that you've already flashed your router with the new firmware and are ready to go:

  1. Open the DD-WRT administration page and enter your password.
  2. Click the tab that says "Administration"
  3. Click the sub-tab called "Management"
  4. In the Management tab look for the item that says "Remote Access", inside the box you'll see "SSH Management", select "Enabled"
  5. Change the SSH remote port to something other then "22" otherwise your router will constantly be bombarded by SSH attacks. I suggest something like "2345" or "6543".
  6. Click "Save Settings" at the bottom of the page.
  7. Now Click the sub-tab called "Services"
  8. Scroll down until you see "Secure Shell"
  9. In this box you want to "Enable" both "SSHd" and "Password Login"
  10. Again change the port to whatever you chose before, it should be the same one.
  11. Click "Save Settings" again.
  12. Now Click the "Reboot Router" button.
  13. When it comes back it should be ready.
Now for the PuTTY configuration on the windows side:
  1. Download the PuTTY client
  2. Run it
  3. Type in the Internet address of your router
  4. Enter the port number you want to connect to (i.e. 2345, 6543, etc...)
  5. Make sure the SSH radio button is selected.
  6. On the left, navigate down to Connection >> SSH >> Tunnels
  7. In the "Source Port" box type in 10000
  8. In the first set of radio Radio buttons select "Dynamic"
  9. In the second set make sure "Auto" is selected
  10. Click the "Add" button
  11. Scroll all the way back up to "Session" and click it
  12. Give the session something generic "Router Tunnel" is fine.
  13. Click "Open" to start the session
  14. At the username prompt enter "root", then your router's password (you changed it from the default, right?)
Ok now the tunnel is ready, now we configure FireFox:
  1. Download and install FireFox, if you can't install anything you should get the thumb drive version which doesn't require installation
  2. Start Firefox
  3. Go to "Tools" >> "Options"
  4. Click the "Advanced" Tab
  5. Where it says "Configure how firefox connects to..." click the "Settings..." button
  6. Select the "Manual Proxy Configuration" radio button
  7. In the "SOCKS Host" box type in "localhost"
  8. In the port information for the SOCKS Host type in "10000"
  9. Make sure "Socks v5" radio button is selected
  10. Clear out the "localhost,127.0.0.1" entries in the "No Proxy for" box
  11. OK your way back to firefox browser window
Now we need to tunnel DNS lookups as well to keep our own DNS server perstine; so we'll tell firefox to pump these DNS lookups through the SOCKS proxy:
  1. In the address bar type "about:config" and hit enter, this will give you FireFox's configuration guts.
  2. In the filter type in "dns", this will cut down the options so you don't have to go shuffling through a bunch of crap
  3. Look for the option "network.proxy.socks_remote_dns"
  4. Double click it so the value changes to "true"
  5. Hit the home button to now you're loading your pages through the proxy.
Enjoy!