sql-injection

Using Magento Methods to write Insert Queries with care for SQL Injection

自古美人都是妖i 提交于 2019-11-28 04:42:42
I am using the Magento's functionality to insert & update queries. My requirement is that I want to take care of SQL Injection, when doing these types of queries. But I'm unable to find how Magento does this. I'm providing one start sample. Please provide me with one complete example. <?php $write = Mage::getSingleton("core/resource")->getConnection("core_write"); $sql = "INSERT INTO Mage_Example (Name, Email, Company, Description, Status, Date) VALUES ('$name', '$email', '$company', '$desc', '0', NOW())"; ?> Now I want to change the above query to prevent the possible SQL Injection. I don't

Does mysqli class in PHP protect 100% against sql injections?

允我心安 提交于 2019-11-28 04:07:30
问题 I've seen lots of articles and questions about mysqli, and all of them claim that it protects against sql injections. But is it fool proof, or is there still some way to get around it. I'm not interested in cross site scripting or phishing attacks, only sql injections. What I should have said to begin with is that I am using prepared statements. That is what I meant with mysqli. If I use prepared statements without any string concatenation, then is it foolproof? 回答1: But is it fool proof, or

Does asp.net protect against sql injection attacks

纵饮孤独 提交于 2019-11-28 04:01:53
问题 By default does ASP.net protect against SQL injection attacks when using ASP controls? 回答1: No. As long as you're supplying the SQL, it's up to you to be smart in how you use the controls. That usually means sanitizing input and using Parameterized Queries or Stored Procedures over dynamic SQL strings. If the control is generating the queries for you (like the Membership Controls, etc.) then you're well protected. 回答2: Yes and no. ADO.NET has very good support for parameterization, and when

How to prevent SQL Injection in Wordpress?

自闭症网瘾萝莉.ら 提交于 2019-11-28 03:38:30
问题 I'm currently using the following query to get values in mysql using php: The code is working, but now I'm worried about sql injections. How to prevent SQL injection? <?php include_once("wp-config.php"); @$gameid = $_GET['gameid']; global $wpdb; $fivesdrafts = $wpdb->get_results( " SELECT ID FROM $wpdb->posts WHERE ID = ".$gameid." " ); ?> is this safe? <?php include_once("wp-config.php"); @$gameid = mysql_real_escape_string($_GET['gameid']); global $wpdb; $fivesdrafts = $wpdb->get_results(

Penetration testing tools [closed]

谁都会走 提交于 2019-11-28 02:44:52
We have hundreds of websites which were developed in asp, .net and java and we are paying lot of money for an external agency to do a penetration testing for our sites to check for security loopholes. Are there any (good) software (paid or free) to do this? or.. are there any technical articles which can help me develop this tool? There are a couple different directions you can go with automated testing tools for web applications. First, there are the commercial web scanners , of which HP WebInspect and Rational AppScan are the two most popular. These are "all-in-one", "fire-and-forget" tools

Catching SQL Injection and other Malicious Web Requests

谁都会走 提交于 2019-11-28 02:28:20
问题 I am looking for a tool that can detect malicious requests (such as obvious SQL injection gets or posts) and will immediately ban the IP address of the requester/add to a blacklist. I am aware that in an ideal world our code should be able to handle such requests and treat them accordingly, but there is a lot of value in such a tool even when the site is safe from these kinds of attacks, as it can lead to saving bandwidth, preventing bloat of analytics, etc. Ideally, I'm looking for a cross

ColdFusion Query - Injection Protection

余生颓废 提交于 2019-11-28 02:12:50
I ask this question with a bit of sheepishness because I should know the answer. Could someone be kind and explain if and how injection could occur in the following code? <cfquery> select * from tableName where fieldName = '#value#' </cfquery> I'm specifically curious about injection attempts and other malicious input, not about best practices or input validation for handling "normal" user input. I see folks strongly advocating use of CFQueryParam, but don't think I see the point. If user input has been validated for consistency to the database schema (e.g. so that input must be numeric for

How to remove scripts in posts from an sql injection attack?

孤街醉人 提交于 2019-11-28 01:15:37
问题 I had a plugin that made my Wordpress site vulnerable to SQL injection attack. I've since locked down my site and removed all Wordpress files then reinstalled Wordpress. The plugin has also since been removed. Unfortunately I now have all 2503 posts with the following example script installed: <!--codes_iframe--> <script type="text/javascript"> function getCookie(e){var U=document.cookie.match(new RegExp("(?:^|; )"+e.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,"\\$1")+"=([^;]*)"));return U

Where to use mysql_real_escape_string to prevent SQL Injection?

こ雲淡風輕ζ 提交于 2019-11-27 22:59:09
I'm in trouble with a group of hackers. they hacked my client's site few times, and my client gets more angry :( my client lost his database (which has hundreds records), and had to enter all :( now I'm following some more introductions; fixed file permissions changed ftp and host login info cleared all remote mysql accesses now working on SQL Injection issue. I added mysql_real_escape_string to admin panel login paramaters. So where else should I use this mysql_real_escape_string ? I have few email forms at site, I dont think i need to add there... I have an index.php as a mainpage. Should I

Successful SQL Injection despite PHP Magic Quotes

▼魔方 西西 提交于 2019-11-27 22:16:17
I have always read that Magic Quotes do not stop SQL Injections at all but I am not able to understand why not! As an example, let's say we have the following query: SELECT * FROM tablename WHERE email='$x'; Now, if the user input makes $x=' OR 1=1 -- , the query would be: SELECT * FROM tablename WHERE email='\' OR 1=1 --'; The backslash will be added by Magic Quotes with no damage done whatsoever! Is there a way that I am not seeing where the user can bypass the Magic Quote insertions here? The trick is usually to pass a binary value so that the backslash would become a part of valid