Lavalair (hack Protection)

Started on the old forum in September 2008 · view the original in the archive · old links redirect here

54 replies · 8,908 views · started 18 years ago · 1 min read

18 participants
Guest #1

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

Guest #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.......

something else Fellow · 2,296 posts #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?

Guest #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 :

CODE<?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[] = '[*]Field "' .$var. '" cannot contain fowl language!'; }

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

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

// Check for illegal database actions in fields if(preg_match("((select|grant|delete|insert|drop|alter|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.'.'.*,[0-9].*INTO.FROM)", $var)) { $error[] = '[]Field "' .$var. '" contains errors.'; }

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

// If any errors occured, output them! if(count($error)>0) { echo '

    (' .count($error). ') errors occured while processing your search:

'; 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 }

?>

And

CODE<?php

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

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

?>

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

learner Lead · 587 posts #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!!

BEST MOBILE ADVERTISER

External image (may be gone)

Guest #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

SpiderWap Lead · 622 posts #8

To make a long boring subject short

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

Example.

$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.

Guest #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..........

Guest #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 😀

kiss Senior · 294 posts #12

how do i hide the adminx folder?

pmpl simply...dont tell to anyone the folder name 😉

www.inbuzunar.mobi -Your mobile portal pocket

Guest #13

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

Guest #14

hide ur .htaccess file also 😀

amylee Principal · 1,092 posts #15

htaccess files are already hidden by default on apache

amylee Principal · 1,092 posts #17

pfft.. i hate big headed people and removing adminx doesn't make the script unhackable 🙄
bet he hasn't patched the latest exploit i found few days ago in core.php

if you want my advice stop using the script as many people here would agree and code your own

ori Lead · 512 posts #18

i dnt think u can eva safe guard a site 100% there will always be some1 out there that can get in jus do regular backups (cpanel does them automatically) also check ur admins pws that there not guessable n regulary change ur mysql details for the database as thats how i get in most sites lol

BoYzONe Developer · 88 posts #19

anybody can give an idea how to protect lavalair script form hacked..they always delete my ibwf_user..any method can be done to proted from hacked or mysql injection?

Guest #20

Wapdesire already contains this protection like that:

CODEif(!get_magic_quotes_gpc()) { $_GET = array_map('trim', $_GET); $_POST = array_map('trim', $_POST); $_COOKIE = array_map('trim', $_COOKIE);

$_GET = array_map('addslashes', $_GET); $_POST = array_map('addslashes', $_POST); $_COOKIE = array_map('addslashes', $_COOKIE); }

But it not works.........

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close