When is a permission required to attack a system?
<blockquote>
  <p><strong>Never attack something you don't have a permission for!</strong></p>
</blockquote>

<p>This is one of the golden rules of penetration testing, yet it's surprisingly unclear. What exactly counts as an attack, and when do I need permission?</p>

<p>Let's consider some examples:</p>

<h3>Example 1</h3>

<p>I want to log in on <code>example.com</code>, and accidentally type my password incorrectly, yet the website authenticates me successfully. Baffled, I try again, this time with a completely wrong password. Again, the website authenticates me successfully. It seems to me as if the back-end doesn't check the password at all! Would I have needed permission for this?</p>

<h3>Example 2</h3>

<p>I buy myself a set of Bluetooth speakers. They come in a cheap "basic" and a more expensive "premium" variant. The only difference is that the more expensive ones have better sound quality.</p>

<p>After opening the cheap ones up, I realize that they are built identically to the expensive ones, and just have a jumper on the circuit board that determines whether the speakers are "basic" or "premium". I change the jumper, and sure enough, the sound is better now.</p>

<p>Realizing what I have done, I ask myself whether I needed permission from the vendor for this.</p>

<h3>Example 3</h3>

<p>I use a website like <a href="https://tio.run/" rel="nofollow noreferrer">TIO</a> to execute some code. Out of curiosity, I try <code>system("cat /etc/passwd")</code> and sure enough, I get a file in the <code>passwd</code> format. I poke around the system a bit more to find the webroot and write a file into it. Again, I can open this file now. I could basically do anything on the web server, including modifying the website, visible to other users.</p>

<p>Did I need permission from the website owners for this?</p>

<h3>Example 4</h3>

<p>My 12 year old cousin shows me a browser game he likes to play. As a joke, I log in as <code>admin'; --</code> and the admin interface revealed itself to me in all it's unescaped, unprepared glory.</p>

<p>Did I need permission from the game's owners for this?</p>

<hr>

<p>As shown in these examples, I didn't do anything malicious, and the difference between legitimate use an an attempted "attack" is difficult to tell - at least on closer inspection.</p>

<p>As such, is there a clear line when <em>exactly</em> permission is necessary?</p>

<hr>

<p><em>This question was originally asked in <a href="https://security.stackexchange.com">Security.SE</a>. I am mostly interested in answers relevant to laws in the European Union.</em></p>

<p><strong>Disclaimer: Not a lawyer or even living in US. I try to write the answer under US law. Other countries law may differ. Make sure you consult a lawyer in your jurisdiction.</strong></p>

<p>Here is my understanding of the individual examples:</p>

<ol>
<li><p>You don't need permission legally, because you are only accessing your own account and your own information. You are the only one damaged by the intrusion and therefore, nobody can really file a lawsuit against you. This is often used by security researchers when the subjects are uncooperative. That being said, if it is an actual pentesting client, you may want to refrain from it regardless.</p></li>
<li><p>You don't need a permission to modify hardware you own. This is completely legal and not considered an attack. It would qualify as an upgrade, such as replacing a component in your laptop. You are allowed to do that.</p></li>
<li><p>You should have a permission here. This is an intentional penetration test and you should have permission to do this.</p></li>
<li><p>The same as 3. This is an intentional penetration test and you should get a permission. Though if you logout immediately and don't mess with the interface, it may not be illegal on the basis that you did not cause any damage or steal any information, or <strong>it may be illegal</strong> under some circumstances. It may also be impossible to prove that you did not do anything while there.</p></li>
</ol>

european-union hacking