Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/284.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Netcat正在运行向php脚本发送二进制数据_Php_Header_Netcat - Fatal编程技术网

Netcat正在运行向php脚本发送二进制数据

Netcat正在运行向php脚本发送二进制数据,php,header,netcat,Php,Header,Netcat,我正试图用netcat向php脚本发送请求 cat "/var/www/9292/123456bytes" | nc "xx.xx.xx.xxx." xxxx 这让我犯了这样的错误: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>400 Bad Request</title> </head><body> <h1

我正试图用netcat向php脚本发送请求

cat "/var/www/9292/123456bytes" | nc "xx.xx.xx.xxx." xxxx
这让我犯了这样的错误:

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>400 Bad Request</title>
</head><body>
<h1>Bad Request</h1>
<p>Your browser sent a request that this server could not understand.<br />
Request header field is missing ':' separator.<br />
<pre>
</pre>
</p>
<hr>
<address>server info port</address>
</body></html>
有什么建议吗

我的输出完全不同:


编辑Apache版本:服务器版本:Apache/2.4.10 Debian

尝试在标题标记下方设置编码。我已添加预期输出,并尝试在标题后添加消息。没有更改。您使用的是哪个版本的Apache?正如我在编辑中提到的,在Apache 2.2.15.2.4.10之前,您会遇到一些常见的错误
    POST /makeTemplate123.php HTTP/1.1
    User-Agent: Cctv-Search/1.0
    Content-Type: image/jpeg
    Cache-Control: no-cache
    Pragma: no-cache
    Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
    Connection: keep-alive
    Content-Length: 2095

    ......JFIF.....`.`.....C......
    ......(.....1#%.(:3=<9387@H\N@DWE78PmQW_bghg>Mqypdx\egc...C......./../cB8Bcccccccccccccccccccccccccccccccccccccccccccccccccc........p.."......................................6......................!..1.A."Qa2q...B....#4Ccr......................................................A.1............?..j*i.}.+vE..s...d85..5.....K..`..hc..y..=@.3.|N.<...?.......h....Y.$.5....W%....?E..cm0..$.$...I$...s...... Z.P2.3.j9..I..w\..F.......1.c.{.?\~..>.m4.......E......{.).nm"B.|....u..........[.H..>..4.~...k.pl......KO..;z/K..S4./.6i.....OpEc...'.m..0k9Y.r.......e. n........>...8.........~.X.R...h...f.."...q...../..mmn.<..\NI?2..q...O.2nd!......A=...\7.qZ.YS..,.+q.....
    .....cb.(&......U5....Nm......v.Q...KO.{.U..&.IC....>!......./.
    ~...tzt...7^.........Y..........4...N...zln._....<..c.$z.W..u..i..........|p..L..5R.et......4. ..Vd]r:........F........i5.y.U;.K.y..\P....=<Vl....Mk[....R....N.Z*...U.Yo)...[.+.Yn.k....)$e..L\.>3O....c..?.9../).....?.!.p<8.?o.DN..z..o......O~..._.....!..A...M.F...
    ..........H...G.O7P...H?qM9...V:........w.......E.....F....)...`...P..6
    ..x|...4..... |.9....-..K../8....t...e/.wd4.>.Q.p...?U..E..m-u.@.~.m\%.$.L...;Q.O...{KA....U3m.>Lj9/........OkA..5U.~.......n..... E...W.....~.Z.....F.p!
    .W...,...h!....p...I..'.8K#!..1#.........W-..Sz9w...._.ex....v...........!...:7m...
    BYTES OF IMAGE 
...
    ----1429512044467boundary--
    header("MIME-Version: 1.0");
    header("Connection: Keep-Alive");
    header("Accept-Encoding: gzip, deflate");
    header("Host: xx.xx.xx.xx:xx");
    header("Content-Type: multipart/related; boundary=boundary_.oOo._MzA3NjM=NTczNw==NDM1Ng==");
echo "some multipart result";