mirror of
https://github.com/nmap/nmap.git
synced 2025-12-06 04:31:29 +00:00
Rename scripts (almost all of them) to make their names more consistent and
make them look better in output. The full list of changes is anonFTP => ftp-anon ASN => asn-query brutePOP3 => pop3-brute bruteTelnet => telnet-brute daytimeTest => daytime dns-safe-recursion-port => dns-random-srcport dns-safe-recursion-txid => dns-random-txid dns-test-open-recursion => dns-recursion ftpbounce => ftp-bounce HTTPAuth => http-auth HTTP_open_proxy => http-open-proxy HTTPpasswd => http-passwd HTTPtrace => http-trace iax2Detect => iax2-version ircServerInfo => irc-info ircZombieTest => irc-zombie MSSQLm => ms-sql-info MySQLinfo => mysql-info popcapa => pop3-capabilities PPTPversion => pptp-version promiscuous => sniffer-detect RealVNC_auth_bypass => realvnc-auth-bypass robots => robots.txt showHTMLTitle => html-title showOwner => identd-owners skype_v2-version => skypev2-version smb-enumdomains => smb-enum-domains smb-enumsessions => smb-enum-sessions smb-enumshares => smb-enum-shares smb-enumusers => smb-enum-users smb-serverstats => smb-server-stats smb-systeminfo => smb-system-info SMTPcommands => smtp-commands SMTP_openrelay_test => smtp-open-relay SNMPcommunitybrute => snmp-brute SNMPsysdescr => snmp-sysdescr SQLInject => sql-injection SSH-hostkey => ssh-hostkey SSHv1-support => sshv1 SSLv2-support => sslv2 strangeSMTPport => smtp-strangeport UPnP-info => upnp-info xamppDefaultPass => xampp-default-auth zoneTrans => zone-transfer
This commit is contained in:
84
scripts/pptp-version.nse
Normal file
84
scripts/pptp-version.nse
Normal file
@@ -0,0 +1,84 @@
|
||||
description = [[
|
||||
Attempts to extract system information from the PPTP service.
|
||||
]]
|
||||
-- rev 0.2 (11-14-2007)
|
||||
|
||||
author = "Thomas Buchanan <tbuchanan@thecompassgrp.net>"
|
||||
|
||||
license = "Same as Nmap--See http://nmap.org/book/man-legal.html"
|
||||
|
||||
categories = {"version"}
|
||||
|
||||
require "comm"
|
||||
require "shortport"
|
||||
|
||||
portrule = shortport.portnumber(1723)
|
||||
|
||||
action = function(host, port)
|
||||
local payload
|
||||
|
||||
-- build a PPTP Start-Control-Connection-Request packet
|
||||
-- copied from packet capture of pptp exchange
|
||||
-- for details of packet structure, see http://www.ietf.org/rfc/rfc2637.txt
|
||||
payload = "\000\156\000\001\026\043\060\077" -- length=156, Message type=control, cookie
|
||||
payload = payload .. "\000\001\000\000\001\000\000\000" -- Control type=Start-Control-Connection-Request, Reserved, Protocol=1.0, Reserverd
|
||||
payload = payload .. "\000\000\000\001\000\000\000\001" -- Framing Capabilities, Bearer Capabilities
|
||||
payload = payload .. "\255\255\000\001" .. "none" -- Maximum channels, firmware version, hostname
|
||||
payload = payload .. "\000\000\000\000\000\000\000\000" -- padding for hostname
|
||||
payload = payload .. "\000\000\000\000\000\000\000\000" -- padding for hostname
|
||||
payload = payload .. "\000\000\000\000\000\000\000\000" -- padding for hostname
|
||||
payload = payload .. "\000\000\000\000\000\000\000\000" -- padding for hostname
|
||||
payload = payload .. "\000\000\000\000\000\000\000\000" -- padding for hostname
|
||||
payload = payload .. "\000\000\000\000\000\000\000\000" -- padding for hostname
|
||||
payload = payload .. "\000\000\000\000\000\000\000\000" -- padding for hostname
|
||||
payload = payload .. "\000\000\000\000" .. "nmap" -- padding for hostname, vendor name
|
||||
payload = payload .. "\000\000\000\000\000\000\000\000" -- padding for vendor name
|
||||
payload = payload .. "\000\000\000\000\000\000\000\000" -- padding for vendor name
|
||||
payload = payload .. "\000\000\000\000\000\000\000\000" -- padding for vendor name
|
||||
payload = payload .. "\000\000\000\000\000\000\000\000" -- padding for vendor name
|
||||
payload = payload .. "\000\000\000\000\000\000\000\000" -- padding for vendor name
|
||||
payload = payload .. "\000\000\000\000\000\000\000\000" -- padding for vendor name
|
||||
payload = payload .. "\000\000\000\000\000\000\000\000" -- padding for vendor name
|
||||
payload = payload .. "\000\000\000\000" -- padding for vendor name
|
||||
|
||||
local try = nmap.new_try()
|
||||
local response = try(comm.exchange(host, port, payload, {timeout=5000}))
|
||||
|
||||
local result
|
||||
|
||||
-- check to see if the packet we got back matches the beginning of a PPTP Start-Control-Connection-Reply packet
|
||||
result = string.match(response, "%z\156%z\001\026\043(.*)")
|
||||
local output
|
||||
|
||||
if result ~= nil then
|
||||
local firmware
|
||||
local hostname
|
||||
local vendor
|
||||
|
||||
-- get the firmware version (2 octets)
|
||||
local s1,s2
|
||||
s1,s2 = string.byte(result, 22, 23)
|
||||
firmware = s1 * 256 + s2
|
||||
|
||||
-- get the hostname (64 octets)
|
||||
local s3
|
||||
s3 = string.sub(result, 24, 87)
|
||||
hostname = string.match(s3, "(.-)%z")
|
||||
|
||||
-- get the vendor (should be 64 octets, but capture to end of the string to be safe)
|
||||
local s4, length
|
||||
length = string.len(result)
|
||||
s4 = string.sub(result, 88, length)
|
||||
vendor = string.match(s4, "(.-)%z")
|
||||
|
||||
port.version.name = "pptp"
|
||||
port.version.name_confidence = 10
|
||||
if vendor ~= nil then port.version.product = vendor end
|
||||
if firmware ~= 0 then port.version.version = "(Firmware: " .. firmware .. ")" end
|
||||
if hostname ~= nil then port.version.hostname = hostname end
|
||||
|
||||
port.version.service_tunnel = "none"
|
||||
nmap.set_port_version(host, port, "hardmatched")
|
||||
end
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user