mirror of
https://github.com/nmap/nmap.git
synced 2026-08-04 06:40:48 +00:00
Add some "local" declarations to scripts/xamppDefaultPass.nse. Without this I
was getting errors like SCRIPT ENGINE: [string "Global Access"]:1: Attempted to change the global 'socket' in c:david mapmswin32DebugscriptsxamppDefaultPass.nse - use nmap.registry if you really wan t to share data between scripts. Notice that there's another issue with the error message, which is that backslashes in the file name are being interpreted as beginning escape sequences (see how the '\n' in "C:\david\nmap" turned into a newline.
This commit is contained in:
parent
82abfd3e1b
commit
c25be95b59
1 changed files with 4 additions and 2 deletions
|
|
@ -15,7 +15,8 @@ require "shortport"
|
|||
portrule = shortport.port_or_service(21, "ftp")
|
||||
|
||||
login = function(socket, user, pass)
|
||||
res = ""
|
||||
local status, err
|
||||
local res = ""
|
||||
status, err = socket:send("USER " .. user .. "\n")
|
||||
status, err = socket:send("PASS " .. pass .. "\n")
|
||||
|
||||
|
|
@ -37,7 +38,8 @@ login = function(socket, user, pass)
|
|||
end
|
||||
|
||||
action = function(host, port)
|
||||
socket = nmap.new_socket()
|
||||
local res
|
||||
local socket = nmap.new_socket()
|
||||
|
||||
socket:connect(host.ip, port.number)
|
||||
res = login(socket, "nobody", "e0e0e0e0")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue