Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Database is not setting up anyone please suggest something else to move forward #26

Open
anukaal opened this issue Mar 31, 2020 · 2 comments

Comments

@anukaal
Copy link

anukaal commented Mar 31, 2020

\n";} else {echo "[*]...................Error purging database: " . mysqli_error($con); echo "

\n";} //Creating new database security $sql="CREATE database security CHARACTER SET gbk "; if (mysqli_query($con, $sql)) {echo "[*]...................Creating New database 'SECURITY' successfully";echo "

\n";} else {echo "[*]...................Error creating database: " . mysqli_error($con);echo "

\n";} //creating table users $sql="CREATE TABLE security.users (id int(3) NOT NULL AUTO_INCREMENT, username varchar(20) NOT NULL, password varchar(20) NOT NULL, PRIMARY KEY (id))"; if (mysqli_query($con, $sql)) {echo "[*]...................Creating New Table 'USERS' successfully";echo "

\n";} else {echo "[*]...................Error creating Table: " . mysqli_error($con);echo "

\n";} //creating table emails $sql="CREATE TABLE security.emails ( id int(3)NOT NULL AUTO_INCREMENT, email_id varchar(30) NOT NULL, PRIMARY KEY (id) )"; if (mysqli_query($con, $sql)) {echo "[*]...................Creating New Table 'EMAILS' successfully"; echo "

\n";} else {echo "[*]...................Error creating Table: " . mysqli_error($con);echo "

\n";} //creating table uagents $sql="CREATE TABLE security.uagents ( id int(3)NOT NULL AUTO_INCREMENT, uagent varchar(256) NOT NULL, ip_address varchar(35) NOT NULL, username varchar(20) NOT NULL, PRIMARY KEY (id) )"; if (mysqli_query($con, $sql)) {echo "[*]...................Creating New Table 'UAGENTS' successfully";echo "

\n";} else {echo "[*]...................Error creating Table: " . mysqli_error($con);echo "

\n";} //creating table referers $sql="CREATE TABLE security.referers ( id int(3)NOT NULL AUTO_INCREMENT, referer varchar(256) NOT NULL, ip_address varchar(35) NOT NULL, PRIMARY KEY (id) )"; if (mysqli_query($con, $sql)) {echo "[*]...................Creating New Table 'REFERERS' successfully";echo "

\n";} else {echo "[*]...................Error creating Table: " . mysqli_error($con);echo "

\n";} //inserting data $sql="INSERT INTO security.users (id, username, password) VALUES ('1', 'Dumb', 'Dumb'), ('2', 'Angelina', 'I-kill-you'), ('3', 'Dummy', 'p@ssword'), ('4', 'secure', 'crappy'), ('5', 'stupid', 'stupidity'), ('6', 'superman', 'genious'), ('7', 'batman', 'mob!le'), ('8', 'admin', 'admin'), ('9', 'admin1', 'admin1'), ('10', 'admin2', 'admin2'), ('11', 'admin3', 'admin3'), ('12', 'dhakkan', 'dumbo'), ('14', 'admin4', 'admin4')"; if (mysqli_query($con, $sql)) {echo "[*]...................Inserted data correctly into table 'USERS'";echo "

\n";} else {echo "[*]...................Error inserting data: " . mysqli_error($con);echo "

\n";} //inserting data $sql="INSERT INTO security.emails (id, email_id) VALUES ('1', 'Dumb@dhakkan.com'), ('2', 'Angel@iloveu.com'), ('3', 'Dummy@dhakkan.local'), ('4', 'secure@dhakkan.local'), ('5', 'stupid@dhakkan.local'), ('6', 'superman@dhakkan.local'), ('7', 'batman@dhakkan.local'), ('8', 'admin@dhakkan.com')"; if (mysqli_query($con, $sql)) {echo "[*]...................Inserted data correctly into table 'EMAILS'";echo "

\n";} else {echo "[*]...................Error inserting data: " . mysqli_error($con);echo "

\n";} //CREATE TABLE security.search (id int(3) NOT NULL AUTO_INCREMENT, search varchar(20) NOT NULL, PRIMARY KEY (id)); //INSERT INTO security.search (search) VALUES ( 'Dumb@dhakkan.com'), ('Angel@iloveu.com'), ('Dummy@dhakkan.local'), ( 'secure@dhakkan.local'), ( 'stupid@dhakkan.local'), ( 'superman@dhakkan.local'), ( 'batman@dhakkan.local'), ( 'admin@dhakkan.com')"; //including the Challenges DB creation file. include("../sql-connections/setup-db-challenge.php"); ?>

@mukkul007
Copy link

@anukaal Hi Anurag. Looking at the traceback of yours, I suspect the password of the database is not set up properly. Please have a look at that.
Also, it seems like you changed the code to work with php7. In case, there is something left missing in your code and it is creating problems in running this lab, you can use the updated lab available at https://github.com/mukkul007/sqli-labs-kali2

@anukaal
Copy link
Author

anukaal commented Apr 1, 2020

its not that problem....Something else . I am doing in mac

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants