Simulate an "ok" via the command line

2

I have a command from the Windows prompt that disables proxy settings:

REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\" /v ProxyEnable /t REG_DWORD /d 0 /f

Browsers on my system are configured to use my system settings. The command works, but not in real time - the effects only happen when I go into the Windows menu of the proxy configuration and click "ok" there.

HowdoIsimulatethis"ok" via prompt?

    
asked by anonymous 05.10.2017 / 21:34

2 answers

5

This is not possible, and for good reason.

Imagine if it were possible to simulate mouse clicks by the user. Just imagine, for a moment.

Now imagine malware doing this.

Now imagine that this way you could:

  • Disable Firewall and Windows Defender;
  • Disable anti-virus;
  • Send items to the bin;
  • Empty the recycle bin;
  • Remove the user;
  • Turn off the machine;
  • With a little imagination, you could have a service that watches which processes the user opens. Wait for him to open a browser, go to an internet banking website with a known layout ... Simulate a fake screen, send the browser window there, and transfer the user's money to a temporary account of yours.

For these reasons, much that deals with machine security requires at least a user confirmation. Sometimes they ask for involvement that goes beyond that.

In time: you are about nineteen years behind in the concept of this virus. The Cult of the Dead Cow invented the Back Orifice to do things like what you want. Fortunately, and for the good of mankind, this is no longer so easy to do since some versions of Windows behind.

    
05.10.2017 / 22:22
0

You can try to create a proxy.reg file:

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings]
"ProxyEnable"=dword:00000001
"ProxyServer"="http://<proxyEndereco>:<porta>"

If you want to run in a bat simply:

regedit /s "c:\caminho\proxy.reg"

Or make a bat to change directly in the registry:

REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable /t REG_DWORD /d 1 /f
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyServer /t REG_SZ /d <proxyEndereco>:<porta> /f

You are only changing ProxyEnable

Reset network settings:

NETSH INT IP RESET all
netsh winsock reset all
ipconfig /release 
Ipconfig /flushdns
    
05.10.2017 / 21:45