Re. Metasploitable, if you're setting aside OS detection from something like Nmap, you've got the fact that Metasploitable comes out of the box with a comprehensive, definite set of ports open & services up for one to test. And many of those services are many years old & long unpatched (deliberately, of course, so you'll have targets for exploitation). So, if you're doing scan on a target machine with an unknown OS and it comes back with..
...every single port open and service version running that Metasploitable has by default, then you can tell with high confidence that you're either dealing with Metasploitable or an OS that has been administered so very, very badly that it's functionally as vulnerable as Metasploitable