標籤:抓包 上傳 webshell wsockexpert
在Web滲透的過程中,最為麻煩的一個環節就是上傳WebShell,之前曾介紹過利用Database Backup來上傳,這也屬於最為簡單和古老的一種方法。本文將介紹另外一種利用抓包來上傳WebShell的方法,目標網站採用南方資料5.0,實驗平台採用IIS搭建,如何利用IIS搭建ASP網站可參考博文http://yttitan.blog.51cto.com/70821/1579372。
首先登入網站後台,找到上傳點。
650) this.width=650;" style="border-bottom:0px;border-left:0px;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://s3.51cto.com/wyfs02/M00/54/08/wKiom1R11GKwq8gtAABEbfJjBYw029.jpg" height="98" />
點擊瀏覽按鈕,開啟“選擇檔案”視窗,隨意選擇一張準備上傳的圖片。
注意,這裡先不要點擊“開啟”來上傳圖片,而是將視窗暫時擱在這裡,繼續下面的操作。
650) this.width=650;" style="border-bottom:0px;border-left:0px;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://s3.51cto.com/wyfs02/M01/54/06/wKioL1R11OTDKi8aAAEbyiv7Ado391.jpg" height="358" />
開啟抓包工具WsockExpert(:http://down.51cto.com/data/1904134 ),點擊工具列中的開啟按鈕,在“Select Process To Monitor”介面中選擇要抓包的瀏覽器進程“IEXPLORER.EXE”,選擇其中的“選擇檔案”操作,然後點擊“open”:
650) this.width=650;" style="border-bottom:0px;border-left:0px;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://s3.51cto.com/wyfs02/M00/54/08/wKiom1R11GOCRB1qAAEMFlYrfZc252.jpg" height="389" />
抓包工具啟動之後,再回過頭來繼續上傳圖片,此時就可以將上傳圖片的資料包抓獲。
抓到的包會有好多,從中選擇類型為“POST”的包,在下面的視窗中會顯示資料包的內容,將其複製到文字檔中。
650) this.width=650;" style="border-bottom:0px;border-left:0px;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://s3.51cto.com/wyfs02/M02/54/08/wKiom1R11GPQmfBvAAI4AtX5-6A566.jpg" height="376" />
下面來分析一下抓到的包,這其中關鍵的是要擷取網站中負責處理上傳檔案的頁面URL以及cookie。
第一行“POST”後面所跟的正是這個頁面,結合下面“Referer:”行所對應的URL,可以得到上傳頁面的URL:http://192.168.80.129/upfile_Other.asp
650) this.width=650;" style="border-bottom:0px;border-left:0px;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://s3.51cto.com/wyfs02/M00/54/08/wKiom1R11GTyc--8AAEUPB-1n7s662.jpg" height="194" />
獲得上傳頁面之後,開啟明小子,利用其中的“綜合上傳”功能來上傳webshell。
在“綜合上傳”中找到與我們所擷取的上傳頁面類似的上傳類型,再將擷取的cookie值複製過來,然後進行上傳。上傳成功之後,就會得到一個.asp檔案,這是由明小子內建的一個小馬。
650) this.width=650;" style="border-bottom:0px;border-left:0px;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://s3.51cto.com/wyfs02/M01/54/08/wKiom1R11GTSgHj_AAK-95cdqlw951.jpg" height="441" />
通過獲得的URL訪問小馬:http://192.168.80.129/UploadFiles/2014112671421146.asp
650) this.width=650;" style="border-bottom:0px;border-left:0px;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://s3.51cto.com/wyfs02/M02/54/08/wKiom1R11GXDmRuDAACbSFsv1wY492.jpg" height="278" />
通過小馬,我們就可以來上傳大馬,將大馬的內容複寫到文字框中並儲存,儲存成功之後,根據檔案路徑可以獲得大馬的URL:http://192.168.80.129/UploadFiles/dama.asp
至此,就成功地將webshell上傳到了網站中。
650) this.width=650;" style="border-bottom:0px;border-left:0px;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://s3.51cto.com/wyfs02/M00/54/08/wKiom1R11GXA9qeGAAEiLH3LzGI312.jpg" height="395" />
本文出自 “一壺濁酒” 部落格,轉載請與作者聯絡!
網路安全系列之五十五 利用抓包來上傳webshell