简体   繁体   English

将cURL php上传文件检测为IPS攻击

[英]cURL php upload file detected as IPS attack

Why my cURL upload file detected as IPS attack by forti firewall : 为什么我的cURL上传文件被强防火墙检测为IPS攻击:

function post_files($url, $files,$data=array()) {


    if (!is_array($files)) {
        //Convert to array
        $files[] = $files;
    }
    $n = sizeof($files);
    for ($i = 0; $i < $n; $i++) {
        $data['file' + $i] = "@" . $files[$i];
    }
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
    curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 2);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);

    $response = curl_exec($ch);
    return $response;
}

Is there any curl option ? 有卷曲选项吗?

With this it seems like the request is from firefox: 与此似乎请求来自firefox:

curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 5.1) AppleWebKit/535.6 (KHTML, like Gecko) Chrome/16.0.897.0 Safari/535.6');

With this the upload seems to come from the actual site: 这样上传似乎来自实际站点:

curl_setopt ($ch, CURLOPT_REFERER, "http://domain you should have come from");

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM