欧美一区二区三区老妇人-欧美做爰猛烈大尺度电-99久久夜色精品国产亚洲a-亚洲福利视频一区二区

nc模擬瀏覽器請求http

《滲 透測試完全初學者指南》的“6.5.1檢測非標準端口”使用了nc手動發(fā)送http命令獲取web的內(nèi)容。依照這個例子是可以執(zhí)行成功的,但按此例子的方法去apache發(fā)起請求則不能成功。如下:

創(chuàng)新互聯(lián)公司是一家專業(yè)提供托里企業(yè)網(wǎng)站建設,專注與網(wǎng)站建設、網(wǎng)站設計HTML5建站、小程序制作等業(yè)務。10年已為托里眾多企業(yè)、政府機構(gòu)等服務。創(chuàng)新互聯(lián)專業(yè)網(wǎng)絡公司優(yōu)惠進行中。

nc 172.28.128.35 80
GET / HTTP/1.1
HTTP/1.1 400 Bad Request
Date: Fri, 27 Dec 2019 03:08:49 GMT
Server: Apache/2.4.6 (CentOS)
Content-Length: 226
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>
<h2>Bad Request</h2>
<p>Your browser sent a request that this server could not understand.<br />
</p>
</body></html>

根據(jù)參考鏈接,需要使用下面的命令才能請求成功

printf "GET / HTTP/1.1\r\nHOST:z\r\n\r\n" | nc 172.28.128.35 80
HTTP/1.1 200 OK
Date: Fri, 27 Dec 2019 03:21:21 GMT
Server: Apache/2.4.6 (CentOS)
Last-Modified: Fri, 27 Dec 2019 02:59:06 GMT
ETag: "8-59aa6ad5747ae"
Accept-Ranges: bytes
Content-Length: 8
Content-Type: text/html; charset=UTF-8

dfafdas

參考鏈接中的文檔解釋了為什么需要這樣的命令。
也可以通過將http命令保存在文本文件中重定向給nc,從print命令看,每一行是以\r\n結(jié)束的,因此保存的文本文檔需要是windows格式的。

  • 創(chuàng)建文件
    cat b.txt 
    GET / HTTP/1.1
    Host: 172.28.128.34
    Accept: */*
  • 轉(zhuǎn)換成windows格式
    unix2dos b.txt
    file b.txt 
    b.txt: ASCII text, with CRLF line terminators
  • 執(zhí)行nc
nc 172.28.128.35 80 < b.txt 
HTTP/1.1 200 OK
Date: Fri, 27 Dec 2019 03:28:08 GMT
Server: Apache/2.4.6 (CentOS)
Last-Modified: Fri, 27 Dec 2019 02:59:06 GMT
ETag: "8-59aa6ad5747ae"
Accept-Ranges: bytes
Content-Length: 8
Content-Type: text/html; charset=UTF-8

dfafdas
  • 參考鏈接:
    https://osric.com/chris/accidental-developer/2018/01/using-nc-netcat-to-make-an-http-request/

分享名稱:nc模擬瀏覽器請求http
分享地址:http://www.chinadenli.net/article42/pgeehc.html

成都網(wǎng)站建設公司_創(chuàng)新互聯(lián),為您提供品牌網(wǎng)站建設外貿(mào)建站網(wǎng)站設計公司移動網(wǎng)站建設微信小程序關(guān)鍵詞優(yōu)化

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

營銷型網(wǎng)站建設