- Joined
- Jun 1, 2007
- Messages
- 96
- Reaction score
- 0
Hello everyone, I'm looking for a way to secure my site (MPOG) because
my site is hacked (LEVEL 99 ALL).
go to release section Xzeeon made a topic of it.. but his way is not rly safe/
function sanitize_data ( $sql ) {
return preg_replace( "/[^a-zA-Z0-9 ]/i", "", $sql );
}
~IcemanCode:function sanitize_data ( $sql ) { return preg_replace( "/[^a-zA-Z0-9 ]/i", "", $sql ); }
What site taken. ? please
MPOG = no
FGUNZ = no
And .. ...
That one clearly sucks. It blocks any slash, dot, comma, and so forth. Just clean ', " and \.
~IcemanCode:function sanitize_data ( $sql ) { return preg_replace( "/[^a-zA-Z0-9 ]/i", "", $sql ); }
$user = $_GET['user'];
$user = sanitize_data ( $_GET['user'] );
anti-sql injection
Can't you test your site against SQL/XSS injections via the firefox extensions SQL Inject Me and XSS Me?No, it strips out anything but a-z, A-Z, and 0-9. And I find it laughable you're suggesting as I told you, despite still promoting your "safe" anti-SQL function.
Considering this is what I posted earlier, I'd say it's perfectly safe - as long as sanitize_data() is called for all data being accepted via $_GET and $_POST, and you should be clean thus far. e.g.:
..would be..Code:$user = $_GET['user'];
Don't forget to include the sanitize_data function in whatever script is calling it!Code:$user = sanitize_data ( $_GET['user'] );
"anti-sql injection" isn't the key to solving all possible security vulnerabilities - what about XSS? What if another vulnerability in the MServer daemon resulted in root (e.g.: Unchecked buffer - possibility for a buffer overflow).
Not to mention, any other vulnerable service could be at fault.
OP, there's too many possible areas that could be gone wrong - start by fixing the forementioned.
Can't you test your site against SQL/XSS injections via the firefox extensions SQL Inject Me and XSS Me?
I have to ask cause I'm not sure if they actually are able to detect if they are vulnerable since all of mine comes up as all green (green means its protected)
google is your friend
No, it strips out anything but a-z, A-Z, and 0-9. And I find it laughable you're suggesting as I told you, despite still promoting your "safe" anti-SQL function.
Considering this is what I posted earlier, I'd say it's perfectly safe - as long as sanitize_data() is called for all data being accepted via $_GET and $_POST, and you should be clean thus far. e.g.:
..would be..Code:$user = $_GET['user'];
Don't forget to include the sanitize_data function in whatever script is calling it!Code:$user = sanitize_data ( $_GET['user'] );
"anti-sql injection" isn't the key to solving all possible security vulnerabilities - what about XSS? What if another vulnerability in the MServer daemon resulted in root (e.g.: Unchecked buffer - possibility for a buffer overflow).
Not to mention, any other vulnerable service could be at fault.
OP, there's too many possible areas that could be gone wrong - start by fixing the forementioned.
Lol, what you told me? I wrote an anti sql-injection function almost 2 year ago which does strip those 3 things. Including some functions to prevent XSS.
Shush shush.
function antisql($sql) {
$sql = preg_replace(sql_regcase("(select|union|0x|cast|exec|varchar|insert into|delete from|update account|update login|update character|ugradeid|drop table|show tables)"),"",$sql);
$sql = trim($sql);
$sql = strip_tags($sql);
$sql = addslashes($sql);
return $sql;
}