this post was submitted on 18 Aug 2025
446 points (98.1% liked)
Funny: Home of the Haha
7991 readers
16 users here now
Welcome to /c/funny, a place for all your humorous and amusing content.
Looking for mods! Send an application to Stamets!
Our Rules:
-
Keep it civil. We're all people here. Be respectful to one another.
-
No sexism, racism, homophobia, transphobia or any other flavor of bigotry. I should not need to explain this one.
-
Try not to repost anything posted within the past month. Beyond that, go for it. Not everyone is on every site all the time.
Other Communities:
-
/c/TenForward@lemmy.world - Star Trek chat, memes and shitposts
-
/c/Memes@lemmy.world - General memes
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
A little sql injection lesson for anyone who wants to try fucking with an automated scammer script for real:
You can't just give it an sql statement. The whole thing needs to be syntatically correct. The statement you're infecting into probably looks something like this:
INSERT INTO scam_responses ( user_id, question, response) VALUES ( $user_id, $question_id, "$response" )
Where $blah is a directive to replace $blah with the contents of that vairable in some scripting languages. So a response would need to close the string and the bracket and start a new statement (or series of statements) where adding '") ' would remain valid. Use semicolons to separate sql statements.
Eg, a response of:
deeznuts" ); UPDATE scam_responses SET response = "you've been hacked by mushrooms!"; INSERT INTO scam_responses ( user_id, question_id, response) VALUES ( 5, 0, "UPDATE scam_responses SET response = you've been hacked by mushrooms!
Would do the trick and might throw off their attempts to fix the security hole with that red herring "injection", which looks like the actual injection but isn't (and isn't even legal due to the lack of quotes).
Though you need to be able to guess enough table and column names to even do this, even if they don't sanitize the input properly, which is why having access to the source code makes a huge difference (since table/column names are usually in there, unless they are really fancy and store that information in another db, though in that case, they probably sanitize).
Though if you're using sql, use stored procedures instead of sql statement strings. You tend to get better performance, too (or at least that was the case back when I did this during the time of dinosaurs).
Thanks, Poindexter.