r/InternetIsBeautiful • u/compilationfailed • Mar 12 '16
Learn to Hack, Learn to Protect Yourself : learn about security vulnerabilities
https://www.hacksplaining.com4
65
u/chuck_of_death Mar 12 '16
Check out http://overthewire.org/wargames/ if you are looking for fun security exercises. Solutions abound on the internet and you can learn a lot of cool stuff.
11
u/captainlam Mar 12 '16
I've been playing around with this and it's fun logging onto other servers. Logging onto their servers via ssh are a bit slow though.
5
u/kabeeray Mar 13 '16
yeah very slow. i like the hands on play. I've always heard the term ssh but to actually do it is pretty amazing feeling.
2
u/_teslaTrooper Mar 13 '16
May be a slight case of reddit hug, they're usually fast enough. Tip for anyone using putty for the first time: selecting text copies it to clipboard, rightclick is paste.
3
193
u/growlzor Mar 12 '16
Very well done. Educational with bits of humor. Even if you don't want to learn to hack, the quick and simple lessons have great visualizations that explain the vulnerabilities in a ELI5 manner.
37
Mar 12 '16
This is indeed quite cool!
SQL injection was a big thing back in the day - to protect yourself though, you literally just need to use mysqli_real_escape_string or an equivalent function when passing variables to SQL queries - while it is true that some people still make the mistake of not using this function, I'm curious how prevalent it is.
45
u/johnghanks Mar 12 '16
The only thing you should be using is parameterized queries. If you're using PHP, the answer is PDOs.
→ More replies (4)6
64
Mar 12 '16
42
u/xkcd_transcriber Mar 12 '16
Title: Exploits of a Mom
Title-text: Her daughter is named Help I'm trapped in a driver's license factory.
Stats: This comic has been referenced 1187 times, representing 1.1503% of referenced xkcds.
xkcd.com | xkcd sub | Problems/Bugs? | Statistics | Stop Replying | Delete
→ More replies (1)8
u/coyote_den Mar 13 '16
back in the day.
I had to hotfix a production web app last week because this image was appearing in the middle of a report.
DevOps knows PHP...
4
u/xkcd_transcriber Mar 13 '16
Title: Backslashes
Title-text: I searched my .bash_history for the line with the highest ratio of special characters to regular alphanumeric characters, and the winner was: cat out.txt | grep -o "\\\[[(].*\\\[\])][^)\]]*$" ... I have no memory of this and no idea what I was trying to do, but I sure hope it worked.
Stats: This comic has been referenced 36 times, representing 0.0349% of referenced xkcds.
xkcd.com | xkcd sub | Problems/Bugs? | Statistics | Stop Replying | Delete
→ More replies (9)7
2
u/reddog323 Mar 13 '16
It sounds like it. Would you consider the course worth taking? I'm new to programming, but very interested in security in that area lately.
→ More replies (1)1
u/Homersteiner Mar 13 '16
Even if you don't want to learn to hack
Hackers build stuff, crackers break stuff.
135
u/Archalon Mar 12 '16
Run child, run to the front page and protect them
38
5
u/AndroidPaulPierce Mar 12 '16
And saved pages everywhere only to be deleted in 2 months when you're cleaning the Saved out.
6
u/Umutuku Mar 13 '16
People remove saved pages? My saved links must be why reddit catches fire occasionally.
32
u/Bi9scuit Mar 12 '16
Imagine you are the owner of breddit.com, the number one social media site for the baking industry.
I'm loving this shit already.
29
9
u/jLynx Mar 12 '16
If you enjoyed this site, I highly recommend trying to complete this game, where the aim is to hack yourself to the end. It uses most of the techniques used in this site. Give it a go http://hack.darkn3ss.com/
6
u/BiggityBates Mar 12 '16
I am trying this site, but it isn't very merciful. It doesn't give you a solution, it just tells you you're wrong with no feedback to guide you (unless I just haven't got the password wrong enough times to start). I would like to know how to go about finding the correct answer instead of just being thrown back to about:blank.
→ More replies (1)2
u/yummyjelly Mar 13 '16
Any hints for level 6? Spoiler tag or pm. Thanks!
2
u/FireBred Mar 13 '16
What have you tried so far?
2
u/yummyjelly Mar 13 '16 edited Mar 13 '16
I've tried typing "youwillneverfindthis" into the box, executing the $.ajax code given in the source with "pass" replaced with "youwillneverfindthis" using chrome developer console, and opening the swf seperately and typing "youwillneverfindthis". Not really sure what else I can do with a swf.
→ More replies (2)
6
11
5
9
u/mrthicky Mar 12 '16
Can someone explain to me why websites don't check for characters that can cause errors before doing a query? (for SQL injection)
35
u/0xKaishakunin Mar 12 '16
Developers don't know Injection attacks, don't care or don't get enough time to do it right. Sometimes they don't even really know SQL, the just copy and paste from Google, Github or Sourceforge.
And QA costs money, so it's cut down.
→ More replies (4)1
Mar 12 '16
In addition to the other answers, there are lots of different contexts that user input can be used in, and lots of different ways that those contexts need to be checked. For instance, you might know to escape single quotes, but you might not know to escape square brackets.
1
Mar 12 '16
Hindsight is 20/20. A best practice approach I know of for today, apart from good ol' input sanitization, is to actually abstract away direct SQL commands. Instead, an application will use a stored procedure or access some surrogate server that is responsible for issuing SQL commands. It's very easy from a security monitoring perspective to pick out the bad guys after that because if you see raw SQL in any query, you know that's a spicy meatball.
1
u/just_speculating Mar 12 '16
It's not about checking for characters. It's about realizing you're building a piece of SQL using a variable that holds a piece of (user input) text. Those are not the same thing. That's like building a Lego castle with a hunk of cookie dough. It can be done, but eventually it will get messy.
Once you get in this mindset of "one of these things is not like the other" you see it everywhere when you're writing code and can handle it appropriately. Unfortunately very few developers are trained to be in this mindset.
1
u/das_ist_nuemberwang Mar 13 '16
If you try to check this for yourself, you'll get it wrong. Whatever language you use will have a way to do it for you, all you have to do is use that. But as everyone else has said, developers are either uninformed or lazy or don't care.
0
Mar 12 '16
[deleted]
8
u/zeny_two Mar 12 '16
Good dev! Bravo for being the only one to point out that parameterization is the real solution to SQL injection.
Encoding, escaping, and scrubbing input are inefficient and easy to get wrong.
0
Mar 12 '16
[deleted]
4
u/zeny_two Mar 13 '16
I am thoroughly impressed. My field is app sec but you've concocted an injection that I would never have thought to attempt. I hope they're paying you well!
→ More replies (5)2
u/validproof Mar 13 '16
Just to add a note on this discussion: For php it is often preferred to use PDO instead of mysql methods for parameterized queries.
PDO statements uses colons. Here is a code sample:
$params = array(':username' => 'test', ':email' => $mail, ':last_login' => time() - 3600); $pdo->prepare(' SELECT * FROM users WHERE username = :username AND email = :email AND last_login > :last_login'); $pdo->execute($params);I found this article comparing the two to be wonderful: http://code.tutsplus.com/tutorials/pdo-vs-mysqli-which-should-you-use--net-24059
→ More replies (2)0
Mar 12 '16
[deleted]
3
u/mrthicky Mar 12 '16
Couldn't they just check it against whatever encoding their SQL server is using? I guess I don't understand why it would matter their check interprets as the real values, as long as the SQL server does the same.
19
u/Myredditusernam Mar 12 '16
thats great, I came across SQL injection a while back and now I know why its so dangerous.
On another note I also learnt today that the website is built using the Bootstrap template!
42
u/terminus10 Mar 12 '16
Good ol' Bobby Tables
22
u/xkcd_transcriber Mar 12 '16
Title: Exploits of a Mom
Title-text: Her daughter is named Help I'm trapped in a driver's license factory.
Stats: This comic has been referenced 1185 times, representing 1.1486% of referenced xkcds.
xkcd.com | xkcd sub | Problems/Bugs? | Statistics | Stop Replying | Delete
7
5
8
u/Ambler3isme Mar 12 '16
Something something Relevant XKCD
4
3
u/xkcd_transcriber Mar 12 '16
Title: Exploits of a Mom
Title-text: Her daughter is named Help I'm trapped in a driver's license factory.
Stats: This comic has been referenced 1186 times, representing 1.1495% of referenced xkcds.
xkcd.com | xkcd sub | Problems/Bugs? | Statistics | Stop Replying | Delete
2
u/TheWetMop Mar 12 '16
The funny thing about bootstrap is that if you ever do any Web Development with it, you'll start seeing it everywhere. It looks great and is really easy to implement. Almost every start up page uses it to some extent
3
u/mechanoid_ Mar 12 '16
I love it. It solves all the difficult, hacky bits of design I hate.
→ More replies (1)1
1
Mar 13 '16
Can you do most of this without Bactrack Linux or Kali Linux? Cause I don't wanna have to dual boot or run a virtual machine.
2
1
u/usernamewillendabrup Mar 14 '16
How much background info do you reckon I need to understand this?
2
u/compilationfailed Mar 14 '16
Intermediate proficiency in PHP, Python or Java and basic computer network knowledge would be helpful.
2
u/usernamewillendabrup Mar 15 '16
Wow. Thanks for the playlist. I'll start chewing at it but it looks long.
3
u/WesNg Mar 12 '16
Anyone else get interested in hacking after watching Mr. Robot? Watching Elliot is almost like watching a pseudo superhero.
9
5
7
Mar 12 '16
Doesn't work with JavaScript turned off.
7
3
u/BaggaTroubleGG Mar 12 '16
And a bunch of different cloudfront domains whitelisted
6
Mar 13 '16
Apparently if you browse the Internet with security best practices (i.e. JavaScript turned off by default, or whitelist particular sites for JavaScript) then websites discussing security best practices won't work for you.
Sigh. It's laughable.
→ More replies (8)
1
u/Wombat789 Mar 12 '16 edited Mar 12 '16
Saw a very similar web page on the front page that won an award for good design. Lol'd hard when I realized it was right. Edit: here she is https://www.reddit.com/r/funny/comments/4a28p4/my_brother_won_a_website_design_contest_with_this/?ref=share&ref_source=link
1
u/compilationfailed Mar 13 '16
Hahahaha xD thanks for sharing! Exactly my thoughts when I visit bootstrap websites
2
u/id0-rsa Mar 12 '16
If you're interested in this topic and you're a coder, be sure to check out id0-rsa.pub. We have a series of cryptanalysis coding challenges along with some introductory material.
2
u/YourTermsOfUseSuck Mar 13 '16 edited Mar 13 '16
User content
In these terms and conditions, “your user content” means material (including without limitation text, images, audio material, video material and audio-visual material) that you submit to this website, for whatever purpose.
You grant to Hacksplaining a worldwide, irrevocable, non-exclusive, royalty-free license to use, reproduce, adapt, publish, translate and distribute your user content in any existing or future media. You also grant to Hacksplaining the right to sub-license these rights, and the right to bring an action for infringement of these rights.
Your user content must not be illegal or unlawful, must not infringe any third party's legal rights, and must not be capable of giving rise to legal action whether against you or Hacksplaining or a third party (in each case under any applicable law).
You must not submit any user content to the website that is or has ever been the subject of any threatened or actual legal proceedings or other similar complaint.
Hacksplaining reserves the right to edit or remove any material submitted to this website, or stored on Hacksplaining's servers, or hosted or published upon this website.
You own my generated content and are taking the rights to take legal action against others for my content? That's not very friendly.
2
4
4
u/DDevil_ Mar 12 '16
It's kinda funny how a site that teaches you how to protect yourself uses your social networks for login, but hey! What could go wrong? :D
49
u/michael1026 Mar 12 '16
Am I missing something here? All three of those websites are very secure. Their security is much better than this website's would be had they implemented their own login system.
→ More replies (1)22
u/53ze Mar 12 '16
Why do I even need to login to watch a few slideshows? The best security is the one that isn't necessary.
1
u/yosoyreddito Mar 12 '16
OAuth with limited permissions granted is better than trusting the site to manage login credentials. Especially when most people register using the same email/password combination for multiple services.
If you're really worried, just make an alt account for these types of registrations.
0
1
u/Lefty_22 Mar 12 '16
Seems like the theme here is 'don't click on links in your e-mail or on webpages that you haven't seen before'.
1
1
1
1
u/elspaniard Mar 12 '16
Love me some subtlepatterns. Their plugin has been extremely useful in design.
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
u/gagnonca Mar 13 '16
I'll have to check this out later. I work in software security so I'm intrigued how good it will be
1
1
1
1
1
1
u/masters1777 Mar 13 '16
https://news.ycombinator.com/item?id=11257454
Not mine, but the site itself, is vuln.
1
1
1
1
1
1
1
u/KarmaKingKong Mar 13 '16
How would you know if a site is vulnerable to SQL injections? I seriously doubt that websites exists wherein you can just enter those codes in the password section and gain access.
1
u/Trendy99935 Mar 13 '16
Awesome will have to sign up. Sign up options are limited though. Facebook? LinkedIn? Github? Who uses these? Will have to look in to one of these too.
I recommend Steve Gibson's security now podcast, very interesting and not overy complex, well sometimes it is.
1
1
u/gabrielolnunes Mar 13 '16
This is for noobies, in the clickjacking example they just swap the url from www.kittens.com to www.k1tt3ns.com without mention it, which in this case is the most important thing to be mentioned. I'm not saying it is useless, but they obviously have their target audience.
1
1
1
1
1
u/Stupid-comment Mar 13 '16
The SQL Injection tutorial was wildly entertaining. I really enjoyed this.
3
u/HamzaAzamUK Mar 13 '16
I'm stuck at enter 'or1=1-- as a password. Then it doesn't move forward. Gave up lol
→ More replies (1)
1
Mar 13 '16
Wow. Amazing! It's very well made. Props to the guys who made it! Educational and funny at the same time.
1
u/P1h3r1e3d13 Mar 13 '16
Great idea, and generally very well done, but it could stand a little copyediting.
1
1
1
1
1
u/dutchbob1 Mar 12 '16
only facebook, LinkedIn or GitHub sign-ups?
sounds bloody fishy to me...
3
u/wolfenx3 Mar 12 '16
It's as safe as creating a regular email(or username) login EDIT: I am curious as to why you need to login at all though, now that I think about it
1
u/blvsh Mar 12 '16
Well, I cant sign up with email, only github,facebook and linkedin.
They should learn about privacy as well while they're at it.
1
1
u/PardonMaiEnglish Mar 12 '16
This is why I cant be mad to all hackers/crackers etc. They might be doing something illegal. But damn they are clever.
This website is amazing btw.
1
u/Homersteiner Mar 13 '16
This is bullshit. Its for profit and will sell your info to spammers. I just tried to "sign up" and the only options for making a new account were "f," then some cat profile, and then some "in" icon. FCATIN? I dont have a cat, so does this mean that "fin" is the account sign in? Stupid fuckers.
-7
1
1
u/TotesMessenger Mar 12 '16
I'm a bot, bleep, bloop. Someone has linked to this thread from another place on reddit:
[/r/techsnap] Learn to Hack, Learn to Protect Yourself : learn about security vulnerabilities • /r/InternetIsBeautiful
If you follow any of the above links, please respect the rules of reddit and don't vote in the other threads. (Info / ^Contact)
1
u/wraith313 Mar 12 '16
I have to assume SQL injection isn't actually that easy, right?
2
u/xhankhillx Mar 12 '16
it is, and it can be completely automated by tools such as sqlmap. most sites are either already nuked or have been fixed by now. good luck finding an sql exploit on paypal or FB, as an e.g.
1
1
u/JaneWithoutACane Mar 12 '16
For anyone who's tried this website: Does this website teach you how to to hack or just about hacking?
2
1
u/egrocket Mar 12 '16
1 security vulnerability: Too many people visited this page and learned how to hack.
1
u/Theletterz Mar 12 '16
Commenting so I can find this later (when I'm sober.).
1
u/CabbagePastrami Mar 13 '16
Me too ! Great idea considering your lack of sobriety!!
Edit : i'm also suprised at the lack of jokes about using this material for "educational purposes".
1
1
Mar 13 '16
For a hacking website, you won't gain ANY trust by enforcing cross-site requests for logging in. However, requiring people link their Facebook account in order to sign up so that you can use for advertising. Wow, this is a very bad/ammatur start. I won't be recommending this.
1.3k
u/amirlyn Mar 12 '16
For the layman who doesn't want to take a course on this but still finds it interesting, I highly recommend these videos by Tom Scott.
Cracking Websites with Cross Site Scripting - Computerphile
Hacking Websites with SQL Injection - Computerphile
Cross Site Request Forgery - Computerphile