Skip to content

Commit f796228

Browse files
authored
create compromised wordpress site docs (#49)
* update export instructions * add compromised wordpress site instructions for userdocs * add compromised wordpress site instructions for staffdocs * update fix-compromised-wordpress.md command formating * correct restoration instructions
1 parent 03f741a commit f796228

2 files changed

Lines changed: 44 additions & 2 deletions

File tree

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
title: Restoring a Compromised WordPress Site
3+
---
4+
5+
Users may request for their site to be restored after it is sorried. Rollbacks can only be performed with `root`.
6+
7+
1. If the user requests for their media to be backed up, `tar` the `/public_html/wp-content/uploads` folder and email it to them.
8+
2. From `supernova`, run
9+
10+
reset-wpadmin username
11+
12+
Note that the user will need to recover their password on the WordPress web admin dashboard later, or manually do so according to the instructions on the user-docs.
13+
3. Run
14+
15+
restore-wpbackup target-username staff-username
16+
17+
as root/with `sudo`. Select a backup using best judgement. It is usually best to check for when files were last changed to estimate a compromise date.
18+
4. Delete the contents of the `public_html` directory.
19+
5. Move the contents of the backed-up directory to `public_html` with `mv public_html_backup/* public_html`.
20+
6. Run `wp core update` in their `public_html` directory.
21+
7. Unsorry the account.

docs/user-docs/services/web/wordpress.md

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ The basic steps to migration are as follows:
7676
2. Use the web admin dashboard to install all the themes and plugins you were
7777
using at WordPress.com
7878

79-
3. Log into your WordPress.com dashboard and go to `Settings > Export` to
79+
3. Log into your WordPress.com dashboard and go to `Tools > Export` to
8080
download a zipped XML file with all your site's posts and content. Note that
8181
this export usually will not include all of your media content.
8282

@@ -89,11 +89,32 @@ The basic steps to migration are as follows:
8989
installation. Additionally, you should try and go through most of your posts
9090
and pages with images, as you may need to relink things again.
9191

92-
Further details can be found at [the support page by WordPress.com][1].
92+
Further details can be found on the [WordPress.com documentation][1].
9393

9494
[1]: https://en.support.wordpress.com/moving-to-a-self-hosted-wordpress-site/
9595

9696

97+
## Fixing a Compromised Site
98+
99+
### What happened?
100+
101+
A malicious actor gained access to and was able to inject code into your site. They may create redirects from a page to a different site, such as a gambling or scam page, or they will run processes on our servers.
102+
103+
Such exploits are fairly common, as WordPress is by far the most popular web content management system. Usually, they gain access through an outdated plugin with a security vulnerability, but there are many possible ways this might have happened.
104+
105+
### What do I do?
106+
107+
Reach out to [help@ocf.berkeley.edu](mailto:help@ocf.berkeley.edu) with your group account username. We will roll your site back to before the compromise date. If you have any recently uploaded media files that you would like before the site is rolled back, let us know in the email and we will save them for you. All data stored in the database (blogs, etc) will not be rolled back.
108+
109+
### How do I prevent this from happening?
110+
111+
- **Keep your site up to date:** Regularly update your PHP version. More information can be found on the [WordPress.com documentation][2]. Enable automatic updates for plugins by selecting `Plugins > Enable auto-updates`.
112+
- **Install security plugins:** WordPress has many security-oriented plugins that can help prevent attacks.
113+
- **Switch away from WordPress:** Since WordPress is by far the most popular web content management system, WordPress sites are the most targeted in attacks. Using a different web platform or static site generator will make it far less likely your site will be targeted.
114+
115+
[2]: https://wordpress.org/support/update-php/
116+
117+
97118
## Frequently Asked Questions
98119

99120
### I forgot my admin password and can't log in

0 commit comments

Comments
 (0)