20145318趙一《網絡對抗》後門原理與實踐
知識點
- 後門
- 後門程序通常是指那些繞過安全性控制而獲取對程序或系統訪問權的程序方法。
- 在軟件的開發階段,程序員經常會在軟件內建立後門程序以即可以修改程序設計中的缺陷。可是,若是這些後門被其餘人知道,或是在發佈軟件以前沒有刪除後門程序,那麼它就成了安全風險,容易被黑客當成漏洞進行攻擊。
實驗內容
(1)使用netcat獲取主機操做Shell,cron啓動,使用socat獲取主機操做Shell, 任務計劃啓動。linux
(2)使用MSF meterpreter生成可執行文件,利用ncat或socat傳送到主機並運行獲取主機Shell,獲取目標主機音頻、攝像頭、擊鍵記錄等內容,並嘗試提權,注入到實踐1中的pwn1中,獲取反彈鏈接Shell。程序員
基礎問題回答
(1)例舉你能想到的一個後門進入到你係統中的可能方式?shell
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
(2)例舉你知道的後門如何啓動起來(win及linux)的方式?windows
- 假裝後誘惑用戶點擊
- Windows下在控制面板的管理工具中能夠設置任務計劃啓動,或者經過修改註冊表來達到自啓的目的;
- Linux下能夠經過cron來啓動。
(3)Meterpreter有哪些給你映像深入的功能?安全
- Meterpreter是Metasploit的默認Windows系統下的Shell Code,沒法無天細思極恐。
(4)如何發現本身有系統有沒有被安裝後門?ruby
- 按期用殺毒軟件進行全盤掃描
- 按期檢查註冊表,日誌等
![](http://static.javashuo.com/static/loading.gif)
實驗總結與體會
- 此次實驗作完後,我深深感到了電腦安全的脆弱性,如今不只有本來留在程序裏的後門,更有自行設計編寫的具備針對性的後門程序時刻威脅着電腦安全,雖然沒有辦法徹底清除,可是也要經常檢查本身的電腦,更要注意不要隨便點擊或在不明網站上下載軟件、視頻等,主觀上要儘可能避免被攻擊且要檢查殺毒。
實驗過程
Win得到Linux Shell
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
- 使用
nc
指令的-e
選項反向鏈接Windows主機的5318端口
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
Linux得到Win Shell
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
- 用Windows反彈鏈接Linux監聽的5318端口
![](http://static.javashuo.com/static/loading.gif)
- 得到Shell成功,能夠在Linux上獲取Windows的命令行
![](http://static.javashuo.com/static/loading.gif)
nc傳輸數據
- Windows監聽準備接收文件,並存儲接收到的文件名爲5318,後綴exe
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
socat:Windows獲取Linux Shell
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
- Windows開啓對Linux對應端口的監聽,Windows獲取Linux Shell成功
![](http://static.javashuo.com/static/loading.gif)
Meterpreter
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
- 設置payload與後門程序一致,LHOST與生成後門程序的主機IP相同,LPORT也與生成的後門程序中的端口號相同
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
- 雙擊Windows中複製的後門程序,自動鏈接預先設置的Linux,獲取Windows Shell
![](http://static.javashuo.com/static/loading.gif)
Meterpreter基本功能
![](http://static.javashuo.com/static/loading.gif)
- 根據help指令提示,進行一些操做,shell獲取windows Shell,exit退出
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
- screenshot抓當前系統桌面,根據提示的保存路徑就能找到抓到的屏幕
![](http://static.javashuo.com/static/loading.gif)
cron
- 在crontab指令增長一條定時任務,
-e
表示編輯,修改IP和端口號爲Windows對應主機端口號,修改時間爲30
![](http://static.javashuo.com/static/loading.gif)
- Windows進入ncat對應文件夾,打開對應端口的監聽
![](http://static.javashuo.com/static/loading.gif)
- 到30分,Linux自動鏈接Windows,獲取Linux Shell成功
![](http://static.javashuo.com/static/loading.gif)