Pachetul conține următoarele extraopțiuni:
Protecti pentru:
Cod: Selectaţi tot
* Anti Flood
* Anti Firewall
* Anti DDos
* Anti SQL injection protection
* Anti XSS attack protection
* Anti Malicious Code Finder
* Remote File Inclusion protection
* Guest Port Checking function
* Local File Inclusion protection
* Null Byte Injection protection
* Flood DOS protection
* CPU Over-Use protection
* Bad Referer protection
* Http Ddos protection
* Users using proxy server protection
* Bad User Agents protection
* Database user blocking
* .htaccess user blocking
* Attack logs viewer
* Security vulnerabilitesAveti doar cateva exemple aici si dovezi.
Protectie client:
Antiflood chat
Cod: Selectaţi tot
#----------------- MAIN CLASS -----------------------------------------------
def __init__(self):
ui.EditLine.__init__(self)
self.SetWindowName("Chat Line")
self.lastShoutTime = 0
self.eventEscape = lambda *arg: None
self.eventReturn = lambda *arg: None
self.eventTab = None
self.chatMode = chat.CHAT_TYPE_TALKING
self.bCodePage = TRUE
self.overTextLine = ui.TextLine()
self.overTextLine.SetParent(self)
self.overTextLine.SetPosition(-1, 0)
self.overTextLine.SetFontColor(1.0, 1.0, 0.0)
self.overTextLine.SetOutline()
self.overTextLine.Hide()
self.lastSentenceStack = []
self.lastSentencePos = 0
self.tempo = 0
self.volte = 0
#--------------------------------------- OTHER FUNCTIONS -----------------
def SendChat(self, text, type):
import time
net.SendChatPacket(text, type)
self.tempo=int(time.clock())+15
def __SendChatPacket(self, text, type):
import player
pg=player.GetName()
if text[0] == '/':
if pg.find("[") == -1:
return
if net.IsChatInsultIn(text):
chat.AppendChat(chat.CHAT_TYPE_INFO, locale.CHAT_INSULT_STRING)
else:
if self.volte > 100:
import time
if int(time.clock()) > self.tempo:
self.SendChat(text, type)
else:
chat.AppendChat(chat.CHAT_TYPE_INFO, "[Anti-Spam] Asteptati 5 secunde.")
else:
self.volte=self.volte+1
net.SendChatPacket(text, type)Cod: Selectaţi tot
def FileCheck(self):
files = None
md5_list = []
files_list = []
fname = "list.md5"
data = None
md5 = None
## Download list
urllib.urlretrieve (constInfo.FILECHECK_URL, fname)
## Read list
f = open(fname)
files = f.readlines()
f.close()
## Clear list
f = open(fname, "w")
f.write("")
f.close()
## Split
i = 0
while i < len(files):
data = files[i].split(constInfo.FILECHECK_SEPARATOR)
files_list.append(data[0])
md5_list.append(data[1])
i += 1
## Check files md5
i = 0
while i < len(files_list):
md5 = self.md5_for_file(files_list[i])
original_md5 = md5_list[i].lower()
original_md5 = original_md5.replace(" ", "")
original_md5 = original_md5.replace("\n", "")
if md5 != original_md5:
self.PopupNotifyMessage(constInfo.FILECHECK_MESSAGE, self.__ExitGame)
break
i += 1
## File MD5 :
def md5_for_file(self, fname):
f = open(fname, 'rb')
data = f.read()
m = md5.new()
if len(data)>0:
m.update(data)
f.close()
return m.hexdigest()
##Cod: Selectaţi tot
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
namespace AuthServer.Protection
{
/// <summary>
/// Bruteforce Entry which holds all necessary information.
/// </summary>
public class BruteforceEntry
{
public string IPAddress;
public int TimesTried;
public DateTime Unbantime;
public DateTime AddedTimeRemove;
}
public static class Bruteforce
{
public static int MaxTrials;
public static IDictionary<string, BruteforceEntry> Entries = new Dictionary<string, BruteforceEntry>();
private static readonly ThreadStart ThreadStart = ThreadExecute;
private static void ThreadExecute()
{
while (true)
{
lock (Entries)
{
DateTime now = DateTime.Now;
foreach(BruteforceEntry be in Entries.Values.ToList())
{
if (be.AddedTimeRemove <= now)
Entries.Remove(be.IPAddress);
else if (be.Unbantime <= now && be.Unbantime.Day == DateTime.Now.Day)
Entries.Remove(be.IPAddress);
}
}
Thread.Sleep(1500);
}
}
/// <param name="value">Amount of false logins somebody can have before getting banned.</param>
public static void Start(byte value = (byte) 11)
{
MaxTrials = value;
new Thread(ThreadStart).Start();
}
public static void AddTry(string IPAddress)
{
lock (Entries)
{
BruteforceEntry be;
if (!Entries.TryGetValue(IPAddress, out be))
{
be = new BruteforceEntry
{
IPAddress = IPAddress,
AddedTimeRemove = DateTime.Now.AddMinutes(5),
Unbantime = new DateTime()
};
Entries.Add(IPAddress, be);
}
else
{
be.TimesTried++;
if (be.TimesTried >= MaxTrials)
be.Unbantime = DateTime.Now.AddMinutes(15);
}
}
}
public static bool IsBanned(string IPAddress)
{
bool isBanned = false;
BruteforceEntry be;
if (Entries.TryGetValue(IPAddress, out be))
isBanned = (be.Unbantime.Day == DateTime.Now.Day);
return isBanned;
}
}
}SITE PROTECTION
Extra multi protection :
Cod: Selectaţi tot
<!-- START Anti-SQL Injection -->
<?php
function madSafety($string) {
$string = stripslashes($string);
$string = strip_tags($string);
$string = mysql_real_escape_string($string);
return $string;
}
?>
<?php
$ip = $_SERVER['REMOTE_ADDR'];
$time = date("l dS of F Y h:i:s A");
$fp = fopen ("[WEB]SQL_Injection.txt", "a+");
$sql_inject_1 = array(";","'","%",'"'); #Whoth need replace
$sql_inject_2 = array("", "","","""); #To wont replace
$GET_KEY = array_keys($_GET); #array keys from $_GET
$POST_KEY = array_keys($_POST); #array keys from $_POST
$COOKIE_KEY = array_keys($_COOKIE); #array keys from $_COOKIE
/*begin clear $_GET */
for($i=0;$i<count($GET_KEY);$i++)
{
$real_get[$i] = $_GET[$GET_KEY[$i]];
$_GET[$GET_KEY[$i]] = str_replace($sql_inject_1, $sql_inject_2, HtmlSpecialChars($_GET[$GET_KEY[$i]]));
if($real_get[$i] != $_GET[$GET_KEY[$i]])
{
fwrite ($fp, "IP: $ip\r\n");
fwrite ($fp, "Method: GET\r\n");
fwrite ($fp, "Value: $real_get[$i]\r\n");
fwrite ($fp, "Time: $time\r\n");
fwrite ($fp, "==================================\r\n");
}
}
/*end clear $_GET */
/*begin clear $_POST */
for($i=0;$i<count($POST_KEY);$i++)
{
$real_post[$i] = $_POST[$POST_KEY[$i]];
$_POST[$POST_KEY[$i]] = str_replace($sql_inject_1, $sql_inject_2, HtmlSpecialChars($_POST[$POST_KEY[$i]]));
if($real_post[$i] != $_POST[$POST_KEY[$i]])
{
fwrite ($fp, "IP: $ip\r\n");
fwrite ($fp, "Method: POST\r\n");
fwrite ($fp, "Value: $real_post[$i]\r\n");
fwrite ($fp, "Time: $time\r\n");
fwrite ($fp, "==================================\r\n");
}
}
/*end clear $_POST */
/*begin clear $_COOKIE */
for($i=0;$i<count($COOKIE_KEY);$i++)
{
$real_cookie[$i] = $_COOKIE[$COOKIE_KEY[$i]];
$_COOKIE[$COOKIE_KEY[$i]] = str_replace($sql_inject_1, $sql_inject_2, HtmlSpecialChars($_COOKIE[$COOKIE_KEY[$i]]));
if($real_cookie[$i] != $_COOKIE[$COOKIE_KEY[$i]])
{
fwrite ($fp, "IP: $ip\r\n");
fwrite ($fp, "Method: COOKIE\r\n");
fwrite ($fp, "Value: $real_cookie[$i]\r\n");
fwrite ($fp, "Script: $script\r\n");
fwrite ($fp, "Time: $time\r\n");
fwrite ($fp, "==================================\r\n");
}
}
/*end clear $_COOKIE */
fclose ($fp);
?>
<?PHP
FUNCTION anti_injection( $user, $pass ) {
$banlist = ARRAY (
"insert", "select", "update", "delete", "distinct", "having", "truncate", "replace",
"handler", "like", " as ", "or ", "procedure", "limit", "order by", "group by", "asc", "desc"
);
IF ( EREGI ( "[a-zA-Z0-9]+", $user ) ) {
$user = TRIM ( STR_REPLACE ( $banlist, '', STRTOLOWER ( $user ) ) );
} ELSE {
$user = NULL;
}
IF ( EREGI ( "[a-zA-Z0-9]+", $pass ) ) {
$pass = TRIM ( STR_REPLACE ( $banlist, '', STRTOLOWER ( $userpass ) ) );
} ELSE {
$pass = NULL;
}
$array = ARRAY ( 'user' => $user, 'pass' => $userpass );
IF ( IN_ARRAY ( NULL, $array ) ) {
DIE ( 'Invalid use of login and/or password. Please use a normal method.' );
} ELSE {
RETURN $array;
}
}
?>
<?php
function mysql_safe($query,$params=false) {
if ($params) {
foreach ($params as &$v) { $v = mysql_real_escape_string($v); }
$sql_query = vsprintf( str_replace("?","'%s'",$query), $params );
$sql_query = mysql_query($sql_query);
} else {
$sql_query = mysql_query($query);
}
return ($sql_query);
}
?>
<?php
class secure{ function secureSuperGlobalGET($key)
{
$_GET[$key] = str_ireplace("script", "blocked", $_GET[$key]);
$_GET[$key] = strip_tags($_GET[$key]);
return $_GET[$key];
}
function secureSuperGlobalPOST($key)
{
$_POST[$key] = str_ireplace("script", "blocked", $_POST[$key]);
$_POST[$key] = strip_tags($_POST[$key]);
return $_POST[$key];
}
function secureVar($key){
$key = str_ireplace("script", "blocked", $key);
$key = strip_tags($key);
return $key;
}
}
?>
<!-- END Anti-SQL Injection -->
<!-----------------------------------------------------------------------!>
<!-- Cookie Protect -->
<?php
foreach ($_COOKIE as $key => $value) {
if(get_magic_quotes_gpc()) $_COOKIE[$key]=stripslashes($value);
$_COOKIE[$key] = mysql_real_escape_string($value);
}
?>
<!-- END Cookie Protect -->
<!-----------------------------------------------------------------------!>
<!-- START XSS Protection -->
<?php
/**
* Protejeaza de atacuri xss
* @param type string $str - stringul care trebuie protejat de xss
* @param type string $allowable_tags - tagurile pe care nu le va elimina, exemplu <b>
*/
function strip_xss($str,$allowable_tags=false){
//daca sa setat tag care sa nu fie eliminat
if(!$allowable_tags){
//facem strip_tags fara a elimina tagul(rile) dorit
$rez = strip_tags($str,$allowable_tags);
}
//altfel
else{
//facem strip_tags
$rez = strip_tags($str);
}
//daca se introduce javascript:alert() in input
if(stripos($rez, "javascript:") !== false) {
//eliminam javascript:
$result = str_replace("javascript:","", htmlentities($rez, ENT_QUOTES));
}
//altfel
else {
//tranformama in entitati html, protectia este pusa pentru " onchange="alert(document.cookie); etc
$result = htmlentities($rez, ENT_QUOTES);
}
return $result;
}
?>
<!-- END XSS Protection -->
<!-----------------------------------------------------------------------!>
<!-- START FIREWALL -->
<?php
define('PHP_FIREWALL_REQUEST_URI', strip_tags( $_SERVER['REQUEST_URI'] ) );
define('PHP_FIREWALL_ACTIVATION', true );
if ( is_file( @dirname(__FILE__).'/php-firewall/firewall.php' ) )
include_once( @dirname(__FILE__).'/php-firewall/firewall.php' );
?>
<!-- STOP FIREWALL -->
<!-----------------------------------------------------------------------!>
<script language=Javascript1.2> function ejs_nodroit() {return(false); } document.oncontextmenu = ejs_nodroit; </script>
<!--------------------------------------------------------------------------END PROTECTION-------------------------------------------------------------->
Cod: Selectaţi tot
IP: 46.102.58.14
Method: POST
Value: Înregistrare
Script: /home/public_html/index.php
Time: Wednesday 31st 2015f December 2014 10:30:07 AM
==================================
IP: 188.241.201.153
Method: POST
Value: Înregistrare
Script: /home/public_html/index.php
Time: Wednesday 31st 2015f December 2014 10:43:20 AM
==================================
IP: 46.102.58.14
Method: POST
Value: Înregistrare
Script: /home/public_html/index.php
Time: Wednesday 31st 2015f December 2014 10:43:31 AM
==================================
IP: 188.241.201.111
Method: POST
Value: Înregistrare
Script: /home/public_html/index.php
Time: Wednesday 31st 2015f December 2014 10:58:08 AM
==================================
IP: 79.114.188.160
Method: POST
Value: Înregistrare
Script: /home/public_html/index.php
Time: Wednesday 31st 2015f December 2014 11:28:28 AM
==================================
IP: 109.101.24.164
Method: POST
Value: Înregistrare
Script: /home/public_html/index.php
Time: Wednesday 31st 2015f December 2014 11:29:09 AM
==================================
IP: 79.113.145.70
Method: POST
Value: Înregistrare
Script: /home/public_html/index.php
Time: Wednesday 31st 2015f December 2014 11:30:52 AM
==================================
IP: 86.121.132.202
Method: POST
Value: ț[email protected]
Script: /home/public_html/index.php
Time: Wednesday 31st 2015f December 2014 12:05:39 PM
==================================
IP: 86.121.132.202
Method: POST
Value: Înregistrare
Script: /home/public_html/index.php
Time: Wednesday 31st 2015f December 2014 12:05:39 PM
==================================
IP: 86.121.132.202
Method: POST
Value: &#[email protected]
Time: Wednesday 31st 2015f December 2014 12:05:39 PM
==================================
IP: 79.114.188.160
Method: POST
Value: Înregistrare
Script: /home/public_html/index.php
Time: Wednesday 31st 2015f December 2014 12:38:22 PM
==================================
IP: 89.165.129.218
Method: POST
Value: Înregistrare
Script: /home/public_html/index.php
Time: Wednesday 31st 2015f December 2014 01:09:50 PM
==================================
IP: 86.121.140.12
Method: POST
Value: Înregistrare
Script: /home/public_html/index.php
Time: Wednesday 31st 2015f December 2014 01:15:16 PM
==================================
IP: 86.121.140.12
Method: POST
Value: Înregistrare
Script: /home/public_html/index.php
Time: Wednesday 31st 2015f December 2014 01:15:31 PM
==================================
IP: 86.121.140.12
Method: POST
Value: Înregistrare
Script: /home/public_html/index.php
Time: Wednesday 31st 2015f December 2014 01:15:49 PM
==================================
IP: 92.81.246.93
Method: POST
Value: Înregistrare
Script: /home/public_html/index.php
Time: Wednesday 31st 2015f December 2014 02:18:16 PM
==================================
IP: 92.81.246.93
Method: POST
Value: Înregistrare
Script: /home/public_html/index.php
Time: Wednesday 31st 2015f December 2014 02:18:38 PM
==================================
IP: 92.84.140.204
Method: POST
Value: Înregistrare
Script: /home/public_html/index.php
Time: Wednesday 31st 2015f December 2014 02:20:17 PM
==================================
IP: 92.84.140.204
Method: POST
Value: Înregistrare
Script: /home/public_html/index.php
Time: Wednesday 31st 2015f December 2014 02:20:50 PM
==================================
IP: 92.84.140.204
Method: POST
Value: Înregistrare
Script: /home/public_html/index.php
Time: Wednesday 31st 2015f December 2014 02:21:31 PM
==================================
IP: 92.84.140.204
Method: POST
Value: Înregistrare
Script: /home/public_html/index.php
Time: Wednesday 31st 2015f December 2014 02:22:08 PM
==================================
IP: 89.123.228.175
Method: POST
Value: Înregistrare
Script: /home/public_html/index.php
Time: Wednesday 31st 2015f December 2014 03:07:30 PM
==================================
IP: 109.101.24.164
Method: POST
Value: Înregistrare
Script: /home/public_html/index.php
Time: Wednesday 31st 2015f December 2014 04:21:09 PM
==================================
IP: 109.101.24.164
Method: POST
Value: Înregistrare
Script: /home/public_html/index.php
Time: Wednesday 31st 2015f December 2014 04:21:32 PM
==================================
IP: 95.76.10.76
Method: POST
Value: Înregistrare
Script: /home/public_html/index.php
Time: Wednesday 31st 2015f December 2014 04:36:40 PM
==================================
IP: 79.113.109.36
Method: POST
Value: Înregistrare
Script: /home/public_html/index.php
Time: Wednesday 31st 2015f December 2014 04:58:11 PM
==================================
IP: 77.228.91.149
Method: POST
Value: Înregistrare
Script: /home/public_html/index.php
Time: Wednesday 31st 2015f December 2014 05:23:52 PM
==================================
IP: 5.12.85.249
Method: POST
Value: Înregistrare
Script: /home/public_html/index.php
Time: Wednesday 31st 2015f December 2014 05:26:30 PM
==================================
IP: 92.80.31.139
Method: POST
Value: Înregistrare
Script: /home/public_html/index.php
Time: Wednesday 31st 2015f December 2014 05:33:13 PM
==================================
IP: 188.25.161.90
Method: POST
Value: Înregistrare
Script: /home/public_html/index.php
Time: Wednesday 31st 2015f December 2014 06:53:59 PM
==================================
IP: 89.123.228.175
Method: POST
Value: Înregistrare
Script: /home/public_html/index.php
Time: Wednesday 31st 2015f December 2014 07:53:11 PM
==================================
IP: 95.77.105.249
Method: POST
Value: Înregistrare
Script: /home/public_html/index.php
Time: Wednesday 31st 2015f December 2014 10:36:50 PM
==================================
IP: 86.122.21.205
Method: POST
Value: Înregistrare
Script: /home/public_html/index.php
Time: Thursday 01st 2015f January 2015 09:11:01 AM
==================================
IP: 92.82.241.144
Method: POST
Value: Înregistrare
Script: /home/public_html/index.php
Time: Thursday 01st 2015f January 2015 09:27:50 AM
==================================
IP: 92.82.241.144
Method: POST
Value: Înregistrare
Script: /home/public_html/index.php
Time: Thursday 01st 2015f January 2015 09:28:03 AM
==================================
IP: 92.82.241.144
Method: POST
Value: Înregistrare
Script: /home/public_html/index.php
Time: Thursday 01st 2015f January 2015 09:31:17 AM
==================================
IP: 89.136.26.200
Method: POST
Value: Înregistrare
Script: /home/public_html/index.php
Time: Thursday 01st 2015f January 2015 11:18:30 AM
==================================
IP: 94.52.183.181
Method: POST
Value: Înregistrare
Script: /home/public_html/index.php
Time: Thursday 01st 2015f January 2015 12:13:19 PM
==================================
IP: 94.52.183.181
Method: POST
Value: Înregistrare
Script: /home/public_html/index.php
Time: Thursday 01st 2015f January 2015 12:13:59 PM
==================================
IP: 94.52.183.181
Method: POST
Value: Înregistrare
Script: /home/public_html/index.php
Time: Thursday 01st 2015f January 2015 12:14:38 PM
==================================
IP: 94.52.183.181
Method: POST
Value: Înregistrare
Script: /home/public_html/index.php
Time: Thursday 01st 2015f January 2015 12:15:02 PM
==================================
IP: 94.52.183.181
Method: POST
Value: Înregistrare
Script: /home/public_html/index.php
Time: Thursday 01st 2015f January 2015 12:15:05 PM
==================================






