Lavalair (hack Protection)

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Lavalair (hack Protection)

    Plz genious php coaders give ur essential and helpfull comments here........

    #2
    my site name is dbangla (its ok now) is was in lavalair forum script........

    but it was hacked by some guys after giving the sql injection protection

    $who=mysql_real_escape_string($_GET["$who"]);

    can anyone plz help me.......

    Comment


      #3
      you spammer now ur site for sure hacked
      Failure is not when a girls leaves you, its only when you let her go virgin. heheh!!

      <span style="color:#9ACD32"><span style="font-size:36pt;line-height:100%">BEST MOBILE ADVERTISER</span></span>

      Comment


        #4
        Most hackers hack for a reason
        like learner says if you decide to spam or mess about with the wrong sites you will get hacked

        Seeming Your site gets Spammed a lot it then i say a big Congratulations to whoever did it!
        if i could hack i would have done the same lol

        Suggestions on how to stop hackers:

        1 Stop Spamming
        2 Stop Your staff from spamming
        3 Getting The Hint Yet?

        Comment


          #5
          I am not give the site link for spamming it was given for proper discussion !
          Can any one give me coding help. I got Some Code Lke This :

          <div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'><?php

          // Create the function
          function make_safe($var, $characters) {

          // Create an array for errors
          $error = array();

          // Create array of curse words to check for
          $curse_words = array("F WORD", "A WORD", "S WORD" "H WORD");

          // Check the variable for any curse words
          $count = 0;
          $var = str_replace($curse_words, "** BEEP **", $var, $count);

          // If more than 2 curse words exist, add an error
          if($count > 2) {
          $error[] = &#39;[*]Field "&#39; .$var. &#39;" cannot contain fowl language!&#39;;
          }

          // Check for illegal characters
          if (preg_match("/[^a-zA-Z0-9\.\-\Ä\ä\Ö\ö\Ü\ü\ ]+$/", $var)) {
          $error[] = &#39;[*]Field "&#39; .$var. &#39;" may not contain illegal characters!&#39;;
          }

          // Check character count
          if(isset($var{$characters})) {
          $error[] = &#39;[*]Field "&#39; .$var. &#39;" exceed max amount of allowed characters!&#39;;
          }

          // Check for illegal database actions in fields
          if(preg_match("((select|grant|delete|insert|drop|a lter|replace|truncate|update|create|rena
          e|describe)[[:space:]]+[A-Z|a-z|0-9|\*| |\,]+[[:space:]]+(from|into|table|database|index|view)[[:space:]]+[A-Z|a-z|0-9|\*| |\,]|UNION SELECT.*\&#39;.*\&#39;.*,[0-9].*INTO.*FROM)", $var)) {
          $error[] = &#39;[*]Field "&#39; .$var. &#39;" contains errors.&#39;;
          }

          // Check for illegal tags
          if(preg_match("(<script|<about|<applet|<activex|<c hrome|<object)", $var)) {
          $error[] = &#39;[*]Field "&#39; .$var. &#39;" contains illegal tags. HTML is disallowed.&#39;;
          }

          // If any errors occured, output them!
          if(count($error)>0) {
          echo &#39;<div style="color: red; font: bold; padding: 10px;">

          (&#39; .count($error). &#39;) errors occured while processing your search:
          • &#39;;

            $start = count($error);
            for($i=0; $i<=$start; ++$i) {
            echo $error[$i];
            }

            echo &#39;</div>
          &#39;;
          exit();
          } else {

          // Parse it through HTML entitites just to play it safe
          $var = htmlentities($var);


          // Make safe for database for later user
          $var = mysql_real_escape_string($var);

          }

          // Closing to function make safe
          }

          ?>
          </div>

          And

          <div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'><?php

          // Make a username safe for database and limit to 30 characters
          $username = $_POST[&#39;username&#39;];

          // User our function!
          $username = make_safe($username, 31);

          ?></div>

          Like This AN d How To Use Them In Lavalair Forum !

          Comment


            #6
            very claver first u say ur site hack and spam and then u change discussion to something else. u created this topic only to spam smartie
            Failure is not when a girls leaves you, its only when you let her go virgin. heheh!!

            <span style="color:#9ACD32"><span style="font-size:36pt;line-height:100%">BEST MOBILE ADVERTISER</span></span>

            Comment


              #7
              i used for sql protection this way without the registration.php page

              mysql_real_escape_string()

              in that case :

              $_GET
              $_POST
              $_COOKIE

              like :

              $who=mysql_real_escape_string($_GET["$who"]);

              I also heard about quick protection : get_magic_quotes_gpc

              Comment


                #8
                To make a long boring subject short

                Where ever you use $_POST[""]; or $_REQUEST[""]; use mysql_real_escape_string

                Example.
                Code:
                $name=mysql_real_escape_string($_POST["name"]);
                What the mysql_real_escape_string does, it protects the script from injections, you do sql injections with forms, and if you use post for example, you post info that got submitted by a form.

                Hope this is usefull to someone.

                Click here!!!

                Comment


                  #9
                  now i am using like this :

                  $who= mysql_real_escape_string($_GET["$who"]);

                  according to ur worlds its will be like :

                  $who= mysql_real_escape_string($_GET["who"]);

                  that means the $ sign will be removed..........

                  Comment


                    #10
                    1)change ur password n include this sign {/ in ur password, 2)hide ur adminx folder,3)dont add uploader in ur site like gallery uploader etc 4)stop spamming on other site :D

                    Comment


                      #11
                      how do i hide the adminx folder?

                      WapCHAT Forum Currenltly changing over to xhtml

                      My Dowloads Site

                      Comment


                        #12
                        how do i hide the adminx folder?[/b]
                        pmpl simply...dont tell to anyone the folder name ;)
                        www.inbuzunar.mobi - Your mobile portal pocket

                        Comment


                          #13
                          i have no adminx folder in my script just 4 tools owner, headadmin, admin and mod........

                          Comment


                            #14
                            hide ur .htaccess file also :D

                            Comment


                              #15
                              htaccess files are already hidden by default on apache

                              Comment

                              Working...
                              X