mirror of
https://github.com/nmap/nmap.git
synced 2026-01-01 20:39:02 +00:00
Merged in my changes from nmap-smb. The primary changes are:
* Updated the way authentication works on smb -- it's significantly cleaner now * smb-enum-shares.nse gives significantly better output now (it checks if shares are writable) * Added a script that checks if smbv2 is enabled on a server * Added smb-psexec, a script for executing commands on a remote Windows server. I also included some default scripts, a compiled .exe to run everything, and a ton of documentation (in the form of NSEDoc) * Added 'override' parameters to some of the functions in smb.lua, which lets the programmer override any field in an outgoing SMB packet without modifying smb.lua. * Lots of random code cleanups in the smb-* scripts/libraries
This commit is contained in:
@@ -130,6 +130,16 @@ function string_to_unicode(string, do_null)
|
||||
do_null = false
|
||||
end
|
||||
|
||||
-- Try converting the value to a string
|
||||
if(type(string) ~= 'string') then
|
||||
string = tostring(string)
|
||||
end
|
||||
|
||||
if(string == nil) then
|
||||
stdnse.print_debug(1, "MSRPC: WARNING: couldn't convert value to string in string_to_unicode()")
|
||||
end
|
||||
|
||||
|
||||
-- Loop through the string, adding each character followed by a char(0)
|
||||
for i = 1, string.len(string), 1 do
|
||||
result = result .. string.sub(string, i, i) .. string.char(0)
|
||||
|
||||
Reference in New Issue
Block a user