sql-injection

ADODB.Recordset error '800a0bb9' Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another

梦想与她 提交于 2020-01-03 06:35:12
问题 I've got an old website that is using ASP Classic and I have recently been asked remove the SQL injection attack threat. I'm trying to use parameterized queries, but it's all a little above my head. here is my code: <% whatSector = request.querystring("whatSector")%> <% adoCon.Open cString dim rs_client if whatSector="" then strSQL="SELECT * FROM clients ORDER BY alphabet" else Set objCommand = Server.CreateObject("ADODB.COMMAND") strCmd1 = "SELECT * FROM clients Where industrySector=? ORDER

duplicate-key error in mysql triggered by count(*) on group by

核能气质少年 提交于 2020-01-03 04:16:18
问题 hi every one i was reading a sans book about blind sql injection the author of the book mention that if you want to trigger an error in mysql use this query and inject it in the target 1 and (select 1 from (select count(*),concat(/*your malicious query here*/,floor(rand(0)*2)x from users group by x) a) and he says (author) that count(*) on a group by "floor(rand(0)*2)" causes a duplicate key in internal table and display the key My questions: first why he put the x there ? second what is

duplicate-key error in mysql triggered by count(*) on group by

浪子不回头ぞ 提交于 2020-01-03 04:16:10
问题 hi every one i was reading a sans book about blind sql injection the author of the book mention that if you want to trigger an error in mysql use this query and inject it in the target 1 and (select 1 from (select count(*),concat(/*your malicious query here*/,floor(rand(0)*2)x from users group by x) a) and he says (author) that count(*) on a group by "floor(rand(0)*2)" causes a duplicate key in internal table and display the key My questions: first why he put the x there ? second what is

Is validating $_GET id in database match secure enough?

孤者浪人 提交于 2020-01-02 07:30:10
问题 I have 2 pages on the website, one is index.php and index page list all posts that exist in database, and other page is post.php and post page display single post when clicked on specific post on index page. Now the code that i used to list all posts on index.php is: $postslist = mysqli_query($db, "SELECT * FROM posts"); while ($post = mysqli_fetch_array($postlist)) { echo '<a href="' .SITEURL.'/post.php?p='.$post['postid'].'>'.$post['title'].'</a>'; } And this works and i have all posts

SQL Injection Prevention

倖福魔咒の 提交于 2020-01-02 06:19:13
问题 I'm currently working on a legacy ASP project where security has now become a large concern. Not only is it insecure encryption methods (md5), but I'm worried about SQL injection problems. I'm not very good with injection quite yet, and I've tried only the basics of what I know. I've found the function which "secures" any user input, but I'm wondering if it is actually doing anything to prevent injection attacks. Here is the function: function sqlfix(input) if not isnull(input) and input <> "

Is this sufficient to prevent query injection while using SQL Server?

佐手、 提交于 2020-01-02 04:06:07
问题 I have recently taken on a project in which I need to integrate with PHP/SQL Server. I am looking for the quickest and easiest function to prevent SQL injection on SQL Server as I prefer MySQL and do not anticipate many more SQL Server related projects. Is this function sufficient? $someVal = mssql_escape($_POST['someVal']); $query = "INSERT INTO tblName SET field = $someVal"; mssql_execute($query); function mssql_escape($str) { return str_replace("'", "''", $str); } If not, what additional

Wordpress Database Output - Remove SQL Injection Escapes

自古美人都是妖i 提交于 2020-01-01 17:07:18
问题 I'm having a problem using $wbdb. When I insert or update data using $wpdb->insert or $wpdb->update, the SQL injection protection actually inserts the \' into the database, and when outputting that information it has the SQL escape with it. (ie: My Value\'s Escaped). I know there's gotta be a way to escape this using a wordpress function, but I haven't been able to find it searching google and the wordpress codex. ...So what's that function, or what am I doing wrong (seems like the '\'

Can I get SQL injection attack from SELECT statement?

允我心安 提交于 2020-01-01 04:56:48
问题 2 Questions actually: I know i must use Stored Procedures as much as Possible, but i would like to know the following please. A: Can i get a SQL Injection attack from a SELECT statement such as (Select * from MyTable) ? B: Also, can i get a SQL Injection attack when I use the SQLDataSource in ASP.NET? 回答1: To answer your questions. A: Yes, you can get an SQL Injection attack from any query that takes parameters (even calling stored procedures if you are not using the provided methods by your

How to use sp_executesql to avoid SQL Injection

无人久伴 提交于 2019-12-31 03:41:46
问题 In the below sample code, Table Name is an input parameter. In this case, how can I avoid SQL injection using sp_executesql . Below is the sample code, I am trying to use sp_executesql to avoid it but it doesn't work. Can anyone tell me how to correct it? ALTER PROC Test @param1 NVARCHAR(50), @param2 INT, @tblname NVARCHAR(100) AS BEGIN DECLARE @sql NVARCHAR(1000) SET @sql= N' select * from ' + @tblname + ' where name= @param1 and id= @param2'; PRINT @sql EXEC Sp_executesql @sql, N'@param1

My ASP.NET Website is Attacked With SQL Injection

我只是一个虾纸丫 提交于 2019-12-31 02:57:30
问题 Hacker reached my database User list and other tables. First of all, I use parameterized command in all of the transactions by using command.Parameters.Add("@Parameter1", SqlDbType.NVarChar).Value All transactions are stored procedures. I am inserting every single site navigation into database. Particular database table as follows; ID int (PK) UserID int (null) URL nvarchar(500) IPAddress nvarchar(25) CreatedAt datetime Project gets UserID information from the code is session opened or not.