Website Security Briefing for Warriors

12 replies
Hi Warriors,

I have read a few threads on the forum recently regarding websites that had been attacked. In particular there was a recent thread about a Warrior who found their blog had been hacked, templates had been changed and malware (viruses) had been embedded into their site.

I've written up these notes below in the hope that I can raise awareness of website security.

Security needs to be taken seriously. You should think about securing your website just as an offline business has to secure its business premises. It's not just malicious users and online criminals to be aware of, but also the "script-kiddies" who just see bypassing the security of website as a game or challenge.

A breach of security can have many effects, including loss of business, damage to your online reputation or brand, financial loss, costs in handling the incident, and legal liability.

I recently gave a presentation about basic online security, and these are the five topics I covered. There are some questions at the end you can use to evaluate your online security.

1. Password Strength and Secure Password Handling

The first step to protecting yourself is selecting a strong password. This means using something that can not be guessed easily. So avoid common passwords, and words that are in the dictionary. Use a password that has a combination of letters, numbers and punctuation. Make sure your password has more than 8 characters.

Passwords should always be stored in an encrypted format. Be wary of websites that have a facility to send you a password reminder, as this means they are storing the password in a clear and readable format. Secure websites store your password in a format called a "password hash" so no one can ever read your password. Rather than a password reminder, these websites will have a system to reset your password to something random, or send a one-time login link to your email address.

Hackers may use computer programs or scripts (called bots) to automate password testing. On a single computer a password hash from an 8 character password would take 16 minutes to crack. Obviously this is slower over the Internet. A cracker may use a "botnet" (network of multiple computers) to increase their capacity, but there are things a website owner can do to make things more difficult. These include limiting the number of login attempts allowed within a specified time period, or adding some further verification such as a CAPTCHA to ensure all login attempts are by human visitors.

Q: Are you using a strong password?
Q: Is your website login system secure?

2. Session Hijacking and User Input

Once you have logged into a website the server remembers who you are so you don't have to login to every single page. You usually login once for a specified period of time. Usually the server remembers you by storing a cookie on your computer that contains a "session ID". This is an identifier that your computer sends to the server with every page request during this session. The server checks this to make sure you logged in.

What if another website could steal your cookies? If someone could get a hold of your session ID while you were logged in, they could potentially get into your account without even knowing your password!

Luckily, your browser will only send the cookie (containing the session ID) back to the website that it came from so you don't have to worry too much about other websites stealing your cookies. However, if your website includes user input (such as a forum or blog comments) then you need to check it very carefully for what are known as Cross Site Scripting (XSS) attacks. This is when an attacker submits content to your site to inject code into your webpages which is then viewed by other users. Since 2007 XSS attacks have accounted for 80% of reported website attacks.

Another concern with user input is that most websites today have some kind of database back-end. When you store user input into a database it must be carefully checked to ensure that it contains no malicious code that can interfere with operation of the database system. If user input is not properly checked before it is sent to the database then there is a chance a malicious user could retrieve secret information or corrupt your data.

Q: Is all user generated content rigorously checked and filtered before it is displayed on your website?
Q: Is all user input on your website filtered before being stored in a database?

3. Keep Up-to-date

New versions of software are released all the time. Open-source software is particularly good at finding and fixing security vulnerabilities because they usually have many more people involved in the development process than proprietary software. This is a major advantage only as long as you keep up-to-date with the latest software versions. Known vulnerabilities can often be exploited by malicious users so as soon as updates are available you should make sure you install them.

If you use a Content Management System, or blog software for example, and if you do not keep up-to-date then you leave yourself open to attack. If someone can work out what version you are using they can find out what vulnerabilities are available to exploit. We have seen stories of this on the forum here. Blogs getting defaced, or malware and viruses being embedded into pages without the owner's knowledge.

Q: Is your website running the most recent version of your CMS, templates, plugins, etc?
Q: Is your server running the most recent software?

4. Multiple Users = Multiple Accounts

Main administrator (root) login details should be kept highly secure. You should create separate accounts for people where possible and give them only the permissions they require to do particular tasks they need. It's a good idea to avoid using the main administrator account for your own daily website maintenance and use a separate account, reserving the main admin account for only occasions that require full server access.

