使用netcat从POST请求中的文件发送二进制数据

时间:2015-04-29 05:28:20

标签: php post netcat

好吧,我学了一点netcat。 我的服务器上有一个php脚本。 我使用get http://xx.xxx.xxx.xx/myscript.php然后使用cat request | nc host port 。我看到了我的页面输出。现在我需要从文件中的tcpdump发送一个二进制数据。如上所述here:我应该这样使用它:

cat "/var/www/9292/123bytes" |nc xx.xxx.xxx.xx 9292

但是当我尝试

cat "/var/www/9292/123bytes" |nc -v xx.xxx.xxx.xx 9292

HTTP/1.1 400 Bad Request
Date: Wed, 29 Apr 2015 05:12:20 GMT
Server: Apache/2.4.10 (Debian)
Content-Length: 385
Connection: close
Content-Type: text/html; charset=iso-8859-1

<!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>Apache/2.4.10 (Debian) Server at ... Port 9292</address>
</body></html>

我收到以下错误:

cat "/var/www/9292/123bytes"

以下是POST /makeTemplate123.php HTTP/1.1 User-Agent: Cctv-Search/1.0 Content-Type: image/jpeg Cache-Control: no-cache Pragma: no-cache Host: localhost:8050 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......................................bytes ----1429512044467boundary--

的输出
:

据我所知,所有标题中都有label Y88_N diff div fold 0 25273.626713 17348.581851 2.016404 2.016404 1 29139.510491 -4208.868050 0.604304 -0.604304 2 34388.439717 -30147.834699 0.458903 -0.458903 3 69704.254089 -32976.152490 0.116894 -0.116894 4 193717.440783 -71359.494098 0.286045 -0.286045 5 28996.634708 10934.944533 2.031293 2.031293 6 45021.782930 680.437629 1.056383 1.056383 。我还有一个建议here来检查apache版本。你可以看到它比2.2.15更早。有什么建议吗?

0 个答案:

没有答案