-
Notifications
You must be signed in to change notification settings - Fork 0
/
libver.src
34 lines (26 loc) · 925 Bytes
/
libver.src
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
//command libver
// just for grabbing version numbers of the lib
// can scan a whole folder
mx = include_lib("/lib/metaxploit.so")
if not mx then mx = include_lib(parent_path(program_path) + "/metaxploit.so")
if not mx then exit("Cannot find metaxploit.so")
if params.len != 1 or params[0] == "-h" or params[0] == "--help" then exit("libver <library.so / folder>")
input = params[0]
pc = get_shell.host_computer
check_lib = function(filename)
lib = mx.load(filename)
if not lib then exit("Error: missing " +filename)
return(lib)
end function
if input.indexOf(".so") then
lib = check_lib(input)
print(input + " : " +lib.version)
else
if not pc.File(input) then exit("libver <library.so / folder>")
lib_files = pc.File(input).get_files
for file in lib_files
if input[-1:] == "/" then input = input[:-1]
lib = check_lib(input+"/"+file.name)
print(input+"/"+file.name + " : " +lib.version)
end for
end if