This is exactly how it works! Most miners are connected to pools like slushpool, f2pool, etc over unencrypted an unauthenticated links. If you can modify this traffic you can steal the hashrate, because you can modify the work being sent to the miners before they do any hashing.