-2

I am a newbie at SQL injection. If I have some lines like this, how could I use SQL injection to bypass the SECRET Login, which means that I have to change the selection category from users to the_secret_table. However, I am not sure how to do that. If you know how to do it, please help me solve this. Thank you in advance.

$query = "SELECT username FROM users WHERE username = '" . $_POST['username'] . "' and password = ?";
    // Test:
    // $query = "SELECT _faculty1 FROM the_faculty_table"
    // $query = "SELECT _faculty2 FROM the_faculty_table"
    // $query = "SELECT the FROM the_faculty_table"
    // $query = "SELECT the_menu_user FROM the_canteen_table";
    // $query = "SELECT the_ceo_user FROM the_vingroup_table";
    //
    // $query = "SELECT the_secret_user FROM the_secret_table";
    // $query = "SELECT the_guest_user_1 FROM the_guest_table";
    // $query = "SELECT the_CFO_user FROM the_cbm_table";
    // $query = "SELECT V202145001 FROM the_students_table"
    // $query = "SELECT V202000001 FROM the_students_table"
    // $query = "SELECT V202000002 FROM the_students_table"
    // $query = "SELECT V202000003 FROM the_students_table"
    // $query = "SELECT V202000004 FROM the_students_table"
    // $query = "SELECT V202000005 FROM the_students_table"
    // $query = "SELECT V202000006 FROM the_students_table"
  • Does this answer your question? [How does the SQL injection from the "Bobby Tables" XKCD comic work?](https://stackoverflow.com/questions/332365/how-does-the-sql-injection-from-the-bobby-tables-xkcd-comic-work) – Your Common Sense May 20 '22 at 13:50
  • What did you try so far? Where *exactly* are you stuck? – nvoigt May 20 '22 at 13:51
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community May 23 '22 at 13:06

0 Answers0