When you change staff/moderators/outsource workers or suppliers you can remove accounts and setup new ones. I'm not suggesting that you don't trust the people you work with, but if you have accounts restricted to just the access they require then if an account gets compromised an attacker is limited in the amount of damage they can cause.

Q: Do you use separate accounts for all users?
Q: Do all your users only have access to the parts of the system they need?

5. Backups

Your site is probably made up of a combination of program code, configuration data, and content database. It is important to have a backup in-case you need to recover from hardware or software failure, but your backup routine is also an important factor in your security planning.

Most professional development teams will have program code and configuration data under version control. This stores a new version every time the code is changed. If a developer makes a change that either breaks something, or a designer makes a tweak to the layout that people don't like, you can restore a previous version of the code from any point in time. Because it is possible to compare different versions of the code you can see what has changed, which can be useful if your website security is compromised as you can discover what changes have been made by the malicious user by comparing to previous versions.

Content is usually stored in a database, and it's important to make regular backups (called "database snapshots") of your content. It depends on how frequently your data changes, and how much you can afford to lose. On a popular site where content is constantly submitted you will want to take a snapshot at least every hour. On a site that has less frequent updates you may want to do nightly snapshots. These backups can usually be automated in your server configuration tools.

Q: Do you have enough backups to easily restore the site to any point in time?
Q: If your server was completely destroyed today, how quickly could you be up and running again on a new system?

Summary

To recap:

Q: Are you using strong passwords?
Q: Is your website login system secure?

Q: Is all user generated content rigorously checked and filtered before it is displayed on your website?
Q: Is all user input on your website filtered before being stored in a database?

Q: Is your website running the most recent version of your CMS, templates, plugins, etc?
Q: Is your server running the most recent software?

Q: Do you use separate accounts for all users?
Q: Do all your users only have access to the parts of the system they need?

Q: Do you have enough backups to easily restore the site to any point in time?
Q: If your server was completely destroyed today, how would your business cope? how quickly could you be up and running again on a new system?

I hope you found this an interesting read. I don't mean to cause alarm unnecessarily, but if it helps just one person protect themselves against losing anything to hackers then it was worth posting. Thanks for reading.

