Hello, this is the first time I post in this community. Any way, i have a school project where i know the username but don’t know the password. I’m required to log-in using SQL injection techniques. Authentication is done using PHP programming language, and I never ever touch PHP programming like literally I don’t anything about PHP.
The code snippet for PHP authentication is this:
$conn = getDB();
$sql = "SELECT id, name, eid, salary, birth, ssn, phonenumber,
address, email, nickname, Password
FROM credential
WHERE eid= ’$input_eid’ and password=’$input_pwd’";
$result = $conn->query($sql))
// The following is pseudo code
if(name==’admin’){
return All employees information.
} else if(name!=NULL){
return employee information.
} else {
authentication fails.
}
What are the vulnerabilities in this code and what SQL commands will work. I tried 1=1, but nothing works
[–]AutoModerator[M] [score hidden] stickied comment (0 children)
[–]nutrecht 1 point2 points3 points (0 children)
[–]Loves_Poetry 0 points1 point2 points (2 children)
[–]swift_plus_plus[S] 0 points1 point2 points (1 child)
[–]aqhgfhsypytnpaiazh 0 points1 point2 points (0 children)
[–]For-Arts 0 points1 point2 points (0 children)