mirror of
https://github.com/nmap/nmap.git
synced 2026-08-04 14:49:29 +00:00
Fixed bug in smb.lua share_get_list function to use anonymous connections first. Closes #904
This commit is contained in:
parent
24f1d960fc
commit
b4e1daef74
2 changed files with 5 additions and 1 deletions
|
|
@ -1,5 +1,8 @@
|
|||
# Nmap Changelog ($Id$); -*-text-*-
|
||||
|
||||
o [NSE] smb library's share_get_list now properly uses anonymous connections
|
||||
first before falling back authenticating as a known user.
|
||||
|
||||
o [NSE] New script smb-vuln-cve-2017-7494 detects a remote code execution
|
||||
vulnerability affecting Samba versions 3.5.0 and greater with writable
|
||||
shares. [Wong Wai Tuck]
|
||||
|
|
|
|||
|
|
@ -2498,6 +2498,7 @@ end
|
|||
-- data is given as a string, not a file.
|
||||
--
|
||||
--@param host The host object
|
||||
--@param data The string containing the data to be written
|
||||
--@param share The share to upload it to (eg, C$).
|
||||
--@param remotefile The remote file on the machine. It is relative to the share's root.
|
||||
--@param use_anonymous [optional] If set to 'true', test is done by the anonymous user rather than the current user.
|
||||
|
|
@ -3189,7 +3190,7 @@ function share_get_list(host)
|
|||
-- Ensure that the server returns the proper error message
|
||||
-- first try anonymously, then using a user account (in case anonymous connections are not supported)
|
||||
for _, anon in ipairs({true, false}) do
|
||||
status, result = share_host_returns_proper_error(host)
|
||||
status, result = share_host_returns_proper_error(host, anon)
|
||||
|
||||
if(status == true and result == false) then
|
||||
return false, "Server doesn't return proper value for non-existent shares; can't enumerate shares"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue