A generic approach would not work with these devices. Lots of such devices have weak credentials so we should have a possibility to test them.

The server header is in many cases quite specific like the following:

Linux, HTTP/1.1, DIR-300 Ver 2.12
Linux, HTTP/1.1, DIR-600 Ver 2.12

others are more generic but I think they are also ok to do a simple check.