r/AskComputerScience • u/Raijinkun • Jul 22 '19
I tried SQL injection without intention to hack, and got IP banned. What should I do?
Hello. I'm a computer science student, and I've just started learning about computer security. So I tried ' or '1' = '1 in an old website on a login page, and then I got an IP banned from that website. It said contact this email for any inquiries, so I apologized them by email. But still, I'm afraid that I could be tracked down, especially that I'm using company's internet. I didn't expect it to ever happen, nor having any intention to hack anyone.
I tried an XSS on another website like <script>alert('xss')</script> and it doesn't do anything, so I thought that attack prevention would just act as if the input is a string. I didn't really think I could get banned for doing this. I should have used VPN or just simulate that in my own website, not trying in the real site.
Edit: After some research on the website. This website, along with other similar webs, use the same content management system, which has been discontinued for many years. https://packetstormsecurity.com/ literally shows the vulnerability on the top Google search, including XSS and SQL Injection. There's even a Youtube video of successfully hacking the website with this content management system (partly that the admin's MD5 hashed password can be accessed and cracked easily).
Apparently, the initial website is safe from XSS, but several others isn't at all. Also, me discovering the vulnerability isn't the first time as well. It was discovered as early as 10 years ago.
For those wondering, the website looks slightly newer than Reddit in 2005, older than Twitter in 2006.
This will be my very first, and most important lesson. I will not try to do anything unsupervised anymore. Thank you for all of your advice.
By the way, the admin's personal info is publicly available (google-able) in the website, including the phone number. Should I personally contact them and inform about this?
17
u/ACoderGirl Jul 22 '19
so I thought that attack prevention would just act as if the input is a string
That... sounds like you don't quite understand what you're doing. At any rate, one site not being vulnerable to XSS in one place doesn't mean others won't be.
Laws against computer hacking are pretty broad and usually use terminology like "unauthorized access to computer systems", which includes via exploits like SQL injection or even simply using someone else's credentials (there has been cases of kids being charged for using stolen admin credentials at school, for example). There can be pretty severe consequences if the company wants to throw the book at you. Even for cases where the company should be doing better (there's no valid reason to be vulnerable to SQL injection), if you end up accidentally causing damage, you put yourself at serious legal risk. And causing damage can be pretty easy. If a site has lost business of any degree, there's good odds they're gonna come after you to try and recuperate something or at least shift the blame.
Being banned is the mildest thing that can happen to you. If you want to practice stuff, I suggest you find places where you have permission to do it, such as https://www.hackthissite.org/ or something that you own (and even then, be careful -- eg, you could run the risk of violating your ISP's terms of service and getting banned from them).
16
u/falafel_eater Jul 22 '19
There are websites specifically designed for people to practice hacking techniques on them without having to worry about getting into trouble or damaging/upsetting anyone. I'm sure you can find them on Google.
Otherwise, hack your own stuff.
2
u/Svitzer Jul 22 '19
What did OP do with ' or '1' = '1 and why is it bad?
3
u/bacondev Jul 22 '19
It's known as a SQL injection. The most relevant section of the linked article is titled âIncorrectly filtered escape charactersâ.
1
u/HungryChoice2232 Oct 29 '24
Have you heard about maltajmae ? They use SQL injection to withdraw large amounts of crypto
0
Jul 22 '19
[deleted]
0
u/Raijinkun Jul 22 '19
Do you think what you did wrong is that you got caught?
I never think about trying to escape from my fault. I thought that using temporary IP to login will only keep the admin session in that IP, which is why I only tried to log in, not mutating any database. If it were successful, I can contact the admin and just forget about that IP forever (which I don't know if it's good or not). My goal here isn't to hack anyone at all, but to investigate on whether or not websites in the old days are protected from any attacks.
I will note this as my lesson. Are there any ways to know that what I do is wrong or not? I've just started learning about security, and I already made a huge mistake this time, so it's going to be very hard for me to try other things. Is it all right if I try everything in localhost? I'm still afraid about violating ISP's ToS (as mentioned above).
143
u/fuhgettaboutitt Jul 22 '19
Okay here's the deal: trying this shit on a system that isn't yours, or a system you don't have explicit permission to do this on IS intention to hack it. End of story. You basically brought a loaded gun into a TSA checkpoint and fired it into the air. Take the free lesson, the IP ban is probably all you're gonna have to deal with. If you want to practice this stuff in a safe environment there's free cracks of old OS's with servers and stuff installed running around. Play with those in a VM. DO NOT CONTINUE TO HACK SHIT THAT DOESNT BELONG TO YOU