your wireless router was hacked or are you saying your iPad was hacked? If the former patch your router with the latest firmware from the vendor for your model router.
If the latter both the Foxconn Chipset hack and the KRACK Wi-Fi exploits were patched before any known variant of software able to perform this exploit were released on to the internet. These were precautionary patches for a potential hack that appears was never developed.
if you logged into a phony account you need to change your credentials with Apple
You may wish to change your Apple ID log/pass with a complex password you don’t use for anywhere else.
If you share the same or similar log/pass combo with another service (e.g. Yahoo, Twitter, Facebook, etc.) and that service is compromised then anyone with that information simply needs to try the same combo elsewhere
To change your Apple ID password see this link:
https://support.apple.com/en-ca/KM205079
To Change the Email associated with your Apple ID see this link:
https://support.apple.com/en-us/HT202667
To change the payment information in your Apple ID see this link:
https://support.apple.com/en-us/HT201266
To Enable two factor authentication see this link:
Availability of two-factor authentication for Apple ID - Apple Support
If you think your Apple ID has been compromised see this link:
https://support.apple.com/en-us/HT204145