Adding DLL and function definition to Railgun
In the previous recipe, we focused on calling Windows API DLLs through Railgun. In this recipe, we will focus on adding our own DLL and function definitions to Railgun. In order to do this, we should have an understanding of Windows DLLs. The Railgun manual can be helpful in giving you a quick idea about different Windows constants that can be used while adding function definitions.
How to do it...
Adding a new DLL definition to Railgun is an easy task. Suppose you want to add a DLL that ships with Windows but it is not present in your Railgun, then you can create a DLL definition under pentest/exploits/framework3/lib/rex/post/meterpreter/extensions/stdapi/railgun/def
and name it as def_dllname.rb
.
Consider the example of adding a shell32.dll definition into Railgun. We can start with adding the following lines of codes:
module Rex module Post module Meterpreter module Extensions module Stdapi module Railgun module Def class Def_shell32 def self...