Any Questions?
#briefing #hackers #passwords #protection #security #warriors #website
  • Profile picture of the author Jagged
    Great Thread Darren, thank you. Too many threads lately on sites being hacked, especially wordpress. It's scary!! A newcommer as myself needs advice such as this. I now know where to go for any questions.
    {{ DiscussionBoard.errors[359957].message }}
  • Profile picture of the author Darren Mothersele
    This is just notes from a general presentation on security. I will write up some more specific notes on securing Wordpress, in particular on a shared hosting environment, as this brings it's own challenges.
    {{ DiscussionBoard.errors[359977].message }}
  • Profile picture of the author Ron Killian
    Thanks for the info. I know I went through all that, some time back when a couple of my blogs were hacked. Sure no fun.
    Signature
    PLR Affiliate Program Has Launched! Easily Promote Over 5,000 PLR and MRR Products.

    Largest Selection of PLR Articles on the Planet! PLR Ebooks, PLR Video, PLR Websites and more with Private Label Rights
    {{ DiscussionBoard.errors[360025].message }}
  • Profile picture of the author NashRyker
    Yes, you have my thanks as well!
    {{ DiscussionBoard.errors[360375].message }}
  • Profile picture of the author TheRichJerksNet
    I realize your post is made to help but -- I personally disagree with most of it and trust me I know what security is..

    Making backups and updating does not keep you safe, it's already been proven on this very forum. Fact is you are dealing with open source code and hackers have access to the code also, I do not care how many updates you make, hackers will still hack it unless you do something to change the software yourself that they know nothing about.

    Telling someone they should update as soon as an update is released is bad advice. Many has already learned this on this very forum also.. Some decided to update to wordpress 2.7 as soon as it was released just to find out 2.7 did not work well with their themes, plugin, and etc ..

    James
    {{ DiscussionBoard.errors[360435].message }}
    • Profile picture of the author Darren Mothersele
      Originally Posted by TheRichJerksNet View Post

      I realize your post is made to help but -- I personally disagree with most of it and trust me I know what security is..

      Making backups and updating does not keep you safe, it's already been proven on this very forum. Fact is you are dealing with open source code and hackers have access to the code also, I do not care how many updates you make, hackers will still hack it unless you do something to change the software yourself that they know nothing about.

      Telling someone they should update as soon as an update is released is bad advice. Many has already learned this on this very forum also.. Some decided to update to wordpress 2.7 as soon as it was released just to find out 2.7 did not work well with their themes, plugin, and etc ..

      James
      I trust you understand what security is, and I don't mean to question this, but...

      Please give references as to when creating backups has ever been a bad idea? Really? Please tell me I miss-understood what you said there. I can quote many many examples where not having backups has seriously harmed a business - but I think it would be quite hard to find an example where having regular backups was a bad thing. Of course backups are not going to keep you safe, but the important is this: When disaster strikes, how long is it going to take you to recover?

      I should have made it clear to distinguish between version updates of software and security updates. I would never, for example, recommend someone upgrade from v5 of Drupal to v6 because it is safer. There are too many changes and lots of functionality changes that need to be tested on your site first. In this case (as with the recent version upgrade to Wordpress) it would be treated as a migration.

      Security upgrades however should always be applied immediately, and it is irresponsible to advise anything other than this. You point out that the code is in the public domain, and this is exactly why you should apply security updates as soon as they are available - because full details of the vulnerable code is available. If you can't apply a full upgrade at the time a security upgrade is announced they are usually released with a "patch" that can be applied to just the vulnerable parts of the system.

      You can always apply updates in a staging area to check compatibility. If you have your site under a version control system (e.g. Subversion) then you can always roll back the changes if there are compatibility issues.

      There are countless examples of where open-source code has a better security record than proprietary equivalents. It is not the fact that the code is open that makes the system hackable. You suggest making changes to the code that "they" don't know about. This should be done with care. Most of the vulnerabilities in websites based on open-source software actually come from the modifications people have made themselves.

      The "bazaar" open-source method is well established as the development methodology that creates the most secure software. If you are interested in reading more on this subject then refer to "The Cathedral and the Bazaar" and related essays by Eric S. Raymond.
      {{ DiscussionBoard.errors[360491].message }}
      • Profile picture of the author TheRichJerksNet
        Originally Posted by Darren Mothersele View Post

        I trust you understand what security is, and I don't mean to question this, but...

        Please give references as to when creating backups has ever been a bad idea? Really? Please tell me I miss-understood what you said there. I can quote many many examples where not having backups has seriously harmed a business - but I think it would be quite hard to find an example where having regular backups was a bad thing. Of course backups are not going to keep you safe, but the important is this: When disaster strikes, how long is it going to take you to recover?

        I should have made it clear to distinguish between version updates of software and security updates. I would never, for example, recommend someone upgrade from v5 of Drupal to v6 because it is safer. There are too many changes and lots of functionality changes that need to be tested on your site first. In this case (as with the recent version upgrade to Wordpress) it would be treated as a migration.

        Security upgrades however should always be applied immediately, and it is irresponsible to advise anything other than this. You point out that the code is in the public domain, and this is exactly why you should apply security updates as soon as they are available - because full details of the vulnerable code is available. If you can't apply a full upgrade at the time a security upgrade is announced they are usually released with a "patch" that can be applied to just the vulnerable parts of the system.

        You can always apply updates in a staging area to check compatibility. If you have your site under a version control system (e.g. Subversion) then you can always roll back the changes if there are compatibility issues.

        There are countless examples of where open-source code has a better security record than proprietary equivalents. It is not the fact that the code is open that makes the system hackable. You suggest making changes to the code that "they" don't know about. This should be done with care. Most of the vulnerabilities in websites based on open-source software actually come from the modifications people have made themselves.

        The "bazaar" open-source method is well established as the development methodology that creates the most secure software. If you are interested in reading more on this subject then refer to "The Cathedral and the Bazaar" and related essays by Eric S. Raymond.
        I never said making backups was a bad idea ... I said making backups do not keep you safe. Everybody should make regular backups of any site they own, this has nothing to do with security. It is or should be standard practice for any site.

        Because things like wordpress and other cms scripts are open source make them the perfect target for hackers. It is a proven fact most developers do not even know or care about security. Thus the reason why so many useless scripts exist. Personally I prefer my custom coded from scratch scripts over any -- Because I know how to build security into my scripts as I always have. Because my scripts are not open to the public then they are more safe then open source, just for that reason alone...

        There are countless examples of where open-source code has a better security record than proprietary equivalents.
        Making claims that open source code is better than any other is not exactly a correct statement unless you personally have been involved in the coding of every single script online. There are countless examples of 100,000 of wordpress blog sites being hacked every year and many are from up-to-date blogs.. My point is, you can make a generalization but making a claim it is better is not correct...

        I have no need to read anything, I have been developing websites for well over 15 years and every site I build is 100% from scratch. No open source code is used at all...

        I do however feel the need to correct bad advice when I see it being given when it comes to security of a website.

        James
        {{ DiscussionBoard.errors[360566].message }}
        • Profile picture of the author Darren Mothersele
          Originally Posted by TheRichJerksNet View Post

          Because my scripts are not open to the public then they are more safe then open source, just for that reason alone...
          I am not questioning your knowledge of security, or your scripts. Your scripts may well be bullet proof. But the fact that they are closed source does not make them safer. Black box testing can be very effective

          Originally Posted by TheRichJerksNet View Post

          Making claims that open source code is better than any other is not exactly a correct statement unless you personally have been involved in the coding of every single script online. There are countless examples of 100,000 of wordpress blog sites being hacked every year and many are from up-to-date blogs.. My point is, you can make a generalization but making a claim it is better is not correct...

          I have no need to read anything, I have been developing websites for well over 15 years and every site I build is 100% from scratch. No open source code is used at all...

          I do however feel the need to correct bad advice when I see it being given when it comes to security of a website.

          James
          To say I am giving bad advice is misleading and, in my opinion, irresponsible. The original post highlights known areas of vulnerabilities that people need to be aware of.

          Your objections to my post seem to fall into two categories:

          1: "Backups do not keep you safe." - This is just a question of semantics. Many people would class recovery strategy as part of security strategy. My point was to encourage people to consider disaster recovery when thinking about security. If the worst does happen it's important to be prepared. You agree on this, so let's leave that there.

          2: "to make sure you always use the latest version is bad advice because sometimes this breaks websites." - You cannot seriously advise people are better off running software with publicly known vulnerabilities. Your argument made the jump to comparing open-source with closed-source software, which is a different argument entirely. All I am advising in my post is that people run the latest version of software. This presupposes they are already running the software so the closed vs open argument is mute.

          I was not questioning your experience writing secure software by referring you to a recognised resource for further reading. I would refer to this text simply as a continuation of the discussion of closed vs open source as that is out of the scope of the original argument.

          I have contributed to and managed development projects in both closed-source and open-source environments, so I would be happy to take this discussion further, but I would still refer to "The Cathedral and The Bazaar" as a starting point as it is an excellent comparison of the two development methodologies.
          {{ DiscussionBoard.errors[360663].message }}
        • Profile picture of the author Darren Mothersele
          Originally Posted by TheRichJerksNet View Post

          No open source code is used at all...
          but, I assume you use LAMP?
          {{ DiscussionBoard.errors[360669].message }}
  • Profile picture of the author write-stuff
    This is an excellent debate and I'm sure we're learning a lot from both sides of it. You guys keep at it. - Russ (who doesn't use any open source code)
    {{ DiscussionBoard.errors[360631].message }}
  • Profile picture of the author tommygadget
    One thing I noticed for sure. The more popular your site gets, the more it gets attacked. My more popular sites routinely get hammered by malware bots and spam comments (yes, I know they are not the same).

    TomG.
    {{ DiscussionBoard.errors[360643].message }}
    • Profile picture of the author Darren Mothersele
      Originally Posted by tommygadget View Post

      One thing I noticed for sure. The more popular your site gets, the more it gets attacked. My more popular sites routinely get hammered by malware bots and spam comments (yes, I know they are not the same).
      Yes, maybe the most effective method of measuring a site's success is the number of spam comments.
      {{ DiscussionBoard.errors[360681].message }}

Trending Topics