duanbiao4035 2016-12-24 20:14
浏览 69
已采纳

使用cURL时,目标页面是否可以检测到确切的URL?

Lets say we have our own script here:

https://example.com/random_name/script.php

// Code inside the script.php
$url = 'https://foo.com';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($ch, CURLOPT_TIMEOUT, 60);
$data = curl_exec($ch);

As you can see, the link above gets content of this domain:

https://foo.com

I know foo.com can see example.com and it's IP Address!

but Questions is, can foo.com (the page we're getting content from) also by any methods detect this exact part: /random_name/script.php is making the request? does it depend on using TLS?

  • 写回答

1条回答 默认 最新

  • dougu2006 2016-12-24 20:31
    关注

    The page (server/application) can have all the information in the request. If the request (in your example - script.php) will not send the extra data (/random_name/script.php) the page the receive the request will not have it.

    If you want to receiving end (foo.com) to know about it you can use the referer header:

    curl_setopt($ch, CURLOPT_REFERER, "https://example.com/random_name/script.php");
    

    And this way - foo.com can view that information in the referer header.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 winform的chart曲线生成时有凸起
  • ¥15 msix packaging tool打包问题
  • ¥15 finalshell节点的搭建代码和那个端口代码教程
  • ¥15 用hfss做微带贴片阵列天线的时候分析设置有问题
  • ¥15 Centos / PETSc / PETGEM
  • ¥15 centos7.9 IPv6端口telnet和端口监控问题
  • ¥120 计算机网络的新校区组网设计
  • ¥20 完全没有学习过GAN,看了CSDN的一篇文章,里面有代码但是完全不知道如何操作
  • ¥15 使用ue5插件narrative时如何切换关卡也保存叙事任务记录
  • ¥20 海浪数据 南海地区海况数据,波浪数据