Surveys on line News

Bluscream

Retired Staff
Contributor
May 8, 2015
967
934
211
I found this on a russian website while searching for the mysterious x-ts3-signature header. It was translated by my good old friend from Google so don't expect miracles but i hope it helps some people interested in all this.

It was evening , There was nothing . (c)
The theme already was rising Online: Question on the running line . and, I think, many asked the same question.
So, I bring to your attention a fascinating read. Nervous and pregnant women not to look: D As you know, the news teamspeak client requests from the server http://news.teamspeak.com . Address nailed in the code, and change it, but to binary editing, - no way. If it is impossible, but very desirable - it is possible: we substitute requests to your server;) assumes that we have a VPS / VPS / mezzanine server. It turns Linux defined nginx, php and TS server . External ip: 10.10.10.10




Let's start with the server configuration:
1. add in / etc / hosts file :
Code:
10.10.10.10 news.teamspeak.com
2. create config for nginx could: /etc/nginx/sites-enabled/news.teamspeak.com
Code:
server {
listen 80;
server_name news.teamspeak.com;

access_log /var/log/nginx/news.teamspeak.com-access.log;
error_log /var/log/nginx/news.teamspeak.com-error.log;
#log_not_found off;
#access_log off;

charset utf-8;
gzip on;

add_header Cache-Control "public, max-age = 1800"; # Expires: minimum and credit default 1800 (half an hour), other values of working adequately.
add_header X-TS3-SIGNATURE "empty"; # Magic header, the client checks that he received the news with a valid server. any non-blank value

# Only GET requests
if ($ request_method! = GET) {
444 return;
}
location = /en/news.txt {
echo "ad space";
echo "<img src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3wgLEAsu68m/7gAAAzxJREFUOMtt079LcgsAxvHv0XM8pmZUomEl1FvSUJE5lEMOGRHhUFtLFLUUEtTe0NhY0B5UCM2BFDQElYVdyIhI+kUIaWidfvkjTTzvcO99ucP9/AEPDw88AoCiKH/t7u66ZVnm8/OTQqHAz88PpVIJs9lMZWUlOp0OWZaxWq243W6Bfwg3Nzfq2toaPp8Ps9nM8/MzqVQKnU6HVqvl+/ubfD6PIAi8v79TLBYRBIGJiQna29sFcX19nfHxcdra2jg8PKS2thaPx4NeryeZTOJwOBBFkXg8TiaTQZZlNBoNm5ubXF1dqdrJycklv9/P7e0tn5+ffHx8EA6H+fn5obq6mvr6egwGA+VyGavVitFoxGAwIEkSj4+PiEajkWg0itFo5PLyko2NDRRFwev1IooiCwsLtLa2EgwGCQaDmM1mpqen8Xg8rK6uIiwvL6tfX19oNBp+/frFw8MDLpcLp9PJ2dkZfr+fbDZLIBBgfn4ek8lEPB7n9fUVg8GAxuFwkE6nqauro6amhrGxMUZGRpAkiaqqKnQ6HTabjampKZ6enhAEgVQqRXNz89/7FAoFcrkcdrud4+Nj0uk09/f33N3dcXFxwfv7OwMDA5hMJkKhEL29vfT29hKLxSiXywiqqqqrq6ucnJxQLBapr6/H4/EQiUTo6upClmVeX1+5vLxkdHQURVHY3t6mu7sbm82GmE6nmZubo1QqcXBwgN1uZ2dnh0QiQUdHB6enpxQKBSRJYm9vD0VReHl5IZPJ4HQ60ZbL5aX+/n5cLheJRIKenh4aGxupra0ll8uxv79PIpHg/Pyc6+trHh4eSCaTDA8PY7FY0AYCgaWtrS30ej19fX1Eo1EODg5wu90MDg6i1WqZmZmhoqKCzs5ORFGkpaWF2dlZYrEYAsDu7q4aCoUwm8243W5sNhu3t7fkcjmy2SylUol8Po/RaMRisWC1WvF6vaysrCACDA0NCQChUEgNh8NkMhl8Ph8ulwtBEFAUBVVVkSQJi8XC29sbxWIRSZL486r/CofD6tHREQB2u52mpiYaGhrQaDTIsgxALBZjb2/v/wP+FYlE1GQySTqd/tMil8thMpkoFAosLi4KvwHlEGaKPGrAOwAAAABJRU5ErkJggg==\">";
}
}


Code:
server {
listen 80;
server_name news.teamspeak.com;

access_log /var/log/nginx/news.teamspeak.com-access.log;
error_log /var/log/nginx/news.teamspeak.com-error.log;
#log_not_found off;
#access_log off;

charset utf-8;
gzip on;

root /var/www/news.teamspeak.com;
index index.php;

add_header Cache-Control "public, max-age = 1800"; # Expires: minimum and credit default 1800 seconds (half an hour), on the other values of working adequately.
add_header X-TS3-SIGNATURE "empty"; # Magic header, the client checks that he received the news with a valid server. any non-blank value

# Only GET requests
if ($ request_method! = GET) {
444 return;
}

location / {
try_files $ uri @rewrite;
}
location @rewrite {
#rewrite ^ / (. *) $ /index.php; #
rewrite ^ / (. *) / news.txt $ /index.php?lang=$1; # With the transfer of the client script language
}
location ~ \ .php $ {
fastcgi_pass unix: /var/run/php5-fpm.sock;
fastcgi_cache_valid 200301302304 30m;
fastcgi_cache_key "$ request_method | $ host | $ request_uri";
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $ document_root $ fastcgi_script_name;
}
}

Check config nginx could: the sudo nginx could -t
Code:
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
and restart: the sudo service, the restart nginx could

