7¤0ìým´QxU«ØÀÓӤŒْ‡¹àWDe|@ [‹g¾Kð4io¸¶!WHÈü-ܢĪªÒÿúÿ—ÿú¤€×0Œ%EH ›üWlÿެö޵3Ëãã Fã¡\4›-å` «s‘8Jr¥BÆC„õ’Ô)dpos, ya que el cortafuegos anularía las sondas o las respuestas a las mismas\&. .RE .PP \fB\-P0\fR (No realizar ping) .RS 4 Con esta opción, Nmap no realiza la etapa de descubrimiento\&. Bajo circunstancias normales, Nmap utiliza dicha etapa para determinar qué máquinas se encuentran activas para hacer un análisis más agresivo\&. Por omisión, Nmap sólo realiza ese tipo de sondeos, como análisis de puertos, detección de versión o de sistema operativo contra los equipos que se están «vivos»\&. Si se deshabilita el descubrimiento de sistemas con la opción \fB\-P0\fR entonces Nmap utilizará las funciones de análisis solicitadas contra \fItodas\fR las direcciones IP especificadas\&. Por lo tanto, si se especifica una red del tamaÃME .. ".timeout")) local version = stdnse.get_script_args(SCRIPT_NAME .. ".version") or 2 timeout = (timeout or 7) * 1000 if version ~= 'all' then version = tonumber(version) end local responses, results, interfaces, lthreads = {}, {}, {}, {} local result, grouptable, sourcetable local group_names_fname = stdnse.get_script_args(SCRIPT_NAME .. ".mgroupnamesdb") or nmap.fetchfile("nselib/data/mgroupnames.db") local mg_names_db = group_names_fname and mgroup_names_fetch(group_names_fname) local collect_interfaces = function (if_table) if if_table and if_table.up == "up" and if_table.link=="ethernet" and if_table.address:match("%d+%.%d+%.%d+%.%d+") then interfaces[#interfaces+1] = if_table end end stdnse.get_script_interfaces(collect_interfaces) -- We should iterate over interfaces for _, interface in pairs(interfaces) do local co = stdnse.new_thread(igmpListener, interface, timeout, responses) igmpQuery(interface, version) lthreads[co] = true end local condvar = nmap.condvar(responses) -- Wait for the listening threads to finish repeat for thread in pairs(lthreads) do if coroutine.status(thread) == "dead" then lthreads[thread] = nil end end if ( next(lthreads) ) then condvar("wait") end until next(lthreads) == nil; -- Output useful info from the responses if #responses > 0 then -- We should sort our list here. -- This is useful to have consistent results for tools such as Ndiff. table.sort(responses, respCompare) for _, response in pairs(responses) do result = {} result.name = response.src table.insert(result, "Interface: " .. response.interface) -- Add to new targets if newtargets script arg provided if target.ALLOW_NEW_TARGETS then target.add(response.src) end if response.type == 0x12 then table.insert(result, "Version: 1") table.insert(result, "Multicast group: ".. response.group) rver ready\r\n| p/Nomadix AG $1 ftpd/ v/$2/ d/WAP/ cpe:/h:nomadix:ag_$1/a match ftp m|^220 Welcome to Easy File Sharing FTP Server!\r\n| p/Easy File Sharing ftpd/ o/Windows/ cpe:/a:efssoft:easy_file_sharing_ftp_server/ cpe:/o:microsoft:windows/a match ftp m|^220- \*+\r\n220- \r\n220- Welcome to Dream FTP Server\r\n220- Copyright 2002 - 2004\r\n220- BolinTech Inc\.\r\n| p/BolinTech Dream FTP Server/ o/Windows/ cpe:/o:microsoft:windows/a match ftp m|^220 Welcome to the Netburner FTP server\.\r\n| p/Netburner embedded device ftpd/ d/specialized/ match ftp m|^220 NetBotz FTP Server ([\w._-]+) ready\.\r\n| p/NetBotz network monitor ftpd/ v/$1/ d/security-misc/ match ftp m|^220 TOSHIBA e-STUDIO5500c FTP server \(([\w._-]+)\) ready\.\r\n| p/Toshiba e-STUDIO5500c printer ftpd/ v/$1/ d/printer/ cpe:/h:toshiba:e-studio5500c/a match ftp m|^220 \(WJ-HD220 FTP Server version ([\w._-]+) Ready\)\r\n| p/Panasonic WJ-HD220 ftpd/ v/$1/ d/media device/ match ftp m|^(?:220-.*\r\n)*220 ([\w._-]+) FTP server \(EMC-SNAS: ([\w._-]+)\) ready\.\r\n| p/EMC Scalable Network Accelerator ftpd/ v/$2/ h/$1/ match ftp m|^220-CentOS release ([\w._-]+) .*\r\n220 ProFTPD ([\w._-]+) Server \(ProFTPD Default Installation\)|s p/ProFTPD/ v/$2/ i/CentOS $1/ o/Linux/ cpe:/a:proftpd:proftpd:$2/a cpe:/o:centos:centos/ match ftp m|^220 TCAdmin FTP Server\r\n| p/Balance Servers TCAdmin game hosting ftpd/ o/Windows/ cpe:/o:microsoft:windows/a match ftp m|^.* klogd: klogd started: BusyBox v([\w._-]+) \(.*\)\r\nDoing BRCTL \.\.\.\r\nsetfilter br0 0 \r\n/var/tmp/act_firewall: No such file or directory\r\n| p/Actiontec router ftpd/ i/firewall broken; BusyBox $1/ d/broadband router/ cpe:/a:busybox:busybox:$1/ # these should be fine. embyte match ftp m|^220 .*BlackJumboDog Version ([^ ]+)| p/Blackjumbodog FTPd/ v/$1/ match ftp m|^220[- ] ?[Cc]rob FTP [Ss]erver [Vv]?([-.\d\w]+)| p/Crob FTPd/ v/$1/ match ftp m|^220.* GlobalSCAPE Secure FTP Server \(v\. ([^\)]+)\)| p/GlobalSCAPE Secure FTPd/ v/$1/ o/Wincontrol permitted-cross-domain-policies="master-only"/>\r\n \r\n\r\n| p/Facebook cross-domain policy/ softmatch adobe-crossdomain m|^<\?xml version=\"1\.0\"\?>.*|s match afsmain m|^\+Welcome to Ability FTP Server \(Admin\)\. \[20500\]\r\n| p/Code-Crafters Ability FTP Server afsmain admin/ o/Windows/ cpe:/a:code-crafters:ability_ftp_server/ cpe:/o:microsoft:windows/a match airserv-ng m|^\x05\0\0\x01.\0\0\0\0....\xff\xff\xff.\0\0\0\0\0\0\0.\0\0\0\0\0\x0fB@\0\0\0.\x80\0\0\0\xff\xff\xff\xff\xff\xff|s p/airserv-ng/ cpe:/a:aircrack-ng:airserv-ng/ match altiris-agent m|^<\0r\0e\0s\0p\0o\0n\0s\0e\0>\0C\0o\0n\0n\0e\0c\0t\0e\0d\0 \0t\0o\0 [\0\d.]*<\0/\0r\0e\0s\0p\0o\0n\0s\0e\0>\0$| p/Altiris remote monitoring agent/ # AMANDA index server 2.4.2p2 on Linux 2.4 match amanda m|^220 ([-.\w]+) AMANDA index server \((\d[-.\w ]+)\) ready\.\r\n| p/Amanda backup system index server/ v/$2/ o/Unix/ h/$1/ cpe:/a:amanda:amanda:$2/ match amanda m|^501 Could not read config file [^!\r\n]+!\r\n220 ([-.\w]+) AMANDA index server \(([-\w_.]+)\) ready\.\r\n| p/Amanda backup system index server/ v/$2/ i/broken: config file not found/ h/$1/ cpe:/a:amanda:amanda:$2/ match amanda m|^ld\.so\.1: amandad: fatal: (libsunmath\.so\.1): open failed: No such file or directory\n$| p/Amanda backup system index server/ i/broken: $1 not found/ cpe:/a:amanda:amanda/ match amanda m|^\n\*\* \(process:\d+\): CRITICAL \*\*: GLib version too old \(micro mismatch\): Amanda was compiled with glib-[\d.]+, but linking with ([\d.]+)\n| p/Amanda backup system index server/ i/broken: GLib $1 too old/ cpe:/a:amanda:amanda/ match AndroMouse m|^AMServer$|s p/AndroMouse Android remote mouse server/ match antivir m|^220 Symantec AntiVirus Scan Engine ready\.\r\n| p/Symantec AntiVirus Scan Engine/ cpe:/a:symantec:antivirus/ cpe:/a:symantec:antivirus_scan_engine/ match antivir m|^200 NOD32SS ([\d.]+) \((\d+)\)\r\n| p/Nime de tentative de conexiune in loguri venind de la o singura sursa trebuie sa stie ca a fost scanat prin metoda connect\&. .RE .PP \fB\-sU\fR(Scanare UDP) .RS 4 In tim ce multe servicii in Internet ruleaza prin protocolul TCP, serviciile \m[blue]\fBUDP\fR\m[]\&\s-2\u[5]\d\s+2sunt si ele raspandite\&. DNS, SNMP si DHCP (porturile inregistrate 53, 161/162 si 67/68) sunt trei dintre cele mai comune\&. Deoarece scanarea UDP este in general lenta si mai dificila decat TCP, unii auditori de securitate ignora aceste porturi\&. Aceasta este o greseala, deoarece serviciile UDP exploatabile sunt destul de cunoscute si atacatorii cu siguranta nu vor ignora un intreg protocol\&. Din fericire, Nmap poate ajuta la inventarierea porturilor UDP\&. .sp Scanarea UDP este acivata cu optiunea \fB\-sU\fR\&. Poate fi combinata cu o scanare TCP cum ar fi scanrea SYN ( \fB\-sS\fR) pentru a verifica ambele protocoale in timpul aceleiasi scanari\&. .sp Scanarea UDP functioneaza prin trimiterea de headere UDP goale (fara date) la fiecare port specificat al masinii tinta\&. Daca un mesaj ICMP de port inaccesibil (tipul 3, codul 3) este returnat, portul este closed (inchis)\&. Alte mesaje ICMP de port care nu poate fi atins (tipul 3, codurile 1, 2, 9, 10 sau 13) marcheaza portul ca filtered (filtrat)\&. Ocazional, un serviciu poate raspunde cu un pachet UDP, demonstrand faptul ca este open (deschis)\&. Daca nici un raspuns nu este primit dupa mai multe retransmisii atunci portul este catalogat ca open|filtered (deschis|filtrat)\&. Asta inseamna ca portul poate fi deschis sau poate un filtru de pachete blocheaza comunicatia\&. Scanarile de versiune ( \fB\-sV\fR) pot fi folosite pentru a ne ajuta sa diferentiem porturile cu adevarat deschise de cele filtrate\&. .sp O mare incercare in scanarea UDP o reprezinta realizarea acesteia rapid\&. Porturile deschise si filtrate rareori trimit raspuns, lasand Nmapul sa astepte si apoi sa retrimita pachetul pentru situatia in care proba sau raspunsul s\nsert( results, result_part ) end end socket:close() results.name = TEMPLATE_NAME table.insert(results, "") table.insert(results, {name = "Additional information", ("The audit was performed using the db-account: %s"):format(username), ("The following admin accounts were excluded from the audit: %s"):format(table.concat(ADMIN_ACCOUNTS, ",")) }) return stdnse.format_output(true, { results }) end --- -- TNS Library supporting a very limited subset of Oracle operations -- -- Summary -- ------- -- The library currently provides functionality to connect and authenticate -- to the Oracle database server. Some preliminary query support has been -- added, which only works against a few specific versions. The library has -- been tested against and known to work with Oracle 10g and 11g. Please check -- the matrix below for tested versions that are known to work. -- -- Due to the lack of documentation the library is based mostly on guesswork -- with a lot of unknowns. Bug reports are therefore both welcome and -- important in order to further improve this library. In addition, knowing -- that the library works against versions not in the test matrix is valuable -- as well. -- -- Overview -- -------- -- The library contains the following classes: -- -- o Packet.* -- - The Packet classes contain specific packets and function to serialize -- them to strings that can be sent over the wire. Each class may also -- contain a function to parse the servers response. -- -- o Comm -- - Implements a number of functions to handle communication -- -- o Crypt -- - Implements encryption algorithms and functions to support -- authentication with Oracle 10G and Oracle 11G. -- -- o Helper -- - A helper class that provides easy access to the rest of the library -- -- -- Example -- ------- -- The following sample code illustrates how scripts can use the Helper class -- to interface the library: -- -- -- tnshelper = tns.Helperp_styles simplepie top_searches webform_features views_ical jquery_ajax_load textimage nodeaccess_nodereference timeline uc_ssl block_term og_user_roles linkit_target syntaxhighlighter_insert commerce_fees subpath_alias tcontact css_browser_selector restrict_by_ip features_diff webform_php profile_permission todolist crm_core cacheflush geofield_ymap apachesolr_sort uc_checkout_tweaks inactive_user field_collection_node_clone htaccess modules_weight simplified_modules uc_affiliate2 node_breadcrumb joomla workflow_extensions tf_views basic_cart cleanpager borealis google_analytics_et mass_pwreset fileshare statistics_filter gallery_assist_ic uc_tc every_field opigno_quiz_app taxonomy_list feeds_comment_processor contact_importer profile_role submitagain omega_ui attachment_links tracking_code drupal_form remote_file_source role_watchdog rel magnific_popup teaserbytype contact_attach field_countdown matrix word_link blockanonymouslinks afb workflow_fields hint views_simple_pager file_formatters commerce_add_to_cart_extras field_delimiter facebook_wall phpbbforum file_aliases node_adoption feeds_youtube hreflang filter_harmonizer book_access better_watchdog_ui commerce_moneybookers link_css imce_watermark field_collection_feeds asset google_webfont_loader_api duplicate_role agrcache media_archive favorites captcha_webform seowatcher commerce_custom_line_items sitecatalyst taxonomy_vtn acquia_search_multi_subs panopoly_demo slideshow commerce_product_bundle content_theme simplecrop course sfweb2lead_webform zipcode imagefield_import context_redirect pollfield facetapi_taxonomy_sort geonames commerce_conditions commerce_price_table google_store_locator boost_expire node_noindex responsive_tables webform_autocomplete search_engine_referers date_repeat_instance creative_commons opigno_class_app uc_atctweaks answers dynamic_persistent_menu facetapi_collapsible uc_product_minmax flexslider_entityreference uc_donation term_level commerce_billy_mail node_registration filterbтветствующий целевому IP, чтобы правильно адресовать фрейм\&. Это часто бывает медленно и проблематично, т\&.к\&. операционные системы не были написаны с учетом того, что им придется посылать миллионы ARP запросов недоступным хостам в короткий промежуток времени\&. .sp ARP сканирование позволяет Nmap вместо ARP запросов использовать свои собственные оптимизированные алгоритмы\&. И если Nmap получает ответ, то ей даже нет необходимости беспокоиться о других типах обнаружения хостов, основанных на IP пакетах\&. Этот делает ARP сканирование более быстрым и надежным\&. Поэтому оно применяется по умолчанию для сканирования локальных сетей\&. Даже если указаны другие типы сканирования (как \fB\-PE\fR или \fB\-PS\fR), Nmap все равно использует ARP сканирование для машин локальной сети\&. Если вы абсолютно не хотите использовать такой тип сканирования, то задайте опцию \fB\-\-send\-ip\fR\&. .RE .PP \fB\-\-traceroute\fR (Отслеживать путь к хосту) .RS 4 Отслеживание осуществляется после сканирования, используя результаты этого сканирования для определения порта и протокола, с помощью которых можно будет достичь цели\&. Процедура работает сÐик\&. В то время, как Nmap обычно используется для проверки безопасности, многие системные администраторы находят ее полезной для обычных задач, таких как контролирование структуры сети, управление расписаниями запуска служб и учет времени работы хоста или службы\&. .PP Выходные данные Nmap это список просканированных целей с дополнительной информацией по каждой из них в зависимости от заданных опций\&. Ключевой информацией является «таблица важных портов»\&. Эта таблица содержит номер порта, протокол, имя службы и состояние\&. Состояние может иметь значение open (открыт), filtered (фильтруется), closed (закрыт) или unfiltered (не фильтруется)\&. Открыт означает, что приложение на целевой машине готово для установки соединения/принятия пакетов на этот порт\&. Фильтруется означает, что брандмауэр, сетевой фильтр, или какая\-то другая помеха в сети блокирует порт, и Nmap не может установить открыт этот порт или закрыт\&. Закрытые порты не связаны ни с каким приложением, но могут быть открыты в любой момент\&. Порты расцениваются как не фильтрованные, когда они отвечают на запросы Nmap, но Nmap не может определить Ð and nmap.verbosity()-nmap.debugging()) or 0 end '\" t .\" Title: nmap .\" Author: [see the "Authors" section] .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: 08/06/2025 .\" Manual: Nmap Reference Guide .\" Source: Nmap .\" Language: English .\" .TH "NMAP" "1" "08/06/2025" "Nmap" "Nmap Reference Guide" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" nmap \- Network exploration tool and security / port scanner .SH "SYNOPSIS" .HP \w'\fBnmap\fR\ 'u \fBnmap\fR [\fIScan\ Type\fR...] [\fIOptions\fR] {\fItarget\ specification\fR} .SH "DESCRIPTION" .PP Nmap (\(lqNetwork Mapper\(rq) is an open source tool for network exploration and security auditing\&. It was designed to rapidly scan large networks, although it works fine against single hosts\&. Nmap uses raw IP packets in novel ways to determine what hosts are available on the network, what services (application name and version) those hosts are offering, what operating systems (and OS versions) they are running, what type of packet filters/firewalls are in use, and dozens of other characteristics\&. While Nmap is commonly used fzj0EAwMwRTELMAkGA1UEBhMCVVMxFDASBgNV BAoMC0FmZmlybVRydXN0MSAwHgYDVQQDDBdBZmZpcm1UcnVzdCBQcmVtaXVtIEVDQzAeFw0xMDAx MjkxNDIwMjRaFw00MDEyMzExNDIwMjRaMEUxCzAJBgNVBAYTAlVTMRQwEgYDVQQKDAtBZmZpcm1U cnVzdDEgMB4GA1UEAwwXQWZmaXJtVHJ1c3QgUHJlbWl1bSBFQ0MwdjAQBgcqhkjOPQIBBgUrgQQA IgNiAAQNMF4bFZ0D0KF5Nbc6PJJ6yhUczWLznCZcBz3lVPqj1swS6vQUX+iOGasvLkjmrBhDeKzQ N8O9ss0s5kfiGuZjuD0uL3jET9v0D6RoTFVya5UdThhClXjMNzyR4ptlKymjQjBAMB0GA1UdDgQW BBSaryl6wBE1NSZRMADDav5A1a7WPDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAK BggqhkjOPQQDAwNnADBkAjAXCfOHiFBar8jAQr9HX/VsaobgxCd05DhT1wV/GzTjxi+zygk8N53X 57hG8f2h4nECMEJZh0PUUd+60wkyWs6Iflc9nF9Ca/UHLbXwgpP5WW+uZPpY5Yse42O+tYHNbwKM eQ== -----END CERTIFICATE----- Certum Trusted Network CA ========================= -----BEGIN CERTIFICATE----- MIIDuzCCAqOgAwIBAgIDBETAMA0GCSqGSIb3DQEBBQUAMH4xCzAJBgNVBAYTAlBMMSIwIAYDVQQK ExlVbml6ZXRvIFRlY2hub2xvZ2llcyBTLkEuMScwJQYDVQQLEx5DZXJ0dW0gQ2VydGlmaWNhdGlv biBBdXRob3JpdHkxIjAgBgNVBAMTGUNlcnR1bSBUcnVzdGVkIE5ldHdvcmsgQ0EwHhcNMDgxMDIy MTIwNzM3WhcNMjkxMjMxMTIwNzM3WjB+MQswCQYDVQQGEwJQTDEiMCAGA1UEChMZVW5pemV0byBU ZWNobm9sb2dpZXMgUy5BLjEnMCUGA1UECxMeQ2VydHVtIENlcnRpZmljYXRpb24gQXV0aG9yaXR5 MSIwIAYDVQQDExlDZXJ0dW0gVHJ1c3RlZCBOZXR3b3JrIENBMIIBIjANBgkqhkiG9w0BAQEFAAOC AQ8AMIIBCgKCAQEA4/t9o3K6wvDJFIf1awFO4W5AB7ptJ11/91sts1rHUV+rpDKmYYe2bg+G0jAC l/jXaVehGDldamR5xgFZrDwxSjh80gTSSyjoIF87B6LMTXPb865Px1bVWqeWifrzq2jUI4ZZJ88J J7ysbnKDHDBy3+Ci6dLhdHUZvSqeexVUBBvXQzmtVSjF4hq79MDkrjhJM8x2hZ85RdKknvISjFH4 fOQtf/WsX+sWn7Et0brMkUJ3TCXJkDhv2/DM+44el1k+1WBO5gUo7Ul5E0u6SNsv+XLTOcr+H9g0 cvW0QM8xAcPs3hEtF10fuFDRXhmnad4HMyjKUJX5p1TLVIZQRan5SQIDAQABo0IwQDAPBgNVHRMB Af8EBTADAQH/MB0GA1UdDgQWBBQIds3LB/8k9sXN7buQvOKEN0Z19zAOBgNVHQ8BAf8EBAMCAQYw DQYJKoZIhvcNAQEFBQADggEBAKaorSLOAT2mo/9i0Eidi15ysHhE49wcrwn9I0j6vSrEuVUEtRCj jSfeC4Jj0O7eDDd5QVsisrCaQVymcODU0HfLI9MA4GxWL+FpDQ3Zqr8hgVDZBqWo/5U30Kr+4rP1 mS1FhIrlQgnXdAIv94nYmem8J9RHjboNRhx3zxSkHLmkMcScKHQDNP8zGSal6Q10tz6XxnboJ5aj Zt3hrvJBW8qYVoNzcOSGGtIxQbovvi0TWnZvTuhOgQ4/WwMioBK+ZlgRSssDxLQqKi2WF+A5VLxI 0vFSDJ3gyICh3WZlXi/EjJKSZp4A== -----END CERTIFICATE----- GlobalSign Root CA - R2 ======================= -----BEGIN CERTIFICATE----- MIIDujCCAqKgAwIBAgILBAAAAAABD4Ym5g0wDQYJKoZIhvcNAQEFBQAwTDEgMB4GA1UECxMXR2xv YmFsU2lnbiBSb290IENBIC0gUjIxEzARBgNVBAoTCkdsb2JhbFNpZ24xEzARBgNVBAMTCkdsb2Jh bFNpZ24wHhcNMDYxMjE1MDgwMDAwWhcNMjExMjE1MDgwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxT aWduIFJvb3QgQ0EgLSBSMjETMBEGA1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2ln bjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKbPJA6+Lm8omUVCxKs+IVSbC9N/hHD6 ErPLv4dfxn+G07IwXNb9rfF73OX4YJYJkhD10FPe+3t+c4isUoh7SqbKSaZeqKeMWhG8eoLrvozp s6yWJQeXSpkqBy+0Hne/ig+1AnwblrjFuTosvNYSuetZfeLQBoZfXklqtTleiDTsvHgMCJiEbKjN S7SgfQx5TfC4LcshytVsW33hoCmEofnTlEnLJGKRILzdC9XZzPnqJworc5HGnRusyMvo4KD0L5CL TfuwNhv2GXqF4G3yYROIXJ/gkwpRl4pazq+r1feqCapgvdzZX99yqWATXgAByUr6P6TqBwMhAo6C ygPCm48CAwEAAaOBnDCBmTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4E FgQUm+IHV2ccHsBqBt5ZtJot39wZhi4wNgYDVR0fBC8wLTAroCmgJ4YlaHR0cDovL2NybC5nbG9i YWxzaWduLm5ldC9yb290LXIyLmNybDAfBgNVHSMEGDAWgBSb4gdXZxwewGoG3lm0mi3f3BmGLjAN BgkqhkiG9w0BAQUFAAOCAQEAmYFThxxol4aR7OBKuEQLq4GsJ0/WwbgcQ3izDJr86iw8bmEbTUsp 9Z8FHSbBuOmDAGJFtqkIk7mpM0sYmsL4h4hO291xNBrBVNpGP+DTKqttVCL1OmLNIG+6KYnX3ZHu 01yiPqFbQfXf5WRDLenVOavSot+3i9DAgBkcRcAtjOj4LaR0VknFBbVPFd5uRHg5h6h+u/N5GJG7 9G+dwfCMNYxdAfvDbbnvRG15RjF+Cv6pgsH/76tuIMRQyV+dTZsXjAzlAcmgQWpzU/qlULRuJQ/7 TBj0/VLZjmmx6BEP3ojY+x1J96relc8geMJgEtslQIxq/H5COEBkEveegeGTLg== -----END CERTIFICATE----- Verisign Class 3 Public Primary Certification Authority - G3 ============================================================ -----BEGIN CERTIFICATE----- MIIEGjCCAwICEQCbfgZJoz5iudXukEhxKe9XMA0GCSqGSIb3DQEBBQUAMIHKMQswCQYDVQQGEwJV UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdv cmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl IG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDMgUHVibGljIFByaW1hcnkgQ2VydGlmaWNh dGlvbiBBdXRob3JpdHkgLSBHMzAeFw05OTEwMDEwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMIHKMQsw CQYDVQ"] = { cmd = "EXPN", success = { [250] = "Requested mail action okay, completed", }, errors = { [550] = "Requested action not taken: mailbox unavailable", [500] = "Syntax error, command unrecognised", [501] = "Syntax error in parameters or arguments", [502] = "Command not implemented", [504] = "Command parameter not implemented", [421] = " Service not available, closing transmission channel", }, }, } --- -- Returns a domain to be used in the SMTP commands that need it. -- -- If the user specified one through the script argument -- smtp.domain this function will return it. Otherwise it will try -- to find the domain from the typed hostname and from the rDNS name. If it -- still can't find one it will return the nmap.scanme.org by default. -- -- @param host The host table -- @return The hostname to be used by the different SMTP commands. get_domain = function(host) local nmap_domain = "nmap.scanme.org" -- Use the user provided options. local result = stdnse.get_script_args("smtp.domain") if not result then if type(host) == "table" then if host.targetname then result = host.targetname elseif (host.name and #host.name ~= 0) then result = host.name end end end return result or nmap_domain end --- Gets the authentication mechanisms that are listed in the response -- of the client's EHLO command. -- -- @param response The response of the client's EHLO command. -- @return An array of authentication mechanisms on success, or nil -- when it can't find authentication. get_auth_mech = function(response) local list = {} for _, line in pairs(stringaux.strsplit("\r?\n", response)) do local authstr = line:match("%d+%-AUTH%s(.*)$") if authstr then for mech in authstr:gmatch("[^%s]+") do table.insert(list, mech) end return list end end return nil end --- Checks the SMTP server reply to name=src_path}) .. encode_path({type=PATH_TYPE.UTF8Name, name=dst_path}) .. encode_path({type=PATH_TYPE.UTF8Name, name=new_name}) packet = self:create_fp_packet( REQUEST.Command, data_offset, data ) self:send_fp_packet( packet ) return self:read_fp_packet() end, --- Sends an GetStatus DSI request (which is basically a FPGetSrvrInfo -- AFP request) to the server and handles the response -- -- @return status (true or false) -- @return table with server information (if status is true) or error string -- (if status is false) fp_get_server_info = function(self) local packet local data_offset = 0 local response, result = {}, {} local offsets = {} local pos local status local data = string.pack("Bx", COMMAND.FPGetSrvrInfo) packet = self:create_fp_packet(REQUEST.GetStatus, data_offset, data) self:send_fp_packet(packet) response = self:read_fp_packet() if response:getErrorCode() ~= ERROR.FPNoErr then return response end packet = response.packet -- parse and store the offsets in the 'header' offsets.machine_type, offsets.afp_version_count, offsets.uam_count, offsets.volume_icon_and_mask, pos = string.unpack(">I2I2I2I2", packet.data) -- the flags are directly in the 'header' result.flags = {} result.flags.raw, pos = string.unpack(">I2", packet.data, pos) -- the short server name is stored directly in the 'header' as -- well result.server_name, pos = string.unpack("s1", packet.data, pos) -- Server offset should begin at an even boundary see link below -- http://developer.apple.com/mac/library/documentation/Networking/Reference/AFP_Reference/Reference/reference.html#//apple_ref/doc/uid/TP40003548-CH3-CHDIEGED if (pos + 1) % 2 ~= 0 then pos = pos + 1 end -- and some more offsets offsets.server_signature, offsets.network_addresses_count, offsets.directory_names_count, offsets.utf8_servuipmentUri = response['body']:find("equipmentUri",nextequipmentUri) table.insert(devices, device) count = count + 1 end output["devices"] = devices end end stdnse.debug2("status-line: "..response['status-line']) local error = response['status-line']:match('Error') if error then stdnse.debug2("Request returned a network error.") return nil, "Request returned a network error." end -- Set the port version port.version.name = "http" port.version.name_confidence = 10 port.version.product = output["productName"] port.version.version = output["productVersion"] port.version.devicetype = output["hardwareType"] table.insert(port.version.cpe, "cpe:/h:".. output["vendorName"] .. ":" .. output["productName"]) nmap.set_port_version(host, port, "hardmatched") return output end end action = function(host,port) -- Identify servers that answer 200 to invalid HTTP requests and exit as these would invalidate the tests local status_404, result_404, _ = http.identify_404(host,port) if ( status_404 and result_404 == 200 ) then stdnse.debug1("Exiting due to ambiguous response from web server on %s:%s. All URIs return status 200.", host.ip, port.number) return nil end return GetInformation(host, port) end local shortport = require "shortport" local netbios = require "netbios" local nmap = require "nmap" local stdnse = require "stdnse" local string = require "string" local table = require "table" description = [[ Retrieves IP addresses of the target's network interfaces via NetBIOS NS. Additional network interfaces may reveal more information about the target, including finding paths to hidden non-routed networks via multihomed systems. ]] --- -- @usage -- nmap -sU -p 137 --script nbns-interfaces -- -- @output -- PORT STATE SERVICE -- 137/udp open netbios-ns -- | nbns-interfaces: -- | hostname: NOTEBOOK-NB3 -- | interfaces: -- | 10.5.4.89 -- | 192.168.56.1 -- |_ [0x024E] = 0x024F, -- LATIN CAPITAL LETTER Y WITH STROKE [0x024F] = {status="valid"}, -- LATIN SMALL LETTER Y WITH STROKE -- LATIN SMALL LETTER S WITH SWASH TAIL..LATIN SMALL LETTER Z WITH SWASH TAIL [0x023F] = {status="valid"}, [0x0240] = {status="valid"}, [0x02B0] = 0x0068, -- MODIFIER LETTER SMALL H [0x02B1] = 0x0266, -- MODIFIER LETTER SMALL H WITH HOOK [0x02B2] = 0x006A, -- MODIFIER LETTER SMALL J [0x02B3] = 0x0072, -- MODIFIER LETTER SMALL R [0x02B4] = 0x0279, -- MODIFIER LETTER SMALL TURNED R [0x02B5] = 0x027B, -- MODIFIER LETTER SMALL TURNED R WITH HOOK [0x02B6] = 0x0281, -- MODIFIER LETTER SMALL CAPITAL INVERTED R [0x02B7] = 0x0077, -- MODIFIER LETTER SMALL W [0x02B8] = 0x0079, -- MODIFIER LETTER SMALL Y -- MODIFIER LETTER LEFT ARROWHEAD..MODIFIER LETTER DOWN ARROWHEAD [0x02C2] = {status="disallowed"}, [0x02C3] = {status="disallowed"}, [0x02C4] = {status="disallowed"}, [0x02C5] = {status="disallowed"}, [0x02D8] = {status="disallowed"}, -- BREVE [0x02D9] = {status="disallowed"}, -- DOT ABOVE [0x02DA] = {status="disallowed"}, -- RING ABOVE [0x02DB] = {status="disallowed"}, -- OGONEK [0x02DC] = {status="disallowed"}, -- SMALL TILDE [0x02DD] = {status="disallowed"}, -- DOUBLE ACUTE ACCENT [0x02DE] = {status="disallowed"}, -- MODIFIER LETTER RHOTIC HOOK [0x02DF] = {status="disallowed"}, -- MODIFIER LETTER CROSS ACCENT [0x02E0] = 0x0263, -- MODIFIER LETTER SMALL GAMMA [0x02E1] = 0x006C, -- MODIFIER LETTER SMALL L [0x02E2] = 0x0073, -- MODIFIER LETTER SMALL S [0x02E3] = 0x0078, -- MODIFIER LETTER SMALL X [0x02E4] = 0x0295, -- MODIFIER LETTER SMALL REVERSED GLOTTAL STOP [0x02EC] = {status="valid"}, -- MODIFIER LETTER VOICING [0x02ED] = {status="disallowed"}, -- MODIFIER LETTER UNASPIRATED [0x02EE] = {status="valid"}, -- MODIFIER LETTER DOUBLE APOSTROPHE [0x0340] = 0x0300, -- COMBINING GRAVE TONE MARK [0x0341] = 0x0301, -- COMBINING ACUTE TONE MARK [0x0342] = {status="valid"}, -- COMBINING GREEK PERISPOMENI [0x0343] = 0x0313,hreads) do if ( coroutine.status(t) == "dead" ) then threads[t] = nil end end if ( next(threads) ) then condvar "wait" end until( next(threads) == nil ) -- urls that could not be retrieved due to low level errors, such as -- failure in socket send or receive local failure_urls = {} -- urls that elicited a 200 OK response local success_urls = {} -- urls that got some non-404-type response local urls_by_code = {} for _, r in ipairs(result) do if ( r.status == -1 ) then table.insert(failure_urls, r.url) elseif ( r.status == 200 ) then table.insert(success_urls, r.url) elseif r.status ~= status_404 then local s = tostring(r.status) urls_by_code[s] = urls_by_code[s] or {} table.insert(urls_by_code[s], r.url) end end local output = stdnse.output_table() if next(failure_urls) then output.errors = failure_urls end if next(success_urls) then output.discovered = success_urls end if next(urls_by_code) then output["other responses"] = urls_by_code end if #output > 0 then return output end end local brute = require "brute" local creds = require "creds" local shortport = require "shortport" local stdnse = require "stdnse" local string = require "string" local table = require "table" description = [[ Performs brute force password auditing against the pcAnywhere remote access protocol. Due to certain limitations of the protocol, bruteforcing is limited to single thread at a time. After a valid login pair is guessed the script waits some time until server becomes available again. ]] --- -- @usage -- nmap --script=pcanywhere-brute -- -- @output -- 5631/tcp open pcanywheredata syn-ack -- | pcanywhere-brute: -- | Accounts -- | administrator:administrator - Valid credentials -- | Statistics -- |_ Performed 2 guesses in 55 seconds, average tps: 0 -- -- @args pcanywhere-brute.timeout socket timeout for connecting to PCAnywhere (default, .. msrpctypes.marshall_winreg_AccessMask('MAXIMUM_ALLOWED_ACCESS') -- [out,ref] policy_handle *handle -- Do the call status, result = call_function(smbstate, 0x01, arguments) if(status ~= true) then return false, result end stdnse.debug3("MSRPC: OpenHKCU() returned successfully") -- Make arguments easier to use arguments = result['arguments'] pos = 1 -- [in] uint16 *system_name, -- [in] winreg_AccessMask access_mask, -- [out,ref] policy_handle *handle pos, result['handle'] = msrpctypes.unmarshall_policy_handle(arguments, pos) pos, result['return'] = msrpctypes.unmarshall_int32(arguments, pos) if(result['return'] == nil) then return false, "Read off the end of the packet (winreg.openhkcu)" end if(result['return'] ~= 0) then return false, smb.get_status_name(result['return']) .. " (winreg.openhkcu)" end return true, result end ---Calls the Windows registry function EnumKey, which returns a single key -- under the given handle, at the index of 'index'. -- --@param smbstate The SMB state table --@param handle A handle to hive or key. winreg_openhku provides a usable key, for example. --@param index The index of the key to return. Generally you'll start at 0 and increment until -- an error is returned. --@param name The name buffer. This should be set to the empty string; however, setting to 'nil' can have -- interesting effects on Windows 2000 (I experienced crashes). --@return (status, result) If status is false, result is an error message. Otherwise, result is a table of values, the most -- useful one being 'name', which is the name of the current key function winreg_enumkey(smbstate, handle, index, name) local status, result local arguments local pos, align stdnse.debug2("MSRPC: Calling EnumKey(%d) [%s]", index, smbstate['ip']) -- [in,ref] policy_handle *handle, a elseif ( comm.version < 3 ) then status, data = comm:GetAdditionalBytes( data, pos, 32 ) if (not(status)) then return false, "Mount: Failed to call GetAdditionalBytes" end fhandle, pos = string.unpack( "c32", data, pos ) else return false, "Mount failed" end return true, fhandle end, --- Attempts to unmount a remote export in order to get the filehandle -- -- @param comm object handles rpc program information and -- low-level packet manipulation -- @param path string containing the path to mount -- @return status success or failure -- @return error string containing error if status is false Unmount = function(self, comm, path) local packet, status local _, pos, data, header, fhandle = "", 1, "", "", {} data = Util.marshall_vopaque(path) packet = comm:EncodePacket( nil, Mount.Procedure.UMNT, { type=Portmap.AuthType.UNIX }, data ) if (not(comm:SendPacket(packet))) then return false, "Unmount: Failed to send data" end status, data = comm:ReceivePacket( ) if ( not(status) ) then return false, "Unmount: Failed to read data from socket" end pos, header = comm:DecodeHeader( data, pos ) if not header then return false, "Unmount: Failed to decode header" end if header.type ~= Portmap.MessageType.REPLY then return false, "Unmount: Packet was not a reply" end if header.state ~= Portmap.State.MSG_ACCEPTED then if (Portmap.RejectMsg[header.denied_state]) then return false, string.format("Unmount: RPC call failed: %s", Portmap.RejectMsg[header.denied_state]) else return false, string.format("Unmount: RPC call failed: code %d", header.state) end end if header.accept_state ~= Portmap.AcceptState.SUCCESS then if (Portmap.AcceptMsg[header.accept_state]) then return false, string.format("Unmount (%s): RPC accepted state: %s", path, Portma-byte string. -- @return An 8-byte string. function DES_string_to_key(data) local table = require 'table' --[[ This is compiled list of known IKE vendor IDs. Most of the VIDs have been copied from ike-scan with permission from the original author, Roy Hills, so a big 'thank you' is in order. -- http://www.nta-monitor.com/wiki/index.php/Ike-scan_Documentation Unknown ids: ab926d9ee113a0219557fcc54e52865c (Citrix NetScaler ?) 5062b335bc20db32c0d54465a2f70100 (fortigate ?) 4f4540454371496d7a684644 (linksys ?) 9436e8d67174ef9aed068d5ad5213f187a3f8ba6000000160000061e (Netscreen 5XP running ScreenOS 4.0.r3) ]] author = {"Jesper Kueckelhahn", "Roy Hills"} license = "Simplified (2-clause) BSD license--See https://nmap.org/svn/docs/licenses/BSD-simplified" fingerprints = {}; -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- Vendor ID Fingerprints -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- Avaya -------------------------------------------------------------------------------- table.insert(fingerprints, { category = 'vendor', vendor = 'Avaya', version = nil, ostype = nil, devicetype = 'security-misc', cpe = nil, fingerprint = '^4485152d18b6bbcc0be8a8469579ddcc' }); -------------------------------------------------------------------------------- -- Checkpoint -------------------------------------------------------------------------------- table.insert(fingerprints, { category = 'vendor', vendor = 'Checkpoint VPN-1 / Firewall-1', version = '4.1 Base', ostype = nil, devicetype = 'security-misc', cpe = nil, fingerprint = '^f4ed19e0c114eb516faaac0ee37daf2807b4381f00000001000000020000000000000000........' }); table apresentados de uma forma organizada e compreensível\&. Dado o número de formas que o Nmap é utilizado pelas pessoas e por outros softwares, nenhum formato irá agradar a todos\&. Então o Nmap oferece diversos formatos incluindo o modo interativo para humanos lerem diretamente e o XML para fácil interpretação por um software\&. .PP Além de oferecer diversos formatos de saída, o Nmap fornece opções para controlar a verbosidade da saída assim como as mensagens de depuração\&. Os tipos de saída podem ser enviados para a saída padrão (standard output) ou para arquivos, o qual o Nmap pode acrescentar ou então sobrescrever\&. Arquivos de saída também podem ser utilizados para se retomar rastreios(scans) abortados\&. .PP O Nmap torna a saída disponível em cinco formatos diferentes\&. O default é chamado de saída interativa (interactive output) e é enviada para a saída padrão (stdout)\&. Há também a saída normal (normal output) que é similar à interativa excepto pelo facto de mostrar menos informações e alertas sobre a execução uma vez que se espera que seja feita uma análise somente após o rastreio(scan) completar, ao invés de interativamente\&. .PP A saída XML é um dos tipos de saída mais importantes pois permite a conversão para HTML, é facilmente analisada por programas como a interface gráfica do Nmap ou pode ser importada em banco de dados\&. .PP Os dois tipos restantes de saída são a simples saída para o grep (grepable output) que inclui a maioria das informações de um anfitrião(host)\-alvo em uma única linha e a s4íd4 sCRiPt KiDDi3 (sCRiPt KiDDi3 0utPUt) para usuários que se consideram 1r4d0z (|<\-r4d)\&. .PP Embora a saída interativa seja a default e não tenha associada nenhuma opção de linha de comando, as outras quatro opções de formato utilizam a mesma sintaxe\&. Elas recebem um argumento que é o nome do arquivo onde os resultados devem ser armazenados\&. Formatos múltiplos podem ser especificados £o da aplicação) esses anfitriões(hosts) estão disponibilizando, que sistemas operativos (e versões de SO) estão em uso, que tipo de filtros de pacotes/firewalls estão em uso e dezenas de outras características\&. Enquanto o Nmap é frequentemente usado para auditorias de segurança, muitos sistemas e administradores de redes consideram\-no útil para as tarefas de rotina como o inventário da rede, gestão de actualizações de serviços e monitorizar o uptime de anfitriões ou serviços\&. .PP A saída do Nmap é uma lista de alvos rastreados(scanned) com informações adicionais de cada um dependendo das opções utilizadas\&. Uma informação chave é a \(lqtabela de portas interessantes\(rq\&. Essa tabela lista o número da porta e o protocolo, o nome do serviço e o estado\&. O estado pode ser aberto (open), filtrado (filtered), fechado (closed), ou não\-filtrado (unfilterd)\&. Aberto (open) significa que uma aplicação na máquina\-alvo está escutando as conexões/pacotes nessa porta\&. Filtrado (filtered) significa que o firewall, filtro ou outro obstáculo de rede está bloqueando a porta de forma que o Nmap não consegue dizer se ela está aberta (open) ou fechada (closed)\&. Portas fechadas (closed)não possuem uma aplicação escutando nelas embora possam abrir a qualquer instante\&. Portas são classificadas como não filtradas (unfiltered)quando elas respondem às sondagens do Nmap mas o Nmap não consegue determinar se as portas estão abertas ou fechadas\&. O Nmap reporta as combinações aberta|filtrada (open|filtered)e fechada|filtrada (closed|filtered)quando não consegue determinar qual dos dois estados descrevem melhor a porta\&. A tabela de portas também pode incluir detalhes de versão de software quando a detecção de versão for solicitada\&. Quando um rastreio(scan) do protocolo IP é solicitado (\fB\-sO\fR) o Nmap fornece informações dos protocolos IP suportados ao invés de portas que estejam abertas\&. .PP Além da tabelsword, database, servername ) local loginPacket = LoginPacket:new() local status, result, data, errorDetail, token local servername = servername or "DUMMY" local pos = 1 local ntlmAuth = false if ( not self.stream ) then return false, "Not connected to server" end loginPacket:SetUsername(username) loginPacket:SetPassword(password) loginPacket:SetDatabase(database) loginPacket:SetServer(servername) local domain = stdnse.get_script_args("mssql.domain") if (domain) then if ( not(HAVE_SSL) ) then return false, "mssql: OpenSSL not present" end ntlmAuth = true -- if the domain was specified without an argument, set a default domain of "." if (domain == 1 or domain == true ) then domain = "." end loginPacket:SetDomain(domain) end status, result = self.stream:Send( loginPacket:ToString() ) if ( not(status) ) then return false, result end status, data, errorDetail = self.stream:Receive() if ( not(status) ) then -- When logging in via named pipes, SQL Server will sometimes -- disconnect the pipe if the login attempt failed (this only seems -- to happen with non-"sa") accounts. At this point, having -- successfully connected and sent a message, we can be reasonably -- comfortable that a disconnected pipe indicates a failed login. if ( errorDetail == "NT_STATUS_PIPE_DISCONNECTED" ) then return false, "Bad username or password", LoginErrorType.InvalidUsernameOrPassword end return false, data end local doNTLM = ntlmAuth while( pos < data:len() ) do pos, token = Token.ParseToken( data, pos ) if ( -1 == pos ) then return false, token end if ( token.type == TokenType.ErrorMessage ) then local errorMessageLookup = { [LoginErrorType.AccountLockedOut] = "Account is locked out", [LoginErrorType.NotAssociatedWithTrustedConed'] = s:match("(.-)") end return settings end --- Parses the appdata XML response -- -- @param xmldata string response from request_appdata -- @return table containing nestled tables closely resembling the DOM model of the XML response function parse_appdata_response(xmldata) local apps = {} xmldata = xmldata:gsub("\r?\n",""):gsub(">%s+<", "><") for AppData in xmldata:gmatch("(.-)") do local app_name = AppData:match("(.-)") or "" local app = {} app['FName'] = app_name app['AccessList'] = extract_appdata_acls(AppData) app['Settings'] = extract_appdata_settings(AppData) table.insert(apps, app) end return apps end -- -- -- @param flags string, should be any of following: alt-addr, no-load-bias -- function request_address(host, port, flags, appname) local xmldata = { '\r\n\z \r\n\z ' } if flags then xmldata[#xmldata+1] = "" .. flags .. "" end if appname then xmldata[#xmldata+1] = "" .. appname .. "" end xmldata[#xmldata+1] = "\r\n" return send_citrix_xml_request(host, port, table.concat(xmldata)) end --- Request information about the Citrix protocol -- -- Consult the NFuse.DTD for a complete list of supported parameters -- This function implements all the supported parameters described in: -- Version 5.0 (draft 1) 24 January 2008 -- -- @param host string or host table which is to be queried -- @param port number or port table of the XML service -- @param params table with parameters -- @return string HTTP response data -- function request_server_data(host, port, params) local params = params or {} local server_type = params.ServerType or {"all"} local client_type = params.ClientType server_name for use with the TLS Server Name Indication extension. -- -- This returns the value of the script argument "tls.servername" if given. Otherwise, it -- returns the target name of the host parameter. -- -- @param host Host table as received by the action function -- @return String of the selected host name function servername(host) local script_arg = stdnse.get_script_args("tls.servername") if script_arg then return script_arg elseif type(host) == "table" then return host.targetname end end local unittest = require "unittest" if not unittest.testing() then return _ENV end test_suite = unittest.TestSuite:new() for name, code in pairs(CIPHERS) do test_suite:add_test(unittest.not_nil(cipher_info(name).kex), name .. ".kex") end return _ENV; local anyconnect = require('anyconnect') local shortport = require('shortport') local vulns = require('vulns') local sslcert = require('sslcert') local stdnse = require "stdnse" description = [[ Detects whether the Cisco ASA appliance is vulnerable to the Cisco ASA ASDM Privilege Escalation Vulnerability (CVE-2014-2126). ]] --- -- @see http-vuln-cve2014-2127.nse -- @see http-vuln-cve2014-2128.nse -- @see http-vuln-cve2014-2129.nse -- -- @usage -- nmap -p 443 --script http-vuln-cve2014-2126 -- -- @output -- PORT STATE SERVICE -- 443/tcp open https -- | http-vuln-cve2014-2126: -- | VULNERABLE: -- | Cisco ASA ASDM Privilege Escalation Vulnerability -- | State: VULNERABLE -- | Risk factor: High CVSSv2: 8.5 (HIGH) (AV:N/AC:M/AU:S/C:C/I:C/A:C) -- | Description: -- | Cisco Adaptive Security Appliance (ASA) Software 8.2 before 8.2(5.47), 8.4 before 8.4(7.5), 8.7 before 8.7(1.11), 9.0 before 9.0(3.10), and 9.1 before 9.1(3.4) allows remote authenticated users to gain privileges by leveraging level-0 ASDM access, aka Bug ID CSCuj33496. -- | -- | References: -- | http://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-2014040Rk°–(¹š˜\a ,€{f¬žê\1g?ÄPÀ\aH•b@ŽgZyׇd —?Pw}‹è‚dÓÏT|g ƥ@{ NáNRhJ÷…h#`À€dXŸgу€ dn¼@èei\ÇŽsa‚f_TÏcd™@Õg¶DôSa¯9¦gWâÀ„g"4'LÜbް+Z]a X•‚?e:“€Ìd1ÏR2g B#ÀŠghMcŒ‡g;‘wf"~^€èh¥Àvbc©G@ciu—Ji$åiFÃd ”Fˆ—g£_@�h¬ÕóR|d`£×d{g^a@ÁbüÃÐÐn%ÑÀ�eèdîÐï(ÿsÀØgE _€Ùc³ñÄhf ‰XÙ³¤@Öc%º#žgw®[ÈfÕ@†‰gã2hÌhkÀßh¶Ókpg�[R˜g9ðf ³°ÆçfQ;¾ßeçÐÌைÄßjh&üð@ôg1­7À0e6ü|Ȉgó]gÐÆ€žc¥¢Ë�—gäÌlb »ŸÂ]f-öHªg¢81@¯gP Hhí~šÇfuvÆŒcaÑ6ÄÃbUŸÆVaJԧhÛ0xÓÀõ(0ùh@Tc çJufLoT@Si+¦}€b:vÀ£b=cal sStr, newpos = string.unpack("c" .. len, encStr, pos) while (sPos < len) do local newSeq newSeq, sPos = decode(sStr, sPos) table.insert(seq, newSeq) end return seq, newpos end -- Encodes an LDAP Application operation and its data as a sequence -- -- @param appno LDAP application number -- @see APPNO -- @param isConstructed boolean true if constructed, false if primitive -- @param data string containing the LDAP operation content -- @return string containing the encoded LDAP operation function encodeLDAPOp( appno, isConstructed, data ) local encoded_str = "" local asn1_type = asn1.BERtoInt( asn1.BERCLASS.Application, isConstructed, appno ) encoded_str = encode( { _ldaptype = string.pack("B", asn1_type), data } ) return encoded_str end --- Performs an LDAP Search request -- -- This function has a concept of softerrors which populates the return tables error information -- while returning a true status. The reason for this is that LDAP may return a number of records -- and then finish off with an error like SIZE LIMIT EXCEEDED. We still want to return the records -- that were received prior to the error. In order to achieve this and not terminating the script -- by returning a false status a true status is returned together with a table containing all searchentries. -- This table has the errorMessage and resultCode entries set with the error information. -- As a try won't catch this error it's up to the script to do so. See ldap-search.nse for an example. -- -- @param socket socket already connected to the ldap server -- @param params table containing at least scope, derefPolicy, baseObject -- the field maxObjects may also be included to restrict the amount of records returned -- @return success true or false. -- @return searchResEntries containing results or a string containing error message function searchRequest( socket, params ) lose return err end end ---This config file is designed for adding a backdoor to the system. It has a few -- options by default, only one enabled by default. I suggest -- -- Note that none of these modules are included with Nmap by default. -- Any variable in the 'config' table in smb-psexec.nse can be overriden in the -- 'overrides' table. Most of them are not really recommended, such as the host, -- key, etc. overrides = {} --overrides.timeout = 40 modules = {} local mod -- TODO: allow the user to specify parameters --Note: password can't be longer than 14-characters, otherwise the program pauses for -- a response mod = {} mod.upload = false mod.name = "Adding a user account: $username/$password" mod.program = "net" mod.args = "user $username $password /add" mod.maxtime = 2 mod.noblank = true mod.req_args = {'username','password'} table.insert(modules, mod) --- -- Library methods for handling JSON data. It handles JSON encoding and -- decoding according to RFC 4627. -- -- There is a straightforward mapping between JSON and Lua data types. One -- exception is JSON NULL, which is not the same as Lua -- nil. (A better match for Lua nil is JavaScript -- undefined.) NULL values in JSON are represented by -- the special value json.NULL. -- -- @author Martin Holst Swende -- @author David Fifield -- @author Patrick Donnelly -- @copyright Same as Nmap--See https://nmap.org/book/man-legal.html -- Version 0.4 -- Created 01/25/2010 - v0.1 - created by Martin Holst Swende -- Heavily modified 02/22/2010 - v0.3. Rewrote the parser into an OO-form, to not have to handle -- all kinds of state with parameters and return values. -- Modified 02/27/2010 - v0.4 Added unicode handling (written by David Fifield). Renamed toJson -- and fromJson into generate() and parse(), implemented more proper numeric parsing anogatás látható\&. Ebben a példában csak a \fB\-A\fR paramétert használtuk az operációs rendszer és a szolgáltatások érzékelésére, a parancsfájl (script) alapú ellenőrzésre és az útvonal feltárására; a \fB\-T4\fR paramétert a gyorsabb végrehajtásra; végül pedig a két célállomás nevét\&. .PP \fB1. példa - Egy jellegzetes Nmap letapogatás\fR .sp .if n \{\ .RS 4 .\} .nf # nmap \-A \-T4 scanme\&.nmap\&.org playground Starting nmap ( https://nmap\&.org ) Interesting ports on scanme\&.nmap\&.org (205\&.217\&.153\&.62): (The 1663 ports scanned but not shown below are in state: filtered) PORT STATE SERVICE VERSION 22/tcp open ssh OpenSSH 3\&.9p1 (protocol 1\&.99) 53/tcp open domain 70/tcp closed gopher 80/tcp open http Apache httpd 2\&.0\&.52 ((Fedora)) 113/tcp closed auth Device type: general purpose Running: Linux 2\&.4\&.X|2\&.5\&.X|2\&.6\&.X OS details: Linux 2\&.4\&.7 \- 2\&.6\&.11, Linux 2\&.6\&.0 \- 2\&.6\&.11 Uptime 33\&.908 days (since Thu Jul 21 03:38:03 2005) Interesting ports on playground\&.nmap\&.org (192\&.168\&.0\&.40): (The 1659 ports scanned but not shown below are in state: closed) PORT STATE SERVICE VERSION 135/tcp open msrpc Microsoft Windows RPC 139/tcp open netbios\-ssn 389/tcp open ldap? 445/tcp open microsoft\-ds Microsoft Windows XP microsoft\-ds 1002/tcp open windows\-icfw? 1025/tcp open msrpc Microsoft Windows RPC 1720/tcp open H\&.323/Q\&.931 CompTek AquaGateKeeper 5800/tcp open vnc\-http RealVNC 4\&.0 (Resolution 400x250; VNC port: 5900) 5900/tcp open vnc VNC (protocol 3\&.8) MAC Address: 00:A0:CC:63:85:4B (Lite\-on Communications) Device type: general purpose Running: Microsoft Windows NT/2K/XP OS details: Microsoft Windows XP Pro RC1+ through final release Service Info: OSs: Windows, Windows XP Nmap finished: 2 IP addresses (2 hosts up) scanned in 88\&.392 seconds .fi .if n \{\ .RE .\} .PP Az Nmap legújabb változata a \m[blhe packet identifier -- @param flags [optional] -- @param keyaddr string containing the keyaddr data -- @param how_many string containing the value to retrieve -- @return obj a new Packet.GIOP.list instance new = function( self, id, flags, keyaddr, how_many ) local o = {} setmetatable(o, self) self.__index = self o.op = "list\0" o.id = id o.flags = flags or Constants.SyncScope.WITH_TARGET o.target_addr = 0 -- KeyAddr o.key_addr = keyaddr o.how_many = how_many or 1000 o.sc = {} return o end, --- Creates and adds a service context to the packet -- -- @param id number containing the context id -- @param data the service context data -- @param pad [optional] number used to pad after the service context addServiceContext = function( self, id, data, pad ) table.insert( self.sc, ServiceContext:new(id, data, pad) ) end, --- Converts the class to a string suitable to send over the socket -- -- @return string containing the packet data __tostring = function( self ) local UNKNOWN, UNKNOWN2, UNKNOWN3 = 2, 1, 6 local data = { string.pack(">I4BxxxI2I2s4s4xxBI4", self.id, self.flags, self.target_addr, UNKNOWN, self.key_addr, self.op, UNKNOWN2, #self.sc ) } for i=1, #self.sc do data[#data+1] = tostring( self.sc[i]) end data[#data+1] = string.pack(">I4I4", UNKNOWN3, self.how_many ) local packet = Packet.GIOP:new( 0, table.concat(data)) packet:setVersion( Constants.VERSION_1_2 ) return tostring( packet ) end, } -- Static class containing various message decoders MessageDecoder = { --- Decodes a get response -- -- @param packet the GIOP packet as received by the comm -- exchGIOPPacket function -- @return status true on success, false on failure -- @return table containing ip and ctx ["get"] = function( packet ) local bo = ( packet.GIOP.byte_order == 0 and ">" or "<") l ) ) while true do local status, lines = socket:receive_lines(1) if not status then break else result[#result+1] = lines end end socket:close() stdnse.debug3("Ended Query at %s.", db) if #result == 0 then return nil end return table.concat( result ) end --- -- Extracts fields (if present) from the information returned in response to our query and determines whether it represents a referral to a -- record hosted elsewhere. The referral is cached in the registry to allow threads for targets in the same assignment to avoid performing -- their queries to this service. If it is not a referral, we assume it is the desired record and the extracted fields are cached in the -- registry ready for output. -- @param tracking Tracking table. -- @param ip String representing a Target's IP address. -- @param response String obtained from a service in response to our query. -- @param data Table of fields captured from previously queried services, indexed by service name. -- @return The data table passed as a parameter which may have been added to or may contain only the fields extracted from the desired -- record (in which case it will no longer be indexed by service name). -- @see extract_objects_from_response, redirection_rules, constrain_response, add_to_cache function analyse_response( tracking, ip, response, data ) if type( response ) ~= "string" or response == "" then return data end local meta, mirrored_db local last_db, this_db, next_db = tracking.last_db, (tracking.this_db or tracking.last_db), tracking.next_db data[this_db] = {} -- check for foreign resource for _, db in pairs( nmap.registry.whois.whoisdb ) do if type( db ) == "table" and type( db.id ) == "string" and db.id ~= "iana" and db.id ~= this_db and type( db.hostname ) == "string" then local pattern = db.id:upper() .. ".*%s*resource:%s*" .. db.hostname if response:match( pfalse, ("Failed to write file (%s)"):format(filename) end f:close() return true end --- Compares two screens and returns the difference as a percentage -- -- @param the original screen -- @param the screen to compare to -- @return percent difference local function screen_diff( orig_screen, current_screen ) if orig_screen == current_screen then return 100 end if #orig_screen == 0 or #current_screen == 0 then return 0 end local m = 1 for i =1 , #orig_screen do if orig_screen:byte(i) == current_screen:byte(i) then m = m + 1 end end return (m/1920)*100 end Driver = { new = function(self, host, port, options) local o = {} setmetatable(o, self) self.__index = self o.host = host o.port = port o.options = options o.tn3270 = tn3270.Telnet:new() o.tn3270:disable_tn3270e() return o end, connect = function( self ) local status, err = self.tn3270:initiate(self.host,self.port) if not status then stdnse.debug2("Could not initiate TN3270: %s", err ) return false end return true end, disconnect = function( self ) self.tn3270:disconnect() self.tn3270 = nil end, login = function (self, user, pass) -- pass is actually the username we want to try local path = self.options['key2'] local macros = self.options['key3'] local cmdfmt = "logon applid(%s)" local type = "applid" local threshold = 75 -- instead of sending 'logon applid()' when macros=true -- we try to logon with just the command if macros then cmdfmt = "%s" type ="macro" threshold = 90 -- sometimes the screen barely changes end stdnse.verbose(2,"Trying VTAM ID: %s", pass) local previous_screen = self.tn3270:get_screen_raw() self.tn3270:send_cursor(cmdfmt:format(pass)) self.tn3270:get_all_data() self.tn3270:get_screen_debug(2) local current_screen = self.tn3270:get_screen_raw() if (self.tn3270:find('UNABLE TO ESTABLISH SEwants to abort the connection\&. .RE .PP SYN (Synchronize) .RS 4 The segment is a request to synchronize sequence numbers and establish a connection\&. The sequence number field contains the sender\*(Aqs initial sequence number\&. .RE .PP FIN (Finish) .RS 4 The sender wants to close the connection\&. .RE .RE .PP \fB\-\-win \fR\fB\fIsize\fR\fR (Window Size) .RS 4 Specifies the TCP window size, this is, the number of octets the sender of the segment is willing to accept from the receiver at one time\&. This is usually the size of the reception buffer that the OS allocates for a given connection\&. \fIsize\fR must be a number in the range [0\(en65535]\&. .RE .PP \fB\-\-badsum\fR (Invalid Checksum) .RS 4 Asks Nping to use an invalid TCP checksum for the packets sent to target hosts\&. Since virtually all host IP stacks properly drop these packets, any responses received are likely coming from a firewall or an IDS that didn\*(Aqt bother to verify the checksum\&. For more details on this technique, see \m[blue]\fB\%https://nmap.org/p60-12.html\fR\m[]\&. .RE .SH "UDP MODE" .PP \fB\-p \fR\fB\fIport_spec\fR\fR, \fB\-\-dest\-port \fR\fB\fIport_spec\fR\fR (Target ports) .RS 4 This option specifies which ports you want UDP datagrams to be sent to\&. It can be a single port, a comma\-separated list of ports (e\&.g\&. 80,443,8080), a range (e\&.g\&. 1\-1023), and any combination of those (e\&.g\&. 21\-25,80,443,1024\-2048)\&. The beginning and/or end values of a range may be omitted, causing Nping to use 1 and 65535, respectively\&. So you can specify \-p\- to target ports from 1 through 65535\&. Using port zero is allowed if you specify it explicitly\&. .RE .PP \fB\-g \fR\fB\fIportnumber\fR\fR, \fB\-\-source\-port \fR\fB\fIportnumber\fR\fR (Spoof source port) .RS 4 This option asks Nping to use the specified port as source port for the transmitted datagrams\&. Note that this might not work on all systems or may require root privileges\&. Specified value must be an integer in tmeout : Give up on target after this long \-\-scan\-delay/\-\-max\-scan\-delay : Adjust delay between probes FIREWALL/IDS EVASION AND SPOOFING: \-f; \-\-mtu : fragment packets (optionally w/given MTU) \-D : Cloak a scan with decoys \-S : Spoof source address \-e : Use specified interface \-g/\-\-source\-port : Use given port number \-\-data\-length : Append random data to sent packets \-\-ttl : Set IP time\-to\-live field \-\-spoof\-mac : Spoof your MAC address OUTPUT: \-oN/\-oX/\-oS/\-oG : Output scan results in normal, XML, s|: Output in the three major formats at once \-v: Increase verbosity level (use twice for more effect) \-d[level]: Set or increase debugging level (Up to 9 is meaningful) \-\-packet\-trace: Show all packets sent and received \-\-iflist: Print host interfaces and routes (for debugging) \-\-append\-output: Append to rather than clobber specified output files \-\-resume : Resume an aborted scan \-\-stylesheet : XSL stylesheet to transform XML output to HTML \-\-no\-stylesheet: Prevent Nmap from associating XSL stylesheet w/XML output MISC: \-6: Enable IPv6 scanning \-A: Enables OS detection and Version detection \-\-datadir : Specify custom Nmap data file location \-\-send\-eth/\-\-send\-ip: Send packets using raw ethernet frames or IP packets \-\-privileged: Assume that the user is fully privileged \-V: Print version number \-h: Print this help summary page\&. EXAMPLES: nmap \-v \-A scanme\&.nmap\&.org nmap \-v \-sP 192\&.168\&.0\&.0/16 10\&.0\&.0\&.0/8 nmap \-v \-iR 10000 \-P0 \-p 80 .fi .if n \{\ .RE .\} .sp .SH "目标说明" .PP 除了选项,所有出现在Nmap命令行上的都被视为对目标主机的说明。 最简单的情况æ˜namic Host Configuration Protocol (DHCP) client. -- -- DHCP, defined in rfc2132 and rfc2131, is a protocol for hosts to automatically -- configure themselves on a network (that is, obtain an ip address). This library, -- which have a trivial one-function interface, can send out DHCP packets of many -- types and parse the responses. -- -- @author Ron Bowes -- -- 2011-12-28 - Revised by Patrik Karlsson -- o Split dhcp_send into dhcp_send, dhcp_receive -- o Added basic support for adding options to requests -- o Added possibility to override transaction id -- o Added WPAD action local datetime = require "datetime" local ipOps = require "ipOps" local math = require "math" local nmap = require "nmap" local stdnse = require "stdnse" local string = require "string" local strbuf = require "strbuf" local table = require "table" local tableaux = require "tableaux" _ENV = stdnse.module("dhcp", stdnse.seeall) request_types = { DHCPDISCOVER = 1, DHCPOFFER = 2, DHCPREQUEST = 3, DHCPDECLINE = 4, DHCPACK = 5, DHCPNAK = 6, DHCPRELEASE = 7, DHCPINFORM = 8 } request_types_str = tableaux.invert(request_types) ---Read an IP address or a list of IP addresses. Print an error if the length isn't a multiple of 4. -- --@param data The packet. --@param pos The position in the packet. --@param length The length that the server claims the field is. --@return The new position (will always be pos + length, no matter what we think it should be) --@return The value of the field, or nil if the field length was wrong. local function read_ip(data, pos, length) if(length ~= 4) then if((length % 4) ~= 0) then stdnse.debug1("dhcp-discover: Invalid length for an ip address (%d)", length) pos = pos + length return pos, nil else local results = {} for i=1, length, 4 do local value value, pos = string.unpack(">I4", data, pos) table.insert(results, ipOps.fromdword(value)) sponse end --- -- send_tcp is a function that is used to run send the appropriate traffic to -- the omron devices via TCP -- -- @param socket Socket that is passed in from Action function send_tcp(socket) -- this is the request address command local req_addr = stdnse.fromhex( "46494e530000000c000000000000000000000000") -- TCP requires a network address that is revived from the first request, -- The read controller data these two strings will be joined with the address local controller_data_read = stdnse.fromhex("46494e5300000015000000020000000080000200") local controller_data_read2 = stdnse.fromhex("000000ef050501") -- send Request Information Packet socket:send(req_addr) local rcvstatus, response = socket:receive() local header = string.byte(response, 1) if(header == 0x46) then local address = string.byte(response, 24) local controller_data = ("%s%c%s%c"):format(controller_data_read, address, controller_data_read2, 0x00) -- send the read controller data request socket:send(controller_data) local rcvstatus, response = socket:receive() return response end return "ERROR" end --- -- Action Function that is used to run the NSE. This function will send the initial query to the -- host and port that were passed in via nmap. The initial response is parsed to determine if host -- is a FINS supported device. -- -- @param host Host that was scanned via nmap -- @param port port that was scanned via nmap action = function(host,port) -- create table for output local output = stdnse.output_table() -- create new socket local socket = nmap.new_socket() local catch = function() socket:close() end -- create new try local try = nmap.new_try(catch) -- connect to port on host try(socket:connect(host, port)) -- init response var local response = "" -- set offset to 0, this will mean its UDP local offset = 0 -- check to see if the protocol is TCP, if it is set offset to 16 -- and perform the tcmo restaurant-advisor splix totalpress kasrod snowflakes hamid-bakeri editorial-plus business-multi-lite auction ezy business-kid visualsite vast shuttle-business world-news centilium-masonry naledi hamlet-lite online-video-games xooblog showcase-lite appointech metrowp yala-mag flash-news ilisa shuttle-gonews pizzaland asterion wild-safari-lite mayasilk algori-shop storefront-eshop ayapsychology avire dentistry-clinic crucial newspaperly-plus gutenify-corporate tannistha jorvik marianne saka accommodation-rental fhomeservices writer-blog cayo food-and-diet otzi-lite photolog meilleur-business planet-green auto-store ogee beautify slight universal louis svelt my-contrastica-under-construction chives dentist-lite corpo-digital nadzhq-minimal hotel-vivanta seos-social organic-market cosparell aletheia cphotopic-lite abaya gourmand launching-soon-lite personal-club transit-lite videomag headnews foodylite techieblog xews-lite poris gray-whale blogger-choice texas renden-magazine web-artist wp-profile the-bootstrap-blog global-ecommerce-store bosa-shopper construction-engineering patio unisco ndesign geodesic clubnature bai nexas leathernote adri wp-masonry cupcake-love business-directory-elementor silver-blue jelly financial-news c9-starter political-era clothing-store-blocks wp-clean-green solar-power melos-light agency-x coverstory creativ-kids-education typist plato jinn rapid newsbook food-recipe campus houston shopping-mall entertainment-media dovetail holiday-tours alternate-lite deerawan-cloudy gutener-business whiteplus personal-lite excel-blog mixtape holidayshop jetblack-education webvideo architect-architecture corner walser magic-blog laveo posterity-dark child-care-kindergarten dark-photography mxs2 belltech zomer transport-gravity kimono videomaker translucent-fluidity-2 collect parfum mosalon remax-store business-solution globalnews omegax creative-focus ft-directory-listing wpazure herbal-ayurveda natalielite khaddokothon dk-responsive calm beam aplobe length in bits of the -- significant part of the prefix -- @param metric number containing the current metric for the -- destination new = function(self, prefix, tag, prefix_len, metric) local o = { prefix = prefix, tag = tag, prefix_len = prefix_len, metric = metric } setmetatable(o, self) self.__index = self return o end, -- Parses a byte string and creates an instance of RTE -- @param data string of bytes -- @return rte instance of RTE parse = function(data) local rte = RIPng.RTE:new() local pos, ip ip, rte.tag, rte.prefix_len, rte.metric, pos = string.unpack(">c16 I2 BB", data) rte.prefix = ipOps.str_to_ip(ip, 'inet6') return rte end, -- Converts a RTE instance to string -- @return string of bytes to send to the server __tostring = function(self) local ipstr = ipOps.ip_to_str(self.prefix) assert(16 == #ipstr, "Invalid IPv6 address encountered") return ipstr .. string.pack(">I2 BB", self.tag, self.prefix_len, self.metric) end, }, -- The Request class contains functions to build a RIPv2 Request Request = { -- Creates a new Request instance -- -- @param command number containing the RIPv2 Command to use -- @return o instance of request new = function(self, entries) local o = { command = 1, version = 1, entries = entries, } setmetatable(o, self) self.__index = self return o end, -- Converts the whole request to a string __tostring = function(self) local RESERVED = 0 local str = {string.pack(">BB I2", self.command, self.version, RESERVED)} for _, rte in ipairs(self.entries) do str[#str+1] = tostring(rte) end return table.concat(str) end, }, -- A RIPng Response Response = { -- Creates a new Response instance -- @return o new instan port The port to connect to. -- @param options A table of other parameters. It may have any of these fields: -- * timeout: A timeout used for socket operations. -- * header: A table containing additional headers to be used for the request. -- * content: The content of the message (content-length will be added -- set header['Content-Length'] to override) -- * cookies: A table of cookies in the form returned by parse_set_cookie. -- * auth: A table containing the keys username and password. -- @return A response table, see module documentation for description. -- @see generic_request local function request(host, port, data, options) if(not(validate_options(options))) then return http_error("Options failed to validate.") end local method local response options = options or {} if type(port) == 'table' then if port.protocol and port.protocol ~= 'tcp' then stdnse.debug1("http.request() supports the TCP protocol only, your request to %s cannot be completed.", host) return http_error("Unsupported protocol.") end end method = string.match(data, "^(%S+)") local socket, partial, opts = do_connect(host, port, data, options) if not socket then stdnse.debug1("http.request socket error: %s", partial) return http_error("Error creating socket.") end repeat local incomplete response, partial, incomplete = next_response(socket, method, partial, options) if not response then return http_error("Error in next_response function; " .. partial, incomplete) end -- See RFC 2616, sections 8.2.3 and 10.1.1, for the 100 Continue status. -- Sometimes a server will tell us to "go ahead" with a POST body before -- sending the real response. If we got one of those, skip over it. until not (response.status >= 100 and response.status <= 199) socket:close() -- if SSL was used to retrieve the URL ]] -- strip off indentation soapmsg = soapmsg:gsub("%f[^\0\n]%s+", "") -- username is not injected into the payload because it is implied soapmsg = soapmsg:gsub("__%w+__", {__SESS__=sessionid, __PASS__=encpass}) local resp = http_post_simple(host, port, url.absolute(path, "soap"), {header=header}, soapmsg) return resp.status == 200 and (resp.body or ""):find('true', 1, true) end }) table.insert(fingerprints, { -- Version 3.6/4 name = "Lantronix ThinWeb Manager", category = "printer", paths = { {path = "/"} }, target_check = function (host, port, path, response) return have_openssl and response.status == 200 and (response.header["server"] or ""):find("^Gordian Embedded") and response.body and response.body:lower():find("lantronix thinweb manager", 1, true) end, login_combos = { {username = "", password = "system"} }, login_check = function (host, port, path, user, pass) local lurl = url.absolute(path, "server_eps.html") -- obtain login nonce local resp1 = http_get_simple(host, port, lurl) local nonce = resp1.status == 403 and sets_cookie(resp1, "SrvrNonce", ".") if not nonce then return false end -- credential is the MD5 hash of the nonce and the password (in upper case) local creds = stdnse.tohex(openssl.md5(nonce .. ":" .. pass:upper())) local cookies = ("SrvrNonce=%s; SrvrCreds=%s"):format(nonce, creds) local resp2 = http_get_simple(host, port, lurl, {cookies=cookies}) return resp2.status == 200 end }) --- --Storage --- table.insert(fingerprints, { -- Version TS200R021 on MSA 2000 G3 name = "HP Storage Management Utility", category = "storage", paths = { {path = "/api/id/"} }, -- TODO: Change the probe path to "/" and use the following target_check -- once the http library adds 200 then output[#output+1] = string.format("\nOutput for '%s':%s", cmd, req.body) --if out set, save output to file if out then local status, err = write_file(out, req.body) if status then output[#output+1] = string.format("Output saved to %s\n", out) else output[#output+1] = string.format("Error saving output to %s: %s\n", out, err) end end else if nmap.verbosity()>= 2 then output[#output+1] = "[Error] Request did not return 200. Make sure your URI value is correct. A WAF might be blocking your request" end end --output if #output>0 then return table.concat(output, "\n") end end local ipOps = require "ipOps" local math = require "math" local nmap = require "nmap" local packet = require "packet" local stdnse = require "stdnse" local tab = require "tab" local table = require "table" description = [[ Tries to discover firewall rules using an IP TTL expiration technique known as firewalking. To determine a rule on a given gateway, the scanner sends a probe to a metric located behind the gateway, with a TTL one higher than the gateway. If the probe is forwarded by the gateway, then we can expect to receive an ICMP_TIME_EXCEEDED reply from the gateway next hop router, or eventually the metric itself if it is directly connected to the gateway. Otherwise, the probe will timeout. It starts with a TTL equals to the distance to the target. If the probe timeout, then it is resent with a TTL decreased by one. If we get an ICMP_TIME_EXCEEDED, then the scan is over for this probe. Every "no-reply" filtered TCP and UDP ports are probed. As for UDP scans, this process can be quite slow if lots of ports are blocked by a gateway close to the scanner. Scan parameters can be controlled using the <code>firewalk.*</code> optional arguments. From an original idea of M. Schiffman and D. Goldsmith, authors of the firewalk tool. ]] --- -- @usage -- nmap --script=firewalk --traceroute <host> -- -de the specified ports from scanning \-F: Fast mode \- Scan fewer ports than the default scan \-r: Scan ports sequentially \- don\*(Aqt randomize \-\-top\-ports <number>: Scan <number> most common ports \-\-port\-ratio <ratio>: Scan ports more common than <ratio> SERVICE/VERSION DETECTION: \-sV: Probe open ports to determine service/version info \-\-version\-intensity <level>: Set from 0 (light) to 9 (try all probes) \-\-version\-light: Limit to most likely probes (intensity 2) \-\-version\-all: Try every single probe (intensity 9) \-\-version\-trace: Show detailed version scan activity (for debugging) SCRIPT SCAN: \-sC: equivalent to \-\-script=default \-\-script=<Lua scripts>: <Lua scripts> is a comma separated list of directories, script\-files or script\-categories \-\-script\-args=<n1=v1,[n2=v2,\&.\&.\&.]>: provide arguments to scripts \-\-script\-args\-file=filename: provide NSE script args in a file \-\-script\-trace: Show all data sent and received \-\-script\-updatedb: Update the script database\&. \-\-script\-help=<Lua scripts>: Show help about scripts\&. <Lua scripts> is a comma\-separated list of script\-files or script\-categories\&. OS DETECTION: \-O: Enable OS detection \-\-osscan\-limit: Limit OS detection to promising targets \-\-osscan\-guess: Guess OS more aggressively TIMING AND PERFORMANCE: Options which take <time> are in seconds, or append \*(Aqms\*(Aq (milliseconds), \*(Aqs\*(Aq (seconds), \*(Aqm\*(Aq (minutes), or \*(Aqh\*(Aq (hours) to the value (e\&.g\&. 30m)\&. \-T<0\-5>: Set timing template (higher is faster) \-\-min\-hostgroup/max\-hostgroup <size>: Parallel host scan group sizes \-\-min\-parallelism/max\-parallelism <numprobes>: Probe parallelization \-\-min\-rtt\-timeout/max\-rtt\-timeout/initial\-rtt\-timeout <time>: Specifies probe round trip time\&. \-\-max\-retries <tries>: Caps number of port scan probe retransmissions\&. \-\-host\-timeounts in the registry to share them between -- scripts. -- -- The complete protocol documentation is available on the official OpenVAS -- website: http://www.openvas.org/omp-2-0.html -- -- Sample use: -- <code> -- local session = omp2.Session:new() -- local status, err = session:connect(host, port) -- local status, err = session:authenticate(username, password) -- ... -- session:close() -- </code> -- -- @author Henri Doreau -- @copyright Same as Nmap -- See https://nmap.org/book/man-legal.html -- -- @args omp2.username The username to use for authentication. -- @args omp2.password The password to use for authentication. -- local nmap = require "nmap" local stdnse = require "stdnse" local table = require "table" _ENV = stdnse.module("omp2", stdnse.seeall) local HAVE_SSL = false if pcall(require,'openssl') then HAVE_SSL = true end --- A Session class holds connection and interaction with the server Session = { --- Creates a new session object new = function(self, socket) local o = {} setmetatable(o, self) self.__index = self o.username = nmap.registry.args["omp2.username"] o.password = nmap.registry.args["omp2.password"] o.socket = socket or nmap.new_socket() return o end, --- Establishes the (SSL) connection to the remote server connect = function(self, host, port) if not HAVE_SSL then return false, "The OMP2 module requires OpenSSL support" end return self.socket:connect(host, port, "ssl") end, --- Closes connection close = function(self) return self.socket:close() end, --- Attempts to authenticate on the current connection authenticate = function(self, username, password) local status, err, xmldata -- TODO escape credentials status, err = self.socket:send("<authenticate><credentials>" .. "<username>" .. username .. "</username>" .. "<password>" .. password .. "</password>" .. "</credentials></authenticate>") if not status then local len = string.unpack("<I2", data) status, data = self.socket:receive_buf(match.numbytes(len), true) if ( not(status) ) then return false, data end -- Parsing goes here end, -- Disconnects from the rsync server -- @return status true on success, false on failure disconnect = function(self) return self.socket:close() end, } return _ENV; # THIS FILE IS GENERATED AUTOMATICALLY FROM A MASTER - DO NOT EDIT. # EDIT /nmap-private-dev/nmap-services-all IN SVN INSTEAD. # Well known service port numbers -*- mode: fundamental; -*- # From the Nmap Security Scanner ( https://nmap.org/ ) # # $Id: nmap-services 39179 2025-05-15 16:03:29Z dmiller $ # # Derived from IANA data and our own research # # This collection of service data is (C) 1996-2025 by Insecure.Com # LLC. It is distributed under the Nmap Public Source license as # provided in the LICENSE file of the source distribution or at # https://svn.nmap.org/nmap/LICENSE . Note that this license # requires you to license your own work under a compatable open source # license. If you wish to embed Nmap technology into proprietary # software, we sell alternative licenses (contact sales@insecure.com). # Dozens of software vendors already license Nmap technology such as # host discovery, port scanning, OS detection, and version detection. # For more details, see https://nmap.org/book/man-legal.html # # Fields in this file are: Service name, portnum/protocol, open-frequency, optional comments # tcpmux 1/tcp 0.001995 # TCP Port Service Multiplexer tcpmux 1/udp 0.001236 # TCP Port Service Multiplexer compressnet 2/tcp 0.000013 # Management Utility compressnet 2/udp 0.001845 # Management Utility compressnet 3/tcp 0.001242 # Compression Process compressnet 3/udp 0.001532 # Compression Process unknown 4/tcp 0.000477 rje 5/tcp 0.000000 # Remote Job Entry rje 5/udp 0.000593 # Remote Job Entry unknown 6/tcp 0.000502 echo 7/sctp 0.000000 echo 7/tcp 0.004855 echo 7/udp 0.024679 unknown 8/tcp 0.n winzigen Paketen umzugehen\&. Ein Sniffer alter Schule namens Sniffit ist beim Erhalt des ersten Fragments sofort mit einem Segmentation\-Fault\-Fehler abgestürzt\&. Wenn Sie diese Option einmal angeben, spaltet Nmap die Pakete in acht Bytes oder weniger nach dem IP\-Header auf\&. Das heißt, ein 20 Byte langer TCP\-Header würde in drei Pakete aufgeteilt, zwei mit acht Bytes des TCP\-Headers und eines mit den restlichen vier\&. Natürlich hat jedes Fragment auch einen IP\-Header\&. Geben Sie erneut \fB\-f\fR an, um 16 Bytes pro Fragment zu benutzen (was die Anzahl der Fragmente verkleinert)\&. Oder Sie geben eine eigene Offset\-Größe mit der Option \fB\-\-mtu\fR (für engl\&. maximum transmission unit) an\&. Wenn Sie \fB\-\-mtu\fR angeben, sollten Sie nicht auch \fB\-f\fR angeben\&. Das Offset muss ein Vielfaches von acht sein\&. Zwar kommen fragmentierte Pakete nicht durch Paketfilter und Firewalls durch, die alle IP\-Fragmente in eine Warteschlange stellen, wie z\&.B\&. die Option \fICONFIG_IP_ALWAYS_DEFRAG\fR im Linux\-Kernel, aber einige Netzwerke können sich den damit verbundenen Performance\-Einbruch nicht leisten und lassen sie folglich deaktiviert\&. Andere können sie nicht aktivieren, weil die Fragmente auf verschiedenen Routen in ihre Netzwerke kommen könnten\&. Manche Quellsysteme defragmentieren hinausgehende Pakete im Kernel\&. Ein Beispiel dafür ist Linux mit dem Verbindungsmodul iptables\&. Führen Sie einen Scan aus, während ein Sniffer wie z\&.B\&. Wireshark läuft, um sicherzustellen, dass die gesendeten Pakete fragmentiert sind\&. Falls Ihr Host\-Betriebssystem Probleme macht, probieren Sie die Option \fB\-\-send\-eth\fR aus, um die IP\-Schicht zu umgehen und rohe Ethernet\-Rahmen zu schicken\&. .sp Eine Fragmentierung wird von Nmap nur für rohe Pakete unterstützt, die man mit TCP\- und UDP\-Port\-Scans (außer beim Connect\-Scan und FTP\-Bounce\-Scan) und der Betriebssystemerkennung benutzen kann\&. Merkmale wie die Versionserkennu) else table.insert(results, ("%-8s %s"):format(tostring(v), eap.eap_str[i] or "unassigned" )) end end for i,v in ipairs(results) do stdnse.debug1("%s", tostring(v)) end return stdnse.format_output(true, results) end local dns = require "dns" local nmap = require "nmap" local shortport = require "shortport" local stdnse = require "stdnse" local string = require "string" description = [[ Retrieves information from a DNS nameserver by requesting its nameserver ID (nsid) and asking for its id.server and version.bind values. This script performs the same queries as the following two dig commands: - dig CH TXT bind.version @target - dig +nsid CH TXT id.server @target References: [1]http://www.ietf.org/rfc/rfc5001.txt [2]http://www.ietf.org/rfc/rfc4892.txt ]] --- -- @usage -- nmap -sSU -p 53 --script dns-nsid <target> -- -- @output -- 53/udp open domain udp-response -- | dns-nsid: -- | NSID dns.example.com (646E732E6578616D706C652E636F6D) -- | id.server: dns.example.com -- |_ bind.version: 9.7.3-P3 -- -- @xmloutput -- <table key="NSID"> -- <elem key="raw">mia01.l.root-servers.org</elem> -- <elem key="hex">6d696130312e6c2e726f6f742d736572766572732e6f7267</elem> -- </table> -- <elem key="id.server">mia01.l.root-servers.org</elem> -- <elem key="bind.version">NSD 3.2.15</elem> author = "John R. Bond" license = "Simplified (2-clause) BSD license--See https://nmap.org/svn/docs/licenses/BSD-simplified" categories = {"discovery", "default", "safe"} portrule = function (host, port) if not shortport.port_or_service(53, "domain", {"tcp", "udp"})(host, port) then return false end -- only check tcp if udp is not open or open|filtered if port.protocol == 'tcp' then local tmp_port = nmap.get_port_state(host, {number=port.number, protocol="udp"}) if tmp_port then return not string.match(tmp_port.state, '^open') end end return true end local function rr_filter(pktRR, label) for _, rec in ipairs(pktRRque a porta de sondagem padrão é 31338, que pouco provavelmente estará em uso\&. Uns poucos serviços, tal como o chargen, irá responder a um pacote UDP vazio, e com isso revelará ao Nmap que a máquina está disponível\&. .sp A principal vantagem deste tipo de scan é que ele passa por firewalls e filtros que apenas examinam o TCP\&. Por exemplo, uma vez eu tive um roteador broadband sem\-fio Linksys BEFW11S4\&. A interface externa desse dispositivo filtrava todas as portas TCP por padrão, mas as sondagens UDP ainda causavam mensagens de porta inalcançável, entregando assim o dispositivo\&. .RE .PP \fB\-PE\fR; \fB\-PP\fR; \fB\-PM\fR (Tipos de Ping do ICMP) .RS 4 Além dos tipos incomuns de descoberta de hosts TCP e UDP discutidos anteriormente, o Nmap pode enviar os pacotes\-padrão que normalmente são enviados pelo onipresente programa ping\&. O Nmap envia um pacote ICMP do tipo 8 (echo request) ao endereço IP alvo, esperando como resposta um tipo 0 (Echo Reply) do host disponível\&. Infelizmente para muitos exploradores de rede, muitos hosts e firewalls atualmente bloqueiam esses pacotes, ao invés de responder como é requerido pela \m[blue]\fBRFC 1122\fR\m[]\&\s-2\u[3]\d\s+2\&. Por essa razão, scans puramente ICMP são raramente confiáveis o suficiente contra alvos desconhecidos na Internet\&. Mas para administradores de sistemas monitorando uma rede interna eles podem ser uma abordagem prática e eficiente\&. Utilize a opção \fB\-PE\fR para ativar esse comportamento echo request\&. .sp Embora o echo request seja a pesquisa padrão de um ping ICMP, o Nmap não pára aqui\&. A padronização do ICMP (\m[blue]\fBRFC 792\fR\m[]\&\s-2\u[4]\d\s+2) também especifica timestamp request, information request, e pacotes address mask request como códigos 13, 15, e 17, respectivamente\&. Apesar do propósito ostensivo dessas pesquisas seja obter informações tais como a máscara do endereço e hora corrente, eles podem ser facilmente utilizados para desCreative Commons\fR\m[]\&\s-2\u[2]\d\s+2\&. Algumas liberdades foram tomadas na tradução de expressões, jargão e gíria\&. Para maiores detalhes sobre a tradução, sugestões ou críticas, envie um e\-mail para os tradutores \-\- não esqueça de substituir \*(Aq\&.at\&.\*(Aq por \*(Aq@\*(Aq\&. [Rev:3244\-01] .SH "SUMáRIO DAS OPçõES" .PP Este sumário de opções é mostrado quando o Nmap é executado sem argumentos, e a última versão está sempre disponível em \m[blue]\fB\%https://nmap.org/data/nmap.usage.txt\fR\m[]\&. Ele ajuda as pessoas a lembrar das opções mais comuns, mas não substitui a documentação mais técnica do restante deste manual\&. Algumas opções obscuras não estão incluídas aqui\&. .PP .if n \{\ .RS 4 .\} .nf Usage: nmap [Scan Type(s)] [Options] {target specification} TARGET SPECIFICATION: Can pass hostnames, IP addresses, networks, etc\&. Ex: scanme\&.nmap\&.org, microsoft\&.com/24, 192\&.168\&.0\&.1; 10\&.0\-255\&.0\-255\&.1\-254 \-iL <inputfilename>: Input from list of hosts/networks \-iR <num hosts>: Choose random targets \-\-exclude <host1[,host2][,host3],\&.\&.\&.>: Exclude hosts/networks \-\-excludefile <exclude_file>: Exclude list from file HOST DISCOVERY: \-sL: List Scan \- simply list targets to scan \-sP: Ping Scan \- go no further than determining if host is online \-P0: Treat all hosts as online \-\- skip host discovery \-PS/PA/PU [portlist]: TCP SYN/ACK or UDP discovery probes to given ports \-PE/PP/PM: ICMP echo, timestamp, and netmask request discovery probes \-n/\-R: Never do DNS resolution/Always resolve [default: sometimes resolve] \-\-dns\-servers <serv1[,serv2],\&.\&.\&.>: Specify custom DNS servers \-\-system\-dns: Use OS\*(Aqs DNS resolver SCAN TECHNIQUES: \-sS/sT/sA/sW/sM: TCP SYN/Connect()/ACK/Window/Maimon scans \-sN/sF/sX: TCP Null, FIN, and Xmas scans \-\-scanflags <flags>: Customize TCP scan flags \-sI <zombie host[:probeport]>: Idlescan \-sO: IP protocol scan is_directory return true end --- This sends a SMB request to read from a file (or a pipe). -- --@param smb The SMB object associated with the connection --@param offset The offset to read from (ignored if it's a pipe) --@param count The maximum number of bytes to read --@param overrides The overrides table --@return (status, result) If status is false, result is an error message. Otherwise, result is a table -- containing a lot of different elements. function read_file(smb, offset, count, overrides) overrides = overrides or {} local header, parameters, data local andx_command, andx_reserved, andx_offset local remaining, data_compaction_mode, reserved_1, data_length_low, data_offset, data_length_high, reserved_2, reserved_3 local response = {} local status header = smb_encode_header(smb, command_codes['SMB_COM_READ_ANDX'], overrides) parameters = string.pack("<BBI2 I2 I4 I2 I2 I4 I2 I4", 0xFF, -- ANDX no further commands 0x00, -- ANDX reserved 0x0000, -- ANDX offset smb['fid'], -- FID offset, -- Offset count, -- Max count low count, -- Min count 0xFFFFFFFF, -- Reserved 0, -- Remaining 0x00000000 -- High offset ) data = "" -- Send the create file stdnse.debug2("SMB: Sending SMB_COM_READ_ANDX") local result, err = smb_send(smb, header, parameters, data, overrides) if(result == false) then return false, err end -- Read the result status, header, parameters, data = smb_read(smb) if(status ~= true) then return false, header end local header_format = "<c4 B I4 B I2 I2 i8 I2 I2 I2 I2 I2" if #header < string.packsize(header_format) then return false, "SMB: ERROR: Server returned less data than it was supposed to (one or more fields are missing); aborting [25]" end -- Check if we were allowed in local protocol_version, command, status, flags, flags2, pid_high, signature, unused, tid, pid, uid, mid, pos = string.unpack(header ALL. --@param data The data being processed. --@param pos The position within <code>data</code>. --@param result This is required when unmarshalling the BODY section, which always comes after -- unmarshalling the HEAD. It is the result returned for this parameter during the -- HEAD unmarshall. If the referent_id was '0', then this function doesn't unmarshall -- anything. --@return (pos, result) The new position in <code>data</code>, and a table representing the datatype. local function unmarshall_lsa_TranslatedSid2(location, data, pos, result) if(result == nil) then result = {} end if(location == HEAD or location == ALL) then pos, result['sid_type'] = unmarshall_lsa_SidType(data, pos) pos, result['rid'] = unmarshall_int32(data, pos) pos, result['sid_index'] = unmarshall_int32(data, pos) pos, result['unknown'] = unmarshall_int32(data, pos) end if(location == BODY or location == ALL) then end return pos, result end ---Marshall a lsa_TranslatedName2 struct -- --<code> -- typedef struct { -- lsa_SidType sid_type; -- lsa_String name; -- uint32 sid_index; -- uint32 unknown; -- } lsa_TranslatedName2; --</code> -- --@param location The part of the pointer wanted, either HEAD (for the data itself), BODY -- (for nothing, since this isn't a pointer), or ALL (for the data). Generally, unless the -- referent_id is split from the data (for example, in an array), you will want -- ALL. --@param sid_type The <code>sid_type</code> value, as a string --@param name The name of the user --@param sid_index The sid_index (I don't know what this is) --@param unknown An unknown value, normally 0 --@return A string representing the marshalled data. local function marshall_lsa_TranslatedName2(location, sid_type, name, sid_index, unknown) local result = "" stdnse.debug4("MSRPC: Entering marshaRUCK=G%RUD=G) IE(DFI=N%T=FA-104%TG=FF%CD=S) # Lanswitch Platform Software Version COMWAREV300R002B16D019SP11 Switch 4200G PWR 24-Port Software Version V200R002B61D005SP01 Fingerprint 3Com Switch 4200G Class 3Com | embedded || switch CPE cpe:/h:3com:switch_4200g auto SEQ(SP=F9-103%GCD=1-6%ISR=109-113%TI=I%CI=I%II=I%SS=S%TS=U) OPS(O1=M5B4%O2=M5B4%O3=M5B4%O4=M5B4%O5=M5B4%O6=M5B4) WIN(W1=2000%W2=2000%W3=2000%W4=2000%W5=2000%W6=2000) ECN(R=Y%DF=N%T=FA-104%TG=FF%W=2000%O=M5B4%CC=N%Q=) T1(R=Y%DF=N%T=FA-104%TG=FF%S=O%A=S+%F=AS%RD=0%Q=) T2(R=N) T3(R=N) T4(R=N) T5(R=Y%DF=N%T=FA-104%TG=FF%W=0%S=Z%A=S+%F=AR%O=%RD=0%Q=) T6(R=Y%DF=N%T=FA-104%TG=FF%W=0%S=A%A=Z%F=R%O=%RD=0%Q=) T7(R=Y%DF=N%T=FA-104%TG=FF%W=0%S=Z%A=S%F=AR%O=%RD=0%Q=) U1(DF=N%T=FA-104%TG=FF%IPL=38%UN=0%RIPL=G%RID=G%RIPCK=G%RUCK=0%RUD=G) IE(DFI=S%T=FA-104%TG=FF%CD=S) # Wireless 7760 11a/b/g Access Point, Firmware Version : AP software 1.6.44 Built on Apr 17, 2009 Fingerprint 3Com 7760 WAP Class 3Com | embedded || WAP CPE cpe:/h:3com:7760 auto SEQ(SP=14-1E%GCD=FA00|1F400|2EE00|3E800|4E200%ISR=99-A3%TI=I%II=I%SS=S%TS=1) OPS(O1=M5B4NW0NNT11%O2=M5B4NW0NNT11%O3=M5B4NW0NNT11%O4=M5B4NW0NNT11%O5=M5B4NW0NNT11%O6=M5B4NNT11) WIN(W1=2000%W2=2000%W3=2000%W4=2000%W5=2000%W6=2000) ECN(R=Y%DF=N%T=3B-45%TG=40%W=2000%O=M5B4NW0%CC=N%Q=) T1(R=Y%DF=N%T=3B-45%TG=40%S=O%A=S+%F=AS%RD=0%Q=) T2(R=N) T3(R=N) T4(R=N) T5(R=Y%DF=N%T=3B-45%TG=40%W=0%S=Z%A=S+%F=AR%O=%RD=0%Q=) T6(R=N) T7(R=N) U1(DF=N%T=3B-45%TG=40%IPL=38%UN=0%RIPL=G%RID=G%RIPCK=I%RUCK=0%RUD=G) IE(DFI=S%T=3B-45%TG=40%CD=S) # 3CRWDR100A-72, Software version 2.06T13 (Apr 25 2007 17:06:30), Boot loader version 0.67.3, ADSL modem version 07.00.04.00A Fingerprint 3Com OfficeConnect 3CRWDR100A-72 wireless ADSL modem Class 3Com | embedded || WAP CPE cpe:/h:3com:officeconnect_3crwdr100a-72 auto SEQ(SP=0-5%GCD=A|14|1E|28|32%ISR=30-3A%TI=I|RD%II=I%SS=S%TS=U) OPS(O1=M578%O2=M578%O3=M280%O4=M578%O5=M218%O6=M109) WIN(W1=1770%W2=1770%W3=1770%W4=1770%W5=1770%W6=1770) ECN(R=Y%DF=Y%T=3B-4ds -- -- NOTE: the second step currently only has support for CISCO devices -- -- Input is a table of collected vendor-ids, output is a table -- with fields: -- vendor, version, name, attributes (table), guess (table), os local function lookup(vendor_ids) if vendor_ids == {} or vendor_ids == nil then return {} end -- concat all vids to one string local all_vids = '' for _,vid in pairs(vendor_ids) do all_vids = all_vids .. vid end -- the results local info = { vendor = nil, attribs = {}, } local unmatched = {} local status, fingerprints status, fingerprints = load_fingerprints() if status then -- loop over the vendor_ids returned in ike request for _,vendor_id in pairs(vendor_ids) do -- loop over the fingerprints found in database for _,row in pairs(fingerprints) do if vendor_id:find(row.fingerprint) then -- if a match is found, check if it's a version detection or attribute if row.category == 'vendor' then local debug_string = '' if row.vendor ~= nil then debug_string = debug_string .. row.vendor .. ' ' end if row.version ~= nil then debug_string = debug_string .. row.version end stdnse.debug2("IKE: Fingerprint: %s matches %s", vendor_id, debug_string) -- Only store the first match if info.vendor == nil then -- the fingerprint contains information about the VID info.vendor = row end elseif row.category == 'attribute' then info.attribs[ #info.attribs + 1] = row stdnse.debug2("IKE: Attribute: %s matches %s", vendor_id, row.text) break end else unmatched[#unmatched+1] = vendor_id end end end end if next(unmatched) then info.unknown_ids = unmatched end --------------------------------------------------- -- Search for the order of the vids -- Uses categor CVSS2 = '7.5' }, description = [[The vulnerability allows an attacker to construct Groovy scripts that escape the sandbox and execute shell commands as the user running the Elasticsearch Java VM.]] } local report = vulns.Report:new(SCRIPT_NAME, host, port) local cleanup = function() return end local nocache = {no_cache=true, bypass_cache=true} --lets check the elastic search version. local response = http.get(host, port, '/') if response.status == 200 and response.body then local status, parsed = json.parse(response.body) if not(status) then stdnse.debug1('Parsing JSON failed(version checking). Probably not running Elasticsearch') return nil else if parsed.version.number then --check if a vulnerable version is running if (tostring(parsed.version.number):find('1.3.[0-7]') or tostring(parsed.version.number):find('1.4.[0-2]')) then vuln_table.state = vulns.STATE.LIKELY_VULN end --help the version/service detection. port.version = { name = 'elasticsearch', name_confidence = 10, product = 'Elastic elasticsearch', version = tostring(parsed.version.number), service_tunnel = 'none', cpe = {'cpe:/a:elasticsearch:elasticsearch:' .. tostring(parsed.version.number)} } nmap.set_port_version(host,port,'hardmatched') else stdnse.debug1('Cant Be Elastic search as no version number present.') return nil end end else stdnse.debug1('Not Running Elastic Search.') return nil end -- check if it is indexed, if not create index response = http.get(host,port,'_cat/indices', nocache) if response.status ~= 200 then stdnse.debug1( "Couldnt fetch indices.") return report:make_output(vuln_table) elseif response.body == '' then if invasive then local rand = rand.random_alpha(8) cleanup = function() e on failure -- @return msg containing the error message if status is false register = function(self, options) local status, response = self.session:register(options) if ( not(status) ) then return false, response end return true end, --- Sends an option request to the server and handles the response -- @name Helper.register -- @return status true on success, false on failure -- @return Response if status is true, nil else. -- @see Response options = function(self) return self.session:options() end, --- Attempts to INVITE the user at uri to a call -- @name Helper.invite -- @param uri string containing the sip uri -- @return status true on success, false on failure invite = function(self, uri) return self.session:invite(uri) end, } return _ENV; --- A relatively small implementation of the Service Location Protocol. -- It was initially designed to support requests for discovering Novell NCP -- servers, but should work for any other service as well. -- -- The implementation is based on the following classes: -- * Request.Service -- - Contains necessary code to produce a service request -- -- * Request.Attributes -- - Contains necessary code to produce a attribute request -- -- * Reply.Service -- - Contains necessary code to process and parse the response to the -- service request -- -- * Reply.Attributes -- - Contains necessary code to process and parse the response to the -- attribute request -- -- The following code illustrates intended use of the library: -- -- <code> -- local helper = srvloc.Helper:new() -- local status, tree = helper:ServiceRequest("ndap.novell", "DEFAULT") -- if ( status ) then tree = tree:match("%/%/%/(.*)%.$") end -- </code> --@author Patrik Karlsson <patrik@cqure.net> --@copyright Same as Nmap--See https://nmap.org/book/man-legal.html -- Version 0.1 -- Created 24/04/2011 - v0.1 - created by Patrik Karlsson <patrik@cqure.net> local nmap = require "nmap" locanpack(">I4", data, pos) while ( pos < lsu.header.length ) do local lsa = OSPF.LSA.parse(data:sub(pos)) if ( type(lsa) == "table" ) then table.insert(lsu.lsas, lsa) pos = pos + lsa.header.length else pos = pos + lsa end end return lsu end, }, Response = { parse = function(data) local ver, ospf_type, pos = string.unpack("BB", data) if ( ospf_type == OSPF.Message.HELLO ) then return OSPF.Hello.parse( data ) elseif( ospf_type == OSPF.Message.DB_DESCRIPTION ) then return OSPF.DBDescription.parse(data) elseif( ospf_type == OSPF.Message.LS_REQUEST ) then return OSPF.LSRequest.parse(data) elseif( ospf_type == OSPF.Message.LS_UPDATE ) then return OSPF.LSUpdate.parse(data) end return end, } } return _ENV; local ajp = require "ajp" local http = require "http" local shortport = require "shortport" local stdnse = require "stdnse" local table = require "table" description = [[ Retrieves the authentication scheme and realm of an AJP service (Apache JServ Protocol) that requires authentication. ]] --- -- @usage -- nmap -p 8009 <ip> --script ajp-auth [--script-args ajp-auth.path=/login] -- -- @output -- PORT STATE SERVICE -- 8009/tcp open ajp13 -- | ajp-auth: -- |_ Digest opaque=GPui3SvCGBoHrRMMzSsgaYBV qop=auth nonce=1336063830612:935b5b389696b0f67b9193e19f47e037 realm=example.org -- -- @args ajp-auth.path Define the request path -- author = "Patrik Karlsson" license = "Same as Nmap--See https://nmap.org/book/man-legal.html" categories = {"default", "auth", "safe"} portrule = shortport.port_or_service(8009, 'ajp13', 'tcp') local arg_path = stdnse.get_script_args(SCRIPT_NAME .. ".path") action = function(host, port) local helper = ajp.Helper:new(host, port) if ( not(helper:connect()) ) then return stdnse.format_output(false, "Failed to connect to AJP server") end local status, ait is returned by the server. -- @param service string containing the service that is requesting the -- encryption (eg. POP, IMAP, STMP) -- @param uri string containing the URI -- @return string The encoded string on success, or nil if Nmap was -- compiled without OpenSSL. function digest_md5_enc(username, password, challenge, service, uri) return DigestMD5:new(challenge, username, password, "AUTHENTICATE", uri, service):calcDigest() end function ntlm_enc(username, password, challenge) return NTLM:new(challenge, username, password):calcResponse() end else function cram_md5_enc() error("cram_md5_enc not supported without OpenSSL") end function digest_md5_enc() error("digest_md5_enc not supported without OpenSSL") end function ntlm_enc() error("ntlm_enc not supported without OpenSSL") end end MECHANISMS["CRAM-MD5"] = cram_md5_enc MECHANISMS["DIGEST-MD5"] = digest_md5_enc MECHANISMS["NTLM"] = ntlm_enc --- Encodes the parameters using the <code>PLAIN</code> mechanism. -- -- @param username string. -- @param password string. -- @return string The encoded string. function plain_enc(username, password) return username.."\0"..username.."\0"..password end MECHANISMS["PLAIN"] = plain_enc --- Checks if the given mechanism is supported by this library. -- -- @param mechanism string to check. -- @return mechanism if it is supported, otherwise nil. -- @return callback The mechanism encoding function on success. function check_mechanism(mechanism) local lmech, lcallback if mechanism then mechanism = string.upper(mechanism) if MECHANISMS[mechanism] then lmech = mechanism lcallback = MECHANISMS[mechanism] else stdnse.debug3( "sasl library does not support '%s' mechanism", mechanism) end end return lmech, lcallback end --- This is the SASL Helper class, script writers should use it to create -- SASL objects. -- -- Usage of the ver instance -- @param host table as received by the action function -- @param port table as received by the action function -- @return o instance of Driver new = function(self, host, port, options) local o = { host = host, port = port, timeout = options.timeout } setmetatable(o, self) self.__index = self return o end, connect = function(self) self.socket = brute.new_socket() self.socket:set_timeout(self.timeout) local status, err = self.socket:connect(self.host, self.port) if ( not(status) ) then local err = brute.Error:new("Connection failed") err:setRetry( true ) return false, err end return true end, login = function(self, username, password) local cmd = "id" local data = ("\0%s\0%s\0%s\0"):format(username, password, cmd) local status, err = self.socket:send(data) if ( not(status) ) then local err = brute.Error:new("Send failed") err:setRetry( true ) return false, err end local response status, response = self.socket:receive() if ( status and not is_login_failure(response)) then return true, creds.Account:new(username, password, creds.State.VALID) end return false, brute.Error:new( "Incorrect password" ) end, disconnect = function(self) self.socket:close() end, } local arg_timeout = stdnse.parse_timespec(stdnse.get_script_args(SCRIPT_NAME .. ".timeout")) arg_timeout = (arg_timeout or 10) * 1000 action = function(host, port) local options = { timeout = arg_timeout } local engine = brute.Engine:new(Driver, host, port, options) engine.options.script_name = SCRIPT_NAME local status, result = engine:start() return result end --- Functions for communicating with Konnex (KNX) devices -- -- @author Niklaus Schiess, Dominik Schneid