A little doubt about SQL injection
I make in localhost a vulnerable script.
if (isset($_POST['username'], $_POST['password'])) {
$username = $_POST[****'username'];
$password = $_POST[****'password'];
$sql = "SELECT * FROM `user` WHERE `username`='$username' AND `password`='$password';";
$users = mysqli_query($con, $sql);
}
And send
username = "'; INSERT INTO `user` (`username`, `password`) VALUES ('test', 'test'); #"
password = ""
This is the complet query
SELECT * FROM `user` WHERE `username`=''; INSERT INTO `user` (`username`, `password`) VALUES ('test', 'test'); #' AND `password`='';
If I put this query in phpmyadmin the query select no user and insert the new line test:test but when I inject this value in form and post the new line isn’t inserted. It can be a protection against injection or I do some syntax error?
?
I will use this like username
'"; mysqli_query($con, "INSERT INTO `user` (`username`, `password`) VALUES ('test', 'test');");//
and the query will create a new mysqli_query
$sql = "SELECT * FROM `user` WHERE `username`=''"; mysqli_query($con, "INSERT INTO `user` (`username`, `password`) VALUES ('test', 'test');");//' AND `password`='$password';";
lol
Thanks, I’m making some scripts to test.
?
From my experience - most websites have PMA in the same directory tree (ex. www.sitename.com/phpmyadmin), so it is actually better to find voulnerabilities in the site itself - SQL injections, Shell injections etc. Past month I’ve been studying Vega and I suggest you to try it out too. It will sniff the target for vulnerabilities and if it finds, for ex., SQL or SHELL injection area, you can try to inject in specified area and get the access to whole database/s and even more.
Also, if you do find voulnerable SQL injection area, try using SQLMap. It’s basic, but it’s worth a try.
P.S. This indian guy posted another, very basic and easy way to get access to PMA via login form. Video is little bit annoying and slow, but funny. You will get the idea. :D
Best of luck @bolofecal and I hope you are doing this for learning purpose :D haha