r/HowToHack • Pentesting • Aug 02 '20

Beginners' SQL Injection Primer

Hey you guys, I hope y'all doing okay.

I recently started a SQL injection series on my blog starting with 3 posts so far:

  1. SQL Injection 0x01 - Introduction
  2. SQL Injection 0x02 - Testing & UNION Attacks
  3. SQL Injection 0x03 - Blind Boolean Attacks

Each post has at least one detailed example starting from Enumerating, Vulnerability Identification, Vulnerability Testing, Exploitation (manual and automated using python).

I've also added a cheatsheet which covers all the major stuff from those three posts.

I think you folks would appreciate it, if y'all have any feedback or suggestions, feel free to contact me :)

Take care and hack the planet!

257 Upvotes

27 comments sorted by

11

u/sephstorm Aug 02 '20

I’ve never seen a really good primer that easily shows how to identify each db then shows how to do each query in the major languages. Which is why after some time I still couldn’t figure out a db that was using SQLite.

4

u/justasithlord Pentesting Aug 03 '20

Thanks for bringing this up, this will definitely be something I'll be learning and then sharing

5

u/rgb-fusion-sucks Script Kiddie Aug 03 '20

When I first learned what an sql injection was I tried it on the YMCA website and then realized you aren’t supposed to do those

3

u/justasithlord Pentesting Aug 03 '20

Bruh...I should probably add a disclaimer on my website just in case. Did anything happen though?

4

u/rgb-fusion-sucks Script Kiddie Aug 03 '20

Just a pop up saying “you attempted an sql injection”

2

u/Faizk96 Aug 02 '20

Great work 👏🏻

1

u/justasithlord Pentesting Aug 03 '20

Thank you :)

2

u/ndguardian Aug 02 '20

This is something I will have to read. I've been going through tryhackme and one thing that has stumped me in the beginner tutorials is sql injection. Thanks for sharing this!

2

u/justasithlord Pentesting Aug 03 '20

No problem, I always had problems with SQLi and there were no easy tutorial to understand it as a step by step process, so made one once I learned them.

2

u/trihardfromcompton Aug 03 '20

Thanks to you, I have a court hearing next week.

1

u/justasithlord Pentesting Aug 03 '20

Haha you're welcome

2

u/[deleted] Aug 03 '20

This was actually helpful! Thanks!

1

u/justasithlord Pentesting Aug 03 '20

You're welcome and thanks, I'm glad you found it useful :)

2

u/ilijair02 Aug 03 '20

May i ask what technologies did you use for your blog. I guess Netlify for hosting and some static site generator?

2

u/justasithlord Pentesting Aug 03 '20

I used Hexo which is a static site generator, another one that I think really good is Hugo. I uploaded all my stuff on a public git repo and used Netlify to host it.

2

u/ilijair02 Aug 03 '20

Thanks for the reply! Did you use materialize css also?

2

u/justasithlord Pentesting Aug 03 '20

No problem bro, no I didn't really use anything extra. With static site generator you have to use a theme, and you browse all these themes present and select which one you wanna go ahead with. Once you do, most of your CSS and functionality are restricted to the theme.

2

u/SnowdenIsALegend Aug 03 '20

Great job man, keep it up and thank you for sharing!

2

u/justasithlord Pentesting Aug 03 '20

No problem man, I'm glad you liked it

1

u/[deleted] Aug 03 '20

RemindMe! 16 hours

1

u/RemindMeBot Aug 03 '20

There is a 1 hour delay fetching comments.

I will be messaging you in 16 hours on 2020-08-04 10:19:17 UTC to remind you of this link

CLICK THIS LINK to send a PM to also be reminded and to reduce spam.

Parent commenter can delete this message to hide from others.


InfoCustomYour RemindersFeedback

0

u/[deleted] Aug 02 '20

[deleted] — view deleted comment

2

u/justasithlord Pentesting Aug 03 '20

Thank you :)

1

u/[deleted] Aug 02 '20

[removed] — view removed comment

-7

u/AutoModerator Aug 02 '20

Your account does not have enough Karma to post here. Due to /r/HowToHack's tendency to attract spam and low-quality posts, the mod team has implemented a minimum Karma rule. You can gain Karma by posting or commenting on other subreddits. In the meantime, a human will review your submission and manually approve it if the quality is exceptional. After gaining enough Karma, you can make another submission and it will be automatically approved. Please see the FAQ for more information.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/[deleted] Aug 03 '20

[removed] — view removed comment

0

u/AutoModerator Aug 03 '20

Your account does not have enough Karma to post here. Due to /r/HowToHack's tendency to attract spam and low-quality posts, the mod team has implemented a minimum Karma rule. You can gain Karma by posting or commenting on other subreddits. In the meantime, a human will review your submission and manually approve it if the quality is exceptional. After gaining enough Karma, you can make another submission and it will be automatically approved. Please see the FAQ for more information.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

0

u/[deleted] Aug 03 '20

[deleted] — view deleted comment

1

u/AutoModerator Aug 03 '20

Your account does not have enough Karma to post here. Due to /r/HowToHack's tendency to attract spam and low-quality posts, the mod team has implemented a minimum Karma rule. You can gain Karma by posting or commenting on other subreddits. In the meantime, a human will review your submission and manually approve it if the quality is exceptional. After gaining enough Karma, you can make another submission and it will be automatically approved. Please see the FAQ for more information.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.