Click here to Skip to main content
15,441,149 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm going to build a website in MVC4.
I want to know how to shield my site from hacking. What kind of things do I have to do to avoid being hacked. One thing I'm especially interested in is how to harden my code to fend off hacking attacks.

Thanks for any pointers in the right direction!
Updated 13-Dec-18 12:46pm
Manfred Rudolf Bihy 3-Aug-13 16:30pm     CRLF
The way you formulated your original question was not acceptable, as we don't offer any active advice on how hacking can be done. You'll have to research that for yourself. Advice on how to harden your code will be given more freely, so I decided to reformulate your question. I hope you don't mind my doing so. Regards, Manfred
Manfred Rudolf Bihy 3-Aug-13 16:36pm     CRLF
You can post links in comments, but you'll have to type in the anchor tag by hand. Just copy and paste won't work in the comments Editor. Cheers!
Patrice T 21-May-19 14:52pm     CRLF
Easier: type in the empty solution, it does all needed for the link; Then cut/paste to comment.

1 solution

One Thing you should definitely look into is SQL-Injection[^]. This technique can be easily thwarted by using parameterized SQL statements[^].

— Manfred
Share this answer
Member 8454063 4-Aug-13 10:42am     CRLF
yes i know . for example i know when i set JsonRequestBehavior on AllowGet , its open for Hijacking . but how can i solve it? public ActionResult MyAction(string str) { var result = MYClass.GetNumber(str); return Json(result, JsonRequestBehavior.AllowGet); }

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900