Monday, December 26, 2011

TSocks with Ubuntu Linux

So it turned out that a simple SSH Tunnel doesn't always accomplish what is needed.  An SSH Tunnel is great for applications that are able to redirect their own packets to a different proxy, but what about applications that don't natively support proxies?

One alternative is to use a VPN Tunnel, in most cases this will work great, but in some networks VPN packets are restricted.  Also VPN networks doesn't typically run on natively installed software.  To solve this issue I turned once again to Linux which seems to have the best collection of geeky programs natively installed.

Step 1: I downloaded VirtualBox which is an OS simulator.
Step 2: I downloaded an ISO file of Ubuntu linux.
Step 3: Download the tsocks .deb file, you may need a normal SSH tunnel if web traffic to that site is being blocked:
   Go to this website, scroll to the very bottom, and click on the link for the correct version of linux and 32 vs 64 bit OS.
   Under the Download Mirrors section click on "select mirror".
   Click on the binary package link to download the .deb file.
Step 4: Install the tsocks .deb file.
Step 5: Edit the tsocks file, first rename the default file then modify the original file.
   sudo mv /etc/tsocks.conf /etc/tsocks.conf.old
   sudo nano /etc/tsocks.conf
Step 6: Add the following two lines to the file:
   server = 127.0.0.1
   server_port = 6060
   these lines tell tsocks to redirect all traffic fed through it to the local loopback ip using port 800.
Step 7: Start up a ssh session accepting traffic on the port that tsocks is now configured to send it on.
   ssh -C -D6060 -v -v user@www.domain.us
   The -v -v are two levels of verbose troubleshooting, you only need to use them if you want to watch what is happening inside the tunnel.
Step 8: Open another command prompt, and startup a firefox session through tsocks. I used firefox simply because it is a decent browser and is the default one installed on linux. Use the following command at a command prompt.
   sudo tsocks firefox

With this setup all firefox's child processes should be tunneled through the tsocks connection as well which includes things like voice calls or video chats started from the web browser but running on different ports.  Replacing firefox with the command for other applications you can try tunneling them through the tsocks connection as well.

Steps 7 and 8 will need to be repeated every time you want to initiate the tunnel from now on.

Getting your audio, and other USB devices to work correctly through the virtual machine is a whole different issue.  If you have too many problems with this try using a regular Linux install instead of a virtual box.


Thursday, December 22, 2011

Cancel a remotely initiated shutdown

If a shutdown of your system has been initiated remotely you will see a dialog similar to this:

systemshutdown

To kill this dialog and cancel the shutdown, open up a command prompt window as administrator.  Then issue the following command:

shutdown -a

The "a" stands for abort.  You can also use the shutdown command to initiate your own shutdown of remote systems.  You can send messages and manipulate many different aspects of the windows shutdown procedure with this command and its parameters.

Thursday, December 15, 2011

Cancel restart from automatic updates

Have you ever been working on a very important project and needed to put off the forced restart that many system administrators have setup on their domain?

As long as you have local admin rights it is a simple process of running the following command from the command prompt.

sc stop wuauserv

Sc.exe is part of the windows resource toolkit, it is called Service Control and can be used for all sorts of service manipulation.  The stop word is fairly self explanitory.  The final word is simply the name of the service to be stopped, in this case the service running the windows update that controls the annoying dialog.

Monday, December 12, 2011

Secure Shell Tunneling

Recently I have had need to get to some websites that were not reachable from my current network location.  They weren't bad websites, just a password storage site and some school related information.

So I started looking around at the various proxy solutions to see what they had to offer, unfortunately, most free proxies have been blocked on many networks in the US for the obvious reason that they help people bypass browsing limitations placed on them.  You can find a listing of many such proxy ips here at: http://hidemyass.com 

This site also offers another kind of proxy called the web-based proxy which allows you to tell their website where you want to go and it will act as a wrapper fetching the content you want inside of itself.  The downside to this method is the ways that the page masks it's content from DNS and IP blocker often leaves the page unusable if the destination page is complex enough.

