Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to redirect connections by an exe file to a specific external ip address

  • I have an exe program that connects randomly to one of the 4 addresses 188.39.21.82...83...84...85 out of which only 82 works
  • Currently I blocked the remaining addresses using Windows 10 Firewall outbound rules by simply blocking them
  • My problem is that the program will keep attempting to connect say 10-20 times (times out after 20 seconds each time) before it finally connects to the IP address ending with 82
  • Is there a way that I can write a rule such that the program will get redirected to the IP address ending with 82 regardless of which IP it attempts to connect with?
  • Example: the program tries to connect to 188.39.21.85 but gets redirect to 188.39.21.82
  • I want to add that all the IP addresses actually work but the exe file doesnt work properly on any of them except the one ending with 82
like image 777
PirateApp Avatar asked Dec 04 '25 09:12

PirateApp


2 Answers

Try using Netsh's add v4tov4 (found here and here) to proxy outgoing connections from the range 188.39.21.83 - 188.39.21.85 (You don't need to include 82 since it works) to go directly to the working host. Only TCP is supported though.

add v4tov4listenport=[port] connectaddress=[188.39.21.82] connectport=[port] listenaddress=[not working IPs]

Note that you may not be able to list listenaddress to multiple addresses in one command, so you might have to change the IP and execute it again.

like image 159
nAZklX Avatar answered Dec 07 '25 04:12

nAZklX


you may as well login to your home router go to port forwarder section usually located on network / advanced setting . from there you can redirect requests from port to another . to access your router usually its the gateway numbber . you can run cmd and type ipconfig / all it will show the internet gateway.

like image 39
Ahmed amin shahin Avatar answered Dec 07 '25 03:12

Ahmed amin shahin