MySQL is an open-source relational database management system.

learn more… | top users | synonyms

1
vote
2answers
124 views

PHP security hacking question, may be more than just PHP

I have an input box for for INSERTing into the database. It is written in PHP PDO. Some one typed in: <"'> and also: ' onClick='alert(1); I'm assuming they were in two different input ...
0
votes
0answers
71 views

What does this injected query achieve?

On this very good link you can see some SQL injection expressions for MySQL. Quick Detection Error Based SQLi For integer inputs: (select 1 and row(1,1)>(select ...
0
votes
1answer
48 views

Detecting datasets that were affected by sql injection

Assuming that I know that one of my applications was attacked by an sql injection, how can I identify edited or selected data sets? On obvious source are webserver logs. This should allow us to ...
2
votes
2answers
97 views

Opening remote MySQL database to office IP address at default MySQL port risks?

I read a few questions regarding this topic that were pretty informative, but still wanted to pose my particular case. My company wants to put our data in the MySQL tables we have through our web ...
-1
votes
0answers
29 views

Exploiting User Input in Excel File

I'm doing the most basic of basic development projects having taken over someone else. There is an export that happens from a MySQL DB to a XSLX file. If I put my name in as =A1&A2&A3 then ...
1
vote
1answer
38 views

SQLi with comment filter: dumping the database

The following SQLi (MySQL) filter is from SQLi-Labs: ... $reg = "/#/" $reg1 ="/--/" $replace ="" $id=preg_replace($reg,$replace,$id); $id=preg_replace($reg1,$replace,$id); .... $sql = "SELECT ...
5
votes
2answers
324 views

SQL Injection query error with backslash

I have a sql injection vulnerable site which works well if i input query like this qq' -- // or qq' -- ; . But when i inject without slash or semi-colon it throws following error "You have an error in ...
5
votes
2answers
151 views

What's the best way to test for SQL Injection vulnerabilities? Manual or SQLMap?

As part of my job I test for web application vulnerabilities regularly. When it comes to SQL Injection, my methodology is to start by manually browsing the website and spidering it, then, sending the ...
1
vote
1answer
41 views

In a User Roles table is it better to identify users with an ID or username?

I want to create a user roles SQL table which stores information about users permissions and roles (Such as Admin, Worker, User) I need 2 columns in the table one which identifies which user it is ...
4
votes
4answers
318 views

MySQL user passwords in PHP

How do I prevent exposing MySQL usernames and passwords in PHP code when establishing a connection?
0
votes
1answer
64 views

Access MySQL via MySQL credentials, assuming no remote MySQL, FTP, or SSH access?

LAMP stack, dedicated server. I set up some MySQL users, gave them full access rights to the necessary databases, and provided the user credentials to some freelance developers. Now that the project ...
0
votes
1answer
44 views

mySQL into outfile strange behaviour

I have sql-injection with file_priv=Y (root user) but I can only create file in /tmp and /var/tmp directories even when i have 777 permissions to destination folder - mysql server just won't create ...
4
votes
0answers
37 views

Why would I use at-rest encryption over a DB's key-based encryption?

Goal I want to store encrypted data in a database. Constraints Application-level encryption (encrypting before sending to the DB) is not a reasonable option for my use case. The DB providers I'm ...
5
votes
1answer
7k views

Understanding Boolean Based SQL Injection

I am trying to understand the concept of Boolean Based Blind SQL Injection. I have gone through OWASP Guide To SQLi to understand it. However I am confused with how exactly does it work. Below id ...
0
votes
1answer
76 views

MySQL database (non-SSL) connections secured via origin/destination IPs, how unsafe are they?

I am testing an Amazon RDS MySQL solution: the database is provided by Amazon RDS but the application logic (php scripts) that accesses the data is hosted in another, different (non-amazon) server. ...
1
vote
1answer
56 views

Amazon RDS MySQL SSL connection, is the password sent in clear?

I am testing Amazon RDS MySQL and I want to connect to MySQL instance using SSL. It works pretty well, but there is something that is not clear to me: reading the FAQs ...
0
votes
0answers
40 views

Getting user to login, then checking if someone is logged in already [migrated]

I'm horrible at security so I was curious if you guys had any ideas. I recently wrote an application in Python that I will be selling to select people. The information on the application is private ...
0
votes
1answer
113 views

How does one securely create a MySQL database and user via the command line?

I'm making an app whose functionality includes creating a database and its user. This is accomplished like so: mysql -e "grant all on database.* to 'user'@'localhost' identified by '$PW';" $PW is ...
0
votes
1answer
33 views

Getting Operating System Username using MySQL SQLi

Suppose I have a website which has SQL injection vulnerability and I got the database schema etc. Is there any means by which I can get the operating system username or the SSH username? Asking from ...
0
votes
1answer
81 views

Dumping custom query via SQL injection when output is in the die() function?

On my localhost I have a PHP link like this abc.com/index.php?q=XYZ where XYZ is a base64encoded parameter that I have verified is injectable. When I try abc.com/index.php?q=XYZ' it returns You ...
0
votes
0answers
49 views

MySQL SQL Injection - Get User Password

I've used SQLMAP to check for SQL injection. I've managed to retrieve the name of just one database (dbInfo) However, using SQLMAP I can't enumerate anything else - where it is tables within the DB ...
37
votes
2answers
30k views

Where to store a key for encryption?

I am looking for a way to store a key used for password encryption. I am using a MySQL database which would store a user name and a password encrypted with AES_ENCRYPT(str,key_str). Where can I safely ...
6
votes
3answers
595 views

Making database code open source

I am building a web app. It is currently not open source, but I am considering making it open source, so that others can fix bugs, improve it, so that others are not suspicious of my motives (fun to ...
1
vote
0answers
14 views

Create a non root user for MySQL with minimal right as using root is not secure [closed]

General rule for root MySQL user is from infosec point of view: "Do not use root for any web application for MySQL connection, Select, Update, or Delete queries. Instead of create and use another ...
3
votes
1answer
53 views

Should I use random usernames for a MySQL database? [duplicate]

I have a script that accesses a MySQL database - clearly a strong, random password and a username unique to the script with no more privileges than it needs are all sensible norms here. However, is ...
2
votes
1answer
83 views

Sqlmap, how to move forward? [duplicate]

So, I'm using Sqlmap for a while now to test the security for my company (we're too small to have IT guy and I'm the closest they got for now), I already managed to access the database remotely and ...
0
votes
2answers
120 views

Is my code using mysqli_real_escape_string and quotes100% safe against SQL Injection?

My code is: SELECT * FROM tlb_members WHERE username="{mysqli_real_escape_string($_GET['test'])}" I'm searching and some people said using quotes in SQL statements is safe. Is this true?
5
votes
3answers
171 views

Securely storing an encryption key on AWS

Regardless of the format of encryption, what is the best way to store an encryption key on an AWS EC2 server? I am storing encrypted information in a MySQL database and my cryptography key is stored ...
3
votes
1answer
76 views

Why is this SQL Injection attempt failing on DVWA?

I'm practicing SQL injection on DVWA (non-blind) with the lowest security settings. I want to list the tables in the current database. To do that, I attempt to enter 0'; show tables;-- in the User ID ...
-1
votes
3answers
3k views

How to hack into a remote mysql database?

(Moved from Stack Overflow as other users said it was a security question) I have a mysql database sitting on a remote server. Nothing else, ie no web site using it, no server side scripts etc, ...
6
votes
2answers
122 views

Securing MySQL server from remote connection

I need to open the port for my MySQL server to the outside and from what I read, the default configuration is not secure nor encrypted. For that I have a few solutions in mind with their reason but ...
1
vote
1answer
102 views

what is the best way to know if the entered decryption key is correct?

I was searching for a way to store the encryption key of AES_ENCRYPT and found a good answer here: where to store a key for encryption However, now I am trying to use "Type in the encryption key when ...
-2
votes
1answer
111 views

Whats the most secure way to send user data from client to server? [closed]

I know there are probably many existing answers to this question but so far I couldn't find a simple detailed answer. On the android app there is two buttons, sign in with facebook and sign in with ...
4
votes
1answer
2k views

Website Login Security (Secure enough?)

I'm making a bigger site for the first time so security really matters, unlike for my really-bad boards with maybe 10 users. So I wanted to ask if the way I'm doing it is secure enough for a semi-big ...
-1
votes
1answer
105 views

why database show vulnerable column when i give a wrong parameter in query?

When we try for inject a website for find vulnerable column then sometimes we need to give a wrong value in the website parameter. Like www.vhul-web.com/index.php?id=1 union select 1,2,3 -- - Now ...
0
votes
1answer
85 views

MySQL AES_ENCRYPT Logs Output

Need: I need to be able to store AES encrypted user data (journal entries) in my database and those entries need to be plain-text searchable. Issue: MySQL outputs queries to its logs in plain text. ...
5
votes
1answer
135 views

sqlmap HTTP 405 error on a vulnerable POST parameter

For academical purposes I need to explode a blind sql injection on a form paramater which is sent using the POST method. The form is very simple, it just has an input text box where to introduce the ...
9
votes
2answers
2k views

When viewing my website from port 3306, I see some weird MySQL info

If I visit my web URL and force port 3306 (MySQL), I see a suspicious looking web page: Is this exposing any vulnerabilities for me? Should I block port 3306?
3
votes
1answer
316 views

SQLMAP and DBMS credentials, how do you use them?

for educational purposes and in order to develop a test for students, i try to "hack" a website developped by a friend : http://www.websitetohack.com.index.php?id=5 When i launch SQLMAP, it finds a ...
3
votes
1answer
380 views

SQL Injection - login bypass [closed]

Background information: SQL Injection as a school task. Login bypass. Given two input fields name and password. Confirm via solve button. Info on what I have and was able to find out: it is ...
17
votes
4answers
9k views

Is it possible to do SQL injection (HIGH Level) on Damn Vulnerable Web App?

I searched all over google to see how it would be possible to bypass the following (it's from the high level of security from DVWA): <?php if (isset($_GET['Submit'])) { // Retrieve data $id ...
4
votes
2answers
177 views

Saving Personal Information (Name, Address, Phone, Email) in MySQL Database

I'm going to build a web app for people to sign up and pay for a membership. The transaction information will all be processed through Authorize.NET but we save the rest of the information (Name, ...
5
votes
2answers
4k views

MySQL AES_ENCRYPT key length

AES_ENCRYPT uses a 128 bit long key to encrypt the data, but how MySQL handle longer or shorter keys? I found out that PyCrypto for instances recomend to transform the key by using MD5, SHA-1, SHA-2, ...
-1
votes
1answer
69 views

How do a basic tests for webapp - online tool made with PHP (forms, shell access, session) [closed]

I created a webapp in PHP (MySQL, jQuery) and now I want to take necessary security measures in order to keep it up and running and harmless for my VPS. App has several public forms ($_POST, $_GET, ...
6
votes
1answer
317 views

Why would output from sqlmap be trimmed?

I've decided to learn sqlmap but having an issue with Sqlmap trimming some of my output, the hash. The hash is about to be 32 characters long but I'm only getting 25 and the warning: [WARNING] ...
0
votes
0answers
53 views

Mysql SSL handshake: symmetric key exchange with CA or server key?

I have my MySQL database set up to require server and client identify verification, with both presenting their certificates signed by the same CA (mysql user was set up with 'require X509'). ...
-1
votes
1answer
135 views

Is it okay to have a blank root password for MySQL if port 3306 is not forwarded?

I'm running a PHP server that will use the root account to access the database. However, the server is behind a router and port 3306 is not port forwarded. Is it okay to have a blank password for the ...
5
votes
2answers
283 views

MySQL BACKRONYM (CVE-2015-3152) only affects MySQL client?

I read the CVE-2015-3152 (https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-3152) named BACKRONYM (http://backronym.fail/), and what I understood (ELI5 style) was the following: Attacker ...
4
votes
1answer
33 views

How much extra security do the Host part of a mysql user account provide?

MySQL users have a username and a Host associated with them, so usually you'd identify the user by 'user'@'host'. The host part is there to assure only clients which connect from that specific host ...
1
vote
1answer
42 views

MySQL Full Text Search Safety

Is this code safe from sql injection? $search = $_GET ['search']; $query = $db->prepare("SELECT COUNT(*) AS num FROM table WHERE MATCH (id,keywords) AGAINST ('$search*' IN BOOLEAN MODE)"); ...