For the second variant additionally create a file /var/www/news.teamspeak.com/index.php :
and in the same directory as the downloaded dump the ts3admin.class.php

Configure the client:
Add a line to the end of the hosts file. Needed admin rights / root, in special cases and the temporary suspension of the anti-virus: it can block access to the file.
The Windows: % windir% \ system32 folder \ drivers \ etc \ hosts file
the Linux: / etc / hosts file
Code:
10.10.10.10 news.teamspeak.com
To check, select the menu item:
P omosch> Display line n ews of H elp> Show News, the T icker

Not connected to a server TS: Connected to the TS server:
src0-jpg.1931

src1-jpg.1932




The algorithm:
1. are resolving news.teamspeak.com. (DNS Query A records and the AAAA)
2.1. GET request http://news.teamspeak.com/ru/news.txt , where ru - used TS client language.
2.2. In the case of an unsuccessful request (404, etc.) - GET request http://news.teamspeak.com/en/news.txt
3. Check Heather non-empty X-TS3-SIGNATURE in the response from the server
4. Parsing of the response and output in the status bar.



What is the difference between the configs nginx?
When checking it was found that the client does not transmit any data to somehow identify the server to which the client or the client from which the request came sits. Ngx_http_userid_module was powerless - $ uid_set issued, but different each time, $ uid_got -. All the empty second option allows the identification of the customer and give the news, at least for each personally;) But here, "bug", because of the implementation of the identification and ip code: 1. if the user is sitting simultaneously on two virtual servers in a single physical server TS, the image will include only the last server 2. if the user is sitting on the same server but with two nicknames: the image will include the first login nickname.







Tags and Formatting
Of the tested and working: <b>, <i> , <u>, <s>, <a>, <span>, <div>, <p>, <table>, <tr>, <th>, < ! td>, <br />, < img />, <- comments // ->
do not work (the parser - loh :(): <script>, as well as any attempt to introduce JavaScript, stupidly ignored <iframe>. , <The form>, <input the>, <the html>, <head>, <body>
<hr> - works, but output as a bar in a couple of pixels, and can not be adjusted. The tag can be defined formatting styles, etc:

HTML:
<Div style = "font: 7pt; background: # 007E3E; color: blue; margin: 10px;"> text </ div>
padding, text-align, border- radius - are ignored. all styles are not tested, not so uporotyh: D Insert images through the tag <img /> only in the format of the base64 . GIF-animation is not supported - shows the first frame. Alpha transparency - works. the svg, including animation and scripts - not tested supported Emoji text or Unified Unicode representation ( Penguin : 128039 & #; & # x1f427;), even those that are not allowed to chat or nickname :) Ways how to disable scrolling rally found. There is a suspicion for another bike developers TS: painting on canvas and its horizontal scrolling timer.
 

VJean

Member
Jan 28, 2016
16
0
36
small note: during setup and testing for this article, i'm found the bug crash of client. on specific nginx config


ps. sorry, config not saved.
 

tagKnife

Well-Known Member
Oct 2, 2015
343
270
146
So wait? The server grabs the news from TeamSpeak and then sends that to the client?
if so great, Nice feature teamspeak please make official.

also that nginx config is overwritten like shit. wtf.

-Edited by MOD Qrazktzyl-
Removed insult.
 
Last edited by a moderator:

ehthe

Retired Staff
Contributor
Apr 26, 2015
1,028
896
216
This is all very complicated, but it's not :p
The teamspeak client just queries a text file from teamspeak new servers. It can be abused, like a whole lot of things about teamspeak ;)
 

VJean

Member
Jan 28, 2016
16
0
36
@DrWhat ***, read original article.

@ehthe yes, all right. in original article demonstrated php source code for generate answer for client language
 
Last edited:

tagKnife

Well-Known Member
Oct 2, 2015
343
270
146
Code:
server {
    listen 80;
    server_name news.teamspeak.com;
    root C:\\WebServer\\nginx\\www\\news.teamspeak.com;
    index index.html index.htm index.php;
    charset utf-8;
    access_log off;
    error_log  C:\\WebServer\\nginx\\logs\\news.teamspeak.com-error.log error;
    sendfile off;
    client_max_body_size 100m;
    gzip_static on;
    server_tokens off;
    location ~* /(en|de|ru|.?.?)/news.txt$ {
        expires 12h;
        access_log off;
        add_header Cache-Control "public";
        add_header X-TS3-SIGNATURE "DrWhat-nginx-news";
        try_files $uri $uri/ /en/news.txt =404;
    }
}
This is all you need, it will try to get the requested langauge directory if you havnt done a diffrent langauge it will defualt to english

demo :
GnHaejt.gif


How ever, The client wont load the news from the server unless the client has some kind of error connecting its self. So each client would have to add your ip pointing to your server
 
Last edited:

VJean

Member
Jan 28, 2016
16
0
36
@DrWhat in current client (v.3.0.19) added official support of Spanish and French, additionally exists more unofficial translates.
if using rewrite, automatic added support for other languages. later will be enough to fix php-script and not nginx config.

It is used to transfer the client language to script
 
Last edited:

tagKnife

Well-Known Member
Oct 2, 2015
343
270
146
@DrWhat in current client (v.3.0.19) added official support of Spanish and French, additionally exists more unofficial translates.
if using rewrite, automatic added support for other languages. later will be enough to fix php-script and not nginx config.
No need. the nginx config automatically resolves all language abbreviations as long as you create a folder for it.

If you want to give Romania news create a folder called "ro" and if a request comes through for /ro/news.txt it will retrieve the Romanian news, and if it doesnt exsist it will default to /en/news.txt

as you can see in the demo gif, It resolves the language "en" "es" and "de" but i didnt create news for "fr" so nginx fetches the en news by default.
 
Top