sql-injection

Is this sanitization unsafe? Is it vulnerable to SQL Injection?

吃可爱长大的小学妹 提交于 2019-12-22 00:17:13
问题 Function RemoveSuspeitos(ByVal strTXT) Dim txtAux As String txtAux = strTXT txtAux = Replace(txtAux, chr(34), "") txtAux = Replace(txtAux, "'", "") RemoveSuspeitos = txtAux End Function DB: MSSQL 1) Forget syntax errors in the above code, I am not expert in VB. 2) Lets say I always use single or double quotes, even for int values (e.g.: '" + $int_id + "'). Is this sanitization unsafe? If yes, why? Please show me a real exploit scenario. 回答1: Here is my try. The problem with vulnerabilities is

Best Way to Prevent SQL Injection Using Javascript or C#?

允我心安 提交于 2019-12-21 20:14:15
问题 I'm currently writing an application which uses ajax on the front end and ASP.NET (C#) on the back end.. A Small Part of the application does an AJAX call to the backend code (to get entries from the SQL database) How can i prevent SQL of JScript injection? I know it is generally unsecure to validate with javascript because javascript can be turned off but as this is an AJAX call so if the user has javascript turned off the AJAX will never run. Whats the best way of validating or escaping the

Best Way to Prevent SQL Injection Using Javascript or C#?

耗尽温柔 提交于 2019-12-21 20:14:11
问题 I'm currently writing an application which uses ajax on the front end and ASP.NET (C#) on the back end.. A Small Part of the application does an AJAX call to the backend code (to get entries from the SQL database) How can i prevent SQL of JScript injection? I know it is generally unsecure to validate with javascript because javascript can be turned off but as this is an AJAX call so if the user has javascript turned off the AJAX will never run. Whats the best way of validating or escaping the

How can I get a username and password from my database in C#?

随声附和 提交于 2019-12-21 19:47:55
问题 I have the following code in my btn_click event: Sqlconnection con = new Sqlconnection("server=.;database=bss;user id=ab;pwd=ab"); con.open(); SqlCommand cmd = new Sqlcommand("select * from login where username='" + txt4name.Text + "' and pwd='" + txt4pwd.Text + "'", con); SqlDataReader reader = cmd.execute Reader(); Where login is the table and username and pwd are its fields. After this code all the values are stored in the reader object. I want to store username and pwd in the separate

How can I get a username and password from my database in C#?

北城余情 提交于 2019-12-21 19:46:10
问题 I have the following code in my btn_click event: Sqlconnection con = new Sqlconnection("server=.;database=bss;user id=ab;pwd=ab"); con.open(); SqlCommand cmd = new Sqlcommand("select * from login where username='" + txt4name.Text + "' and pwd='" + txt4pwd.Text + "'", con); SqlDataReader reader = cmd.execute Reader(); Where login is the table and username and pwd are its fields. After this code all the values are stored in the reader object. I want to store username and pwd in the separate

SQL Injection through mysql_query [duplicate]

时光总嘲笑我的痴心妄想 提交于 2019-12-21 09:23:55
问题 This question already has answers here : How can I prevent SQL injection in PHP? (28 answers) Closed 9 months ago . I'm working on a site that has been hacked through SQL Injection (at first glance only db entries are corrupted with cross-site scripting) the potential vulnerability I found after looking at the code is that there's a lot of mysql_query call whose inputs are not escaped at all. The good old : $query = "SELECT * FROM mytable where name LIKE '%".$_GET['name']."%'"; /*HACK HERE*/

SQL Injection through mysql_query [duplicate]

谁说我不能喝 提交于 2019-12-21 09:23:04
问题 This question already has answers here : How can I prevent SQL injection in PHP? (28 answers) Closed 9 months ago . I'm working on a site that has been hacked through SQL Injection (at first glance only db entries are corrupted with cross-site scripting) the potential vulnerability I found after looking at the code is that there's a lot of mysql_query call whose inputs are not escaped at all. The good old : $query = "SELECT * FROM mytable where name LIKE '%".$_GET['name']."%'"; /*HACK HERE*/

Showing custom error message on exception: A potentially dangerous Request.Form value was detected from the client

好久不见. 提交于 2019-12-21 07:16:34
问题 I am using Login Control of ASP.NET in my web application. I want to show a funny type of error on a label when this exception occures System.Web.HttpRequestValidationException: A potentially dangerous Request.Form value was detected from the client it occurs when a user try to do sql injection attack or some HTML or SCRIPT operations by entering them in Username text field of Login control. I tried many things such as enclosing the authentication login in try catch block and catching the

XSS Attack on the ASP.NET Website [closed]

随声附和 提交于 2019-12-21 05:06:25
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 9 years ago . I am in a very big trouble. Please help!!!!!!!!!! My website has been attacked by some malicious script < / title> < script src = http : // google-stats50.info/ur.php >. This script is appended to any column(s)

Does Hibernate Criteria Api completely protect from SQL Injection

蓝咒 提交于 2019-12-21 04:14:25
问题 I am working with Hibernate to protect my website from SQL Injection. I heard that Hibernate Criteria API is more powerful than HQL. Does Hibernate Criteria Api completely protect from SQL Injection? 回答1: Yes, it does. Criteria API as well as query parameters in HQL or JPQL both escape the parameters and would not execute malicious SQL. The vulnerability is only exposed if you simply concatenate the parameters into your query. Then any malicious SQL becomes part of your query. EDIT The OWASP