当前位置: 首页 > 工具软件 > Ruby/LDAP > 使用案例 >

ruby ARGV ARGF 输出文件内容

蒋胡非
2023-12-01

使用ARGV ARGF 打印文件p1.txt , p2.txt , p3.txt 的内容:

命令:root@kali:~/Desktop# ruby /usr/share/metasploit-framework/testys.rb p1.txt p2.txt p3.txt

testys.rb内容如下,区别是否有gets:

ARGV.each {|i| print while  gets}
ARGF.each{|i| print i}

打印结果相同:

p1============================================
GET /admin/user/ HTTP/1.1
Host: 192.168.1.50
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
Referer: http://192.168.1.50/admin/
Accept-Language: zh-CN,zh;q=0.9
Cookie: language=zh_CN; TBP_ldap_domain=adrms.com; tongbupan_current_host_for_privacy=2019-02-26 19:45:38,http://192.168.1.50; session=64341f70-459d-47eb-9cad-3c4e6e318cf0; aulnkt=Pt06t6Vswl8A0HisXuQAQHmge4E; fileListStyle=file-list
Connection: close

p2==============================================
GET /feeds/count/?_=1551191026961 HTTP/1.1
Host: 192.168.1.50
Accept: application/json, text/javascript, */*; q=0.01
X-Requested-With: XMLHttpRequest
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36
Referer: http://192.168.1.50/admin/user/
Accept-Language: zh-CN,zh;q=0.9
Cookie: language=zh_CN; TBP_ldap_domain=adrms.com; tongbupan_current_host_for_privacy=2019-02-26 19:45:38,http://192.168.1.50; session=64341f70-459d-47eb-9cad-3c4e6e318cf0; aulnkt=Pt06t6Vswl8A0HisXuQAQHmge4E; fileListStyle=file-list
Connection: close

p3======================================
POST /admin/grouptree/ HTTP/1.1
Host: 192.168.1.50
Content-Length: 0
Accept: application/json, text/javascript, */*; q=0.01
Origin: http://192.168.1.50
X-Requested-With: XMLHttpRequest
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36
Referer: http://192.168.1.50/admin/user/
Accept-Language: zh-CN,zh;q=0.9
Cookie: language=zh_CN; TBP_ldap_domain=adrms.com; tongbupan_current_host_for_privacy=2019-02-26 19:45:38,http://192.168.1.50; session=64341f70-459d-47eb-9cad-3c4e6e318cf0; aulnkt=Pt06t6Vswl8A0HisXuQAQHmge4E; fileListStyle=file-list
Connection: close
 

 类似资料: