It would take a lawyer (or several) to give a true answer to your question, and I am not entitled to give legal advice in any way. However, in most countries, penetration testing without target consent tends to attract legal trouble, in the same way that going down the street and trying the clutch of all house doors to see which ones open is risky. Even in countries where trying the clutch would not be illegal (but only entering the house would be), you would have a hard time explaining to the cops and judges that your suspicious activity was not done with immediate malicious intent.
To use an even more graphic (and approximate) analogy: if you rush towards another person (let's call him Bob) while brandishing a big knife, but a cop grabs you before the deed is accomplished, you might try to say to the judge: "But it is not proven that I was trying to kill Bob; I just wanted to see if it was possible to stab him, but I would of course have stopped right before piercing Bob's skin. The cop intervention was unnecessary.". My bet is that the judge won't be convinced.
To sum up, law matters are intricate, but it does not take a lawyer to predict that penetration testing without target consent can end with you being prosecuted, with no surefire legal escape way. Whether this is good is another debate (extreme libertarians would claim that any open server is fair game for any kind of penetration testing, and even downright intrusion and data plunder).