سلام ، آیا این بازدید اول شماست ؟ یا
نمایش نتایج: از شماره 1 تا 4 , از مجموع 4

موضوع: باگ یاهو !

Hybrid View

پست قبلی پست قبلی   پست بعدی پست بعدی
  1. #1

    تاریخ عضویت
    Jan 2006
    نوشته ها
    163
    تشکر
    0
    تشکر شده 0 بار در 0 ارسال

    پاسخ : باگ یاهو !

    البته این لینکی که دادید قر و قاطی شده. ولی به هر حال اسم این آسیب پذیری URL Redirect هستش که درجه خطرناک بودنش از 1000 چیزی حول و حوش 100 هم نمیشه . در واقع آنچنان هم خطر ناک نیست.
    اوه یاهو اینقد باگ داره که دیگه کسی XSS هم رو یاهو پیدا کنه گزارش نمیکنه.

    راستی یه چیز با نمک اون صفحه یاهو که ریدایرکت میکنه سورسشو دارم.
    کد:
    <?php
    
    /*
    
    Behavior matrix:
    
    y! referrer	error status	rd type		int action	ext action
    -----------	------------	-------		----------	----------
    yes		403		ad		warn		redirect
    yes		403		nav		warn		redirect
    yes		403		none		standard	standard
    yes		410		ad		warn		redirect
    yes		410		nav		warn		redirect
    yes		410		none		standard	standard
    no		403		ad		warn		warn
    no		403		nav		warn		warn
    no		403		none		standard	standard
    no		410		ad		warn		warn
    no		410		nav		warn		warn
    no		410		none		standard	standard
    
    actions:
    
    - redirect: continue with the redirect.
    - warn: output failure notice and show link to destination.
    - standard: regular 403 or 410 error message.
    
    */
    
    define('FORBIDDEN', '403');
    define('EXPIRED', '410');
    
    // subroutines
    
    function is_yahoo_url ($referrer) {
     if ($referrer == FALSE) return FALSE;
    
     $parsed = parse_url($referrer);
    
     return (array_key_exists('host', $parsed) &&
    	 preg_match("/\.yahoo\.com$/", strtolower($parsed['host'])));
    }
    
    function extract_rd ($uri) {
     if ($uri == FALSE) return FALSE;
    
     if (preg_match('/\/(\?|\*[\-\*]?)(.+)$/', $uri, $matches)) {
      $type = $matches[1];
      $dest = $matches[2];
    
      if ($type == "*" or $type == "?") {
       ## anchor decode
       $dest = preg_replace("/%23/", "#", $dest);
      }
      elseif ($type == "**") {
       ## full url decode
       $dest = urldecode($dest);
      }
    
      $dest = preg_replace("/(https?|ftp)%3a\/\//i", "$1://", $dest);
    
      // avoid cross-site scripting
      $dest = yiv_get_url($dest);
    
      return $dest;
     }
    
     return FALSE;
    }
    
    function output_error ($code, $uri, $rd = FALSE) {
     $template   = file_get_contents("./rd_error.html");
     $year     = date("Y");
     $uri     = htmlentities($uri); // avoid cross-site scripting
    
     if ($code == FORBIDDEN or $code == EXPIRED) {
      if ($code == FORBIDDEN) {
       $status = "Forbidden";
       $message =
    <<<MESSAGE
    
    You don't have permission to access <code>$uri</code> on this server.
    
    MESSAGE;
      }
      else {
       $status = "Gone";
       $message =
    <<<MESSAGE
    
    The requested resource:
    <p>
    <code>$uri</code>
    <p>
    is no longer available on this server and there is no forwarding address.
    <p>
    Please remove all references to this resource.
    
    MESSAGE;
      }
      if ($rd !== FALSE) {
       $message =
    <<<MESSAGE
    
    <b><font size=+1>This link is not authorized by Yahoo!</font></b>
    <p>
    If you would like to continue to this link's intended destination
    <em>at your own risk</em>, click <a href="$rd">here</a>.
    
    MESSAGE;
      }
     }
     else {
      $status = "Server Error";
      $message = "This server is unable to process your request.";
     }
    
     print str_replace(array('$year', '$code', '$status', '$message'),
    		  array($year, $code, $status, $message),
    		  $template);
    }
    
    function redirect ($dest) {
     header("Location: $dest");
     print <<<BODY
    <html><body>The document as moved <a href="$dest">here</a>.</body></html>
    BODY;
    }
    
    // main ()
    
    $ip   = getenv('REMOTE_ADDR');
    $referrer = getenv('HTTP_REFERER');
    $status = getenv('REDIRECT_STATUS');
    $uri   = getenv('REQUEST_URI');
    $dest  = extract_rd($uri);
    
    if ($status == FALSE) $status = FORBIDDEN;
    
    if (is_yahoo_url($referrer)) {
     if ($dest !== FALSE &&
       !ynet_db_is_yahoo_internal_addr($ip)) {
      redirect($dest);
     }
     else {
      output_error($status, $uri, $dest);
     }
    }
    else {
     output_error($status, $uri, $dest);
    }
    
    ?>

    جهت مشاهده لینک ها باید ثبت نام کنید یا لاگین کنید.


  2. # ADS
    تبلیغات در جوملا فارسی
    تاریخ عضویت
    Always
    نوشته ها
    Many
     

علاقه مندی ها (Bookmarks)

علاقه مندی ها (Bookmarks)

مجوز های ارسال و ویرایش

  • شما نمیتوانید موضوع جدیدی ارسال کنید
  • شما امکان ارسال پاسخ را ندارید
  • شما نمیتوانید فایل پیوست کنید.
  • شما نمیتوانید پست های خود را ویرایش کنید
  •