php scanner

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

    php scanner

    hi guys im wondern if anyone has or is willing to share a php script that will do the following....
    1)scan sub folders for rogue pages or file extenstions
    2)have an exclude list so these files dont show in the scan
    3)must be in php format

    ie so if i use the script to scan images folder it will return any extensions showing .txt .html .php in that folder
    i think if it can be modded to suit lava it will be good to modify such a script to run on a server to
    check for rogue files hackers try uploading
    ...................... any input on this will be appreciated i been googlen but not found much

    Added after 58 minutes:

    dont worry i found the answer i needed it works
    Last edited by ozziemale31; 12.07.12, 05:20.









    Dont Ask Me Dumb Questions.Or you'l get a Dumb Answer..
    Want A Profesional Logo or Theme For Your wap site Pm Me.If I Have The Time Ill Make It For Free


    #2
    sounds interesting. care to share your findings?
    <?php
    include ('Ghost');
    if ($Post == true) {
    echo '

    sigpic
    alt='coding-talk.com!!' />';
    echo 'Sharing Is Caring!';
    } else {
    echo '

    alt='the username GHOST has been comprimised!' />';
    echo 'OMG SOMEBODY HELP ME!!';
    }
    ?>

    Comment


      #3
      re

      Originally posted by Ghost View Post
      sounds interesting. care to share your findings?
      i was looking at modifyn the scanner code used in johncms440 script it pics up rogue php and html files while using an exclude list at same time im studying the scandir function to see if can make myown









      Dont Ask Me Dumb Questions.Or you'l get a Dumb Answer..
      Want A Profesional Logo or Theme For Your wap site Pm Me.If I Have The Time Ill Make It For Free

      Comment


        #4
        cool. may look into this at some point when i get some spare time.
        its interesting.
        <?php
        include ('Ghost');
        if ($Post == true) {
        echo '

        sigpic
        alt='coding-talk.com!!' />';
        echo 'Sharing Is Caring!';
        } else {
        echo '

        alt='the username GHOST has been comprimised!' />';
        echo 'OMG SOMEBODY HELP ME!!';
        }
        ?>

        Comment


          #5
          re

          Originally posted by Shannon388
          sounds interesting. care to share your findings?

          [PHP]
          hi mate i got a soloution for that code

          PHP Code:
          <?php
          $dir 
          "images/"//You could add a $_GET to change the directory
          $files scandir($dir);
          echo 
          "<list>";
          foreach(
          $files as $key => $value){

          //////// Add File Extensions To Be Displayed
          if(strpos($value".php") > 0) {
          /////// Return results
          echo "".$value."<br/>";
          }
          echo 
          "</list>";
          }
          ?>
          Added after 17 minutes:

          i also found by using

          PHP Code:
          <?php
          $dir 
          "images/"//You could add a $_GET to change the directory
          $files scandir($dir);
          echo 
          "<list>";
          foreach(
          $files as $key => $value){
          if(
          strpos($value".png") > 0) {
          echo 
          "".$value."<br/>";
          }
          if(
          strpos($value".php") > 0) {
          echo 
          "".$value."<br/>";
          }
          if(
          strpos($value".txt") > 0) {
          echo 
          "".$value."<br/>";
          }
          echo 
          "</list>";
          }
          ?>
          will return a list in alphabetical order

          like eg:
          11.php
          acdc.txt
          bank.png
          blueribbon.png
          book.png
          forum.png
          greenribbon.png
          news.png
          pokes.png
          poll.png
          reputation.png
          search.png
          test.txt
          wall_icon.png
          warning.png
          yellowribbon.png

          Added after 15 minutes:
          Last edited by ozziemale31; 13.07.12, 13:42.









          Dont Ask Me Dumb Questions.Or you'l get a Dumb Answer..
          Want A Profesional Logo or Theme For Your wap site Pm Me.If I Have The Time Ill Make It For Free

          Comment


            #6
            another version ive done using style sheet
            PHP Code:
            <?php
            /*
            --------------------------------------
               Shell Scanner Script
                      By Ozziemale
            --------------------------------------
            */
            header("Content-type: text/html; charset=ISO-8859-1");
            echo 
            "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>";
            echo 
            "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">";
            ?>
            <meta name="description" content="www.m-zonez.net" />
            <meta name="keywords" content="free downloads and more for your phone " />
            <link rel="shortcut icon" href="images/favicon.ico" />
            <link rel="icon" href="images/favicon.gif" type="image/gif" />
            <?php
              
            echo "<head>";
                echo 
            "<title>Error!!!</title>";
                   echo 
            "<style type=\"text/css\">

            * {
                 margin: 0;
                padding: 0;
            }
            /*
            Css Style by
            Rampage
            Default Theme
            */

            body {
            color : #FFFFFF;
            font-size : 12px;
            font-family : arial;
            background-color : #000000;
            max-width : 640px;
            max-height : 75px;
            margin : auto;
            }
               <!-- Script By Rampage -->
            </style>"
            ;
              echo 
            "<head>";
              echo 
            "<title>Data Base Error!</title>";
              echo 
            "</head>";
              echo 
            "<body>";
              
            ?>
              <?php

            $dir 
            "images/"//You could add a $_GET to change the directory
            $files scandir($dir);
            echo 
            "<font color=\"#00CC00\">------------------------------------------------<br /></font>";
            echo 
            "<font color=\"#00CC00\">Shell Scanner V.1 By Ozziemale31<br /></font>";
            echo 
            "<font color=\"#00CC00\">------------------------------------------------<br /></font>";
            echo 
            "<list><center>";
            foreach(
            $files as $key => $value){

            if(
            strpos($value".php") > 0) {
            echo 
            "<font color=\"#00CC00\"><strong>Possible Shell Script:</strong> </font><font color=\"#FF0000\">".$value."</font><br/>";
            }
            if(
            strpos($value".php4") > 0) {
            echo 
            "<font color=\"#00CC00\"><strong>Possible Shell Script:</strong> </font><font color=\"#FF0000\">".$value."</font><br/>";
            }
            if(
            strpos($value".php5") > 0) {
            echo 
            "<font color=\"#00CC00\"><strong>Possible Shell Script:</strong> </font><font color=\"#FF0000\">".$value."</font><br/>";
            }
            if(
            strpos($value".asp") > 0) {
            echo 
            "<font color=\"#00CC00\"><strong>Possible Shell Script:</strong> </font><font color=\"#FF0000\">".$value."</font><br/>";
            }
            if(
            strpos($value"php.jpg") > 0) {
            echo 
            "<font color=\"#00CC00\"><strong>Possible Shell Script:</strong> </font><font color=\"#FF0000\">".$value."</font><br/>";
            }
            if(
            strpos($value"php.gif") > 0) {
            echo 
            "<font color=\"#00CC00\"><strong>Possible Shell Script:</strong> </font><font color=\"#FF0000\">".$value."</font><br/>";
            }
            if(
            strpos($value".xhtml") > 0) {
            echo 
            "<font color=\"#00CC00\"><strong>Possible Shell Script:</strong> </font><font color=\"#FF0000\">".$value."</font><br/>";
            }
            if(
            strpos($value".cgi") > 0) {
            echo 
            "<font color=\"#00CC00\"><strong>Possible Shell Script:</strong> </font><font color=\"#FF0000\">".$value."</font><br/>";
            }
            if(
            strpos($value".wml") > 0) {
            echo 
            "<font color=\"#00CC00\"><strong>Possible Shell Script:</strong> </font><font color=\"#FF0000\">".$value."</font><br/>";
            }
            if(
            strpos($value".txt") > 0) {
            echo 
            "<font color=\"#00CC00\"><strong>Possible Shell Script:</strong> </font><font color=\"#FF0000\">".$value."</font><br/>";
            }
            echo 
            "</list></center>";

            }
            echo 
            "<font color=\"#00CC00\">------------------------------------------------<br /></font>";
            echo 
            "<font color=\"#00CC00\">www.m-zonez.net<br />&copy; copyright 2012 &copy;<br />All Rights Reserved</font>";
            echo 
            "</body>";
                echo 
            "</html>";
            ?>









            Dont Ask Me Dumb Questions.Or you'l get a Dumb Answer..
            Want A Profesional Logo or Theme For Your wap site Pm Me.If I Have The Time Ill Make It For Free

            Comment


              #7
              nice work bud, with a little change in it to "know" what files should exist first
              and this will be a very handy tools indeed.
              <?php
              include ('Ghost');
              if ($Post == true) {
              echo '

              sigpic
              alt='coding-talk.com!!' />';
              echo 'Sharing Is Caring!';
              } else {
              echo '

              alt='the username GHOST has been comprimised!' />';
              echo 'OMG SOMEBODY HELP ME!!';
              }
              ?>

              Comment

              Working...
              X