.

.

Sunday, May 28, 2017

Roshan Thpa

How to Hack a WordPress Site using SQL Injection

STEP 1 – Find out Vulnerabilities in WordPress Website

If your website has been hacked or you want to make sure no one can hack this, you must take a look on plugin files and their coding. Might be somewhere coder is using sql queries without awareness of SQL Injection way to hack wordpress website. If this is somewhere, hacker will use union query and can fetch your all database rows from wp_users table and below is an example query to fetch all wordpress users using union query to know email addresses of all users.
What exactly hacker doing is here to know email of the admin, for this, he is using an union query.
Few months ago, Plugin all-video-gallery had a Vulnerabilities in config.php because of following code.
In this query, Plugin developer was using $_pid variable directly in query without any type casting.
$_pid=$_GET['pid']
So hacker could pass this union query using pid attribute parameter in url like this.
if you append that union query in this query it’s become as below.
This file output is a xml file
how to hack wordpress site step 1 How to Hack a Wordpress Site using SQL Injection

STEP 2 – Reset WordPress Password and Get Activation Key

Now they’ll try to reset your password using administrator’s email. For this, they’ll go to login page and will click on Lost Your Password link. On this time, A new activation code will be mailed to administrator’s email and hacker will get this activation code using following query.
Again, They’ll pass this union query as previous step.
This file output is a xml file as below
how to hack wordpress website step 2 How to Hack a Wordpress Site using SQL Injection

STEP 3 – Use Activation key and Reset Password

This one is last step where he’ll actually reset your password and will get full control on your wordpress website. In this step, He’ll use activation key to reset password and will follow this link http://{DOMAIN_NAME_HERE}/wp-login.php?action=rp&key={ACTIVATION_KEY_HERE}&login={USERNAME_HERE}
So a hacker could be able to access your wordpress website and can have full control on your website. Normally they insert malicious code on your files or modify a plugin file to become that as a wordpress backdoor to hack your website again.

Roshan Thpa

About Roshan Thpa -

Roshan Kumar Thapa is veteran keen tech-savvy person which has enabled him to qualify for the job. He has knowledge in wide range of IT fields. He is highly trained and skilled in Graphic design, Tally, A+ hardware and networking, AutoCAD, Web Design/Development, Application Development, Video editing, Q-Basic and had good knowledge of C, C++, C# and Java programming. He keeps a keen interest in information technology and loves to keep himself updated through news, magazines, books, and blogs. He likes to learn and share his knowledge. He also runs a blog where he posts updates about the latest advancements in technology and his own teachings as well.

Subscribe to this Blog via Email :