Server IP : 85.193.89.191 / Your IP : 18.188.92.227 Web Server : Apache System : Linux 956367-cx40159.tmweb.ru 3.10.0-1160.105.1.el7.x86_64 #1 SMP Thu Dec 7 15:39:45 UTC 2023 x86_64 User : bitrix ( 600) PHP Version : 8.1.27 Disable Function : NONE MySQL : OFF | cURL : OFF | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /lib/python2.7/site-packages/ansible/plugins/inventory/ |
Upload File : |
� � �\c @` s� d d l m Z m Z m Z e Z d Z d Z d d l Z d d l Z d d l m Z m Z d d l m Z d d l m Z d d l m Z m Z d d l m Z m Z m Z d e e e f d � � YZ d S( i ( t absolute_importt divisiont print_functions name: nmap plugin_type: inventory version_added: "2.6" short_description: Uses nmap to find hosts to target description: - Uses a YAML configuration file with a valid YAML extension. extends_documentation_fragment: - constructed - inventory_cache requirements: - nmap CLI installed options: plugin: description: token that ensures this is a source file for the 'nmap' plugin. required: True choices: ['nmap'] address: description: Network IP or range of IPs to scan, you can use a simple range (10.2.2.15-25) or CIDR notation. required: True exclude: description: list of addresses to exclude type: list ports: description: Enable/disable scanning for open ports type: boolean default: True ipv4: description: use IPv4 type addresses type: boolean default: True ipv6: description: use IPv6 type addresses type: boolean default: True notes: - At least one of ipv4 or ipv6 is required to be True, both can be True, but they cannot both be False. - 'TODO: add OS fingerprinting' sk # inventory.config file in YAML format plugin: nmap strict: False address: 192.168.0.0/24 N( t Popent PIPE( t constants( t AnsibleParserError( t to_nativet to_text( t BaseInventoryPlugint Constructablet Cacheablet InventoryModulec B` sJ e Z d Z e j d � Z e j d � Z d � Z d � Z e d � Z RS( t nmaps7 ^Nmap scan report for ([\w,.,-]+) \(([\w,.,:,\[,\]]+)\)s ^(\d+)/(\w+)\s+(\w+)\s+(\w+)c C` sz d | _ xW t j j d � j d � D]: } t j j | d � } t j j | � r% | | _ Pq% q% Wt t | � j � d S( Nt PATHt :R ( t Nonet _nmapt ost environt gett splitt patht joint existst superR t __init__( t selfR t candidate( ( sB /usr/lib/python2.7/site-packages/ansible/plugins/inventory/nmap.pyR F s " c C` s\ t } t t | � j | � rX t j j | � \ } } | sL | t j k rX t } qX n | S( N( t FalseR R t verify_fileR R t splitextt Ct YAML_FILENAME_EXTENSIONSt True( R R t validt file_namet ext( ( sB /usr/lib/python2.7/site-packages/ansible/plugins/inventory/nmap.pyR Q s c C` s� | j d k r t d � � n t t | � j | | | d | �| j | � | j g } | j d sv | j d � n | j d r� | j d r� | j d � nV | j d r� | j d r� | j d � n+ | j d r� | j d r� t d � � n | j d r1| j d � | j d j | j d � � n | j | j d � y,t | d t d t �} | j � \ } } | j d k r�t d | j t | � f � � n d } d } g } y t | d d �} Wn) t k r�} t d t | � � � n XxQ| j � D]C} | j j | � } | r�| d k rG| j j | d | � n | j d � j d � rq| j d � } n | j d � } | j d � } | d k r| j j | � | j j | d | � g } qqn | j j | � } | d k r| r| j i | j d � d 6| j d � d 6| j d � d 6| j d � d 6� qqqW| rp| rp| j j | d | � n Wn5 t k r�} t d t | � t | � f � � n Xd S( Ns8 nmap inventory plugin requires the nmap cli tool to workt cachet portss -sPt ipv4t ipv6s -4s -6s3 One of ipv4 or ipv6 must be enabled for this plugint excludes --excludet ,t addresst stdoutt stderri s Failed to run nmap, rc=%s: %st errorst surrogate_or_stricts( Invalid (non unicode) input returned: %si s .in-addr.arpai t ipt portt protocoli t statei t services failed to parse %s: %s ( R R R R R t parset _read_config_datat _optionst appendR R R t communicatet returncodeR R t UnicodeErrort splitlinest find_hostt matcht inventoryt set_variablet groupt endswitht add_hostt find_portt Exception( R R@ t loaderR R&