I know that Hacking is illegal in any country. my question is this "is it illegal to hack enemy country website ?" e.g i lived in Pakistan, let say i hacked Indian Govt websites. is this illegal ? if this is illegal what will be fine and prison charge?

  • It depends on the laws of Pakistan and the willingness of the Pakistani authorities to enforce them. It would be illegal in India obviously, so theoretically if they knew you had hacked them, they could issue an international arrest warrant that would make travelling outside of Pakistan risky.
    – Cicero
    Apr 20, 2018 at 13:09

2 Answers 2


This question really depends on the specific countries involved, as all law depends on jurisdiction. However, there are essentially two ways that breaking into foreign computer systems could be illegal: 1) Your own country has laws against hacking that include hacking into foreign computers or 2) The country you're breaking into has laws about hacking that are not limited to citizens.

In the first case, your own country would find such "hacking" illegal; in the second, your target country would find such "hacking" illegal. If you violate the first, which is the less likely option, you could be traced, located and prosecuted by your own country. If you violate the second, which is the more likely option, the target country would target you for extradition and prosecution. Depending on the amount of political power your target country has, this could result in you being shipped off to another country to face their courts, without the protection of your own country.

In other words, it could very well be illegal, though the specific sentence resulting from such a crime is far too specific to even attempt to address in the general case.

  • what if i moved to third country like Abu Dhabi or US ? Apr 19, 2018 at 20:24
  • 1
    That country might think the hacking is a crime in their country and prosecute you. And of course the country that was hacked can ask them for extradition, and I would guess that Abu Dhabi or USA would be more likely to extradite you than your own country (especially to India).
    – gnasher729
    Apr 19, 2018 at 20:37
  • 2
    @KashifSaleem That would help you with the less likely first case, it would not help you with the second, except perhaps by reducing the risk of extradition. To summarize, you're very likely to be breaking someone's laws, and if you carry out such "hacking" you will almost certainly be at risk of criminal prosecution. The only variable you're really tinkering with by changing locations is the likelihood of actually being extradited and/or prosecuted, and while I won't personally give you legal advice I wouldn't bet my chances on the odds of getting caught. Apr 19, 2018 at 20:40

You might think you are a hero for attacking a hostile foreign nation known for its rogue hacking activity, but you are not. In the grand scheme of diplomacy, you are a single individual acting on their own without authorization from your host state. Even if your activity is somewhat against "the enemy", you are not part of your host nation's cyber force which on its own, would not engage in such activity unless it is granted vetted permission. So the big answer is: YOU ARE ON YOUR OWN. Even reconnaissance can get you in trouble since you will be signaling to your victim that you are acting on your nation's behalf. Join your country's cyber force if you have all this hunger and skill...

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .