Skocz do zawartości
  • 👋 Witaj na MPCForum!

    Przeglądasz forum jako gość, co oznacza, że wiele świetnych funkcji jest jeszcze przed Tobą! 😎

    • Pełny dostęp do działów i ukrytych treści
    • Możliwość pisania i odpowiadania w tematach
    • System prywatnych wiadomości
    • Zbieranie reputacji i rozwijanie swojego profilu
    • Członkostwo w jednej z największych społeczności graczy

    👉 Dołączenie zajmie Ci mniej niż minutę – a zyskasz znacznie więcej!

    Zarejestruj się teraz

Zabezpieczenia,skrypty,bazy.. - TS3


AnonyPL

Rekomendowane odpowiedzi

Opublikowano

^

|
|
|
|

|
|
|
|
|
|
|
|
|
|

V

 

Witam,

Chciałbym podzielić się skryptami,regulkami iptables oraz wszystkim co mam.

Znajdziesz tutaj wiele więcej niż w innych postach.

 

1# Anty DDOS

 by Par0noid
<?php
/*
Activate DDoS Protection by par0noid.info
*/
 
//Please replace this with your informations!
//Bitte mit deinen Einstellungen ersetzen!
 
$ts3_ip = "<YOUR IP>";
$ts3_queryport = "10011";
$ts3_serveradmin = "serveradmin";
$ts3_password = "<YOUR SERVERADMIN PASSWORD>";
 
/*
##################################################################################
##################################################################################
DO NOT EDIT UNDER THIS LINE! | NICHTS UNTER DIESER LINIE BEARBEITEN!
##################################################################################
##################################################################################
*/
 
function escapeText($text) {
    $text = str_replace("\t", '\t', $text);
    $text = str_replace("\v", '\v', $text);
    $text = str_replace("\r", '\r', $text);
    $text = str_replace("\n", '\n', $text);
    $text = str_replace("\f", '\f', $text);
    $text = str_replace(' ', '\s', $text);
    $text = str_replace('|', '\p', $text);
    $text = str_replace('/', '\/', $text);
    return $text;
}
function executeCommand($handle, $command) {
    fwrite($handle, $command."\n");    
    if(strpos(fgets($handle), 'error id=0 msg=ok') !== false) {
        return true;
    }else{
        return false;
    }
}
 
$fp = fsockopen($ts3_ip, $ts3_queryport, $errno, $errstr, 5);
 
if (!$fp) {
    echo "$errstr ($errno)<br />\n";
} else {
    if(strpos(fgets($fp), 'TS3') !== false) {
        fgets($fp); //trash
 
        if(executeCommand($fp, "login ".escapeText($ts3_serveradmin)." ".escapeText($ts3_password))) {            
            if(executeCommand($fp, "instanceedit serverinstance_pending_connections_per_ip=2")) {
                echo "Aktivierung erfolgreich!";
            }else{
                echo "Aktivierung fehlgeschlagen!";
            }
        }else{
            echo "Login fehlgeschlagen!";
        }
    }else{
        echo 'Kein TS3-Server erreichbar!';
    }
    fclose($fp);
}
?>

2# Firewall TS3 [ipTables]

# ~ ~ ~ ~ ~ ~ Reguly GLOBALNE ~ ~ ~ ~ ~ ~ #
iptables-F
iptables-X
iptables-P INPUT DROP
iptables-P FORWARD DROP
iptables-P OUTPUT ACCEPT
iptables-A INPUT-m state - state ESTABLISHED, RELATED-j ACCEPT
iptables-A INPUT-i lo-j ACCEPT
 
# ~ ~ ~ ~ ~ ~ Reguly PODSTAWOWE ~ ~ ~ ~ ~ ~ #
iptables-A INPUT-p tcp - dport 80-j ACCEPT
iptables-A INPUT-p tcp - dport 443-j ACCEPT
iptables-A INPUT-p tcp - dport 21-j ACCEPT
iptables-A INPUT-p tcp - dport 22-j ACCEPT
 
