1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-15 12:19:02 +00:00

Lua 5.2 upgrade [1] for NSE.

[1] http://seclists.org/nmap-dev/2012/q2/34
This commit is contained in:
batrick
2012-05-27 08:53:32 +00:00
parent a839e69449
commit 000f6dc4d9
553 changed files with 13477 additions and 8870 deletions

View File

@@ -12,7 +12,13 @@
-- @copyright Same as Nmap--See http://nmap.org/book/man-legal.html
-- @author "Patrik Karlsson <patrik@cqure.net>"
module(... or "pgsql",package.seeall)
local bin = require "bin"
local nmap = require "nmap"
local openssl = require "openssl"
local stdnse = require "stdnse"
local string = require "string"
local table = require "table"
_ENV = stdnse.module("pgsql", stdnse.seeall)
-- Version 0.3
-- Created 02/05/2010 - v0.1 - created by Patrik Karlsson <patrik@cqure.net>
@@ -20,9 +26,6 @@ module(... or "pgsql",package.seeall)
-- the correct version class
-- Revised 03/04/2010 - v0.3 - added support for trust authentication method
require("openssl")
require("bit")
--- Supported pgsql message types
MessageType = {
Error = 0x45,
@@ -478,7 +481,7 @@ v3 =
local pos = 1
if ( params.authtype == AuthenticationType.MD5 ) then
local hash = pgsql.createMD5LoginHash(username, password, salt)
local hash = createMD5LoginHash(username, password, salt)
data = bin.pack( "C>Iz", MessageType.PasswordMessage, 40, hash )
try( socket:send( data ) )
elseif ( params.authtype == AuthenticationType.Plain ) then
@@ -621,3 +624,5 @@ function detectVersion(host, port)
return v3
end
return _ENV;