1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-24 08:29:04 +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:
david
2007-12-09 05:47:26 +00:00
parent 82abfd3e1b
commit c25be95b59

View File

@@ -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")