This will kill the connection between the hacker and your safari browser. If you are using an ethernet connection, simply disconnect the ethernet cable.Turn off the WiFi connection from Mac’s menu.In case if you are still facing trouble in closing the unwanted pages in Safari, you will need to take some additional steps.
Pressing shift key will prevent the previously opened pages to relaunch again in Safari.