The easiest way is to always use a DNS whitelist firewall on a external device on your network. It is a pain in the ass to manage that list, but you'll log and block every unexpected connection.
Otherwise, you can do a basic grep for "http" in the source, or even by scanning a binary for strings. This vector is easily mitigated by an attacker using encryption or a simple cypher, but it will catch a lot of script kiddies.