I would like to know how Security Researchers and hackers scan the internet to find vulnerable devices. For example in this article here, what sort of request/packets are those researchers sending to find the backdoored routers?
Likewise with the heartbleed vulnerability, many hackers and security researchers scanned the internet to find vulnerable servers, how was this done and how did it work?
To expand on this, I have also read about people/companies finding millions of vulnerable servers due to a certain vulnerability by scanning the entire IPv4 address space. What type/sort of genre would these exploits that hackers use to exploit devices by scanning the internet be (examples of old exploits that are obsolete would help)? (Technical answers in detail is what I am looking for)