sql-injection

Valid Email Addresses - XSS and SQL Injection

冷暖自知 提交于 2019-12-04 02:19:39
Since there are so many valid characters for email addresses, are there any valid email addresses that can in themselves be XSS attacks or SQL injections? I couldn't find any information on this on the web. The local-part of the e-mail address may use any of these ASCII characters: Uppercase and lowercase English letters (a–z, A–Z) Digits 0 to 9 Characters ! # $ % & ' * + - / = ? ^ _ ` { | } ~ Character . (dot, period, full stop) provided that it is not the last character, and provided also that it does not appear two or more times consecutively (e.g. John..Doe@example.com). http://en

How to execute arbitrary parameterized SQL in rails

佐手、 提交于 2019-12-04 01:09:20
For performance reasons, I need to write a new method in my Rails model that executes some arbitrary SQL: UPDATE table SET col1 = ? AND col2 = ? WHERE id = ? I understand I can use ActiveRecord::Base.connection.execute or ActiveRecord::Base.connection.update with a string of SQL to get the results I need, but what is the proper procedure for substituting the parameter placeholders ( ? ) with the actual parameter values? Is there a Rails method for interpolating parameters into a SQL statement, or should it just be done by manual interpolation? The latter seems unsafe... You could also do this:

C# sqlite injection [duplicate]

风流意气都作罢 提交于 2019-12-03 23:20:27
This question already has answers here : Closed 5 years ago . Avoiding SQL injection without parameters (21 answers) If I change my select from String insSQL2 = "select * from Produtos where nome = '" + txtBuscaNome.Text + "'" To String insSQL2 = "select * from Produtos where nome = ''" + txtBuscaNome.Text + "''" Will it prevent sql injection? No. SQL injection isn't about creatively using quote characters. It's about treating input as data instead of as code . Take a look at a classic SQL injection vulnerability: "SELECT * FROM Users WHERE Id = " + someValue; It may intuitively look like you

What is SQL injection [closed]

回眸只為那壹抹淺笑 提交于 2019-12-03 22:15:19
I want to know about SQL injection. So, please help me. Lots of information about SQL Injection on wikipedia, and xkcd has a very good example as well. In general, if your application is using a SQL database, a SQL Injection attack is an attempt to use your program to pass dangerous values to the SQL database. The best preventative measures are to never construct SQL strings without cleaning them up - the best way to do this is to use parameterized queries and widely used data access libraries. Start here: google "sql injection" . You will see that there is plenty to read about it. If you want

PHP What is the default charset for pdo mysql

岁酱吖の 提交于 2019-12-03 21:52:06
I was reading about the second order MySQL injection on this page Are PDO prepared statements sufficient to prevent SQL injection? . and it brought many questions about the charset , and I am not sure if my code is safe to MySQL injection In my code, I never use charset while making a query, I simply do $pdo = new PDO("mysql:host=" . DB_HOST . ";dbname=" . DB_NAME, DB_USER, DB_PASSWORD, [PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC, PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, PDO::ATTR_EMULATE_PREPARES => false, PDO::ATTR_PERSISTENT => false]); $stmt = $pdo->prepare("SELECT * FROM

how to prevent SQL Injection in JSP?

£可爱£侵袭症+ 提交于 2019-12-03 17:48:03
问题 Just last week, I was doing some PHP stuff. I worked a little solution to prevent SQL injections. PHP has been always my man, it has readily 3 solutions for use (maybe more). One is to enable "magic queries" using stripslashes() function. Another one (the recommended) is to use mysql_real_escape_string() function. That simple and my problem is solved. However, things don't seem to be that simple when it comes to JSP. I searched and didn't find any built-in function to strip slashes or do

Dynamic LINQ with direct user input, any dangers?

时光怂恿深爱的人放手 提交于 2019-12-03 17:20:42
问题 I have a table in a ASP.NET MVC application that I want to be sortable (serverside) and filterable using AJAX. I wanted it to be fairly easy to use in other places and didn't feel like hardcoding the sorting and filtering into query expressions so I looked for a way to build the expressions dynamically and the best way to do this I found was with Dynamic LINQ. User input from a URL like below is directly inserted into a dynamic Where or OrderBy. /Orders?sortby=OrderID&order=desc&CustomerName

Found 'OR 1=1/* sql injection in my newsletter database

杀马特。学长 韩版系。学妹 提交于 2019-12-03 16:22:22
问题 I found the following in the "e-mail" field of my newsletter subscriber database: ' OR 1=1/* I know it's a SQL injection, but that's it. I've googled it a little bit, but I'm still on clear on what exactly it's trying to achieve. This occurred early Nov, and to my knowledge we had no outages around that time. Can any of you kind souls tell me what this guy was probably trying and do? Is there any way to know whether he achieved what he was trying to do? I know virtually nothing about this and

XSS Attack on the ASP.NET Website [closed]

落爺英雄遲暮 提交于 2019-12-03 15:51:42
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) of some table automatically. I have removed this script. But after a few hours, it re-appeared in some tables. But this time it is < / title> < script src = http : // google-stats49.info/ur.php >. My client is complaining about the script. Technology used is ASP.NET 1.1, SQL SERVER 2005. Please help. Thanks in advance!!!!!! When you render the text from the database you can use two ways

Found a weak escape function for MySql, how to exploit?

不羁的心 提交于 2019-12-03 14:58:50
问题 In an application I'm working on I've found a weak escape function to prevent injection. I'm trying to prove this, but I'm having trouble coming up with a simple example. The escape function works as follows (PHP example). function escape($value) { $value = str_replace("'","''",$value); $value = str_replace("\\","\\\\",$value); return $value; } I realize this doesn't deal with values encoded using double quotes ("), but all queries are constructed using single quotes ('). Who can defeat this