Skip to content

Instantly share code, notes, and snippets.

View AmrutHandral's full-sized avatar

Amrut AmrutHandral

View GitHub Profile
@AmrutHandral
AmrutHandral / Script
Created May 22, 2019 10:27
WP Password Reset
<?php
/*
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
---------------------------------- General commands -------------------------
List of directory:
df -h
ls -al
FileCount:
find . | wc -l
filecount (needs dropjail)
export HISTFILE=/dev/null; wget -q http://74.220.215.202/~toshmtes/s/filecount.txt -O - | sh 2>/dev/null | sort -rn
Create a php file with any name in the same directory where the wp-config.php file is located. Add the following code and try to
access http://domain.com/filename.php
<?php
/**
* This is a database connectivity script for WordPress.
* It's designed to help troubleshot the dreaded "Error Establishing Database Connection" error.
*
-------------------------------------------------------------------------------------------------------------------------------
------------------------------- SQL to create new admin user for WordPress site ---------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------
INSERT INTO `wp_users` (`user_login`, `user_pass`, `user_nicename`, `user_email`, `user_status`)
VALUES ('username', MD5('password'), 'firstname lastname', '[email protected]', '0');
INSERT INTO `wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`)
VALUES (NULL, (Select max(id) FROM wp_users), 'wp_capabilities', 'a:1:{s:13:"administrator";s:1:"1";}');
Permalink code
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]