That´s right, but automated scans normally first try default ports. To scan all possible ports last to long.
Too long, you say? When you have devices that are online with the same configuration, for years(!), would you think that's enough to fingerprint them? Or, again, it's too long?
Please keep in mind some things:
1. almost 2/3 of Internet traffic is done by automated "stuff" (discovery software, bots, scanners etc)
2. existence of shodan and others like it
3. there are
tools that, with the right setup /rig and Internet connection, can scan the whole IPv4 range in about one hour for one port; what happens when you have 10 setups like that? or 1000? or a botnet of scanners?
4. "bad actors" will usually exchange information and lists / scans
5. to have a "view" about all of those above: try to setup a server with a known port open (for example, 22 - SSH); how much time do you think it takes until you see first login attempts? usually it happens within one hour after setup and you'll get around one attempt every 5-10 minutes - and this is in a pool of around 4 294 967 296 IPs (- some special ones); please don't say "yes, but I will not be the *scanned* one - only the other 4 billions"
6. bad actors can always scale up scanners using already infected devices (embedded, mobiles, PCs etc)... and, with the widespread of opensource and "tutorials", these can happen easily
7. we're living in an era were we have Gbps home connections - it's not the dialup 90s anymore
8. we also have cheap VPSs (sometimes free / trial) and easily-to-deploy/automate Operating Systems, making scanning, again, a no-fuss job
These are common-sense things that anyone connecting any device to Internet and opening access to it should know.