ServerVerwaltung

New Member
May 14, 2017
11
1
15
Hello, im searching for a Script like these...
Name of the script: Detect User
Functions of the script: Detect User over IP via Browser, if a User is logged in to a Teamspeak Server and open the Website, this site will show his UID, IP and Username
Why do you want it: Im new to coding and want to learn something about it
Screenshots:
Original source (if any):
Other notes: It shoud be based on Teamspeak PHP Framework. Ive tried it a lot of time but dont get it. Thank you a lot :)
 

LeU5er

Security Researcher
Aug 6, 2016
448
45
118
This is made with the ts3adminclass from http://ts3admin.info.
Just download this php file (https://raw.githubusercontent.com/par0noid/ts3admin.class/master/lib/ts3admin.class.php) and put it in the same directory where the index.php file is located.
You only have to edit the "General Config" in the index.php file.
PHP:
<?php
require('ts3admin.class.php');

//General Config
$ts3['ip'] = '127.0.0.1';            // address
$ts3['queryport'] = '10011';        // queryport
$ts3['port'] = '9987';                // voiceport
$ts3['user'] = 'serveradmin';       // serveradmin username
$ts3['pass'] = 'password';            // serveradmin password
$ts3['displayname'] = "CheckBot";    // nickname of the bot

if (isset($_SERVER["HTTP_CF_CONNECTING_IP"])) {
  $_SERVER['REMOTE_ADDR'] = $_SERVER["HTTP_CF_CONNECTING_IP"];
  $ip = $_SERVER['REMOTE_ADDR'];
}
?>
<?php
    $tsAdmin = new ts3admin($ts3['ip'], $ts3['queryport']);
        $tsAdmin->connect();
        $tsAdmin->login($ts3['user'], $ts3['pass']);
        $tsAdmin->selectServer($ts3['port']);
        $tsAdmin->setName($ts3['displayname']);
        $clients = $tsAdmin->clientList("-ip -uid");
        foreach($clients['data'] as $client) {
            if ($client['connection_client_ip'] == $ip) {
                    echo "<center>";
                    echo "<p><b>Username: </b>";
                    echo $client['client_nickname'];
                    echo "<p><b>IP-Address: </b>";
                    echo $client['connection_client_ip'];                 
                    echo "<p><b>UID: </b>";
                    echo $client['client_unique_identifier'];
                    echo "</center>";
        }
    }
?>
 

ServerVerwaltung

New Member
May 14, 2017
11
1
15
Thank you LeU5er,
but that wont work for me but ive got modified/edit your script.
Now it works fine :)
PHP:
<?php
require('ts3admin.class.php');

//General Config
$ts3['ip'] = '127.0.0.1';            // address
$ts3['queryport'] = '10011';        // queryport
$ts3['port'] = '9987';                // voiceport
$ts3['user'] = 'serveradmin';       // serveradmin username
$ts3['pass'] = 'password';            // serveradmin password
$ts3['displayname'] = "CheckBot";    // nickname of the bot

?>
<?php
//get ipadress of client
    $ip = $_SERVER["REMOTE_ADDR"];
?>
<?php
    $tsAdmin = new ts3admin($ts3['ip'], $ts3['queryport']);
        $tsAdmin->connect();
        $tsAdmin->login($ts3['user'], $ts3['pass']);
        $tsAdmin->selectServer($ts3['port']);
        $tsAdmin->setName($ts3['displayname']);
        $clients = $tsAdmin->clientList("-ip -uid");
        foreach($clients['data'] as $client) {
            if ($client['connection_client_ip'] == $ip) {
                    echo "<center>";
                    echo "<p><b>Username: </b>";
                    echo $client['client_nickname'];
                    echo "<p><b>IP-Address: </b>";
                    echo $client['connection_client_ip'];                
                    echo "<p><b>UID: </b>";
                    echo $client['client_unique_identifier'];
                    echo "</center>";
        }
    }
?>
 
Top