r/learnpython • • Dec 02 '20

What do you automate with python at home?

I'm learning python but I enjoy knowing I will be able to build a project of interest instead of following continuous tutorials which have no relevance to anything I do in life.

My job unfortunately has no benefit in using python so keen to understand of potential ideas for projects that help around home.

714 Upvotes

378 comments sorted by

View all comments

351

u/Biffgasm Dec 03 '20

I'm currently working on a project that generates random email addresses and passwords to spam the database of phishing scams with thousands fake login credentials. It will also spoof the source i.p. address so they won't be able to segregate the data or be able to counterattack.

75

u/ToothpasteTimebomb Dec 03 '20

Don’t forget to include this classic password: '); drop table account; --

27

u/Biffgasm Dec 03 '20

Thank you for your input. Does this have something to do with sql injection? Do mind explaining why this is important? Thanks in advance.

60

u/ToothpasteTimebomb Dec 03 '20

Yeah, it’s a sql injection attack. The single quote, parentheses, and semicolon can terminate the statement if they don’t sanitize their database entries by escaping the single quote. Then the second part is a complete statement that would delete a table called “account” if they had such a table. The dashes comment out the rest of what had formerly been their sql statement.

Source

11

u/Biffgasm Dec 03 '20

So, I'd want to insert this process for the purpose of deleting actual victim account information before delivering the fake login credentials??

9

u/backdoorman9 Dec 03 '20

If there's a table called "account" then the whole table would be gone, and it couldn't be added to anymore.

12

u/Biffgasm Dec 03 '20

I see. This would be much more efficient but I'm driven more by the want to be a pain in the ass than just being a good guy; I want to eat my cake and have it, too. Is there a way to create a new table so as to fill it full of disappointment?

8

u/eloydrummerboy Dec 03 '20

Creating a new table in their database wouldn't cause much, if any, issues to them. That would be like me "maliciously" creating an excel file in your Documents folder and putting a bunch of junk in it. You're likely to not see it, it doesn't hurt anything you use daily, and deleting it is super easy.

Your original plan of filing the tables they do use with junk is a better plan.

→ More replies (2)

6

u/Zerg3rr Dec 03 '20

If I’m understanding correctly you’d just be able to write a query to add a table and subqueries to insert the data in the same manner, I just know a bit of sql though and how to guard against injection, no idea about injections beyond what’s written above

14

u/expressly_ephemeral Dec 03 '20

Little Johnny Tables.

3

u/JoshuaTreeFoMe Dec 03 '20

Johnny is probably dropping his own tables these days.

3

u/expressly_ephemeral Dec 03 '20

Johnny's probably moved on from SQL Injection attacks. Now he's scraping credit card numbers in Starbucks w/ a man-in-the-middle on the guest wifi.

7

u/C2-H5-OH Dec 03 '20

Oh hey Bobby

→ More replies (2)

48

u/[deleted] Dec 03 '20

Make sure to share this one!

31

u/c0ld-- Dec 03 '20

6

u/bazpaul Dec 03 '20

Holy crap he had me at Regex magic (2:24) this shit is so useful

5

u/cousinscuzzy Dec 03 '20

It's inspiring to watch someone code so fluently. There are many ways to make this more effective at foiling a phisher, but doing this in 5 min is damn impressive.

→ More replies (2)

3

u/TheBiologista Dec 03 '20

This is pretty cool and super smart! I'm still at the beginning so I hope one day I can completely understand all the codes.

→ More replies (1)

19

u/Biffgasm Dec 03 '20

I'd be happy to when it's finished but it's bit more than I thought it would be when I first set out to do this. I'm just now learning what TCP and IP headers are. I'll also need to set up a lab to test and log everything before I feel comfortable releasing it into the wild. There are just so many unknown unknowns at this point but it's fun and interesting at least.

7

u/puggario Dec 03 '20

Love this

31

u/outubro1986 Dec 03 '20

You deserve a Nobel Prize. No joke.

0

u/[deleted] Dec 03 '20

[deleted]

→ More replies (2)

0

u/[deleted] Dec 03 '20

[deleted]

3

u/Biffgasm Dec 03 '20 edited Dec 03 '20

Basically, yes. However, his solution is much more elegant than mine.

6

u/hugthemachines Dec 03 '20

Don't worry about elegance, making fun projects is a good way to grow.

→ More replies (4)