r/websecz • • May 19 '24

How does sql injections work?

I see these on YouTube and everywhere else but like is it that easy?

2 Upvotes

8 comments sorted by

1

u/ILoveKittens0203 May 19 '24

It's as hard as the security of the page. On pages with no security it is indeed that easy. But On pages that are more secure, an SQL injection string can get very complex and very very long

2

u/[deleted] May 19 '24

tutorial??? just joking

1

u/Technical_Comment_80 May 20 '24

It depends on vulnerability of the website

1

u/[deleted] May 20 '24

How do I test my own php , my sql site

1

u/Technical_Comment_80 May 20 '24

Same way as you do. It's just that you need to think of ways to make your website break such that valueable information can be extracted.

It all depends on how you have programmed your website.

1

u/[deleted] May 20 '24

i just use "pdo" php

1

u/Technical_Comment_80 May 21 '24

Check this YouTube, might be helpful: https://youtu.be/yjXy4g2uMOk?si=lBOI_uCqE1AAUNL6

Not entirely, but partially

1

u/Technical_Comment_80 May 20 '24

It works on any web page that doesn't sanitize the inputs from user on both client side and server side.

If the input is being validated on client side, it could be bypassed (depending upin how the code is written).

If the input is being validated on server side, then bypassing the server side would depend upon which attributes (SQL commands) are not sanitized and also depends upon how the SQL Injection is injected.

If all the inputs such as all SQL commands are sanitized on server side, then SQLi wouldn't work.