1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module nmap</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head><body bgcolor="#f0f0f8">
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"> <br><big><big><strong>nmap</strong></big></big> (version 0.2.4)</font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/xael/ESPACE_KM/python/python-nmap/nmap/nmap.py">/home/xael/ESPACE_KM/python/python-nmap/nmap/nmap.py</a></font></td></tr></table>
<p><tt>nmap.py - version and date, see below<br>
<br>
Author : Alexandre Norman - norman at xael.org<br>
Contributors: Steve 'Ashcrow' Milner - steve at gnulinux.net<br>
Brian Bustin - brian at bustin.us<br>
Licence : GPL v3 or any later version<br>
<br>
<br>
This program is free software: you can redistribute it and/or modify<br>
it under the terms of the GNU General Public License as published by<br>
the Free Software Foundation, either version 3 of the License, or<br>
any later version.<br>
<br>
This program is distributed in the hope that it will be useful,<br>
but WITHOUT ANY WARRANTY; without even the implied warranty of<br>
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<br>
GNU General Public License for more details.<br>
<br>
You should have received a copy of the GNU General Public License<br>
along with this program. If not, see <<a href="http://www.gnu.org/licenses/">http://www.gnu.org/licenses/</a>>.<br>
<br>
<br>
Test strings :<br>
^^^^^^^^^^^^<br>
>>> import nmap<br>
>>> if __get_last_online_version() != __version__:<br>
... raise ValueError('Current version is {0} - Last published version is {1}'.format(__version__, __get_last_online_version()))<br>
>>> nm = nmap.<a href="#PortScanner">PortScanner</a>()<br>
>>> try:<br>
... nm.scan(arguments='-wrongargs')<br>
... except nmap.<a href="#PortScannerError">PortScannerError</a>:<br>
... pass<br>
>>> r=nm.scan('127.0.0.1', '22-443')<br>
>>> nm.command_line()<br>
'nmap -oX - -p 22-443 -sV 127.0.0.1'<br>
>>> nm.scaninfo()<br>
{'tcp': {'services': '22-443', 'method': 'connect'}}<br>
>>> nm.all_hosts()<br>
['127.0.0.1']<br>
>>> nm['127.0.0.1'].hostname()<br>
'localhost.localdomain'<br>
>>> nm['127.0.0.1'].state()<br>
'up'<br>
>>> nm['127.0.0.1'].all_protocols()<br>
['tcp']<br>
>>> nm['127.0.0.1']['tcp'].keys()<br>
dict_keys([80, 25, 443, 22, 111])<br>
>>> nm['127.0.0.1'].has_tcp(22)<br>
True<br>
>>> nm['127.0.0.1'].has_tcp(23)<br>
False<br>
>>> nm['127.0.0.1']['tcp'][22]<br>
{'state': 'open', 'reason': 'syn-ack', 'name': 'ssh'}<br>
>>> nm['127.0.0.1'].tcp(22)<br>
{'state': 'open', 'reason': 'syn-ack', 'name': 'ssh'}<br>
>>> nm['127.0.0.1']['tcp'][22]['state']<br>
'open'<br>
>>> nm.scanstats()['uphosts']<br>
'1'<br>
>>> nm.scanstats()['downhosts']<br>
'0'<br>
>>> nm.scanstats()['totalhosts']<br>
'1'<br>
>>> 'timestr' in nm.scanstats().keys()<br>
True<br>
>>> 'elapsed' in nm.scanstats().keys()<br>
True<br>
>>> nm.listscan('192.168.1.0/30')<br>
['192.168.1.0', '192.168.1.1', '192.168.1.2', '192.168.1.3']<br>
>>> nm.listscan('localhost/30')<br>
['127.0.0.0', '127.0.0.1', '127.0.0.2', '127.0.0.3']<br>
>>> r=nm.scan('127.0.0.1', arguments='-O')<br>
>>> nm['127.0.0.1']['osclass']<br>
[{'vendor': u'Linux', 'osfamily': u'Linux', 'type': u'general purpose', 'osgen': u'2.6.X', 'accuracy': u'98'}, {'vendor': u'Netgear', 'osfamily': u'embedded', 'type': u'WAP', 'osgen': '', 'accuracy': ''}, {'vendor': u'Gemtek', 'osfamily': u'embedded', 'type': u'WAP', 'osgen': '', 'accuracy': ''}, {'vendor': u'Siemens', 'osfamily': u'embedded', 'type': u'WAP', 'osgen': '', 'accuracy': ''}, {'vendor': u'Linux', 'osfamily': u'Linux', 'type': u'general purpose', 'osgen': u'2.4.X', 'accuracy': u'90'}, {'vendor': u'Linksys', 'osfamily': u'embedded', 'type': u'WAP', 'osgen': '', 'accuracy': ''}, {'vendor': u'Linux', 'osfamily': u'Linux', 'type': u'WAP', 'osgen': u'2.4.X', 'accuracy': u'90'}, {'vendor': u'Nokia', 'osfamily': u'Linux', 'type': u'general purpose', 'osgen': u'2.6.X', 'accuracy': u'89'}]<br>
>>> nm['127.0.0.1']['fingerprint']<br>
'OS:SCAN(V=5.50%D=11/9%OT=22%CT=1%CU=37937%PV=N%DS=0%DC=L%G=Y%TM=4EBAE79D%P=\nOS:i686-pc-linux-gnu)SEQ(SP=103%GCD=1%ISR=10D%TI=Z%CI=Z%II=I%TS=8)OPS(O1=M4\nOS:00CST11NW6%O2=M400CST11NW6%O3=M400CNNT11NW6%O4=M400CST11NW6%O5=M400CST11\nOS:NW6%O6=M400CST11)WIN(W1=8000%W2=8000%W3=8000%W4=8000%W5=8000%W6=8000)ECN\nOS:(R=Y%DF=Y%T=40%W=8018%O=M400CNNSNW6%CC=Y%Q=)T1(R=Y%DF=Y%T=40%S=O%A=S+%F=\nOS:AS%RD=0%Q=)T2(R=N)T3(R=Y%DF=Y%T=40%W=8000%S=O%A=S+%F=AS%O=M400CST11NW6%R\nOS:D=0%Q=)T4(R=Y%DF=Y%T=40%W=0%S=A%A=Z%F=R%O=%RD=0%Q=)T5(R=Y%DF=Y%T=40%W=0%\nOS:S=Z%A=S+%F=AR%O=%RD=0%Q=)T6(R=Y%DF=Y%T=40%W=0%S=A%A=Z%F=R%O=%RD=0%Q=)T7(\nOS:R=Y%DF=Y%T=40%W=0%S=Z%A=S+%F=AR%O=%RD=0%Q=)U1(R=Y%DF=N%T=40%IPL=164%UN=0\nOS:%RIPL=G%RID=G%RIPCK=G%RUCK=G%RUD=G)IE(R=Y%DFI=N%T=40%CD=S)\n'</tt></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
<tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td>
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="collections.html">collections</a><br>
<a href="os.html">os</a><br>
<a href="re.html">re</a><br>
</td><td width="25%" valign=top><a href="shlex.html">shlex</a><br>
<a href="string.html">string</a><br>
<a href="subprocess.html">subprocess</a><br>
</td><td width="25%" valign=top><a href="sys.html">sys</a><br>
<a href="types.html">types</a><br>
<a href="xml.html">xml</a><br>
</td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ee77aa">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
<tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td>
<td width="100%"><dl>
<dt><font face="helvetica, arial"><a href="builtins.html#Exception">builtins.Exception</a>(<a href="builtins.html#BaseException">builtins.BaseException</a>)
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="nmap.html#PortScannerError">PortScannerError</a>
</font></dt></dl>
</dd>
<dt><font face="helvetica, arial"><a href="builtins.html#dict">builtins.dict</a>(<a href="builtins.html#object">builtins.object</a>)
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="nmap.html#PortScannerHostDict">PortScannerHostDict</a>
</font></dt></dl>
</dd>
<dt><font face="helvetica, arial"><a href="builtins.html#object">builtins.object</a>
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="nmap.html#PortScanner">PortScanner</a>
</font></dt><dt><font face="helvetica, arial"><a href="nmap.html#PortScannerAsync">PortScannerAsync</a>
</font></dt></dl>
</dd>
</dl>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="PortScanner">class <strong>PortScanner</strong></a>(<a href="builtins.html#object">builtins.object</a>)</font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt><a href="#PortScanner">PortScanner</a> allows to use nmap from python<br> </tt></td></tr>
<tr><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="PortScanner-__getitem__"><strong>__getitem__</strong></a>(self, host)</dt><dd><tt>returns a host detail</tt></dd></dl>
<dl><dt><a name="PortScanner-__init__"><strong>__init__</strong></a>(self, nmap_search_path<font color="#909090">=('nmap', '/usr/bin/nmap', '/usr/local/bin/nmap', '/sw/bin/nmap', '/opt/local/bin/nmap')</font>)</dt><dd><tt>Initialize the module<br>
detects nmap on the system and nmap version<br>
may raise <a href="#PortScannerError">PortScannerError</a> exception if nmap is not found in the path<br>
<br>
nmap_search_path = tupple of string where to search for nmap executable. Change this if you want to use a specific version of nmap.</tt></dd></dl>
<dl><dt><a name="PortScanner-all_hosts"><strong>all_hosts</strong></a>(self)</dt><dd><tt>returns a sorted list of all hosts</tt></dd></dl>
<dl><dt><a name="PortScanner-command_line"><strong>command_line</strong></a>(self)</dt><dd><tt>returns command line used for the scan<br>
<br>
may raise AssertionError exception if called before scanning</tt></dd></dl>
<dl><dt><a name="PortScanner-get_nmap_last_output"><strong>get_nmap_last_output</strong></a>(self)</dt><dd><tt>returns the last text output of nmap in raw text<br>
this may be used for debugging purpose</tt></dd></dl>
<dl><dt><a name="PortScanner-has_host"><strong>has_host</strong></a>(self, host)</dt><dd><tt>returns True if host has result, False otherwise</tt></dd></dl>
<dl><dt><a name="PortScanner-listscan"><strong>listscan</strong></a>(self, hosts<font color="#909090">='127.0.0.1'</font>)</dt><dd><tt>do not scan but interpret target hosts and return a list a hosts</tt></dd></dl>
<dl><dt><a name="PortScanner-nmap_version"><strong>nmap_version</strong></a>(self)</dt><dd><tt>returns nmap version if detected (int version, int subversion)<br>
or (0, 0) if unknown</tt></dd></dl>
<dl><dt><a name="PortScanner-scan"><strong>scan</strong></a>(self, hosts<font color="#909090">='127.0.0.1'</font>, ports<font color="#909090">=None</font>, arguments<font color="#909090">='-sV'</font>)</dt><dd><tt>Scan given hosts<br>
<br>
May raise <a href="#PortScannerError">PortScannerError</a> exception if nmap output something on stderr<br>
<br>
hosts = string for hosts as nmap use it 'scanme.nmap.org' or '198.116.0-255.1-127' or '216.163.128.20/20'<br>
ports = string for ports as nmap use it '22,53,110,143-4564'<br>
arguments = string of arguments for nmap '-sU -sX -sC'</tt></dd></dl>
<dl><dt><a name="PortScanner-scaninfo"><strong>scaninfo</strong></a>(self)</dt><dd><tt>returns scaninfo structure<br>
{'tcp': {'services': '22', 'method': 'connect'}}<br>
<br>
may raise AssertionError exception if called before scanning</tt></dd></dl>
<dl><dt><a name="PortScanner-scanstats"><strong>scanstats</strong></a>(self)</dt><dd><tt>returns scanstats structure<br>
{'uphosts': '3', 'timestr': 'Thu Jun 3 21:45:07 2010', 'downhosts': '253', 'totalhosts': '256', 'elapsed': '5.79'}<br>
<br>
may raise AssertionError exception if called before scanning</tt></dd></dl>
<hr>
Data descriptors defined here:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary for instance variables (if defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list of weak references to the object (if defined)</tt></dd>
</dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="PortScannerAsync">class <strong>PortScannerAsync</strong></a>(<a href="builtins.html#object">builtins.object</a>)</font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt><a href="#PortScannerAsync">PortScannerAsync</a> allows to use nmap from python asynchronously<br>
for each host scanned, callback is called with scan result for the host<br> </tt></td></tr>
<tr><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="PortScannerAsync-__del__"><strong>__del__</strong></a>(self)</dt><dd><tt>Cleanup when deleted</tt></dd></dl>
<dl><dt><a name="PortScannerAsync-__init__"><strong>__init__</strong></a>(self)</dt><dd><tt>Initialize the module<br>
detects nmap on the system and nmap version<br>
may raise <a href="#PortScannerError">PortScannerError</a> exception if nmap is not found in the path</tt></dd></dl>
<dl><dt><a name="PortScannerAsync-scan"><strong>scan</strong></a>(self, hosts<font color="#909090">='127.0.0.1'</font>, ports<font color="#909090">=None</font>, arguments<font color="#909090">='-sV'</font>, callback<font color="#909090">=None</font>)</dt><dd><tt>Scan given hosts in a separate process and return host by host result using callback function<br>
<br>
<a href="#PortScannerError">PortScannerError</a> exception from standard nmap is catched and you won't know about it<br>
<br>
hosts = string for hosts as nmap use it 'scanme.nmap.org' or '198.116.0-255.1-127' or '216.163.128.20/20'<br>
ports = string for ports as nmap use it '22,53,110,143-4564'<br>
arguments = string of arguments for nmap '-sU -sX -sC'<br>
callback = callback function which takes (host, scan_data) as arguments</tt></dd></dl>
<dl><dt><a name="PortScannerAsync-still_scanning"><strong>still_scanning</strong></a>(self)</dt><dd><tt>Return True if a scan is currently running, False otherwise</tt></dd></dl>
<dl><dt><a name="PortScannerAsync-stop"><strong>stop</strong></a>(self)</dt><dd><tt>Stop the current scan process</tt></dd></dl>
<dl><dt><a name="PortScannerAsync-wait"><strong>wait</strong></a>(self, timeout<font color="#909090">=None</font>)</dt><dd><tt>Wait for the current scan process to finish, or timeout</tt></dd></dl>
<hr>
Data descriptors defined here:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary for instance variables (if defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list of weak references to the object (if defined)</tt></dd>
</dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="PortScannerError">class <strong>PortScannerError</strong></a>(<a href="builtins.html#Exception">builtins.Exception</a>)</font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt><a href="builtins.html#Exception">Exception</a> error class for <a href="#PortScanner">PortScanner</a> class<br> </tt></td></tr>
<tr><td> </td>
<td width="100%"><dl><dt>Method resolution order:</dt>
<dd><a href="nmap.html#PortScannerError">PortScannerError</a></dd>
<dd><a href="builtins.html#Exception">builtins.Exception</a></dd>
<dd><a href="builtins.html#BaseException">builtins.BaseException</a></dd>
<dd><a href="builtins.html#object">builtins.object</a></dd>
</dl>
<hr>
Methods defined here:<br>
<dl><dt><a name="PortScannerError-__init__"><strong>__init__</strong></a>(self, value)</dt></dl>
<dl><dt><a name="PortScannerError-__str__"><strong>__str__</strong></a>(self)</dt></dl>
<hr>
Data descriptors defined here:<br>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list of weak references to the object (if defined)</tt></dd>
</dl>
<hr>
Data and other attributes inherited from <a href="builtins.html#Exception">builtins.Exception</a>:<br>
<dl><dt><strong>__new__</strong> = <built-in method __new__ of type object><dd><tt>T.<a href="#PortScannerError-__new__">__new__</a>(S, ...) -> a new <a href="builtins.html#object">object</a> with type S, a subtype of T</tt></dl>
<hr>
Methods inherited from <a href="builtins.html#BaseException">builtins.BaseException</a>:<br>
<dl><dt><a name="PortScannerError-__delattr__"><strong>__delattr__</strong></a>(...)</dt><dd><tt>x.<a href="#PortScannerError-__delattr__">__delattr__</a>('name') <==> del x.name</tt></dd></dl>
<dl><dt><a name="PortScannerError-__getattribute__"><strong>__getattribute__</strong></a>(...)</dt><dd><tt>x.<a href="#PortScannerError-__getattribute__">__getattribute__</a>('name') <==> x.name</tt></dd></dl>
<dl><dt><a name="PortScannerError-__reduce__"><strong>__reduce__</strong></a>(...)</dt></dl>
<dl><dt><a name="PortScannerError-__repr__"><strong>__repr__</strong></a>(...)</dt><dd><tt>x.<a href="#PortScannerError-__repr__">__repr__</a>() <==> repr(x)</tt></dd></dl>
<dl><dt><a name="PortScannerError-__setattr__"><strong>__setattr__</strong></a>(...)</dt><dd><tt>x.<a href="#PortScannerError-__setattr__">__setattr__</a>('name', value) <==> x.name = value</tt></dd></dl>
<dl><dt><a name="PortScannerError-__setstate__"><strong>__setstate__</strong></a>(...)</dt></dl>
<dl><dt><a name="PortScannerError-with_traceback"><strong>with_traceback</strong></a>(...)</dt><dd><tt><a href="builtins.html#Exception">Exception</a>.<a href="#PortScannerError-with_traceback">with_traceback</a>(tb) --<br>
set self.<strong>__traceback__</strong> to tb and return self.</tt></dd></dl>
<hr>
Data descriptors inherited from <a href="builtins.html#BaseException">builtins.BaseException</a>:<br>
<dl><dt><strong>__cause__</strong></dt>
<dd><tt>exception cause</tt></dd>
</dl>
<dl><dt><strong>__context__</strong></dt>
<dd><tt>exception context</tt></dd>
</dl>
<dl><dt><strong>__dict__</strong></dt>
</dl>
<dl><dt><strong>__traceback__</strong></dt>
</dl>
<dl><dt><strong>args</strong></dt>
</dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="PortScannerHostDict">class <strong>PortScannerHostDict</strong></a>(<a href="builtins.html#dict">builtins.dict</a>)</font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>Special dictionnary class for storing and accessing host scan result<br> </tt></td></tr>
<tr><td> </td>
<td width="100%"><dl><dt>Method resolution order:</dt>
<dd><a href="nmap.html#PortScannerHostDict">PortScannerHostDict</a></dd>
<dd><a href="builtins.html#dict">builtins.dict</a></dd>
<dd><a href="builtins.html#object">builtins.object</a></dd>
</dl>
<hr>
Methods defined here:<br>
<dl><dt><a name="PortScannerHostDict-all_ip"><strong>all_ip</strong></a>(self)</dt><dd><tt>returns list of ip ports</tt></dd></dl>
<dl><dt><a name="PortScannerHostDict-all_protocols"><strong>all_protocols</strong></a>(self)</dt><dd><tt>returns a list of all scanned protocols</tt></dd></dl>
<dl><dt><a name="PortScannerHostDict-all_sctp"><strong>all_sctp</strong></a>(self)</dt><dd><tt>returns list of sctp ports</tt></dd></dl>
<dl><dt><a name="PortScannerHostDict-all_tcp"><strong>all_tcp</strong></a>(self)</dt><dd><tt>returns list of tcp ports</tt></dd></dl>
<dl><dt><a name="PortScannerHostDict-all_udp"><strong>all_udp</strong></a>(self)</dt><dd><tt>returns list of udp ports</tt></dd></dl>
<dl><dt><a name="PortScannerHostDict-has_ip"><strong>has_ip</strong></a>(self, port)</dt><dd><tt>returns True if ip port has info, False otherwise</tt></dd></dl>
<dl><dt><a name="PortScannerHostDict-has_sctp"><strong>has_sctp</strong></a>(self, port)</dt><dd><tt>returns True if sctp port has info, False otherwise</tt></dd></dl>
<dl><dt><a name="PortScannerHostDict-has_tcp"><strong>has_tcp</strong></a>(self, port)</dt><dd><tt>returns True if tcp port has info, False otherwise</tt></dd></dl>
<dl><dt><a name="PortScannerHostDict-has_udp"><strong>has_udp</strong></a>(self, port)</dt><dd><tt>returns True if udp port has info, False otherwise</tt></dd></dl>
<dl><dt><a name="PortScannerHostDict-hostname"><strong>hostname</strong></a>(self)</dt><dd><tt>returns hostname</tt></dd></dl>
<dl><dt><a name="PortScannerHostDict-ip"><strong>ip</strong></a>(self, port)</dt><dd><tt>returns info for ip port</tt></dd></dl>
<dl><dt><a name="PortScannerHostDict-sctp"><strong>sctp</strong></a>(self, port)</dt><dd><tt>returns info for sctp port</tt></dd></dl>
<dl><dt><a name="PortScannerHostDict-state"><strong>state</strong></a>(self)</dt><dd><tt>returns host state</tt></dd></dl>
<dl><dt><a name="PortScannerHostDict-tcp"><strong>tcp</strong></a>(self, port)</dt><dd><tt>returns info for tpc port</tt></dd></dl>
<dl><dt><a name="PortScannerHostDict-udp"><strong>udp</strong></a>(self, port)</dt><dd><tt>returns info for udp port</tt></dd></dl>
<hr>
Data descriptors defined here:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary for instance variables (if defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list of weak references to the object (if defined)</tt></dd>
</dl>
<hr>
Methods inherited from <a href="builtins.html#dict">builtins.dict</a>:<br>
<dl><dt><a name="PortScannerHostDict-__contains__"><strong>__contains__</strong></a>(...)</dt><dd><tt>D.<a href="#PortScannerHostDict-__contains__">__contains__</a>(k) -> True if D has a key k, else False</tt></dd></dl>
<dl><dt><a name="PortScannerHostDict-__delitem__"><strong>__delitem__</strong></a>(...)</dt><dd><tt>x.<a href="#PortScannerHostDict-__delitem__">__delitem__</a>(y) <==> del x[y]</tt></dd></dl>
<dl><dt><a name="PortScannerHostDict-__eq__"><strong>__eq__</strong></a>(...)</dt><dd><tt>x.<a href="#PortScannerHostDict-__eq__">__eq__</a>(y) <==> x==y</tt></dd></dl>
<dl><dt><a name="PortScannerHostDict-__ge__"><strong>__ge__</strong></a>(...)</dt><dd><tt>x.<a href="#PortScannerHostDict-__ge__">__ge__</a>(y) <==> x>=y</tt></dd></dl>
<dl><dt><a name="PortScannerHostDict-__getattribute__"><strong>__getattribute__</strong></a>(...)</dt><dd><tt>x.<a href="#PortScannerHostDict-__getattribute__">__getattribute__</a>('name') <==> x.name</tt></dd></dl>
<dl><dt><a name="PortScannerHostDict-__getitem__"><strong>__getitem__</strong></a>(...)</dt><dd><tt>x.<a href="#PortScannerHostDict-__getitem__">__getitem__</a>(y) <==> x[y]</tt></dd></dl>
<dl><dt><a name="PortScannerHostDict-__gt__"><strong>__gt__</strong></a>(...)</dt><dd><tt>x.<a href="#PortScannerHostDict-__gt__">__gt__</a>(y) <==> x>y</tt></dd></dl>
<dl><dt><a name="PortScannerHostDict-__init__"><strong>__init__</strong></a>(...)</dt><dd><tt>x.<a href="#PortScannerHostDict-__init__">__init__</a>(...) initializes x; see help(type(x)) for signature</tt></dd></dl>
<dl><dt><a name="PortScannerHostDict-__iter__"><strong>__iter__</strong></a>(...)</dt><dd><tt>x.<a href="#PortScannerHostDict-__iter__">__iter__</a>() <==> iter(x)</tt></dd></dl>
<dl><dt><a name="PortScannerHostDict-__le__"><strong>__le__</strong></a>(...)</dt><dd><tt>x.<a href="#PortScannerHostDict-__le__">__le__</a>(y) <==> x<=y</tt></dd></dl>
<dl><dt><a name="PortScannerHostDict-__len__"><strong>__len__</strong></a>(...)</dt><dd><tt>x.<a href="#PortScannerHostDict-__len__">__len__</a>() <==> len(x)</tt></dd></dl>
<dl><dt><a name="PortScannerHostDict-__lt__"><strong>__lt__</strong></a>(...)</dt><dd><tt>x.<a href="#PortScannerHostDict-__lt__">__lt__</a>(y) <==> x<y</tt></dd></dl>
<dl><dt><a name="PortScannerHostDict-__ne__"><strong>__ne__</strong></a>(...)</dt><dd><tt>x.<a href="#PortScannerHostDict-__ne__">__ne__</a>(y) <==> x!=y</tt></dd></dl>
<dl><dt><a name="PortScannerHostDict-__repr__"><strong>__repr__</strong></a>(...)</dt><dd><tt>x.<a href="#PortScannerHostDict-__repr__">__repr__</a>() <==> repr(x)</tt></dd></dl>
<dl><dt><a name="PortScannerHostDict-__setitem__"><strong>__setitem__</strong></a>(...)</dt><dd><tt>x.<a href="#PortScannerHostDict-__setitem__">__setitem__</a>(i, y) <==> x[i]=y</tt></dd></dl>
<dl><dt><a name="PortScannerHostDict-__sizeof__"><strong>__sizeof__</strong></a>(...)</dt><dd><tt>D.<a href="#PortScannerHostDict-__sizeof__">__sizeof__</a>() -> size of D in memory, in bytes</tt></dd></dl>
<dl><dt><a name="PortScannerHostDict-clear"><strong>clear</strong></a>(...)</dt><dd><tt>D.<a href="#PortScannerHostDict-clear">clear</a>() -> None. Remove all items from D.</tt></dd></dl>
<dl><dt><a name="PortScannerHostDict-copy"><strong>copy</strong></a>(...)</dt><dd><tt>D.<a href="#PortScannerHostDict-copy">copy</a>() -> a shallow copy of D</tt></dd></dl>
<dl><dt><a name="PortScannerHostDict-get"><strong>get</strong></a>(...)</dt><dd><tt>D.<a href="#PortScannerHostDict-get">get</a>(k[,d]) -> D[k] if k in D, else d. d defaults to None.</tt></dd></dl>
<dl><dt><a name="PortScannerHostDict-items"><strong>items</strong></a>(...)</dt><dd><tt>D.<a href="#PortScannerHostDict-items">items</a>() -> a set-like <a href="builtins.html#object">object</a> providing a view on D's items</tt></dd></dl>
<dl><dt><a name="PortScannerHostDict-keys"><strong>keys</strong></a>(...)</dt><dd><tt>D.<a href="#PortScannerHostDict-keys">keys</a>() -> a set-like <a href="builtins.html#object">object</a> providing a view on D's keys</tt></dd></dl>
<dl><dt><a name="PortScannerHostDict-pop"><strong>pop</strong></a>(...)</dt><dd><tt>D.<a href="#PortScannerHostDict-pop">pop</a>(k[,d]) -> v, remove specified key and return the corresponding value.<br>
If key is not found, d is returned if given, otherwise KeyError is raised</tt></dd></dl>
<dl><dt><a name="PortScannerHostDict-popitem"><strong>popitem</strong></a>(...)</dt><dd><tt>D.<a href="#PortScannerHostDict-popitem">popitem</a>() -> (k, v), remove and return some (key, value) pair as a<br>
2-tuple; but raise KeyError if D is empty.</tt></dd></dl>
<dl><dt><a name="PortScannerHostDict-setdefault"><strong>setdefault</strong></a>(...)</dt><dd><tt>D.<a href="#PortScannerHostDict-setdefault">setdefault</a>(k[,d]) -> D.<a href="#PortScannerHostDict-get">get</a>(k,d), also set D[k]=d if k not in D</tt></dd></dl>
<dl><dt><a name="PortScannerHostDict-update"><strong>update</strong></a>(...)</dt><dd><tt>D.<a href="#PortScannerHostDict-update">update</a>(E, **F) -> None. Update D from <a href="builtins.html#dict">dict</a>/iterable E and F.<br>
If E has a .<a href="#PortScannerHostDict-keys">keys</a>() method, does: for k in E: D[k] = E[k]<br>
If E lacks .<a href="#PortScannerHostDict-keys">keys</a>() method, does: for (k, v) in E: D[k] = v<br>
In either case, this is followed by: for k in F: D[k] = F[k]</tt></dd></dl>
<dl><dt><a name="PortScannerHostDict-values"><strong>values</strong></a>(...)</dt><dd><tt>D.<a href="#PortScannerHostDict-values">values</a>() -> an <a href="builtins.html#object">object</a> providing a view on D's values</tt></dd></dl>
<hr>
Data and other attributes inherited from <a href="builtins.html#dict">builtins.dict</a>:<br>
<dl><dt><strong>__hash__</strong> = None</dl>
<dl><dt><strong>__new__</strong> = <built-in method __new__ of type object><dd><tt>T.<a href="#PortScannerHostDict-__new__">__new__</a>(S, ...) -> a new <a href="builtins.html#object">object</a> with type S, a subtype of T</tt></dl>
<dl><dt><strong>fromkeys</strong> = <built-in method fromkeys of type object><dd><tt><a href="builtins.html#dict">dict</a>.<a href="#PortScannerHostDict-fromkeys">fromkeys</a>(S[,v]) -> New <a href="builtins.html#dict">dict</a> with keys from S and values equal to v.<br>
v defaults to None.</tt></dl>
</td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#55aa55">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
<tr><td bgcolor="#55aa55"><tt> </tt></td><td> </td>
<td width="100%"><strong>__last_modification__</strong> = '2011.11.09'</td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#7799ee">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Author</strong></big></font></td></tr>
<tr><td bgcolor="#7799ee"><tt> </tt></td><td> </td>
<td width="100%">Alexandre Norman (norman@xael.org)</td></tr></table>
</body></html>
|