wouldn't listreceivedbyaddress reveal all funded addresses in the wallet?
But it would also just be easier to just send yourself all of the coins in the wallet instead of getting their private keys.
If an attacker were able to get the dumpwallet output, they would then have the keys for all of the keypool keys and the master private key and HD seed which means they can then know all of your future addresses too. That is much more dangerous.