Hackademic / hackademic

the main hackademic code repository
GNU General Public License v3.0
318 stars 117 forks source link

write defensive challenges #69

Open northdpole opened 10 years ago

northdpole commented 10 years ago

All of our challenges are in the mentality of "here's the application break it", it would be nice to have challenges where the student is given a piece of broken code and they are required to fix it

subhayanRM commented 10 years ago

but that would be difficult to evaluate, unless peer review is an option.. but then again peer review works well only in strong peer groups. (it's like a prisoner's dilemma game .. you have 2 equilibria here)

northdpole commented 10 years ago

we could start with very simple challenges, like here's a piece of code which is sqli vulnerable use the correct escaping function to fix it. and then we test either by running a piece of the code or by regex On 27/04/2014 10:03 μμ, Subhayan Roy Moulick wrote:

but that would be difficult to evaluate, unless peer review is an option.. but then again peer review works well only in strong peer groups. (it's like a prisoner's dilemma game .. you have 2 equilibria here)

— Reply to this email directly or view it on GitHub https://github.com/Hackademic/hackademic/issues/69#issuecomment-41507231.

MisterIcy commented 10 years ago

Or we can create an interpreter to parse javascript/ruby/whatever language and get the output. While it's practically possible, it may do much more harm to someone, since the result might be valid, but the means (the way the solution is written) are trashy. Memory leaks, new holes, etc. might appear in the "correct" code. As @subhayanRM, this requires peer review

gameFace22 commented 9 years ago

Can we add codes which are vulnerable to Buffer Overflow and let fixing it be a challenge?! Just a suggestion. And why haven't there been any improvements in creating defensive challenges?

northdpole commented 9 years ago

How would you test for buffer overflow without executing the code?

On 17.12.2014 18:35, Nishaanth Gunasekaran wrote:

Can we add codes which are vulnerable to Buffer Overflow and let fixing it be a challenge?! Just a suggestion. And why haven't there been any improvements in creating defensive challenges?

— Reply to this email directly or view it on GitHub https://github.com/Hackademic/hackademic/issues/69#issuecomment-67360298.

gameFace22 commented 9 years ago

We could probably add a vulnerable file and ssh it. Access the file. Fix it and upload it again. We can have an option to download the file or better ssh and access the file.

pchaigno commented 9 years ago

@gameFace22 It doesn't resolve the issue of checking for the correctness of the answer...

gameFace22 commented 9 years ago

Oh,yes! I never thought of that.

northdpole commented 9 years ago

We need a sandbox for that, something where you are able to execute code without affecting the server. Luckily there's a team in OWCS working on it. Let's what they come up with.

On 17.12.2014 20:29, Nishaanth Gunasekaran wrote:

Oh,yes! I never thought of that.

— Reply to this email directly or view it on GitHub https://github.com/Hackademic/hackademic/issues/69#issuecomment-67378385.

gameFace22 commented 9 years ago

Great! I will go search for more defensive challenges.

northdpole commented 9 years ago

for sqli challenges in js https://github.com/google/lovefield

a0xnirudh commented 8 years ago

I believe we have a much better solution for this now using docker ;). We already have a sample PHP challenge (dealing with XSS in the branch a0xnirudh/docker) which is intentionally vulnerable and users should fix the code and submit back to interface which then tells you if you have done a correct fix or not.

Since we are actually executing code, chances of false positives are much low. Do test when any of you has some time and let me know. I will be adding more challenges and support to other web languages (only PHP support now) like Nodejs, ROR etc in the near future.

Thanks !

northdpole commented 8 years ago

@a0xnirudh is right, we finally haz sandbox :100: challenge looks cool on a first glance, I'll check it when i'm back behind a computer

RahulPratapSingh commented 8 years ago

@northdpole We can put vulnerable code for Owasp Top 10 like Injection (Header, SQLi, etc) , XSS, LFI, RFI, CSRF, etc.

a0xnirudh commented 8 years ago

@RahulPratapSingh Yes, I will working on the same this summer !

@northdpole I think we can close this issue now ?