r/AskComputerScience • • 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?

35 Upvotes

17 comments sorted by

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

32

u/not-just-yeti Jul 22 '19

Totally agree.

Though the firing-the-gun comparison is a bit strong ... more like you went up to somebody's house, and decided to see if you could slide their kitchen window open, w/o planning to enter, just trying. But don't you try that on my house; that's creepy!

14

u/Sqeaky Jul 22 '19

Us laws on hacking do not fuck around. If the target site knew who OP was they could press charges and and really screw up his life. He could be looking at jail time.

Likely that is not going to Happen. They probably don't know or care who OP is. They couldn't prove OP didn't have a virus. It is not worth their time/money. But it is still a real risk for OP, maybe not as likely to be caught as the TSA analogy, but perhaps for as much or more jail time depending on details of each.

1

u/smokey_bee Jul 22 '19

Idk, I'd compare it more-less to driving around with a garage door opener, seeing if theres a door that might actually open.

1

u/TypicalCardiologist5 Jul 23 '19

How do other programmers feel about the laws governing hacking? Are they justified? Too strong? Not strong enough? Interested in hearing perspectives of others in the industry.

1

u/fuhgettaboutitt Jul 28 '19

You have to understand the history a little bit but basically in the 80s there was a slew of major hacks of banks when security was not really at the point it was today. People were pretty helpless. So they passed laws with really stiff penalties. I work for a big company, tbh I think they're appropriate. If you can bring my business to a screeching halt then yeah I want some legal repocussions that are similar for you

1

u/TypicalCardiologist5 Jul 28 '19

It makes sense that if you bring a business to a screeching halt that there should be consequences, I'm just not sure about penetration testing of a system. If you check whether or not a door is locked I'm not so sure that should be a crime.

1

u/FuckYeezy Jul 22 '19

Much better analogy. To be fair, I'd hardly even call this hacking, since not protecting against basic SQL injection like this is like leaving your front door open with a sign saying "please don't take anything". Also it sounds like his "hacking attempt" was unsuccessful anyway, I doubt he'll experience any further problems. u/fuhgettaboutitt is right, take the free lesson and don't throw the ball around in the house anymore, go somewhere safe that you own.

1

u/BobBrock86 Feb 08 '24

You sound kind a fun guy.. 🙄

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

u/[deleted] 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).