The next time you find something like this, run stat on it and archive all your available logs for anything that has had access to the directory in question. These often come in through flaws in a web application like WordPress, Joomla, osCommerce, or jCow. A good incident response admin can often tell you how it was done and how to fix the security issue.

There's often more than one file, and sometimes they also inject malicious code into legitimate files.

For what it's worth, there are also often FTP uploads or uploads through a control panel's file manager. The attackers do that by compromising a PC and looking for passwords saved in FTP clients or web browsers. So scan and secure any PC you have, any on the same LAN, and any for any contract developers or admins you've had or change your credentials and settings in a way that refuses access to anything you can't clean.

It's much harder to tell exactly how something came to exist on the system after the metadata is destroyed. Some web hosting companies have good free incident response in their security departments, like HostGator.


In reply to Re: Something I found on my site by mr_mischief
in thread Something I found on my site by GnikLlort

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.