2011-08-10 2 views

답변

1

신뢰할 수 없으면 아니오. 누구든지 실제 클라이언트를 위장 할 수 있습니다.

잘 작동하는 봇은 자체 사용자 에이전트를 사용합니다. 당신은 어쨌든 비 잘 행동 한 봇을 생각하면 안됩니다.

0

사용자 에이전트가 신뢰할 수없고 쉽게 스푸핑되었다고 동의합니다. 그러나 스푸핑을 좀 더 세게 만들기 위해 일부 JavaScript를 빌드 할 수 있습니다. 자바 스크립트 엔진이없는 것을 차별화 할 수 있습니다. 내 대답보기 : https://stackoverflow.com/a/12571513/399704

0

자바 스크립트 또는 사용자 에이전트 문자열을 통해 검색하는 것 이상의 것이 있습니다.

사용자 에이전트 문자열을 위장 할 때 브라우저를 식별하는 방법에 대해 조사했습니다. 많은 브라우저 (때로는 버전 차이가 거의없고 때로는 큰 버전)가 다른 순서로 다른 헤더 정보를 전송한다는 사실을 알게되었습니다. 일반적으로 헤더 정보가 서버로 전송 된 순서를 감지하여 모든 대형 브라우저 (Firefox, IE, Chrome 등)를 구분할 수 있습니다. 모든 것들에도 불구하고 이것은 또한 스푸핑 될 수 있습니다. 자세한 내용은

는 여기에 읽기 : http://hide.network/why-does-changing-your-user-agent-almost-come-to-nothing/

그것은 조금 감지하기 어려운,하지만 가능합니다. PHP에서는 단순히 함수 getallheaders()을 사용하여이 작업을 수행 할 수 있습니다. 테스트 할 때 브라우저에서 보내는 것과 동일한 헤더 정보 순서를 제공합니다. 모든 키의 실제 색인 만 검색하면됩니다.

<?php 
    foreach (getallheaders() as $name => $value) 
    { 
     echo "$name: $value<br />\n"; 
    } 
?> 

편집 :

나는 PHP의 일부 주요 브라우저를 감지하는 스크립트를 썼다. 처음에는 페이지 링크를 클릭하여 보낼 리퍼러를 잊어 버렸습니다. 나는 IE와 FF의 referer가있는 목록에 헤더를 추가했는데 아마도 도움이 될 것입니다. hide.network/header.php에 스크립트를 업로드했지만 두 개 이상의 링크를 게시 할 수 없습니다.

<?php 
    $headerInformation = array(); 

    // declaring and filling pre-defined header orders of browsers 
    $browserInformation = array 
          (
           "browserNames" => array 
           (
            "Mozilla Firefox 37.0", 
            "Mozilla Firefox 37.0 with referer", 
            "Internet Explorer 11", 
            "Internet Explorer 11 with referer", 
            "Internet Explorer 8", 
            "Google Chrome 42", 
            "SRWare Iron 37" 
           ), 
           "headerInformation" => array 
           (
            array("host", "user-agent", "accept", "accept-language", "accept-encoding", "connection", "cache-control"), 
            array("host", "user-agent", "accept", "accept-language", "accept-encoding", "referer", "connection", "cache-control"), 
            array("accept", "accept-language", "user-agent", "accept-encoding", "host", "dnt", "connection"), 
            array("accept", "referer", "accept-language", "user-agent", "accept-encoding", "host", "dnt", "connection"), 
            array("accept", "accept-language", "user-agent", "accept-encoding", "host", "connection"), 
            array("host", "connection", "cache-control", "accept", "user-agent", "accept-encoding", "accept-language"), 
            array("host", "connection", "accept", "user-agent", "accept-encoding", "accept-language") 
           ), 
           "identScore" => array(0, 0, 0, 0, 0) 
          ); 

    // parsing all header values 
    foreach (getallheaders() as $name => $value) 
    { 
     array_push($headerInformation, strtolower($name)); 
    } 

    // calculating possibility for each browser 
    for($i = 0; $i < count(10); $i++) 
    { 
     for($j = 0; $j < count($browserInformation["browserNames"]); $j++) 
     { 
      $currentPossibility = count(array_intersect_assoc($browserInformation["headerInformation"][$j], $headerInformation))/count($headerInformation) * 100; 
      $currentPossibility = round($currentPossibility, 2); 
      $browserInformation["identScore"][$j] = $currentPossibility; 
     } 
    } 

    // sort array 
    array_multisort($browserInformation["identScore"], SORT_DESC, SORT_NUMERIC, 
        $browserInformation["browserNames"], $browserInformation["headerInformation"]); 

    // output 
    for($i = 0; $i < count(10); $i++) 
    { 
     for($j = 0; $j < count($browserInformation["browserNames"]); $j++) 
     { 
      echo "possibility " . $browserInformation["browserNames"][$j] . ": " . $browserInformation["identScore"][$j] . " %<br />"; 
     } 
    } 

    // output original sent header 
    echo "<pre>"; 
    var_dump($headerInformation); 
    echo "</pre>"; 
?> 
관련 문제