0

Suppose someone hacks my computer (by any means, say a virus or trojan like RAT), will they be able to know my IP address in real time? This is about dynamic IP addresses.

  • There are commands that you can run on your machine to get a machine's IP, right? – schroeder Nov 29 '20 at 09:19
  • @schroeder Not aware about that. Could you say more? – Andrew Rozario Nov 29 '20 at 09:20
  • @schroeder Oh yes obviously I can know my own IP address by visiting whatismyipaddress.com. But how does the hacker know my IP address? – Andrew Rozario Nov 29 '20 at 09:23
  • 1
    Because the trojan dials 'home' to a central control server to report a successful takeover. How did you think botnets work? – Shadur Nov 29 '20 at 09:24
  • Say they have remote access to my computer, and if they tried to check it from that website, I would know it (that the website is opening automatically). But any way that they could secretly know my IP? – Andrew Rozario Nov 29 '20 at 09:25
  • https://superuser.com/questions/165986/windows-command-that-returns-external-ip – schroeder Nov 29 '20 at 09:55
  • 2
    You wouldn't know it, because unless the trojan's writers are spectacularly inept they wouldn't use your actual browser to go to that site -- it's entirely possible to make a https call without opening an entire browser. – Shadur Nov 29 '20 at 09:58

2 Answers2

3

Suppose someone hacks my computer (by any means, say a virus or trojan like RAT), will they be able to know my IP address in real time? This is about dynamic IP addresses.

Yes,By "hacking" your computer,i am guessing you mean popping a shell on the system,they would know the public/private IP address of the system when they receive the connect back or when they connect to your system by opening your system ports.

yeah_well
  • 3,699
  • 1
  • 13
  • 30
2

An attacker is either going to be directly connecting to a host or receiving a connection back from it; in either case, the system must know which IP address it is talking to by necessity. If the victim is behind a NAT, this address will be their public IP address.

If an attacker is able to run commands on your machine, they could also determine your internal address (e.g. using ipconfig on Windows).

Neither way above requires any activity that would be easily detected by the victim.

multithr3at3d
  • 12,355
  • 3
  • 29
  • 42