librex 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/README +0 -0
- data/lib/rex.rb +0 -0
- data/lib/rex.rb.ts.rb +0 -0
- data/lib/rex/LICENSE +0 -0
- data/lib/rex/arch.rb +0 -0
- data/lib/rex/arch/sparc.rb +0 -0
- data/lib/rex/arch/sparc.rb.ut.rb +0 -0
- data/lib/rex/arch/x86.rb +0 -0
- data/lib/rex/arch/x86.rb.ut.rb +0 -0
- data/lib/rex/assembly/nasm.rb +0 -0
- data/lib/rex/assembly/nasm.rb.ut.rb +0 -0
- data/lib/rex/codepage.map +0 -0
- data/lib/rex/compat.rb +0 -0
- data/lib/rex/constants.rb +0 -0
- data/lib/rex/elfparsey.rb +0 -0
- data/lib/rex/elfparsey/elf.rb +0 -0
- data/lib/rex/elfparsey/elfbase.rb +0 -0
- data/lib/rex/elfparsey/exceptions.rb +0 -0
- data/lib/rex/elfscan.rb +0 -0
- data/lib/rex/elfscan/scanner.rb +0 -0
- data/lib/rex/elfscan/search.rb +0 -0
- data/lib/rex/encoder/alpha2.rb +0 -0
- data/lib/rex/encoder/alpha2/alpha_mixed.rb +0 -0
- data/lib/rex/encoder/alpha2/alpha_upper.rb +0 -0
- data/lib/rex/encoder/alpha2/generic.rb +0 -0
- data/lib/rex/encoder/alpha2/unicode_mixed.rb +0 -0
- data/lib/rex/encoder/alpha2/unicode_upper.rb +0 -0
- data/lib/rex/encoder/ndr.rb +0 -0
- data/lib/rex/encoder/ndr.rb.ut.rb +0 -0
- data/lib/rex/encoder/nonalpha.rb +0 -0
- data/lib/rex/encoder/nonupper.rb +0 -0
- data/lib/rex/encoder/xdr.rb +0 -0
- data/lib/rex/encoder/xdr.rb.ut.rb +0 -0
- data/lib/rex/encoder/xor.rb +0 -0
- data/lib/rex/encoder/xor/dword.rb +0 -0
- data/lib/rex/encoder/xor/dword_additive.rb +0 -0
- data/lib/rex/encoders/xor_dword.rb +0 -0
- data/lib/rex/encoders/xor_dword_additive.rb +0 -0
- data/lib/rex/encoders/xor_dword_additive.rb.ut.rb +0 -0
- data/lib/rex/encoding/xor.rb +0 -0
- data/lib/rex/encoding/xor.rb.ts.rb +0 -0
- data/lib/rex/encoding/xor/byte.rb +0 -0
- data/lib/rex/encoding/xor/byte.rb.ut.rb +0 -0
- data/lib/rex/encoding/xor/dword.rb +0 -0
- data/lib/rex/encoding/xor/dword.rb.ut.rb +0 -0
- data/lib/rex/encoding/xor/dword_additive.rb +0 -0
- data/lib/rex/encoding/xor/dword_additive.rb.ut.rb +0 -0
- data/lib/rex/encoding/xor/exceptions.rb +0 -0
- data/lib/rex/encoding/xor/generic.rb +0 -0
- data/lib/rex/encoding/xor/generic.rb.ut.rb +0 -0
- data/lib/rex/encoding/xor/qword.rb +0 -0
- data/lib/rex/encoding/xor/word.rb +0 -0
- data/lib/rex/encoding/xor/word.rb.ut.rb +0 -0
- data/lib/rex/exceptions.rb +0 -0
- data/lib/rex/exceptions.rb.ut.rb +0 -0
- data/lib/rex/exploitation/cmdstager.rb +0 -0
- data/lib/rex/exploitation/cmdstager/base.rb +0 -0
- data/lib/rex/exploitation/cmdstager/debug_asm.rb +0 -0
- data/lib/rex/exploitation/cmdstager/debug_write.rb +0 -0
- data/lib/rex/exploitation/cmdstager/tftp.rb +0 -0
- data/lib/rex/exploitation/cmdstager/vbs.rb +0 -0
- data/lib/rex/exploitation/egghunter.rb +0 -0
- data/lib/rex/exploitation/egghunter.rb.ut.rb +0 -0
- data/lib/rex/exploitation/encryptjs.rb +0 -0
- data/lib/rex/exploitation/heaplib.js.b64 +0 -0
- data/lib/rex/exploitation/heaplib.rb +0 -0
- data/lib/rex/exploitation/javascriptosdetect.rb +2 -2
- data/lib/rex/exploitation/obfuscatejs.rb +0 -0
- data/lib/rex/exploitation/opcodedb.rb +0 -0
- data/lib/rex/exploitation/opcodedb.rb.ut.rb +0 -0
- data/lib/rex/exploitation/seh.rb +0 -0
- data/lib/rex/exploitation/seh.rb.ut.rb +0 -0
- data/lib/rex/file.rb +0 -0
- data/lib/rex/file.rb.ut.rb +0 -0
- data/lib/rex/image_source.rb +0 -0
- data/lib/rex/image_source/disk.rb +0 -0
- data/lib/rex/image_source/image_source.rb +0 -0
- data/lib/rex/image_source/memory.rb +0 -0
- data/lib/rex/io/bidirectional_pipe.rb +0 -0
- data/lib/rex/io/datagram_abstraction.rb +0 -0
- data/lib/rex/io/stream.rb +13 -15
- data/lib/rex/io/stream_abstraction.rb +0 -0
- data/lib/rex/io/stream_server.rb +0 -0
- data/lib/rex/job_container.rb +10 -25
- data/lib/rex/logging.rb +0 -0
- data/lib/rex/logging/log_dispatcher.rb +0 -0
- data/lib/rex/logging/log_sink.rb +0 -0
- data/lib/rex/logging/sinks/flatfile.rb +0 -0
- data/lib/rex/logging/sinks/stderr.rb +0 -0
- data/lib/rex/machparsey.rb +0 -0
- data/lib/rex/machparsey/exceptions.rb +0 -0
- data/lib/rex/machparsey/mach.rb +1 -1
- data/lib/rex/machparsey/machbase.rb +0 -0
- data/lib/rex/machscan.rb +0 -0
- data/lib/rex/machscan/scanner.rb +0 -0
- data/lib/rex/mime.rb +0 -0
- data/lib/rex/mime/header.rb +0 -0
- data/lib/rex/mime/message.rb +0 -0
- data/lib/rex/mime/part.rb +0 -0
- data/lib/rex/nop/opty2.rb +0 -0
- data/lib/rex/nop/opty2.rb.ut.rb +0 -0
- data/lib/rex/nop/opty2_tables.rb +0 -0
- data/lib/rex/ole.rb +0 -0
- data/lib/rex/ole/clsid.rb +0 -0
- data/lib/rex/ole/difat.rb +0 -0
- data/lib/rex/ole/directory.rb +0 -0
- data/lib/rex/ole/direntry.rb +0 -0
- data/lib/rex/ole/fat.rb +0 -0
- data/lib/rex/ole/header.rb +0 -0
- data/lib/rex/ole/minifat.rb +0 -0
- data/lib/rex/ole/storage.rb +0 -0
- data/lib/rex/ole/stream.rb +0 -0
- data/lib/rex/ole/substorage.rb +0 -0
- data/lib/rex/ole/util.rb +0 -0
- data/lib/rex/parser/arguments.rb +0 -0
- data/lib/rex/parser/arguments.rb.ut.rb +0 -0
- data/lib/rex/parser/ini.rb +0 -0
- data/lib/rex/parser/ini.rb.ut.rb +0 -0
- data/lib/rex/parser/nexpose_xml.rb +0 -0
- data/lib/rex/parser/nmap_xml.rb +0 -0
- data/lib/rex/payloads.rb +0 -0
- data/lib/rex/payloads/win32.rb +0 -0
- data/lib/rex/payloads/win32/common.rb +0 -0
- data/lib/rex/payloads/win32/kernel.rb +0 -0
- data/lib/rex/payloads/win32/kernel/common.rb +0 -0
- data/lib/rex/payloads/win32/kernel/migration.rb +0 -0
- data/lib/rex/payloads/win32/kernel/recovery.rb +0 -0
- data/lib/rex/payloads/win32/kernel/stager.rb +26 -3
- data/lib/rex/peparsey.rb +0 -0
- data/lib/rex/peparsey/exceptions.rb +0 -0
- data/lib/rex/peparsey/pe.rb +0 -0
- data/lib/rex/peparsey/pe_memdump.rb +0 -0
- data/lib/rex/peparsey/pebase.rb +0 -0
- data/lib/rex/peparsey/section.rb +0 -0
- data/lib/rex/pescan.rb +0 -0
- data/lib/rex/pescan/analyze.rb +0 -0
- data/lib/rex/pescan/scanner.rb +0 -0
- data/lib/rex/pescan/search.rb +0 -0
- data/lib/rex/platforms.rb +0 -0
- data/lib/rex/platforms/windows.rb +0 -0
- data/lib/rex/poly.rb +0 -0
- data/lib/rex/poly/block.rb +0 -0
- data/lib/rex/poly/register.rb +0 -0
- data/lib/rex/poly/register/x86.rb +0 -0
- data/lib/rex/post.rb +0 -0
- data/lib/rex/post/dir.rb +0 -0
- data/lib/rex/post/file.rb +0 -0
- data/lib/rex/post/file_stat.rb +0 -0
- data/lib/rex/post/gen.pl +0 -0
- data/lib/rex/post/io.rb +0 -0
- data/lib/rex/post/meterpreter.rb +0 -0
- data/lib/rex/post/meterpreter/channel.rb +0 -0
- data/lib/rex/post/meterpreter/channel_container.rb +0 -0
- data/lib/rex/post/meterpreter/channels/pool.rb +0 -0
- data/lib/rex/post/meterpreter/channels/pools/file.rb +0 -0
- data/lib/rex/post/meterpreter/channels/pools/stream_pool.rb +0 -0
- data/lib/rex/post/meterpreter/channels/stream.rb +0 -0
- data/lib/rex/post/meterpreter/client.rb +0 -0
- data/lib/rex/post/meterpreter/client_core.rb +0 -0
- data/lib/rex/post/meterpreter/dependencies.rb +0 -0
- data/lib/rex/post/meterpreter/extension.rb +0 -0
- data/lib/rex/post/meterpreter/extensions/espia/espia.rb +0 -0
- data/lib/rex/post/meterpreter/extensions/espia/tlv.rb +0 -0
- data/lib/rex/post/meterpreter/extensions/incognito/incognito.rb +0 -0
- data/lib/rex/post/meterpreter/extensions/incognito/tlv.rb +0 -0
- data/lib/rex/post/meterpreter/extensions/priv/fs.rb +0 -0
- data/lib/rex/post/meterpreter/extensions/priv/passwd.rb +0 -0
- data/lib/rex/post/meterpreter/extensions/priv/priv.rb +0 -0
- data/lib/rex/post/meterpreter/extensions/priv/tlv.rb +0 -0
- data/lib/rex/post/meterpreter/extensions/railgun/api.rb +9303 -0
- data/lib/rex/post/meterpreter/extensions/railgun/api_constants.rb +38105 -0
- data/lib/rex/post/meterpreter/extensions/railgun/def_kernel32.rb +3678 -0
- data/lib/rex/post/meterpreter/extensions/railgun/railgun.rb +815 -0
- data/lib/rex/post/meterpreter/extensions/railgun/tlv.rb +54 -0
- data/lib/rex/post/meterpreter/extensions/sniffer/sniffer.rb +0 -0
- data/lib/rex/post/meterpreter/extensions/sniffer/tlv.rb +0 -0
- data/lib/rex/post/meterpreter/extensions/stdapi/constants.rb +0 -0
- data/lib/rex/post/meterpreter/extensions/stdapi/fs/dir.rb +0 -0
- data/lib/rex/post/meterpreter/extensions/stdapi/fs/file.rb +0 -0
- data/lib/rex/post/meterpreter/extensions/stdapi/fs/file_stat.rb +0 -0
- data/lib/rex/post/meterpreter/extensions/stdapi/fs/io.rb +0 -0
- data/lib/rex/post/meterpreter/extensions/stdapi/net/config.rb +0 -0
- data/lib/rex/post/meterpreter/extensions/stdapi/net/interface.rb +0 -0
- data/lib/rex/post/meterpreter/extensions/stdapi/net/route.rb +0 -0
- data/lib/rex/post/meterpreter/extensions/stdapi/net/socket.rb +7 -7
- data/lib/rex/post/meterpreter/extensions/stdapi/net/socket_subsystem/tcp_client_channel.rb +21 -8
- data/lib/rex/post/meterpreter/extensions/stdapi/net/socket_subsystem/tcp_server_channel.rb +0 -0
- data/lib/rex/post/meterpreter/extensions/stdapi/net/socket_subsystem/udp_channel.rb +33 -17
- data/lib/rex/post/meterpreter/extensions/stdapi/stdapi.rb +0 -0
- data/lib/rex/post/meterpreter/extensions/stdapi/sys/config.rb +0 -0
- data/lib/rex/post/meterpreter/extensions/stdapi/sys/event_log.rb +0 -0
- data/lib/rex/post/meterpreter/extensions/stdapi/sys/event_log_subsystem/event_record.rb +0 -0
- data/lib/rex/post/meterpreter/extensions/stdapi/sys/power.rb +0 -0
- data/lib/rex/post/meterpreter/extensions/stdapi/sys/process.rb +0 -0
- data/lib/rex/post/meterpreter/extensions/stdapi/sys/process_subsystem/image.rb +0 -0
- data/lib/rex/post/meterpreter/extensions/stdapi/sys/process_subsystem/io.rb +0 -0
- data/lib/rex/post/meterpreter/extensions/stdapi/sys/process_subsystem/memory.rb +0 -0
- data/lib/rex/post/meterpreter/extensions/stdapi/sys/process_subsystem/thread.rb +0 -0
- data/lib/rex/post/meterpreter/extensions/stdapi/sys/registry.rb +0 -0
- data/lib/rex/post/meterpreter/extensions/stdapi/sys/registry_subsystem/registry_key.rb +0 -0
- data/lib/rex/post/meterpreter/extensions/stdapi/sys/registry_subsystem/registry_value.rb +0 -0
- data/lib/rex/post/meterpreter/extensions/stdapi/sys/thread.rb +0 -0
- data/lib/rex/post/meterpreter/extensions/stdapi/tlv.rb +0 -0
- data/lib/rex/post/meterpreter/extensions/stdapi/ui.rb +0 -0
- data/lib/rex/post/meterpreter/inbound_packet_handler.rb +0 -0
- data/lib/rex/post/meterpreter/object_aliases.rb +0 -0
- data/lib/rex/post/meterpreter/packet.rb +0 -0
- data/lib/rex/post/meterpreter/packet_dispatcher.rb +0 -0
- data/lib/rex/post/meterpreter/packet_parser.rb +0 -0
- data/lib/rex/post/meterpreter/packet_response_waiter.rb +0 -0
- data/lib/rex/post/meterpreter/ui/console.rb +0 -0
- data/lib/rex/post/meterpreter/ui/console/command_dispatcher.rb +0 -0
- data/lib/rex/post/meterpreter/ui/console/command_dispatcher/core.rb +0 -0
- data/lib/rex/post/meterpreter/ui/console/command_dispatcher/espia.rb +0 -0
- data/lib/rex/post/meterpreter/ui/console/command_dispatcher/incognito.rb +0 -0
- data/lib/rex/post/meterpreter/ui/console/command_dispatcher/priv.rb +0 -0
- data/lib/rex/post/meterpreter/ui/console/command_dispatcher/priv/elevate.rb +0 -0
- data/lib/rex/post/meterpreter/ui/console/command_dispatcher/priv/passwd.rb +0 -0
- data/lib/rex/post/meterpreter/ui/console/command_dispatcher/priv/timestomp.rb +0 -0
- data/lib/rex/post/meterpreter/ui/console/command_dispatcher/railgun.rb +57 -0
- data/lib/rex/post/meterpreter/ui/console/command_dispatcher/sniffer.rb +0 -0
- data/lib/rex/post/meterpreter/ui/console/command_dispatcher/stdapi.rb +0 -0
- data/lib/rex/post/meterpreter/ui/console/command_dispatcher/stdapi/fs.rb +0 -0
- data/lib/rex/post/meterpreter/ui/console/command_dispatcher/stdapi/net.rb +0 -0
- data/lib/rex/post/meterpreter/ui/console/command_dispatcher/stdapi/sys.rb +0 -0
- data/lib/rex/post/meterpreter/ui/console/command_dispatcher/stdapi/ui.rb +0 -0
- data/lib/rex/post/meterpreter/ui/console/interactive_channel.rb +0 -0
- data/lib/rex/post/permission.rb +0 -0
- data/lib/rex/post/process.rb +0 -0
- data/lib/rex/post/thread.rb +0 -0
- data/lib/rex/post/ui.rb +0 -0
- data/lib/rex/proto.rb +0 -0
- data/lib/rex/proto.rb.ts.rb +0 -0
- data/lib/rex/proto/dcerpc.rb +0 -0
- data/lib/rex/proto/dcerpc.rb.ts.rb +0 -0
- data/lib/rex/proto/dcerpc/client.rb +45 -44
- data/lib/rex/proto/dcerpc/exceptions.rb +0 -0
- data/lib/rex/proto/dcerpc/handle.rb +0 -0
- data/lib/rex/proto/dcerpc/handle.rb.ut.rb +0 -0
- data/lib/rex/proto/dcerpc/ndr.rb +0 -0
- data/lib/rex/proto/dcerpc/ndr.rb.ut.rb +0 -0
- data/lib/rex/proto/dcerpc/packet.rb +0 -0
- data/lib/rex/proto/dcerpc/packet.rb.ut.rb +0 -0
- data/lib/rex/proto/dcerpc/response.rb +32 -31
- data/lib/rex/proto/dcerpc/response.rb.ut.rb +0 -0
- data/lib/rex/proto/dcerpc/uuid.rb +0 -0
- data/lib/rex/proto/dcerpc/uuid.rb.ut.rb +0 -0
- data/lib/rex/proto/drda.rb +0 -0
- data/lib/rex/proto/drda.rb.ts.rb +0 -0
- data/lib/rex/proto/drda/constants.rb +0 -0
- data/lib/rex/proto/drda/constants.rb.ut.rb +0 -0
- data/lib/rex/proto/drda/packet.rb +0 -0
- data/lib/rex/proto/drda/packet.rb.ut.rb +0 -0
- data/lib/rex/proto/drda/utils.rb +0 -0
- data/lib/rex/proto/drda/utils.rb.ut.rb +0 -0
- data/lib/rex/proto/http.rb +0 -0
- data/lib/rex/proto/http.rb.ts.rb +0 -0
- data/lib/rex/proto/http/client.rb +1 -1
- data/lib/rex/proto/http/client.rb.ut.rb +0 -0
- data/lib/rex/proto/http/handler.rb +0 -0
- data/lib/rex/proto/http/handler/erb.rb +0 -0
- data/lib/rex/proto/http/handler/erb.rb.ut.rb +0 -0
- data/lib/rex/proto/http/handler/erb.rb.ut.rb.rhtml +0 -0
- data/lib/rex/proto/http/handler/proc.rb +0 -0
- data/lib/rex/proto/http/handler/proc.rb.ut.rb +0 -0
- data/lib/rex/proto/http/header.rb +0 -0
- data/lib/rex/proto/http/header.rb.ut.rb +0 -0
- data/lib/rex/proto/http/packet.rb +0 -0
- data/lib/rex/proto/http/packet.rb.ut.rb +0 -0
- data/lib/rex/proto/http/request.rb +0 -0
- data/lib/rex/proto/http/request.rb.ut.rb +0 -0
- data/lib/rex/proto/http/response.rb +0 -0
- data/lib/rex/proto/http/response.rb.ut.rb +0 -0
- data/lib/rex/proto/http/server.rb +0 -0
- data/lib/rex/proto/http/server.rb.ut.rb +0 -0
- data/lib/rex/proto/smb.rb +0 -0
- data/lib/rex/proto/smb.rb.ts.rb +0 -0
- data/lib/rex/proto/smb/client.rb +1 -1
- data/lib/rex/proto/smb/client.rb.ut.rb +0 -0
- data/lib/rex/proto/smb/constants.rb +0 -0
- data/lib/rex/proto/smb/constants.rb.ut.rb +0 -0
- data/lib/rex/proto/smb/crypt.rb +0 -0
- data/lib/rex/proto/smb/crypt.rb.ut.rb +0 -0
- data/lib/rex/proto/smb/evasions.rb +18 -17
- data/lib/rex/proto/smb/exceptions.rb +0 -0
- data/lib/rex/proto/smb/simpleclient.rb +0 -0
- data/lib/rex/proto/smb/simpleclient.rb.ut.rb +0 -0
- data/lib/rex/proto/smb/utils.rb +0 -0
- data/lib/rex/proto/smb/utils.rb.ut.rb +0 -0
- data/lib/rex/proto/sunrpc.rb +0 -0
- data/lib/rex/proto/sunrpc/client.rb +0 -0
- data/lib/rex/proto/tftp.rb +0 -0
- data/lib/rex/proto/tftp/constants.rb +0 -0
- data/lib/rex/proto/tftp/server.rb +212 -37
- data/lib/rex/script.rb +0 -0
- data/lib/rex/script/base.rb +0 -0
- data/lib/rex/script/meterpreter.rb +0 -0
- data/lib/rex/script/shell.rb +0 -0
- data/lib/rex/service.rb +0 -0
- data/lib/rex/service_manager.rb +0 -0
- data/lib/rex/service_manager.rb.ut.rb +0 -0
- data/lib/rex/services/local_relay.rb +0 -0
- data/lib/rex/socket.rb +25 -0
- data/lib/rex/socket.rb.ut.rb +0 -0
- data/lib/rex/socket/comm.rb +0 -0
- data/lib/rex/socket/comm/local.rb +0 -0
- data/lib/rex/socket/comm/local.rb.ut.rb +0 -0
- data/lib/rex/socket/ip.rb +0 -0
- data/lib/rex/socket/parameters.rb +0 -0
- data/lib/rex/socket/parameters.rb.ut.rb +0 -0
- data/lib/rex/socket/range_walker.rb +0 -0
- data/lib/rex/socket/range_walker.rb.ut.rb +0 -0
- data/lib/rex/socket/ssl_tcp.rb +0 -0
- data/lib/rex/socket/ssl_tcp.rb.ut.rb +0 -0
- data/lib/rex/socket/ssl_tcp_server.rb +0 -0
- data/lib/rex/socket/ssl_tcp_server.rb.ut.rb +0 -0
- data/lib/rex/socket/subnet_walker.rb +0 -0
- data/lib/rex/socket/subnet_walker.rb.ut.rb +0 -0
- data/lib/rex/socket/switch_board.rb +11 -5
- data/lib/rex/socket/switch_board.rb.ut.rb +0 -0
- data/lib/rex/socket/tcp.rb +0 -0
- data/lib/rex/socket/tcp.rb.ut.rb +0 -0
- data/lib/rex/socket/tcp_server.rb +0 -0
- data/lib/rex/socket/tcp_server.rb.ut.rb +0 -0
- data/lib/rex/socket/udp.rb +0 -0
- data/lib/rex/socket/udp.rb.ut.rb +0 -0
- data/lib/rex/struct2.rb +0 -0
- data/lib/rex/struct2/c_struct.rb +0 -0
- data/lib/rex/struct2/c_struct_template.rb +0 -0
- data/lib/rex/struct2/constant.rb +0 -0
- data/lib/rex/struct2/element.rb +0 -0
- data/lib/rex/struct2/generic.rb +0 -0
- data/lib/rex/struct2/restraint.rb +0 -0
- data/lib/rex/struct2/s_string.rb +0 -0
- data/lib/rex/struct2/s_struct.rb +0 -0
- data/lib/rex/sync.rb +0 -0
- data/lib/rex/sync/event.rb +0 -0
- data/lib/rex/sync/read_write_lock.rb +0 -0
- data/lib/rex/sync/ref.rb +0 -0
- data/lib/rex/sync/thread_safe.rb +0 -0
- data/lib/rex/test.rb +0 -0
- data/lib/rex/text.rb +15 -4
- data/lib/rex/text.rb.ut.rb +3 -0
- data/lib/rex/time.rb +0 -0
- data/lib/rex/transformer.rb +0 -0
- data/lib/rex/transformer.rb.ut.rb +0 -0
- data/lib/rex/ui.rb +0 -0
- data/lib/rex/ui/interactive.rb +0 -0
- data/lib/rex/ui/output.rb +0 -0
- data/lib/rex/ui/output/none.rb +0 -0
- data/lib/rex/ui/progress_tracker.rb +0 -0
- data/lib/rex/ui/subscriber.rb +0 -0
- data/lib/rex/ui/text/color.rb +0 -0
- data/lib/rex/ui/text/color.rb.ut.rb +0 -0
- data/lib/rex/ui/text/dispatcher_shell.rb +0 -0
- data/lib/rex/ui/text/input.rb +0 -0
- data/lib/rex/ui/text/input/buffer.rb +0 -0
- data/lib/rex/ui/text/input/readline.rb +0 -0
- data/lib/rex/ui/text/input/socket.rb +0 -0
- data/lib/rex/ui/text/input/stdio.rb +0 -0
- data/lib/rex/ui/text/irb_shell.rb +0 -0
- data/lib/rex/ui/text/output.rb +0 -0
- data/lib/rex/ui/text/output/buffer.rb +0 -0
- data/lib/rex/ui/text/output/file.rb +0 -0
- data/lib/rex/ui/text/output/socket.rb +0 -0
- data/lib/rex/ui/text/output/stdio.rb +0 -0
- data/lib/rex/ui/text/progress_tracker.rb +0 -0
- data/lib/rex/ui/text/progress_tracker.rb.ut.rb +0 -0
- data/lib/rex/ui/text/shell.rb +0 -0
- data/lib/rex/ui/text/table.rb +0 -0
- data/lib/rex/ui/text/table.rb.ut.rb +0 -0
- data/lib/rex/zip.rb +0 -0
- data/lib/rex/zip/archive.rb +0 -0
- data/lib/rex/zip/blocks.rb +0 -0
- data/lib/rex/zip/entry.rb +0 -0
- metadata +414 -347
@@ -0,0 +1,54 @@
|
|
1
|
+
# Copyright (c) 2010, patrickHVE@googlemail.com
|
2
|
+
# All rights reserved.
|
3
|
+
#
|
4
|
+
# Redistribution and use in source and binary forms, with or without
|
5
|
+
# modification, are permitted provided that the following conditions are met:
|
6
|
+
# * Redistributions of source code must retain the above copyright
|
7
|
+
# notice, this list of conditions and the following disclaimer.
|
8
|
+
# * Redistributions in binary form must reproduce the above copyright
|
9
|
+
# notice, this list of conditions and the following disclaimer in the
|
10
|
+
# documentation and/or other materials provided with the distribution.
|
11
|
+
# * The names of the author may not be used to endorse or promote products
|
12
|
+
# derived from this software without specific prior written permission.
|
13
|
+
#
|
14
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
15
|
+
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
16
|
+
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
17
|
+
# DISCLAIMED. IN NO EVENT SHALL patrickHVE@googlemail.com BE LIABLE FOR ANY
|
18
|
+
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
19
|
+
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
20
|
+
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
21
|
+
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
22
|
+
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
23
|
+
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
24
|
+
|
25
|
+
module Rex
|
26
|
+
module Post
|
27
|
+
module Meterpreter
|
28
|
+
module Extensions
|
29
|
+
module Railgun
|
30
|
+
|
31
|
+
TLV_TYPE_EXTENSION_RAILGUN = 0
|
32
|
+
TLV_TYPE_RAILGUN_SIZE_OUT = TLV_META_TYPE_UINT | (TLV_TYPE_EXTENSION_RAILGUN + TLV_EXTENSIONS + 1)
|
33
|
+
TLV_TYPE_RAILGUN_STACKBLOB = TLV_META_TYPE_RAW | (TLV_TYPE_EXTENSION_RAILGUN + TLV_EXTENSIONS + 2)
|
34
|
+
TLV_TYPE_RAILGUN_BUFFERBLOB_IN = TLV_META_TYPE_RAW | (TLV_TYPE_EXTENSION_RAILGUN + TLV_EXTENSIONS + 3)
|
35
|
+
TLV_TYPE_RAILGUN_BUFFERBLOB_INOUT = TLV_META_TYPE_RAW | (TLV_TYPE_EXTENSION_RAILGUN + TLV_EXTENSIONS + 4)
|
36
|
+
|
37
|
+
TLV_TYPE_RAILGUN_BACK_BUFFERBLOB_OUT = TLV_META_TYPE_RAW | (TLV_TYPE_EXTENSION_RAILGUN + TLV_EXTENSIONS + 5)
|
38
|
+
TLV_TYPE_RAILGUN_BACK_BUFFERBLOB_INOUT = TLV_META_TYPE_RAW | (TLV_TYPE_EXTENSION_RAILGUN + TLV_EXTENSIONS + 6)
|
39
|
+
TLV_TYPE_RAILGUN_BACK_RET = TLV_META_TYPE_UINT | (TLV_TYPE_EXTENSION_RAILGUN + TLV_EXTENSIONS + 7)
|
40
|
+
TLV_TYPE_RAILGUN_BACK_ERR = TLV_META_TYPE_UINT | (TLV_TYPE_EXTENSION_RAILGUN + TLV_EXTENSIONS + 8)
|
41
|
+
|
42
|
+
TLV_TYPE_RAILGUN_DLLNAME = TLV_META_TYPE_STRING | (TLV_TYPE_EXTENSION_RAILGUN + TLV_EXTENSIONS + 9)
|
43
|
+
TLV_TYPE_RAILGUN_FUNCNAME = TLV_META_TYPE_STRING | (TLV_TYPE_EXTENSION_RAILGUN + TLV_EXTENSIONS + 10)
|
44
|
+
TLV_TYPE_RAILGUN_MULTI_GROUP = TLV_META_TYPE_GROUP | (TLV_TYPE_EXTENSION_RAILGUN + TLV_EXTENSIONS + 11)
|
45
|
+
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -37,14 +37,14 @@ class Socket
|
|
37
37
|
#
|
38
38
|
def initialize(client)
|
39
39
|
self.client = client
|
40
|
-
|
40
|
+
|
41
41
|
# register the inbound handler for the tcp server channel (allowing us to receive new client connections to a tcp server channel)
|
42
42
|
client.register_inbound_handler( Rex::Post::Meterpreter::Extensions::Stdapi::Net::SocketSubsystem::TcpServerChannel )
|
43
43
|
|
44
44
|
end
|
45
45
|
|
46
46
|
#
|
47
|
-
# Deregister the inbound handler for the tcp server channel
|
47
|
+
# Deregister the inbound handler for the tcp server channel
|
48
48
|
#
|
49
49
|
def shutdown
|
50
50
|
client.deregister_inbound_handler( Rex::Post::Meterpreter::Extensions::Stdapi::Net::SocketSubsystem::TcpServerChannel )
|
@@ -63,7 +63,7 @@ class Socket
|
|
63
63
|
#
|
64
64
|
def create( params )
|
65
65
|
res = nil
|
66
|
-
|
66
|
+
|
67
67
|
if( params.tcp? )
|
68
68
|
if( params.server? )
|
69
69
|
res = create_tcp_server_channel( params )
|
@@ -73,7 +73,7 @@ class Socket
|
|
73
73
|
elsif( params.udp? )
|
74
74
|
res = create_udp_channel( params )
|
75
75
|
end
|
76
|
-
|
76
|
+
|
77
77
|
return res
|
78
78
|
end
|
79
79
|
|
@@ -89,7 +89,7 @@ class Socket
|
|
89
89
|
raise ::Rex::ConnectionError.new
|
90
90
|
end
|
91
91
|
raise e
|
92
|
-
end
|
92
|
+
end
|
93
93
|
end
|
94
94
|
|
95
95
|
#
|
@@ -100,7 +100,7 @@ class Socket
|
|
100
100
|
channel = SocketSubsystem::TcpClientChannel.open(client, params)
|
101
101
|
if( channel != nil )
|
102
102
|
return channel.lsock
|
103
|
-
end
|
103
|
+
end
|
104
104
|
return nil
|
105
105
|
rescue ::Rex::Post::Meterpreter::RequestError => e
|
106
106
|
case e.result
|
@@ -123,7 +123,7 @@ class Socket
|
|
123
123
|
raise ::Rex::ConnectionError.new
|
124
124
|
end
|
125
125
|
raise e
|
126
|
-
end
|
126
|
+
end
|
127
127
|
end
|
128
128
|
|
129
129
|
|
@@ -22,13 +22,13 @@ module SocketSubsystem
|
|
22
22
|
#
|
23
23
|
###
|
24
24
|
class TcpClientChannel < Rex::Post::Meterpreter::Stream
|
25
|
-
|
25
|
+
|
26
26
|
class << self
|
27
27
|
def cls
|
28
28
|
return CHANNEL_CLASS_STREAM
|
29
29
|
end
|
30
30
|
end
|
31
|
-
|
31
|
+
|
32
32
|
module SocketInterface
|
33
33
|
def type?
|
34
34
|
'tcp'
|
@@ -58,26 +58,26 @@ class TcpClientChannel < Rex::Post::Meterpreter::Stream
|
|
58
58
|
|
59
59
|
attr_accessor :channel
|
60
60
|
end
|
61
|
-
|
61
|
+
|
62
62
|
#
|
63
63
|
# Simple mixin for lsock in order to help avoid a ruby interpreter issue with ::Socket.pair
|
64
64
|
# Instead of writing to the lsock, reading from the rsock and then writing to the channel,
|
65
65
|
# we use this mixin to directly write to the channel.
|
66
66
|
#
|
67
|
-
# Note: This does not work with OpenSSL as OpenSSL is implemented
|
67
|
+
# Note: This does not work with OpenSSL as OpenSSL is implemented natively and requires a real
|
68
68
|
# socket to write to and we cant intercept the sockets syswrite at a native level.
|
69
69
|
#
|
70
70
|
# Note: The deadlock only seems to effect the Ruby build for cygwin.
|
71
71
|
#
|
72
72
|
module DirectChannelWrite
|
73
|
-
|
73
|
+
|
74
74
|
def syswrite( buf )
|
75
75
|
channel._write( buf )
|
76
76
|
end
|
77
|
-
|
77
|
+
|
78
78
|
attr_accessor :channel
|
79
79
|
end
|
80
|
-
|
80
|
+
|
81
81
|
##
|
82
82
|
#
|
83
83
|
# Factory
|
@@ -133,7 +133,7 @@ class TcpClientChannel < Rex::Post::Meterpreter::Stream
|
|
133
133
|
|
134
134
|
rsock.extend( SocketInterface )
|
135
135
|
rsock.channel = self
|
136
|
-
|
136
|
+
|
137
137
|
end
|
138
138
|
|
139
139
|
#
|
@@ -161,6 +161,19 @@ class TcpClientChannel < Rex::Post::Meterpreter::Stream
|
|
161
161
|
return true
|
162
162
|
end
|
163
163
|
|
164
|
+
#
|
165
|
+
# Wrap the _write() call in order to catch some common, but harmless Windows exceptions
|
166
|
+
#
|
167
|
+
def _write(*args)
|
168
|
+
begin
|
169
|
+
super(*args)
|
170
|
+
rescue ::Rex::Post::Meterpreter::RequestError => e
|
171
|
+
case e.result
|
172
|
+
when 10000 .. 10100
|
173
|
+
raise ::Rex::ConnectionError.new
|
174
|
+
end
|
175
|
+
end
|
176
|
+
end
|
164
177
|
end
|
165
178
|
|
166
179
|
end; end; end; end; end; end; end
|
File without changes
|
@@ -19,7 +19,7 @@ class UdpChannel < Rex::Post::Meterpreter::Channel
|
|
19
19
|
# We inclue Rex::Socket::Udp as this channel is effectivly a UDP socket.
|
20
20
|
#
|
21
21
|
include Rex::Socket::Udp
|
22
|
-
|
22
|
+
|
23
23
|
#
|
24
24
|
# We are a datagram channel.
|
25
25
|
#
|
@@ -28,7 +28,7 @@ class UdpChannel < Rex::Post::Meterpreter::Channel
|
|
28
28
|
return CHANNEL_CLASS_DATAGRAM
|
29
29
|
end
|
30
30
|
end
|
31
|
-
|
31
|
+
|
32
32
|
#
|
33
33
|
# Open a new UDP channel on the remote end. The local host/port are optional, if none are specified
|
34
34
|
# the remote end will bind to INADDR_ANY with a random port number. The peer host/port are also
|
@@ -59,9 +59,9 @@ class UdpChannel < Rex::Post::Meterpreter::Channel
|
|
59
59
|
c.params = params
|
60
60
|
c
|
61
61
|
end
|
62
|
-
|
62
|
+
|
63
63
|
#
|
64
|
-
# Simply
|
64
|
+
# Simply initialize this instance.
|
65
65
|
#
|
66
66
|
def initialize(client, cid, type, flags)
|
67
67
|
super(client, cid, type, flags)
|
@@ -75,7 +75,7 @@ class UdpChannel < Rex::Post::Meterpreter::Channel
|
|
75
75
|
#
|
76
76
|
def timed_read( length=65535, timeout=def_read_timeout )
|
77
77
|
result = ''
|
78
|
-
|
78
|
+
|
79
79
|
begin
|
80
80
|
Timeout.timeout( timeout ) {
|
81
81
|
while( true )
|
@@ -90,12 +90,12 @@ class UdpChannel < Rex::Post::Meterpreter::Channel
|
|
90
90
|
rescue Timeout::Error
|
91
91
|
result = ''
|
92
92
|
end
|
93
|
-
|
93
|
+
|
94
94
|
return result
|
95
95
|
end
|
96
|
-
|
96
|
+
|
97
97
|
#
|
98
|
-
# We overwrite Rex::Socket::Udp.recvfrom in order to correctly hand out the
|
98
|
+
# We overwrite Rex::Socket::Udp.recvfrom in order to correctly hand out the
|
99
99
|
# datagrams which the remote end of this channel has received and are in the
|
100
100
|
# queue.
|
101
101
|
#
|
@@ -130,7 +130,7 @@ class UdpChannel < Rex::Post::Meterpreter::Channel
|
|
130
130
|
# return the result in the form [ data, host, port ]
|
131
131
|
return result
|
132
132
|
end
|
133
|
-
|
133
|
+
|
134
134
|
#
|
135
135
|
# Overwrite the low level sysread to read data off our datagram queue. Calls
|
136
136
|
# to read() will end up calling this.
|
@@ -139,9 +139,9 @@ class UdpChannel < Rex::Post::Meterpreter::Channel
|
|
139
139
|
result = self.recvfrom( length )
|
140
140
|
return result[0]
|
141
141
|
end
|
142
|
-
|
142
|
+
|
143
143
|
#
|
144
|
-
# Overwrite the low level syswrite to write data to the remote end of the channel.
|
144
|
+
# Overwrite the low level syswrite to write data to the remote end of the channel.
|
145
145
|
# Calls to write() will end up calling this.
|
146
146
|
#
|
147
147
|
def syswrite( buf )
|
@@ -149,12 +149,12 @@ class UdpChannel < Rex::Post::Meterpreter::Channel
|
|
149
149
|
end
|
150
150
|
|
151
151
|
#
|
152
|
-
# This function is called by Rex::Socket::Udp.sendto and writes data to a specified
|
152
|
+
# This function is called by Rex::Socket::Udp.sendto and writes data to a specified
|
153
153
|
# remote peer host/port via the remote end of the channel.
|
154
154
|
#
|
155
155
|
def send( buf, flags, saddr )
|
156
156
|
af, peerhost, peerport = Rex::Socket.from_sockaddr( saddr )
|
157
|
-
|
157
|
+
|
158
158
|
addends = [
|
159
159
|
{
|
160
160
|
'type' => TLV_TYPE_PEER_HOST,
|
@@ -165,12 +165,12 @@ class UdpChannel < Rex::Post::Meterpreter::Channel
|
|
165
165
|
'value' => peerport
|
166
166
|
}
|
167
167
|
]
|
168
|
-
|
168
|
+
|
169
169
|
return _write( buf, buf.length, addends )
|
170
170
|
end
|
171
171
|
|
172
172
|
#
|
173
|
-
# The channels direct io write handler for any incoming data from the remote end
|
173
|
+
# The channels direct io write handler for any incoming data from the remote end
|
174
174
|
# of the channel. We extract the data and peer host/port, and save this to a queue
|
175
175
|
# of incoming datagrams which are passed out via calls to self.recvfrom()
|
176
176
|
#
|
@@ -178,15 +178,31 @@ class UdpChannel < Rex::Post::Meterpreter::Channel
|
|
178
178
|
|
179
179
|
peerhost = packet.get_tlv_value( TLV_TYPE_PEER_HOST )
|
180
180
|
peerport = packet.get_tlv_value( TLV_TYPE_PEER_PORT )
|
181
|
-
|
181
|
+
|
182
182
|
if( peerhost and peerport )
|
183
183
|
@datagrams << [ data, peerhost, peerport ]
|
184
184
|
return true
|
185
185
|
end
|
186
|
-
|
186
|
+
|
187
187
|
return false
|
188
188
|
end
|
189
189
|
|
190
|
+
#
|
191
|
+
# Wrap the _write() call in order to catch some common, but harmless Windows exceptions
|
192
|
+
#
|
193
|
+
def _write(*args)
|
194
|
+
begin
|
195
|
+
super(*args)
|
196
|
+
rescue ::Rex::Post::Meterpreter::RequestError => e
|
197
|
+
case e.result
|
198
|
+
when 10000 .. 10100
|
199
|
+
raise ::Rex::ConnectionError.new
|
200
|
+
end
|
201
|
+
end
|
202
|
+
end
|
203
|
+
|
204
|
+
|
190
205
|
end
|
191
206
|
|
192
207
|
end; end; end; end; end; end; end
|
208
|
+
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,57 @@
|
|
1
|
+
require 'rex/post/meterpreter'
|
2
|
+
|
3
|
+
module Rex
|
4
|
+
module Post
|
5
|
+
module Meterpreter
|
6
|
+
module Ui
|
7
|
+
|
8
|
+
###
|
9
|
+
#
|
10
|
+
# Packet sniffer extension user interface.
|
11
|
+
#
|
12
|
+
###
|
13
|
+
class Console::CommandDispatcher::Railgun
|
14
|
+
|
15
|
+
Klass = Console::CommandDispatcher::Railgun
|
16
|
+
|
17
|
+
include Console::CommandDispatcher
|
18
|
+
|
19
|
+
#
|
20
|
+
# Initializes an instance of the railgun command interaction.
|
21
|
+
#
|
22
|
+
def initialize(shell)
|
23
|
+
super
|
24
|
+
end
|
25
|
+
|
26
|
+
#
|
27
|
+
# List of supported commands.
|
28
|
+
#
|
29
|
+
def commands
|
30
|
+
{
|
31
|
+
# "railgun_test" => "Run a simple railgun_test"
|
32
|
+
}
|
33
|
+
end
|
34
|
+
|
35
|
+
=begin
|
36
|
+
def cmd_railgun_test(*args)
|
37
|
+
begin
|
38
|
+
r = client.railgun.multi([
|
39
|
+
["kernel32", "GetLogicalDrives", []]
|
40
|
+
])
|
41
|
+
rescue ::Exception => e
|
42
|
+
p "Error: #{e} #{e.backtrace}"
|
43
|
+
end
|
44
|
+
end
|
45
|
+
=end
|
46
|
+
|
47
|
+
def name
|
48
|
+
"Railgun"
|
49
|
+
end
|
50
|
+
|
51
|
+
end
|
52
|
+
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|