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

时间:2015-04-27 09:53:46

标签: 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>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>

以下是cat "/var/www/9292/123456bytes"

的输出
    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";


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

0 个答案:

没有答案