Hacked: Lessons Learned and Relearned

Hacked!A couple of weeks ago while I was on vacation my WordPress site was hacked. It started first with a weird email from Wordfence trying to tell me something but it was so garbled I knew either it was in serious need of an update or something worse had happened. When I got to my site, I found something worse had happened. What was weird was I could only see the hack on one device. So when I contacted my hosting provider, they of course said it was my PC (I was on an iPad).  The reason for contacting them was early evidence seemed to point to something hacking into my site from the host. This would mean the host server was hacked. As I didn’t have my laptop with me with my usual tools to look at things securely (such as turning off all JavaScript and Flash in the browser so I could minimize the chances of compromising my laptop. My wife had her work laptop but I was not going to compromise it. So I just decided to leave my site down. This is not something a commercial site could do. Imagine the sales Amazon would lose if it were down for an hour. But my site isn’t an e-commerce site. Instead it is just a blog.

The early answers from my provider were I should scan my PC to make sure it isn’t affected. Agreed, always a good measure. I run antivirus that is pretty highly respected and a malware prevention program but as we all know, the vulnerabilities they don’t know about they can’t protect you from and even then they are not foolproof. I knew the hack was on the site and not my PC. I had logged in local and looked at the code and there it was “Hacked By Explo!T3r”.  Don’t do a Google Search for that as you will be surprised how many sites have been hacked by the same or similar group and are still hacked and un-repaired and may not even know, but Google knows. Okay, search but don’t visit their sites just in case. And the worse part about it was it was all tangled up the cache so I would have to make sure to wipe my cache once I cleared up the mess. I backed up my site as it was so that I could download it and do a file by file comparison with a previous backup to see what was changed or infected. Additionally I scanned it with both antivirus and malware scanners to see if there was something evidently evil about it. Nothing found.

A senior engineer at my hosting provider asked me when was my site working. I hadn’t logged in in over a week so I told him when I was last on the site. And they said they would restore a backup for me from that time period. Now, I wasn’t aware they were backing up things also. I know I have to run manual backups and I download them to a cloud provider so I have “off site” backups so to speak. I know I could automate this process and I have in the past but the free plugins that do backups have some limitations and being that my site isn’t for commercial gain, I have to keep things low to no budget. Plus that is in keeping with my open source spirit. So when I finally got back from vacation I looked and my site was really down now. Database Connection error. I guess their backup didn’t massage my database before backing up. So I knew what I had to do.

First I checked the modified date on all files on my site and decided I would wipe the site and roll in the last manual backup I ran. When did I run this backup? The end of June. I have violated my very own rule. Backup and backup often. Also backup before going forward. So I lost all of my July posts, which was a shame as they were really good and have brought a lot of traffic to my site.  Don’t worry my “Social Media for Small Business” series will return and soon have some additional entries.

So after restoring my site to the June backup and changing my passwords to the most complicated passwords I have ever used the site is back up and running. I looked through the code and the hack modified entries in my database so either they compromised MySQL for my site, did a SQL Injection hack, used an account with author privs that had a less than awesome password, or even an exploit of one of the recent vulnerabilities that were fixed by the latest update to WordPress 4.2.3

Here are some lessons learned:

1. Backup and backup often (I failed my own rules here).

2. Update often. (I didn’t have any pending updates of plugins or WordPress so I was technically as good as I could get).

3. Complex passwords. I use complex passwords but I had an account that did not. Wordfence offers a scanner that checks password complexity.

4. Compare backups. There is a lot to learn by comparing files from one backup to a newer one. What has changed since the last backup?

5. Verify your .htaccess files are set correctly.

6. This one will be controversial. Country blocking. Wordfence (paid version) has an option to block by country. I had turned this off because my site seemed slow and I was looking to see if my .htaccess file had become unruly with too many entries. However if you have a topic on your blog that might be controversial (my entries about my Faith), then you know you may offend someone. While I want my site open for everyone, there are some countries where the majority of hackers come from so blocking their countries (determined by IP address ranges and domain suffixes) will save you some headaches.

Look at my WordPress Security Essentials to see the things I do and should have done to protect my site. In this case, do as I suggest, not as I do.

The Writer’s Emotional Roller Coaster

ArcelorMittal Orbit, Olympic Park, Stratford, London 29July2012

Writing is an emotional roller coaster. When you think about all of the emotions you go through every day as a writer, it is shocking we get anything done at all.

Happiness – When we are writing, getting words on the screen or page, it is exciting. Our characters are moving forward in the story line or our ideas are flowing and we are on an emotional high point. We feel a giddiness. We don’t want to stop. Nothing matters, sleep, eating, love ones, almost going to the bathroom. The fingers are flying against the keyboard.

Guilt – This emotion can run at least two ways. The first way – Why can’t I write today? I just want to get 1,000 words in today. Is that so much to ask of my brain? The second way -uh, I do have this family. I need to spend time with them but my main character is at a turning point. She is whispering in my ear what she is going to do next. But I spent the whole weekend chained to my computer and we never left the house. I have to spend time with them or I need to cut the grass. I burned all of my vacation days on my “Great American Novel” and now they want to go a family vacation.

Sadness – Why can’t I write just one word today? I have all day free and I can’t even get the word “A, An, or the” on the page. Why didn’t I write anything Tuesday? I could have gotten up early and wrote for two hours before work. Or why did my main character have to die? That means they aren’t a main character. I have to figure out how to undo this. But he told me it was his time to go. Maybe Susan is the main character. Yeah, that could work. But I wrote 100+ pages of backstory for Manny. He can’t be dead on page 158. Why? Why? Why? Why are there tears on my final draft?

Denial – What ever made me think I could write? I can’t spell. I have the grammar of a ten year old. Am I trying to be Hemingway (with these short sentences) or Faulkner (with these paragraph sentences)? My words read like the writing of the last book I read. What is up with that? I am obviously NOT a writer. That is the wrong verb right there. Why suddenly do my words sound like they fell out of a perfume bottle? Why can’t I decide between affect and effect? Daisies happen.


Anger – It is my computer and I can smash it with a baseball bat if I want, right? It is my computer and I can throw it out the window. “Yes, officer. I did not see that little old lady outside my window when I threw it. I forgot for a moment I live on the fourth floor.”

Police Tape- Do Not Cross

Stress – Why is the Internet down when I am trying to email my editor, my publisher, my mom? Why having I heard back from that magazine I sent the article to? That was my best work. I know I said I would have the book done by the 12th but well, my dog chewed up the power cord for my laptop. I swear it’s done. What do you mean it will cost $100 to change that font? I did not say I wanted Comic San Serif, it is either Helvetica or Courier or forget the whole thing. Stupid eReader is going to change my font anyway but still. Why are all of these bills due now and I don’t have my advance yet, my royalty check yet. Where is my dog? Why do I have to work when I am a writer?

Happiness (again) – This the greatest day of my life. The book is finished. It is a beautiful day outside. My spouse doesn’t hate me. The kids are talking to me again after my shouting match.

And then your emotions change. Wait, there is a typo on the first page. How did I miss putting a word there. I have read this stupid thing a hundred times. I should have seen that. Ugh!