Jan
08
2010
What the hackers are looking for ? #2

Τον Οκτώβριο 2009 είχα γράψει το εξής post: Τι σελίδες αναζητούν οι hackers; κοιτώντας τα logs μου κι ειδικότερα τα http 404 (not found). Στο site μου διαθέτω μόνο δύο εφαρμογές (blog/wiki) και τα δύο δουλεύουν με mod_rewrite ώστε να κάνουν URL manipulation.

Από τον Οκτώβριο του 2009 μέχρι σήμερα μαζεύω τα πιο δημοφιλή αρχεία (urls) που προσπαθούν να δούν ή να κατεβάσουν οι hackers και τις περνάω σε ένα δικό μου .htaccess αρχείο στην ρίζα του site μου.

Το παραθέτω εδώ, σε περίπτωση που ενδιαφέρει κι άλλους:

RewriteEngine on
RewriteRule xmlrpc.php$ index.php
RewriteRule login_page.php$ index.php
RewriteRule setup.php$ index.php
RewriteRule config.inc.php$ index.php
RewriteRule multithumb.php$ index.php
RewriteRule orderSuccess.inc.php$ index.php
RewriteRule send_reminders.php$ index.php
RewriteRule config.php$ index.php
RewriteRule ask_password.php$ index.php
RewriteRule msgimport$ index.php
RewriteRule README$ index.php
RewriteRule fastenv$ index.php
RewriteRule main.php$ index.php
RewriteRule sql.php$ index.php

Μεγάλη προσοχή όμως!

Θα πρέπει να μην έχετε αρχεία στο τέλος ενός valid url γιατί αλλιώς θα κάνει redirection στο αρχικό site.

Ένα παράδειγμα είναι και το εξής:

http://balaskas.gr/README το οποίο ΔΕΝ υπάρχει.
Αντί να εμφανίσει το http 404 λάθος θα κάνει redirection στην αρχική σελίδα μου.

  1. Avatar di Giorgos Keramidas Giorgos Keramidas

    Saturday, January 9, 2010 - 00:44:57

    In my laptop’s lighttpd I use a similar setup to redirect *everything* to the OddMuse wiki backend script:

    <pre># Permit automatic directory listings, but only for the stuff found
    # under the toplevel /files/… directory.
    dir-listing.activate = “disable”
    $HTTP[”url”] =~ “^/files($|/)” {
    dir-listing.activate = “enable”
    }

    # URL rewriting rules for the Wiki.
    url.rewrite-once = (
    “^/favicon.ico$” => “$0”,
    “^/files(/.*)?$” => “$0”,
    “^/?$” => “/cgi-bin/wiki.pl”,
    “^/(.*)$” => “/cgi-bin/wiki.pl/$1”,
    “^?(.*)$” => “/cgi-bin/wiki.pl?$1”,
    )</pre>

    This way hitting non-existent Wiki pages gives OddMuse a chance to trap the request and redirect it to a “There’s no page called Foo, do you want to create one?”.

    I’m not sure if this is a 100% bulletproof setup or if it is more secure than the standard 404 response, but it helps me immensely when I want to create new pages. I just direct my browser to http://localhost/NewPage and add text through the “Edit this page” link :-)