title: Capturing and redirecting outgoing traffic from given ip:port to target ip:port
body: <p>On Windows 7 I have an SSH tunnel running on my local <code>127.0.0.1:34567</code> address that I need to access so I can access <code>12.34.56.78:8080</code> with the help of SSH proxying for me as I cannot access that IP directly (due to not being on the whitelist).</p>
  
  <p>My basic simple goal therefore is that on Windows whenever I request <code>12.34.56.78:8080</code> from anywhere (my browser for instance), I would like the request to instead be diverted to <code>127.0.0.1:34567</code> transparently, and I would like a software solution to this instead of a hardware one if possible. I think this is what's usually achieved in Linux by something called iptables, but I'm looking for something I can use on windows.</p>
  
  <p>Does anyone know how this is possible? If I need to use any external Windows program for this, that is fine, but I prefer it to be free.</p>
  
  <p><strong>EDIT:</strong> please do not present me with reverse tunnel solutions. My goal is to request the same ip:port that I'm blocked from, but to be able to get to that ip:port successfully through the means of my existing SSH tunnel. Reverse tunnels involve requesting a different ip:port which is not what I'm looking for (I already have a forward tunnel I can use if I wanted to make requests to a different ip:port).</p>
  
  <p><strong>Example scenario:</strong> Pretend that you have an C-compiled <code>.exe</code> file whose source code you don't have access to that is hardcoded to request <code>12.34.56.78:8000</code> for SOAP webservices. The problem is, your IP is blocked from that ip:port, but you do have access to an SSH server which isn't blocked by <code>210.212.239.117:8080</code> and also have an SSH tunnel set up for that SSH server to access that ip:port... but your <code>.exe</code> has the original ip:port hardcoded, so you can't just tell it to request the SSH tunnel ip:port, as it's not possible to change the ip:port to be requested in any way due to it being hardcoded! You would have to have the request to <code>210.212.239.117:8080</code> on your computer somehow diverted to your SSH tunnel on the OS level. So how would you get that done?</p>
  
  <p><strong>EDIT 2:</strong> I'm not looking for routing tables either (I think). I don't want to modify the route my request goes through to reach target ip:port; I actually want to have the requested ip and port themselves silently changed. I kind of want to achieve something like the <code>hosts</code> file, except instead of resolving hostnames to ips, I want ip:ports to be reresolved to different ip:ports.</p>
  
  <p><strong>Bounty:</strong> Sorry, it appears this stackoverflow question of mine counts as Offtopic and isn't eligable for offering a bounty, so sorry to anyone who put in extra work and would have potentially received the bounty!</p>