Last active
September 27, 2019 07:18
-
-
Save Tedezed/d0821d805efafb05a3d4037251e94ad1 to your computer and use it in GitHub Desktop.
Revisions
-
Tedezed revised this gist
Sep 27, 2019 . 1 changed file with 6 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,19 +1,20 @@ <?php // php check_password_admin_wordpress.php USER_PASSWORD WORDPRESS_DATABASE_USER WORDPRESS_DATABASE_PASSWORD MARIADB_HOST MARIADB_PORT_NUMBER WORDPRESS_DATABASE_NAME PATH_WP_INCLUDES // Arguments var_dump($argv); $password = $argv[1]; $db_user = getenv($argv[2]); $db_pass = getenv($argv[3]); $db_host = getenv($argv[4]); $db_port = getenv($argv[5]); $db_database = getenv($argv[6]); $path_wp_includes = getenv($argv[7]); // include_once(dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . "wp-includes" . DIRECTORY_SEPARATOR . "class-phpass.php"); include_once($path_wp_includes . "class-phpass.php"); $conn = new mysqli($db_host,$db_user,$db_pass,$db_database,$db_port); @@ -29,4 +30,4 @@ echo "password is incorrect \n"; } ?> -
Tedezed created this gist
Sep 24, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,32 @@ <?php // php check_password_admin_wordpress.php USER_PASSWORD WORDPRESS_DATABASE_USER WORDPRESS_DATABASE_PASSWORD MARIADB_HOST MARIADB_PORT_NUMBER WORDPRESS_DATABASE_NAME // Arguments var_dump($argv); // include_once(dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . "wp-includes" . DIRECTORY_SEPARATOR . "class-phpass.php"); include_once("/opt/bitnami/wordpress/wp-includes/class-phpass.php"); $password = $argv[1]; $db_user = getenv($argv[2]); $db_pass = getenv($argv[3]); $db_host = getenv($argv[4]); $db_port = getenv($argv[5]); $db_database = getenv($argv[6]); $conn = new mysqli($db_host,$db_user,$db_pass,$db_database,$db_port); //$result_query = mysqli_query($conn, "SELECT user_pass FROM wp_users WHERE id=1;"); $result_query = $conn->query("SELECT user_pass FROM wp_users WHERE id=1;"); $row = mysqli_fetch_assoc($result_query); $wp_hasher = new PasswordHash(8, true); $check = $wp_hasher->CheckPassword($password, $row['user_pass']); if($check) { echo "password is correct \n"; } else { echo "password is incorrect \n"; } ?>