Identificador de Proxy -
CharCoast - 18.01.2015
Dei uma pesquisada e encontrei esse site que identifica e diz se um ip esta sendo ocultado por proxy.
Nгo tenho muito conhecimento sobre essa бrea, mas usei alguns ips do hotspot Shield nesse site e ele conseguiu identificar.
Site
Quem sabe alguйm ai consegue desenvolver um anti proxy ou algo do gкnero.
Se eu estiver falando merda podem me xingar ai XD
Re: Identificador de Proxy -
MultiKill - 18.01.2015
Olhe isto:
pawn Код:
#include a_http
main()
{
HTTP(0, HTTP_GET, "www.shroomery.org/ythan/proxycheck.php?ip=1", "", "MyHttpResponse");
}
forward MyHttpResponse(index, response_code, data[]);
public MyHttpResponse(index, response_code, data[])
{
if(response_code == 200) //Did the request succeed?
{
printf("The URL replied: %s", data);
}
else
{
printf("The request failed! The response code was: %d", response_code);
}
return 1;
}
E olhe estб informaзгo do site:
"A resposta й um ъnico caractere e conterб um dos trкs valores: Y se й um proxy, N , se nгo й, ou X , se hб um erro."
Para saber mais sobre a funзгo HTTP:
https://sampwiki.blast.hk/wiki/HTTP
Re: Identificador de Proxy -
ipsLuan - 18.01.2015
Quote:
Originally Posted by MultiKill
Olhe isto:
pawn Код:
#include a_http
main() { HTTP(0, HTTP_GET, "www.shroomery.org/ythan/proxycheck.php?ip=1", "", "MyHttpResponse"); } forward MyHttpResponse(index, response_code, data[]); public MyHttpResponse(index, response_code, data[]) { if(response_code == 200) //Did the request succeed? { printf("The URL replied: %s", data); } else { printf("The request failed! The response code was: %d", response_code); } return 1; }
E olhe estб informaзгo do site:
"A resposta й um ъnico caractere e conterб um dos trкs valores: Y se й um proxy, N , se nгo й, ou X , se hб um erro."
Para saber mais sobre a funзгo HTTP:
https://sampwiki.blast.hk/wiki/HTTP
|
E como fazer pra usar o IP do jogador?
pawn Код:
HTTP(0, HTTP_GET, "www.shroomery.org/ythan/proxycheck.php?ip=%s", "ip", "MyHttpResponse");
Poderia ser assim?
Re: Identificador de Proxy -
MultiKill - 18.01.2015
Vocк teria que formatar:
pawn Код:
new ip[16], formato[59];
GetPlayerIp(playerid, ip, sizeof ip);
format(formato, sizeof formato, "www.shroomery.org/ythan/proxycheck.php?ip=%s", ip);
HTTP(playerid, HTTP_GET, formato, "", "MyHttpResponse");
E as respostas sгo simples:
pawn Код:
public MyHttpResponse(index, response_code, data[])
{
if(response_code == 200)
{
if(data[0] == 'Y')
{
// Se й um proxy
}
if(data[0] == 'N')
{
// Se nгo й um proxy
}
if(data[0] == 'X')
{
// se hб um erro ( exemplo se o ip nгo й vбlido
}
}
else
{
printf("The request failed! The response code was: %d", response_code);
}
return 1;
}
Re: Identificador de Proxy -
connork - 19.01.2015
Esse site ai nгo й muito seguro, jб fiz alguns testes neles... A melhor soluзгo que encontrei atй agora foi essa que desenvolvi:
http://tssabr.org/checkproxy.php?ip=216.172.142.15
Ele verifica se o IP possui um servidor VPN/Proxy executado, se tiver й retornado true, se nгo й retornado false.
Re: Identificador de Proxy -
CharCoast - 19.01.2015
MuliKill, tentei fazer oque falaste, mas com o link do
connork
pawn Код:
public MyHttpResponse(index, response_code, data[])
{
if(response_code == 200)
{
if(data[0] == 'false')
{
// Se nгo й um proxy
}
if(data[0] == 'true')
{
}
}
return 1;
}
Mas nessa parte da alguns erros:
pawn Код:
GM2.pwn(45479) : error 027: invalid character constant
GM2.pwn(45479) : error 017: undefined symbol "alse"
GM2.pwn(45479 -- 45480) : error 029: invalid expression, assumed zero
GM2.pwn(45479 -- 45480) : fatal error 107: too many error messages on one line
Imaginei que o segundo erro (undefined symbol "alse") fosse por causa do 0 em
. Entгo fui mudando para outros valores, 1, 2, 3,4... mas continuou o mesmo erro
Re: Identificador de Proxy -
connork - 19.01.2015
char != string.
Sua verificaзгo tб errada.
Re: Identificador de Proxy -
MultiKill - 19.01.2015
Como o connork disse a verificaзгo estб errada, use strcmp:
pawn Код:
if(strcmp(data,"false", true) == 0)
{
}
Re: Identificador de Proxy -
CharCoast - 19.01.2015
Quote:
Originally Posted by MultiKill
Como o connork disse a verificaзгo estб errada, use strcmp:
pawn Код:
if(strcmp(data,"false", true) == 0) { }
|
Valeu Multi