Skip to content

Commit ea83cb0

Browse files
committed
Make the railgun def class names platform specific
1 parent feb8d14 commit ea83cb0

File tree

17 files changed

+39
-29
lines changed

17 files changed

+39
-29
lines changed

lib/rex/post/meterpreter/extensions/stdapi/railgun/def/linux/def_libc.rb

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ module Stdapi
77
module Railgun
88
module Def
99

10-
class Def_libc
10+
class Def_linux_libc
1111

1212
def self.create_dll(constant_manager, dll_path = 'libc.so.6')
13-
dll = DLL.new(dll_path, constant_manager)
13+
lib = DLL.new(dll_path, constant_manager)
1414

15-
dll.add_function(
15+
lib.add_function(
1616
'calloc',
1717
'LPVOID',
1818
[
@@ -22,7 +22,7 @@ def self.create_dll(constant_manager, dll_path = 'libc.so.6')
2222
nil,
2323
'cdecl'
2424
)
25-
dll.add_function(
25+
lib.add_function(
2626
'free',
2727
'VOID',
2828
[
@@ -31,14 +31,14 @@ def self.create_dll(constant_manager, dll_path = 'libc.so.6')
3131
nil,
3232
'cdecl',
3333
)
34-
dll.add_function(
34+
lib.add_function(
3535
'getpid',
3636
'DWORD',
3737
[],
3838
nil,
3939
'cdecl'
4040
)
41-
dll.add_function(
41+
lib.add_function(
4242
'inet_ntop',
4343
'LPVOID',
4444
[
@@ -50,7 +50,7 @@ def self.create_dll(constant_manager, dll_path = 'libc.so.6')
5050
nil,
5151
'cdecl'
5252
)
53-
dll.add_function(
53+
lib.add_function(
5454
'inet_pton',
5555
'DWORD',
5656
[
@@ -61,14 +61,14 @@ def self.create_dll(constant_manager, dll_path = 'libc.so.6')
6161
nil,
6262
'cdecl'
6363
)
64-
dll.add_function(
64+
lib.add_function(
6565
'malloc',
6666
'LPVOID',
6767
[['SIZE_T', 'size', 'in']],
6868
nil,
6969
'cdecl'
7070
)
71-
dll.add_function(
71+
lib.add_function(
7272
'memfrob',
7373
'LPVOID',
7474
[
@@ -78,7 +78,7 @@ def self.create_dll(constant_manager, dll_path = 'libc.so.6')
7878
nil,
7979
'cdecl'
8080
)
81-
dll.add_function(
81+
lib.add_function(
8282
'mmap',
8383
'LPVOID',
8484
[
@@ -92,7 +92,7 @@ def self.create_dll(constant_manager, dll_path = 'libc.so.6')
9292
nil,
9393
'cdecl'
9494
)
95-
dll.add_function(
95+
lib.add_function(
9696
'mprotect',
9797
'DWORD',
9898
[
@@ -103,7 +103,7 @@ def self.create_dll(constant_manager, dll_path = 'libc.so.6')
103103
nil,
104104
'cdecl'
105105
)
106-
dll.add_function(
106+
lib.add_function(
107107
'munmap',
108108
'DWORD',
109109
[
@@ -113,7 +113,17 @@ def self.create_dll(constant_manager, dll_path = 'libc.so.6')
113113
nil,
114114
'cdecl'
115115
)
116-
return dll
116+
lib.add_function(
117+
'strcat',
118+
'LPVOID',
119+
[
120+
['PCHAR', 'to', 'inout'],
121+
['PCHAR', 'from', 'in']
122+
],
123+
nil,
124+
'cdecl'
125+
)
126+
return lib
117127
end
118128

119129
end

lib/rex/post/meterpreter/extensions/stdapi/railgun/def/osx/def_libc.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module Stdapi
77
module Railgun
88
module Def
99

10-
class Def_libc
10+
class Def_osx_libc
1111

1212
def self.create_dll(constant_manager, dll_path = 'libc.dylib')
1313
lib = DLL.new(dll_path, constant_manager)

lib/rex/post/meterpreter/extensions/stdapi/railgun/def/osx/def_libobjc.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module Stdapi
77
module Railgun
88
module Def
99

10-
class Def_libobjc
10+
class Def_osx_libobjc
1111

1212
def self.create_dll(constant_manager, dll_path = 'libobjc.dylib')
1313
lib = DLL.new(dll_path, constant_manager)

lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_advapi32.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module Stdapi
77
module Railgun
88
module Def
99

10-
class Def_advapi32
10+
class Def_windows_advapi32
1111

1212
CREDENTIAL = [
1313
[:Flags, :DWORD],

lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_crypt32.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module Stdapi
77
module Railgun
88
module Def
99

10-
class Def_crypt32
10+
class Def_windows_crypt32
1111

1212
def self.create_dll(constant_manager, dll_path = 'crypt32')
1313
dll = DLL.new(dll_path, constant_manager)

lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_iphlpapi.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module Stdapi
77
module Railgun
88
module Def
99

10-
class Def_iphlpapi
10+
class Def_windows_iphlpapi
1111

1212
def self.create_dll(constant_manager, dll_path = 'iphlpapi')
1313
dll = DLL.new(dll_path, constant_manager)

lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_kernel32.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module Stdapi
77
module Railgun
88
module Def
99

10-
class Def_kernel32
10+
class Def_windows_kernel32
1111

1212
def self.create_dll(constant_manager, dll_path = 'kernel32')
1313
dll = DLL.new(dll_path, constant_manager)

lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_netapi32.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module Stdapi
77
module Railgun
88
module Def
99

10-
class Def_netapi32
10+
class Def_windows_netapi32
1111

1212
def self.create_dll(constant_manager, dll_path = 'netapi32')
1313
dll = DLL.new(dll_path, constant_manager)

lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_ntdll.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module Stdapi
77
module Railgun
88
module Def
99

10-
class Def_ntdll
10+
class Def_windows_ntdll
1111

1212
def self.create_dll(constant_manager, dll_path = 'ntdll')
1313
dll = DLL.new(dll_path, constant_manager)

lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_psapi.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module Stdapi
77
module Railgun
88
module Def
99

10-
class Def_psapi
10+
class Def_windows_psapi
1111

1212
def self.create_dll(constant_manager, dll_path = 'psapi')
1313
dll = DLL.new(dll_path, constant_manager)

0 commit comments

Comments
 (0)