# ~ ~ ~ ~ ~ ~ Reguly DODATKOWE ~ ~ ~ ~ ~ ~ #
iptables-A INPUT-p tcp - dport 25-j ACCEPT
iptables-A INPUT-p tcp - dport 53-j ACCEPT
iptables-A INPUT-p udp - dport 53-j ACCEPT
iptables-A INPUT-p udp - dport 137-j ACCEPT
iptables-A INPUT-p udp - dport 138-j ACCEPT
iptables-A INPUT-p tcp - dport 139-j ACCEPT
iptables-A INPUT-p tcp - dport 445-j ACCEPT
iptables-A INPUT-p tcp - dport 587-j ACCEPT
iptables-A INPUT-p tcp - dport 3306-j ACCEPT
iptables-A INPUT-p tcp - dport 6081-j ACCEPT
iptables-A INPUT-p tcp - dport 6082-j ACCEPT
iptables-A INPUT-p tcp - dport 9899-j ACCEPT
iptables-A INPUT-p udp - dport 9987-j ACCEPT
iptables-A INPUT-p udp - dport 9989-j ACCEPT
iptables-A INPUT-p udp - dport 9990-j ACCEPT
iptables-A INPUT-p udp - dport 9991-j ACCEPT
iptables-A INPUT-p udp - dport 9992-j ACCEPT
iptables-A INPUT-p udp - dport 9993-j ACCEPT
iptables-A INPUT-p udp - dport 9994-j ACCEPT
iptables-A INPUT-p udp - dport 9995-j ACCEPT
iptables-A INPUT-p udp - dport 9996-j ACCEPT
iptables-A INPUT-p udp - dport 9997-j ACCEPT
iptables-A INPUT-p udp - dport 9998-j ACCEPT
iptables-A INPUT-p udp - dport 9999-j ACCEPT
iptables-A INPUT-p tcp - dport 10011-j ACCEPT
iptables-A INPUT-p tcp - dport 10013-j ACCEPT
iptables-A INPUT-p tcp - dport 10016-j ACCEPT # przetestowaś
iptables-A INPUT-p tcp - dport 30033-j ACCEPT
iptables-A INPUT-p tcp - dport 30039-j ACCEPT
iptables-A INPUT-p tcp - dport 30040-j ACCEPT # przetestowaś
iptables-A INPUT-p udp - dport 39030-j ACCEPT
iptables-A INPUT-p udp - dport 49296-j ACCEPT
 
# ~ ~ ~ ~ ~ ~ Reguly ANTY-DDOS ~ ~ ~ ~ ~ ~ #
 
iptables-A INPUT-p tcp - dport 80-m state - state NEW-m granica - granica 50minute - granica-burst 50-j ACCEPT
iptables-A INPUT-m state - state RELATED, ESTABLISHED-m granica - 50second granica - granica-burst 50-j ACCEPT
 
# Blokada PRZED atakiem DOS - Ping of Death
iptables-A INPUT-p ICMP - icmp-type echo-request-m d?ugoúci - d?ugoúś 6065535-j ACCEPT
 
# Blokada PRZED atakiem DOS - Teardrop
iptables-A INPUT-p UDP-f-j DROP
 
# Blokada PRZED atakiem DOS - Teardrop
iptables-A INPUT-p UDP-f-j DROP
 
# Blokada PRZED atakiem DOS - SYN-flood
iptables-A INPUT-p TCP - syn-m connlimit - connlimit-powyNej 9-j DROP
iptables-N SYN_FLOOD
iptables-A INPUT-p tcp - syn-j SYN_FLOOD
iptables-SYN_FLOOD-m granica - granica 2  s - granica-burst 6-j RETURN
iptables-SYN_FLOOD-j DROP
 
# Blokada PRZED atakiem DOS - UDP-flood (Pepsi attack)
iptables-A INPUT-m pkttype - pkt typu broadcast-j DROP
iptables-A INPUT-p ICMP - icmp-type echo-request-m pkttype - pkt typu broadcast-j DROP
iptables-A INPUT-p ICMP - icmp-type echo-request-m granica - granica 3  s-j ACCEPT
 
# Blokada PRZED atakiem DOS - SMBnuke
iptables-A INPUT-p UDP - dport 135139-j DROP
iptables-A INPUT-p TCP - dport 135139-j DROP
 
# Blokada PRZED atakiem DOS - Connection-flood
iptables-A INPUT-p TCP - syn-m connlimit - connlimit-powyNej 3-j DROP
 
# Blokada PRZED atakiem DOS - Fraggle
iptables-A INPUT-p UDP-m pkttype - pkt typu broadcast-j DROP
iptables-A INPUT-p UDP-m granica - granica 3  s-j ACCEPT
 
# Blokada PRZED atakiem DOS - Jolt
iptables-A INPUT-p ICMP-f-j DROP

3# Zliczanie ilości slotów przez klient Query

Kod za pomocą jakiego client query zlicza ilość slotów na serwerze.

Potrzebujemy do tego bibliotek TS3 PHP Framework.


<?php require_once("../libraries/TeamSpeak3/TeamSpeak3.php"); TeamSpeak3::init(); try { $ts3_ServerInstance = TeamSpeak3::factory("serverquery://" . $cfg["user"] . ":" . $cfg["pass"] . "@" . $cfg["host"] . ":" . $cfg["query"] . "/"); $ts3_VirtualServer = $ts3_ServerInstance->serverGetById(1); $dane = $ts3_VirtualServer->getInfo(TRUE, TRUE); echo $dane["virtualserver_maxclients"] } ?>
W skrócie kod powinien wyglądać tak:

$dane = $ts3_VirtualServer->getInfo(TRUE, TRUE); echo $dane["virtualserver_maxclients"];
Te linijki na górze odwołują się do liczby slotów ($dane to tylko deklaracja zmiennej, może być $sleiv i też będzie działać)
Co w rezultacie daje wynik: 412 

Wkróce pojawią się nowe skrypty!

Zakaz Kopiowania!

╔═══════════════════════════════════════╗

• Polish Anonymous •

• You're on a 24-hour, then they will DDOS attacks! •

• Polish Power Stressers •

╚═══════════════════════════════════════╝

Opublikowano