Fortunately there is a third solution which I was recently taught about called SSH tunneling.  I already love dealing with remote servers so this plays right into my skill-set and has become an easy favorite.  Skill-set might be pushing it a bit far since there really is no skill-set required to implement the tunnel, all the required server software is already naively built into *nix servers and the client end can be downloaded for free.

To route your web traffic over an ssh tunnel first you need some form of ssh client, I use windows so I typically use putty.exe.  Other methods can be read about here: Free SSH.  You will need an account on a remote SSH/*nix server that you can reach.  If you don't have one you can risk using a free one from a list such as this: SSH Proxy List; keep in mind that any server you log into could potentially be tracking or reading any and all data you send through it, including passwords to all your accounts.


  1. With your remote account and putty.exe in hand, start up putty.
  2. Under Connection/SSH/Tunnels create a new source port, can be any port you choose that is not being used; for destination choose dynamic.
  3. Under Session type in the IP or host name as well as Port number (typically 22 for SSH connections).
  4. Choose a connection type of SSH and click open.
  5. It will probably prompt you to store the key in the registry, go ahead and do it.
  6. Login to the remote server with your username and password.
  7. Next, in your web browser, get into its settings/network connections/proxy servers; you will want to configure a manual proxy server and set the SOCKS Host to 127.0.0.1 (which is your own computer that now has an open ssh connection)
  8. Enter the port you choose when you created the tunnel configuration in putty.
  9. And save.


You should now be able to reach any website that you can resolve a name to an ip for.  If you need a free and open DNS server you can use Googles: 8.8.4.4 or 8.8.8.8.

Friday, December 9, 2011

Power Over Ethernet in Switch-port Modules

I recently ran into a rather interesting issue regarding enabling POE for a switch-port module.  Those of you who have worked with routers extensively for years are probably well aware of both the problem and the solution, however those of us who have only a years experience managing them need some nudges in the right direction some times.

Problem:
Now for the problem. We had done some recent updates on our networks routers adding sticky mac configurations to the switch-port modules inside them.  After the update a few of our users started reporting that their IP phones would no longer power up.  Their computers hanging off the same switch-port modules were all working fine.  But not all switch-port modules were having the issue.

Solution:
After spending hours going through the configs we sought external help.  I was lucky enough that the first person I talked to had not only heard of the issue but had been able to find a solution.  The solution was so simple it is almost embarrassing to post it.  I learned that POE for routers modules is tied to the default VLAN for that router, in order to allow power to flow through to the switch-port module we needed to trunk the default vlan through on the switch-port modules trunk port, in our case vlan 1.

As soon as we trunked vlan1 through everything powered up and life was good again.  For security reasons we had been trained to shut the default vlan down and never use it.  It never occurred to me to check to see if a vlan, which was always administratively down, had access.  It is still rather odd that power flows even though the interface is down, yet still requires the interface on the trunk port.

Saturday, December 3, 2011

Logitech USB Headset Low Volume

My mother was having problems with her Logitech USB headset, we would be chatting and she was having trouble hearing me.  It took a little while but she finally came across a rather unique solution on the Internet.

A few days later she lost the ability to use her headset at all, I couldn't even hear her.  After some basic troubleshooting I suggested that she try restoring her computer to date prior in which it worked.  This worked and I was once again able to hear her, however she was no longer able to hear me very well.  I looked through my email and found the solution she used once before and using that she made adjustments to her volume until things worked normally again.

She then had a feedback problem which she used a prior blog post of mine which talked about muting the microphone to fix.


I don't know where on the Internet she got the following quote, if anyone knows let me know so I can give credit to the original poster.
I have a logitech usb 250 headset that suddenly one day the volume was verly low on the headset. Have tried and searched for a solution but nothing worked. Today i found a solution that worked for me.

Try this:
1. Open control panel
2. Open sound/playback devices
3. Select Logitech USB Headset, and click on the Properties
4. Opel Levels tab, and click on Balance button
5. Slide one of the sliders so that the values are different, for example top at 100, and bottom at 99
I agree with the original poster that this is a very strange solution, but it work.  I hope this helps someone with their own issues, and hopefully Logitech will come out with an updated driver that solves these issues.