script monitors your site for dangerous SQL injection and RFI vulnerabilities

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    script monitors your site for dangerous SQL injection and RFI vulnerabilities

    this php script help u to protect ur site for dangerous SQL injection and RFI vulnerabilities :

    Installation

    1. make "logs " dir

    2. chmod the directory 'logs' to 777

    3. Add the following line to the .htaccess file in root folder to monitor the requests.

    php_value auto_append_file /home/username/public_html/requestlogger.php

    replace /home/username/public_html/ with your root path.

    php script here :

    PHP Code:
    <? // Security module by 12345 xmen
        // Please do not change anything in this file
    log_requests();

    function log_requests(){

    $aurl=urldecode($_SERVER['REQUEST_URI']);

        if($GLOBALS['logged']!=1){

            $GLOBALS['logged']=1;

    if(!(
    strstr($aurl,'\'') ||
    strstr($aurl,'"')
    )
    )return;

            $filename = $_SERVER['DOCUMENT_ROOT'].'/crappylog/crap-'.date("d-M-y", time()).'.txt';
            $somecontent = date("D d M y-H:i:s", time());

            $somecontent .= "|| TIME: ".$timespent;
            $somecontent .= "|| URI: ";
            $somecontent.=$_SERVER['REQUEST_URI'];
            $somecontent .= "|| URIU: ";
            //$somecontent.=$aurl;
            
    /*
            $somecontent .= "|| BROWSER: ";
            $somecontent.=$_SERVER['HTTP_USER_AGENT'];

            
            $somecontent .= "|| IP: ";
            $somecontent.=$_SERVER['REMOTE_ADDR'];
            
            $somecontent .= "|| FORWARDED: ";
            $somecontent.=$_SERVER['HTTP_X_FORWARDED_FOR'];        


            $somecontent .= "|| POST: ";
            foreach($_POST as $k=>$v){
                $k=preg_replace("/[\s]/", " ", $k);
                $v=preg_replace("/[\s]/", " ", $v);
                $somecontent.="$k==$v::";
            }
    */

            touch($filename);

            if (is_writable($filename)) {
                $handle = fopen($filename, 'a');
                flock($handle, LOCK_EX);
                if (!$handle) {
                     echo "Cannot open";
                }
                if (fwrite($handle, $somecontent."\n") === FALSE) {
                    echo "Cannot write";
                }
                flock($handle, LOCK_UN);
                fclose($handle);

            }
            else {
                echo "logger not writable";
            }
        }
    }
        
    ?>
    i hope its hlp you if u like say thanks !

    #2
    you can monitor but you cant prevent hacking LOL


    btw theres also codes here posted by subzero
    com site: http://vampist.net
    download site: http://wapdloads.net
    fb: http://www.facebook.com/pmplx

    Comment


      #3
      Monitor has in how, how did u got the monitor
      http://myfacepals.com
      MYFACEPALS SOCIAL NETWORKsigpic

      Comment


        #4
        Gr8

        PHP Code:
        echo good job
        thanx

        Comment


          #5
          Originally posted by wapmetal View Post
          you can monitor but you cant prevent hacking LOL


          btw theres also codes here posted by subzero
          sanitize all inputs from user

          Comment


            #6
            Originally posted by opera View Post
            PHP Code:
            echo good job
            thanx
            lol wrong code
            PHP Code:
            echo "good job"
            is correct ;)
            Follow me @ksg91 | My Blog: http://ksg91.com | Nokia Blog: http://NokiaTips.in

            Comment

            Working...
            X