Tak tylko zauważ, że każda inna maszyna z jakiejkolwiek serwerowni ma inne porty i zabezpieczenia przed serwerem który mamy. Więc regułki i tak muszą być przystosowane.

1385681103-U843596.jpg

 

Opublikowano

@kurwisko porty? Chyba ip ;) Każdy adres ip/maszyna może mieć takie same porty ;p

@top Mi się nie przyda ale wygląda spoko . Fajnie że coś ktoś za darmo daje $_$

Opublikowano

 

<?php
/*
Activate DDoS Protection by par0noid.info
*/

//Please replace this with your informations!
//Bitte mit deinen Einstellungen ersetzen!

$ts3_ip = "<YOUR IP>";
$ts3_queryport = "10011";
$ts3_serveradmin = "serveradmin";
$ts3_password = "<YOUR SERVERADMIN PASSWORD>";

/*
##################################################################################
##################################################################################
DO NOT EDIT UNDER THIS LINE! | NICHTS UNTER DIESER LINIE BEARBEITEN!
##################################################################################
##################################################################################
*/

function escapeText($text) {
$text = str_replace("\t", '\t', $text);
$text = str_replace("\v", '\v', $text);
$text = str_replace("\r", '\r', $text);
$text = str_replace("\n", '\n', $text);
$text = str_replace("\f", '\f', $text);
$text = str_replace(' ', '\s', $text);
$text = str_replace('|', '\p', $text);
$text = str_replace('/', '\/', $text);
return $text;
}
function executeCommand($handle, $command) {
fwrite($handle, $command."\n"); 
if(strpos(fgets($handle), 'error id=0 msg=ok') !== false) {
return true;
}else{
return false;
}
}

$fp = fsockopen($ts3_ip, $ts3_queryport, $errno, $errstr, 5);

if (!$fp) {
echo "$errstr ($errno)<br />\n";
} else {
if(strpos(fgets($fp), 'TS3') !== false) {
fgets($fp); //trash

if(executeCommand($fp, "login ".escapeText($ts3_serveradmin)." ".escapeText($ts3_password))) { 
if(executeCommand($fp, "instanceedit serverinstance_pending_connections_per_ip=2")) {
echo "Aktivierung erfolgreich!";
}else{
echo "Aktivierung fehlgeschlagen!";
}
}else{
echo "Login fehlgeschlagen!";
}
}else{
echo 'Kein TS3-Server erreichbar!';
}
fclose($fp);
}
?>

i ,ze niby na jakiej zasadzie ma to dzialac ?? bo cos mi tu smierdzi

Opublikowano

 

<?php
/*
Activate DDoS Protection by par0noid.info
*/

//Please replace this with your informations!
//Bitte mit deinen Einstellungen ersetzen!

$ts3_ip = "<YOUR IP>";
$ts3_queryport = "10011";
$ts3_serveradmin = "serveradmin";
$ts3_password = "<YOUR SERVERADMIN PASSWORD>";

/*
##################################################################################
##################################################################################
DO NOT EDIT UNDER THIS LINE! | NICHTS UNTER DIESER LINIE BEARBEITEN!
##################################################################################
##################################################################################
*/

function escapeText($text) {
$text = str_replace("\t", '\t', $text);
$text = str_replace("\v", '\v', $text);
$text = str_replace("\r", '\r', $text);
$text = str_replace("\n", '\n', $text);
$text = str_replace("\f", '\f', $text);
$text = str_replace(' ', '\s', $text);
$text = str_replace('|', '\p', $text);
$text = str_replace('/', '\/', $text);
return $text;
}
function executeCommand($handle, $command) {
fwrite($handle, $command."\n"); 
if(strpos(fgets($handle), 'error id=0 msg=ok') !== false) {
return true;
}else{
return false;
}
}

$fp = fsockopen($ts3_ip, $ts3_queryport, $errno, $errstr, 5);

if (!$fp) {
echo "$errstr ($errno)<br />\n";
} else {
if(strpos(fgets($fp), 'TS3') !== false) {
fgets($fp); //trash

if(executeCommand($fp, "login ".escapeText($ts3_serveradmin)." ".escapeText($ts3_password))) { 
if(executeCommand($fp, "instanceedit serverinstance_pending_connections_per_ip=2")) {
echo "Aktivierung erfolgreich!";
}else{
echo "Aktivierung fehlgeschlagen!";
}
}else{
echo "Login fehlgeschlagen!";
}
}else{
echo 'Kein TS3-Server erreichbar!';
}
fclose($fp);
}
?>

i ,ze niby na jakiej zasadzie ma to dzialac ?? bo cos mi tu smierdzi

 

instanceedit serverinstance_pending_connections_per_ip=2

To coś odpowiada za ten antyddos.

Ustawia ilość połączeń z jednego adresu ip. 

Niby zabezpieczenie ale jak ktoś sie postara to i tak bedą ddos'y ;)

  • 2 tygodnie później...

Zarchiwizowany

Ten temat przebywa obecnie w archiwum. Dodawanie nowych odpowiedzi zostało zablokowane.

×
×
  • Dodaj nową pozycję...