-
Notifications
You must be signed in to change notification settings - Fork 9
/
nmappy.py
2442 lines (2349 loc) · 96.7 KB
/
nmappy.py
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
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/usr/bin/python
#
# This software is provided under under the BSD 3-Clause License.
# See the accompanying LICENSE file for more information.
#
# Python implementation of Nmap
#
# Author:
# Arris Huijgen
import argparse, socket, sys, os.path, csv, string, random, subprocess, re
from datetime import datetime
from netaddr import *
VERSION = 0.51
WEB_URL = 'https://github.com/bitsadmin/nmappy/'
MAX_RESULTS_DISPLAY = 30
ALL_SERVICES_INCLUDED = False
# TARGET SPECIFICATION
# URL: https://nmap.org/book/man-target-specification.html
def target_spec(value):
targets = {}
octets = value.split('.')
# IP address is specified
contains_invalid_char = [char not in string.digits + '/-,' for octet in octets for char in octet]
if len(octets) == 4 and True not in contains_invalid_char:
# - 192.168.0.0/24
if '/' in octets[3]:
cidr = IPNetwork(value)
targets = {key: None for key in [str(ip) for ip in cidr[1:-1]]}
# - 192.168.0.1-254
elif '-' in octets[3]:
(ip_start, ip_end) = map(int, octets[3].split('-'))
targets = {key: None for key in
['.'.join(octets[0:3] + [str(host)]) for host in xrange(ip_start, ip_end + 1)]}
# 192.168.0.1,103,104
elif ',' in octets[3]:
targets = {key: None for key in
['.'.join(octets[0:3] + [str(host)]) for host in octets[3].split(',')]}
# - 192.168.0.*
# - 192.168.*.*
elif '*' in octets:
ips = [[i for i in xrange(1, 255)] if octet == '*' else [octet] for octet in octets]
targets = {key: None for key in
['.'.join(map(str, [a, b, c, d])) for a in ips[0] for b in ips[1] for c in ips[2] for d in
ips[3]]}
# - 192.168.0.1
else:
targets = {value: None}
# Hostname is specified
# - myserver.me
else:
targets = {value: None}
return targets
def check_file_exists(value):
if not os.path.isfile(value):
raise argparse.ArgumentTypeError('File \'%s\' does not exist.' % value)
return value
def read_input_list(args):
targets = {}
with open(args.input_filename, 'r') as input:
for line in input:
dict.update(targets, target_spec(line.strip()))
return targets
# SCAN TECHNIQUES
# Implemented: -sT, -sU
# URL: https://nmap.org/book/man-port-scanning-techniques.html
def scan_technique(value):
if value == 'U':
raise argparse.ArgumentTypeError('UDP is not supported at this moment.')
if len(value) > 1:
raise argparse.ArgumentTypeError('Currently a combination of TCP and UDP is not supported.')
return value
# PORT SPECIFICATION AND SCAN ORDER
# Implemented: -p, --top-ports
# URL: https://nmap.org/book/man-port-specification.html
def port_specification(value):
ports = []
# Use specified ports
if len(value) > 0:
for part in value.split(','):
# Port range
if '-' in part:
range = map(int, part.split('-'))
for p in xrange(range[0], range[1] + 1):
ports.append(p)
# Single port
else:
ports.append(int(part))
return ports
# OUTPUT
# Implemented: -oN
# URL: https://nmap.org/book/man-output.html
def output_validate(value):
if value == 'X':
raise argparse.ArgumentTypeError('Currently the XML output option is not supported.')
return value
def parse_arguments():
parser = argparse.ArgumentParser(description='NmapPy %.2f ( %s )' % (VERSION, WEB_URL), add_help=False)
# TARGET SPECIFICATION
target = parser.add_argument_group('TARGET SPECIFICATION')
input_options = target.add_mutually_exclusive_group(required=True)
input_options.add_argument('targets', action='store', nargs='?', type=target_spec, help='Can pass hostnames, IP addresses, networks, etc.')
input_options.add_argument('-iL', dest='input_filename', action='store', nargs='?', type=check_file_exists, default=None, help='Input from list of hosts/networks')
# HOST DISCOVERY
discovery = parser.add_argument_group('HOST DISCOVERY')
discovery.add_argument('-Pn', dest='skip_host_discovery', action='store_true', help='Treat all hosts as online -- skip host discovery')
discovery.add_argument('-sn', dest='ping_scan', action='store_true', help='Ping Scan - disable port scan')
# SCAN TECHNIQUES
scantech = parser.add_argument_group('SCAN TECHNIQUES')
scantech.add_argument('-s', dest='scan_technique', action='store', type=scan_technique, choices='TU', default='T', help='TCP Connect()/UDP scan (not implemented)')
# PORT SPECIFICATION AND SCAN ORDER
portspec = parser.add_argument_group('PORT SPECIFICATION AND SCAN ORDER')
portspec.add_argument('-p', dest='ports', action='store', type=port_specification, help='Only scan specified ports')
portspec.add_argument('--top-ports',dest='top_ports', action='store', type=int, default=1000, help='Scan <number> most common ports')
portspec.add_argument('-F', dest='top_ports', action='store_const', default=False, const=100, help='Fast mode - Scan fewer ports than the default scan')
portspec.add_argument('-r', dest='ports_randomize', action='store_false', help='Scan ports consecutively - don\'t randomize')
# SERVICE/VERSION DETECTION
# -
# SCRIPT SCAN
# -
# OS DETECTION
# -
# TIMING AND PERFORMANCE
performance = parser.add_argument_group('TIMING AND PERFORMANCE')
performance.add_argument('-T', dest='timing', action='store', type=int, choices=[i for i in xrange(1,6)], default=3, help='Set timing template (higher is faster)')
# FIREWALL/IDS EVASION AND SPOOFING
# -
# OUTPUT
output = parser.add_argument_group('OUTPUT')
output.add_argument('-v', dest='verbosity', action='count', default=0, help='Increase verbosity level (use -vv or more for greater effect)')
output.add_argument('-o', dest='output_type', action='store', choices='NX', type=output_validate, help='Output scan in normal/XML (not implemented)')
output.add_argument('output_file', help='File name/location', nargs='?')
# MISC
misc = parser.add_argument_group('MISC')
misc.add_argument('-h', '--help', action='help', help='Print this help summary page.')
# Always show full help when no arguments are provided
if len(sys.argv) == 1:
parser.print_help()
sys.exit(1)
return parser.parse_args()
def ping(ip, timing):
# Windows (win32)
if sys.platform == 'win32':
cmd = ['ping', '-n', '1', '-w', str(2000/timing), ip]
# Success: Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
# Fail: Request timed out.
pattern = '^Reply from ([0-9]{1,3}\.?){4}: bytes=[0-9]+ time[=<]?(?P<MS>([0-9]+))ms TTL=[0-9]+\r$'
# Linux (linux2)
else:
cmd = ['timeout', '%.2f' % (2.0/timing), 'ping', '-s', '24', '-c', '1', ip]
# Success: 1 packets transmitted, 1 received, 0% packet loss, time 0ms
# Fail: [empty]
pattern = '^1 packets transmitted, 1 received, 0% packet loss, time (?P<MS>([0-9]+))ms$'
# Execute command
process = subprocess.Popen(cmd, stdout=subprocess.PIPE)
output = process.communicate()[0]
# Extract milliseconds from output
ms = -1
m = re.search(pattern, output, flags=re.MULTILINE)
if m is not None:
ms = int(m.group('MS'))
# Exit process
process.wait()
return ms
def check_port(host, proto, port, timeout):
result = False
try:
if proto == 'tcp':
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
else:
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.settimeout(1.0/timeout)
r = sock.connect_ex((host, port))
if r == 0:
result = True
sock.close()
except Exception:
pass
return result
def read_services():
# Read services from file, if available; otherwise the (limited) built-in list will be used
if not ALL_SERVICES_INCLUDED and os.path.isfile('nmap-services'):
sfile = csv.reader(open('nmap-services', 'r'), dialect='excel-tab')
global services
services = []
for s in sfile:
if not str(s[0]).startswith('#'):
services.append((s[1], s[0], s[2]))
services = sorted(services, key=lambda s: s[2], reverse=True)
# Process list for easier usage
for s in services:
(port, proto) = str(s[0]).split('/')
(port, proto) = (int(port), proto)
services_lookup[proto][port] = s[1]
services_top[proto].append(port)
def configure_scan(args):
# If -iL (input list) is provided, fill targets based on this
if args.input_filename is not None:
args.targets = read_input_list(args)
# Determine protocol based on Port Scanning Technique
if args.scan_technique == 'T':
args.proto = 'tcp'
else:
args.proto = 'udp'
# In case no ports are provided, use top-ports
if not args.ports:
ports = []
for s in services_top[args.proto]:
ports.append(s)
if len(ports) == args.top_ports:
break
args.ports = ports
# Randomize order of ports
if args.ports_randomize:
random.shuffle(args.ports)
# Output
if args.output_type == 'N':
try:
f = open(args.output_file, 'w', 0)
args.output = f
except IOError as e:
print "I/O error({0}): {1}".format(e.errno, e.strerror)
sys.exit(1)
else:
args.output = None
def finish_scan(args):
# Close output file handle
if args.output:
args.output.close()
def print_line(line, output):
print line
if output:
output.write(line + '\n')
def main():
# Check validity of commandline arguments
args = parse_arguments()
# Prepare services list
read_services()
# Configure scan
configure_scan(args)
try:
# Header
start_time = datetime.now()
print ''
print_line('Starting NmapPy %.2f ( %s ) at %s' % (VERSION, WEB_URL, start_time.strftime('%Y-%m-%d %H:%M %Z%z')), args.output)
targets_sorted = sorted(args.targets.keys(), key=lambda i: socket.inet_aton(i) if re.match('([0-9]{1,3}\.?){4}', i) is not None else '')
for target in targets_sorted:
ip = socket.gethostbyname(target)
# HOST DISCOVERY
ms = 0 # -1 = down; 0 = (forced) up; >0 = up with latency
report_line = 'NmapPy scan report for %s%s' % (target, ' (%s)' % ip if ip != target else '')
# Skip discovery if -Pn is set
if not args.skip_host_discovery:
ms = ping(ip, args.timing)
# Host is down
if ms == -1:
# If only one host is scanned, display info line
if len(args.targets) == 1:
print_line('Note: Host seems down. If it is really up, but blocking our ping probes, try -Pn', args.output)
# Store info that host is down
args.targets[target] = (ip, ms, [])
# Continue to next host, which results a scan finished in case only one host is scanned
continue
# Host is up
else:
print_line(report_line, args.output)
else:
print_line(report_line, args.output)
# Host status line
latency = ''
if not args.skip_host_discovery:
latency = ' (%.2fs latency)' % (ms / 1000.0)
print_line('Host is up%s.' % latency, args.output)
# Skip port scan in case of ping scan
if args.ping_scan:
continue
# PORT SCAN
table = AsciiTable(args.ports)
table.print_heading()
results = []
for port in args.ports:
# Perform check and store result
state = check_port(ip, args.proto, port, args.timing)
results.append([port, state])
# Show all if number of ports to check is less than or equal to MAX_RESULTS_DISPLAY
if len(args.ports) <= MAX_RESULTS_DISPLAY or args.verbosity > 0 or state:
table.print_line(args.proto, port, state, args.output)
args.targets[target] = (ip, ms, results)
# Summary per host: Closed ports
if len(args.ports) > MAX_RESULTS_DISPLAY:
hidden = len(args.ports) - len(filter(lambda r: r[1], results))
# All ports are closed
if hidden == len(args.ports):
print_line('All %d scanned ports on %s are filtered' % (len(args.ports), ip), args.output)
# Some ports are open
elif hidden > 0:
print_line('Not shown: %d closed ports' % hidden, args.output)
print_line('', args.output)
# Overall summary
end_time = datetime.now()
elapsed = (end_time - start_time)
targets_total = len(args.targets)
targets_up = len(filter(lambda t: args.targets[t][1] != -1, args.targets))
print_line(
'NmapPy done: %d IP address%s (%d host%s up) scanned in %d.%02d seconds' % (
targets_total,
'es' if targets_total > 1 else '', # XX IP address(es)
targets_up,
's' if targets_up > 1 else '', # (XX host(s) up)
elapsed.seconds,
elapsed.microseconds/10000),
args.output
)
# Round off scan
finish_scan(args)
except KeyboardInterrupt:
sys.exit(1)
class AsciiTable:
def __init__(self, ports=None):
# Estimate the maximum width required for the PORT column
if not ports:
self.maxportwidth = len('65535/tcp')
else:
self.maxportwidth = len('%d/tcp' % max(ports))
def print_heading(self):
f = '{0: <%d} {1: <6} {2}' % self.maxportwidth
print f.format('PORT', 'STATE', 'SERVICE')
def print_line(self, proto, port, state, output):
f = '{0: <%d} {1: <6} {2}' % self.maxportwidth
print_line(f.format(
'%d/%s' % (port, proto),
'open' if state else 'closed',
services_lookup[proto][port] if (proto in services_lookup and port in services_lookup[proto]) else ''
),
output)
# nmap-services (C) 1996-2011 by Insecure.Com LLC.
services = [
('80/tcp', 'http', '0.484143'),
('631/udp', 'ipp', '0.450281'),
('161/udp', 'snmp', '0.433467'),
('137/udp', 'netbios-ns', '0.365163'),
('123/udp', 'ntp', '0.330879'),
('138/udp', 'netbios-dgm', '0.297830'),
('1434/udp', 'ms-sql-m', '0.293184'),
('445/udp', 'microsoft-ds', '0.253118'),
('135/udp', 'msrpc', '0.244452'),
('67/udp', 'dhcps', '0.228010'),
('23/tcp', 'telnet', '0.221265'),
('53/udp', 'domain', '0.213496'),
('443/tcp', 'https', '0.208669'),
('21/tcp', 'ftp', '0.197667'),
('139/udp', 'netbios-ssn', '0.193726'),
('22/tcp', 'ssh', '0.182286'),
('500/udp', 'isakmp', '0.163742'),
('68/udp', 'dhcpc', '0.140118'),
('520/udp', 'route', '0.139376'),
('1900/udp', 'upnp', '0.136543'),
('25/tcp', 'smtp', '0.131314'),
('4500/udp', 'nat-t-ike', '0.124467'),
('514/udp', 'syslog', '0.119804'),
('49152/udp', 'unknown', '0.116002'),
('162/udp', 'snmptrap', '0.103346'),
('69/udp', 'tftp', '0.102835'),
('5353/udp', 'zeroconf', '0.100166'),
('111/udp', 'rpcbind', '0.093988'),
('49154/udp', 'unknown', '0.092369'),
('3389/tcp', 'ms-wbt-server', '0.083904'),
('110/tcp', 'pop3', '0.077142'),
('1701/udp', 'L2TP', '0.076163'),
('998/udp', 'puparp', '0.073395'),
('996/udp', 'vsinet', '0.073362'),
('997/udp', 'maitrd', '0.073247'),
('999/udp', 'applix', '0.073230'),
('3283/udp', 'netassistant', '0.066072'),
('49153/udp', 'unknown', '0.060743'),
('445/tcp', 'microsoft-ds', '0.056944'),
('1812/udp', 'radius', '0.053839'),
('136/udp', 'profile', '0.051862'),
('139/tcp', 'netbios-ssn', '0.050809'),
('143/tcp', 'imap', '0.050420'),
('53/tcp', 'domain', '0.048463'),
('2222/udp', 'msantipiracy', '0.047902'),
('135/tcp', 'msrpc', '0.047798'),
('3306/tcp', 'mysql', '0.045390'),
('2049/udp', 'nfs', '0.044531'),
('32768/udp', 'omad', '0.044407'),
('5060/udp', 'sip', '0.044350'),
('8080/tcp', 'http-proxy', '0.042052'),
('1025/udp', 'blackjack', '0.041813'),
('1433/udp', 'ms-sql-s', '0.036821'),
('3456/udp', 'IISrpc-or-vat', '0.036607'),
('80/udp', 'http', '0.035767'),
('1723/tcp', 'pptp', '0.032468'),
('111/tcp', 'rpcbind', '0.030034'),
('995/tcp', 'pop3s', '0.029921'),
('993/tcp', 'imaps', '0.027199'),
('20031/udp', 'bakbonenetvault', '0.025490'),
('1026/udp', 'win-rpc', '0.024777'),
('7/udp', 'echo', '0.024679'),
('5900/tcp', 'vnc', '0.023560'),
('1646/udp', 'radacct', '0.023196'),
('1645/udp', 'radius', '0.023180'),
('593/udp', 'http-rpc-epmap', '0.022933'),
('1025/tcp', 'NFS-or-IIS', '0.022406'),
('518/udp', 'ntalk', '0.022208'),
('2048/udp', 'dls-monitor', '0.021549'),
('626/udp', 'serialnumberd', '0.021473'),
('1027/udp', 'unknown', '0.019822'),
('587/tcp', 'submission', '0.019721'),
('177/udp', 'xdmcp', '0.018551'),
('1719/udp', 'h323gatestat', '0.018500'),
('427/udp', 'svrloc', '0.018270'),
('497/udp', 'retrospect', '0.017348'),
('8888/tcp', 'sun-answerbook', '0.016522'),
('4444/udp', 'krb524', '0.016343'),
('1023/udp', 'unknown', '0.016188'),
('65024/udp', 'unknown', '0.016064'),
('199/tcp', 'smux', '0.015945'),
('19/udp', 'chargen', '0.015865'),
('9/udp', 'discard', '0.015733'),
('49193/udp', 'unknown', '0.015562'),
('1029/udp', 'solid-mux', '0.014536'),
('1720/tcp', 'h323q931', '0.014277'),
('49/udp', 'tacacs', '0.014020'),
('465/tcp', 'smtps', '0.013888'),
('88/udp', 'kerberos-sec', '0.013476'),
('1028/udp', 'ms-lsa', '0.013443'),
('17185/udp', 'wdbrpc', '0.013395'),
('1718/udp', 'h225gatedisc', '0.012554'),
('49186/udp', 'unknown', '0.012550'),
('548/tcp', 'afp', '0.012395'),
('113/tcp', 'ident', '0.012370'),
('81/tcp', 'hosts2-ns', '0.012056'),
('6001/tcp', 'X11:1', '0.011730'),
('2000/udp', 'cisco-sccp', '0.011697'),
('10000/tcp', 'snet-sensor-mgmt', '0.011692'),
('31337/udp', 'BackOrifice', '0.011469'),
('514/tcp', 'shell', '0.011078'),
('49192/udp', 'unknown', '0.011044'),
('49201/udp', 'unknown', '0.011044'),
('515/udp', 'printer', '0.011022'),
('2223/udp', 'rockwell-csp2', '0.010902'),
('443/udp', 'https', '0.010840'),
('5060/tcp', 'sip', '0.010613'),
('49181/udp', 'unknown', '0.010542'),
('179/tcp', 'bgp', '0.010538'),
('1813/udp', 'radacct', '0.010429'),
('1026/tcp', 'LSA-or-nterm', '0.010237'),
('120/udp', 'cfdptkt', '0.010181'),
('158/udp', 'pcmail-srv', '0.010148'),
('2000/tcp', 'cisco-sccp', '0.010112'),
('49200/udp', 'unknown', '0.010040'),
('8443/tcp', 'https-alt', '0.009986'),
('8000/tcp', 'http-alt', '0.009710'),
('3703/udp', 'adobeserver-3', '0.009580'),
('32815/udp', 'unknown', '0.009322'),
('17/udp', 'qotd', '0.009209'),
('32768/tcp', 'filenet-tms', '0.009199'),
('5000/udp', 'upnp', '0.008913'),
('32771/udp', 'sometimes-rpc6', '0.008490'),
('33281/udp', 'unknown', '0.008286'),
('554/tcp', 'rtsp', '0.008104'),
('1030/udp', 'iad1', '0.008007'),
('26/tcp', 'rsftp', '0.007991'),
('1433/tcp', 'ms-sql-s', '0.007929'),
('623/udp', 'asf-rmcp', '0.007929'),
('1022/udp', 'exp2', '0.007929'),
('49152/tcp', 'unknown', '0.007907'),
('32769/udp', 'filenet-rpc', '0.007768'),
('5632/udp', 'pcanywherestat', '0.007694'),
('10000/udp', 'ndmp', '0.007598'),
('49156/udp', 'unknown', '0.007530'),
('49182/udp', 'unknown', '0.007530'),
('49191/udp', 'unknown', '0.007530'),
('49194/udp', 'unknown', '0.007530'),
('2001/tcp', 'dc', '0.007339'),
('9200/udp', 'wap-wsp', '0.007268'),
('515/tcp', 'printer', '0.007214'),
('30718/udp', 'unknown', '0.007190'),
('49185/udp', 'unknown', '0.007028'),
('49188/udp', 'unknown', '0.007028'),
('49190/udp', 'unknown', '0.007028'),
('49211/udp', 'unknown', '0.007028'),
('5001/udp', 'commplex-link', '0.007018'),
('5355/udp', 'llmnr', '0.006938'),
('8008/tcp', 'http', '0.006843'),
('49154/tcp', 'unknown', '0.006767'),
('32770/udp', 'sometimes-rpc4', '0.006745'),
('34555/udp', 'unknown', '0.006732'),
('34861/udp', 'unknown', '0.006732'),
('37444/udp', 'unknown', '0.006732'),
('1027/tcp', 'IIS', '0.006724'),
('1032/udp', 'iad3', '0.006705'),
('3130/udp', 'squid-ipc', '0.006656'),
('4045/udp', 'lockd', '0.006656'),
('1031/udp', 'iad2', '0.006639'),
('5666/tcp', 'nrpe', '0.006614'),
('646/tcp', 'ldp', '0.006549'),
('49158/udp', 'unknown', '0.006526'),
('49196/udp', 'unknown', '0.006526'),
('37/udp', 'time', '0.006458'),
('2967/udp', 'symantec-av', '0.006425'),
('5000/tcp', 'upnp', '0.006423'),
('4000/udp', 'icq', '0.006392'),
('989/udp', 'ftps-data', '0.006277'),
('3659/udp', 'apple-sasl', '0.006277'),
('5631/tcp', 'pcanywheredata', '0.006248'),
('4672/udp', 'rfa', '0.006227'),
('34862/udp', 'unknown', '0.006214'),
('23/udp', 'telnet', '0.006211'),
('631/tcp', 'ipp', '0.006160'),
('49153/tcp', 'unknown', '0.006158'),
('8081/tcp', 'blackice-icecap', '0.006147'),
('2049/tcp', 'nfs', '0.006110'),
('88/tcp', 'kerberos-sec', '0.006072'),
('49162/udp', 'unknown', '0.006024'),
('49187/udp', 'unknown', '0.006024'),
('49189/udp', 'unknown', '0.006024'),
('49195/udp', 'unknown', '0.006024'),
('79/tcp', 'finger', '0.006022'),
('5800/tcp', 'vnc-http', '0.005947'),
('2148/udp', 'veritas-ucl', '0.005946'),
('106/tcp', 'pop3pw', '0.005934'),
('2121/tcp', 'ccproxy-ftp', '0.005834'),
('1110/tcp', 'nfsd-status', '0.005809'),
('49155/tcp', 'unknown', '0.005702'),
('41524/udp', 'unknown', '0.005697'),
('6000/tcp', 'X11', '0.005683'),
('513/tcp', 'login', '0.005595'),
('10080/udp', 'amanda', '0.005585'),
('990/tcp', 'ftps', '0.005570'),
('5357/tcp', 'wsdapi', '0.005474'),
('427/tcp', 'svrloc', '0.005382'),
('32772/udp', 'sometimes-rpc8', '0.005352'),
('49156/tcp', 'unknown', '0.005322'),
('407/udp', 'timbuktu', '0.005305'),
('42/udp', 'nameserver', '0.005288'),
('543/tcp', 'klogin', '0.005282'),
('544/tcp', 'kshell', '0.005269'),
('33354/udp', 'unknown', '0.005179'),
('1034/udp', 'activesync-notify', '0.005173'),
('5101/tcp', 'admdog', '0.005156'),
('49180/udp', 'unknown', '0.005020'),
('49199/udp', 'unknown', '0.005020'),
('144/tcp', 'news', '0.004981'),
('1001/udp', 'unknown', '0.004955'),
('3389/udp', 'ms-wbt-server', '0.004955'),
('6346/udp', 'gnutella', '0.004893'),
('7/tcp', 'echo', '0.004855'),
('21/udp', 'ftp', '0.004844'),
('13/udp', 'daytime', '0.004827'),
('517/udp', 'talk', '0.004794'),
('1068/udp', 'instl_bootc', '0.004778'),
('389/tcp', 'ldap', '0.004717'),
('8009/tcp', 'ajp13', '0.004642'),
('990/udp', 'ftps', '0.004625'),
('1041/udp', 'danf-ak2', '0.004625'),
('1045/udp', 'fpitp', '0.004625'),
('1782/udp', 'hp-hcip', '0.004625'),
('6001/udp', 'X11:1', '0.004625'),
('19283/udp', 'keysrvr', '0.004575'),
('49171/udp', 'unknown', '0.004518'),
('49179/udp', 'unknown', '0.004518'),
('49184/udp', 'unknown', '0.004518'),
('49202/udp', 'unknown', '0.004518'),
('49205/udp', 'unknown', '0.004518'),
('49208/udp', 'unknown', '0.004518'),
('49209/udp', 'unknown', '0.004518'),
('49210/udp', 'unknown', '0.004518'),
('3128/tcp', 'squid-http', '0.004516'),
('9876/udp', 'sd', '0.004498'),
('444/tcp', 'snpp', '0.004466'),
('39213/udp', 'sygatefw', '0.004446'),
('9999/tcp', 'abyss', '0.004441'),
('5009/tcp', 'airport-admin', '0.004416'),
('800/udp', 'mdbs_daemon', '0.004333'),
('7070/tcp', 'realserver', '0.004328'),
('389/udp', 'ldap', '0.004300'),
('464/udp', 'kpasswd5', '0.004300'),
('1036/udp', 'nsstp', '0.004295'),
('1038/udp', 'mtqp', '0.004295'),
('1039/udp', 'sbl', '0.004295'),
('1419/udp', 'timbuktu-srv3', '0.004267'),
('5190/tcp', 'aol', '0.004190'),
('192/udp', 'osu-nms', '0.004168'),
('199/udp', 'smux', '0.004152'),
('44968/udp', 'unknown', '0.004143'),
('3000/tcp', 'ppp', '0.004115'),
('5432/tcp', 'postgresql', '0.004090'),
('1008/udp', 'ufsd', '0.004020'),
('49159/udp', 'unknown', '0.004016'),
('49166/udp', 'unknown', '0.004016'),
('1900/tcp', 'upnp', '0.003977'),
('3986/tcp', 'mapper-ws_ethd', '0.003977'),
('1024/udp', 'unknown', '0.003964'),
('1033/udp', 'netinfo-local', '0.003964'),
('13/tcp', 'daytime', '0.003927'),
('19682/udp', 'unknown', '0.003922'),
('22986/udp', 'unknown', '0.003922'),
('22/udp', 'ssh', '0.003905'),
('1029/tcp', 'ms-lsa', '0.003801'),
('9/tcp', 'discard', '0.003764'),
('2002/udp', 'globe', '0.003740'),
('5051/tcp', 'ida-agent', '0.003649'),
('6646/tcp', 'unknown', '0.003649'),
('664/udp', 'secure-aux-bus', '0.003634'),
('1021/udp', 'exp1', '0.003634'),
('11487/udp', 'unknown', '0.003634'),
('49157/tcp', 'unknown', '0.003573'),
('49163/udp', 'unknown', '0.003514'),
('49165/udp', 'unknown', '0.003514'),
('49168/udp', 'unknown', '0.003514'),
('49172/udp', 'unknown', '0.003514'),
('58002/udp', 'unknown', '0.003514'),
('1043/udp', 'boinc', '0.003493'),
('1028/tcp', 'unknown', '0.003421'),
('873/tcp', 'rsync', '0.003400'),
('1755/tcp', 'wms', '0.003350'),
('2717/tcp', 'pn-requester', '0.003345'),
('4899/tcp', 'radmin', '0.003337'),
('683/udp', 'corba-iiop', '0.003304'),
('1019/udp', 'unknown', '0.003304'),
('1044/udp', 'dcutility', '0.003304'),
('1049/udp', 'td-postman', '0.003304'),
('1885/udp', 'vrtstrapserver', '0.003304'),
('3052/udp', 'apc-3052', '0.003304'),
('5093/udp', 'sentinel-lm', '0.003304'),
('5351/udp', 'nat-pmp', '0.003304'),
('6000/udp', 'X11', '0.003304'),
('7938/udp', 'unknown', '0.003304'),
('5500/udp', 'securid', '0.003295'),
('9100/tcp', 'jetdirect', '0.003287'),
('16680/udp', 'unknown', '0.003268'),
('27892/udp', 'unknown', '0.003268'),
('119/tcp', 'nntp', '0.003262'),
('32773/udp', 'sometimes-rpc10', '0.003238'),
('37/tcp', 'time', '0.003161'),
('1000/tcp', 'cadlock', '0.003149'),
('3001/tcp', 'nessus', '0.003124'),
('35777/udp', 'unknown', '0.003107'),
('41058/udp', 'unknown', '0.003107'),
('113/udp', 'auth', '0.003031'),
('5001/tcp', 'commplex-link', '0.003023'),
('49160/udp', 'unknown', '0.003012'),
('49169/udp', 'unknown', '0.003012'),
('49174/udp', 'unknown', '0.003012'),
('52225/udp', 'unknown', '0.003012'),
('685/udp', 'mdc-portmapper', '0.002973'),
('686/udp', 'hcp-wismar', '0.002973'),
('1047/udp', 'neod1', '0.002973'),
('1056/udp', 'vfo', '0.002973'),
('1886/udp', 'leoip', '0.002973'),
('6004/udp', 'X11:4', '0.002973'),
('8193/udp', 'sophos', '0.002973'),
('38293/udp', 'landesk-cba', '0.002970'),
('782/udp', 'hp-managed-node', '0.002933'),
('82/tcp', 'xfer', '0.002923'),
('786/udp', 'concert', '0.002900'),
('10010/tcp', 'rxapi', '0.002889'),
('38037/udp', 'landesk-cba', '0.002869'),
('1030/tcp', 'iad1', '0.002860'),
('32774/udp', 'sometimes-rpc12', '0.002819'),
('9090/tcp', 'zeus-admin', '0.002747'),
('2107/tcp', 'msmq-mgmt', '0.002737'),
('1024/tcp', 'kdm', '0.002722'),
('780/udp', 'wpgs', '0.002718'),
('1080/udp', 'socks', '0.002685'),
('32775/udp', 'sometimes-rpc14', '0.002668'),
('2103/tcp', 'zephyr-clt', '0.002661'),
('682/udp', 'xfr', '0.002643'),
('983/udp', 'unknown', '0.002643'),
('1014/udp', 'unknown', '0.002643'),
('1054/udp', 'brvread', '0.002643'),
('1066/udp', 'fpo-fns', '0.002643'),
('2051/udp', 'epnsdp', '0.002643'),
('6970/udp', 'unknown', '0.002643'),
('6971/udp', 'unknown', '0.002643'),
('9950/udp', 'apc-9950', '0.002643'),
('781/udp', 'hp-collector', '0.002636'),
('5050/udp', 'mmcc', '0.002636'),
('16832/udp', 'unknown', '0.002614'),
('16947/udp', 'unknown', '0.002614'),
('18449/udp', 'unknown', '0.002614'),
('19120/udp', 'unknown', '0.002614'),
('19503/udp', 'unknown', '0.002614'),
('19616/udp', 'unknown', '0.002614'),
('20019/udp', 'unknown', '0.002614'),
('20126/udp', 'unknown', '0.002614'),
('20389/udp', 'unknown', '0.002614'),
('21383/udp', 'unknown', '0.002614'),
('22846/udp', 'unknown', '0.002614'),
('22996/udp', 'unknown', '0.002614'),
('25375/udp', 'unknown', '0.002614'),
('27195/udp', 'unknown', '0.002614'),
('28547/udp', 'unknown', '0.002614'),
('29823/udp', 'unknown', '0.002614'),
('30303/udp', 'unknown', '0.002614'),
('30365/udp', 'unknown', '0.002614'),
('31073/udp', 'unknown', '0.002614'),
('31681/udp', 'unknown', '0.002614'),
('31891/udp', 'unknown', '0.002614'),
('6004/tcp', 'X11:4', '0.002597'),
('33355/udp', 'unknown', '0.002589'),
('42172/udp', 'unknown', '0.002589'),
('1801/tcp', 'msmq', '0.002585'),
('5050/tcp', 'mmcc', '0.002584'),
('32779/udp', 'sometimes-rpc22', '0.002584'),
('19/tcp', 'chargen', '0.002559'),
('49167/udp', 'unknown', '0.002510'),
('49175/udp', 'unknown', '0.002510'),
('49198/udp', 'unknown', '0.002510'),
('49204/udp', 'unknown', '0.002510'),
('49212/udp', 'unknown', '0.002510'),
('49213/udp', 'unknown', '0.002510'),
('49215/udp', 'unknown', '0.002510'),
('52503/udp', 'unknown', '0.002510'),
('53571/udp', 'unknown', '0.002510'),
('8031/tcp', 'unknown', '0.002509'),
('5002/udp', 'rfe', '0.002504'),
('1041/tcp', 'danf-ak2', '0.002433'),
('27015/udp', 'halflife', '0.002432'),
('255/tcp', 'unknown', '0.002409'),
('1048/tcp', 'neod2', '0.002357'),
('1049/tcp', 'td-postman', '0.002357'),
('1053/tcp', 'remote-as', '0.002357'),
('1054/tcp', 'brvread', '0.002357'),
('1056/tcp', 'vfo', '0.002357'),
('1064/tcp', 'jstel', '0.002357'),
('1065/tcp', 'syscomlan', '0.002357'),
('2967/tcp', 'symantec-av', '0.002357'),
('3703/tcp', 'adobeserver-3', '0.002357'),
('5003/udp', 'filemaker', '0.002356'),
('17/tcp', 'qotd', '0.002346'),
('7000/udp', 'afs3-fileserver', '0.002339'),
('513/udp', 'who', '0.002323'),
('1485/udp', 'lansource', '0.002323'),
('684/udp', 'corba-iiop-ssl', '0.002313'),
('1037/udp', 'ams', '0.002313'),
('1048/udp', 'neod2', '0.002313'),
('1065/udp', 'syscomlan', '0.002313'),
('1090/udp', 'ff-fms', '0.002313'),
('1761/udp', 'cft-0', '0.002313'),
('9103/udp', 'bacula-sd', '0.002313'),
('808/tcp', 'ccproxy-http', '0.002296'),
('3689/tcp', 'rendezvous', '0.002283'),
('32777/udp', 'sometimes-rpc18', '0.002282'),
('539/udp', 'apertus-ldp', '0.002274'),
('434/udp', 'mobileip-agent', '0.002257'),
('767/udp', 'phonebook', '0.002257'),
('54321/udp', 'bo2k', '0.002246'),
('3401/udp', 'squid-snmp', '0.002241'),
('1031/tcp', 'iad2', '0.002221'),
('112/udp', 'mcidas', '0.002208'),
('1044/tcp', 'dcutility', '0.002205'),
('1071/tcp', 'bsquare-voip', '0.002205'),
('5901/tcp', 'vnc-1', '0.002145'),
('512/udp', 'biff', '0.002142'),
('1000/udp', 'ock', '0.002142'),
('6347/udp', 'gnutella2', '0.002142'),
('100/tcp', 'newacct', '0.002133'),
('9102/tcp', 'jetdirect', '0.002133'),
('1039/tcp', 'sbl', '0.002129'),
('2869/tcp', 'icslap', '0.002129'),
('4001/tcp', 'newoak', '0.002129'),
('5120/tcp', 'unknown', '0.002129'),
('8010/tcp', 'xmpp', '0.002129'),
('9000/tcp', 'cslistener', '0.002129'),
('363/udp', 'rsvp_tunnel', '0.002125'),
('2105/tcp', 'eklogin', '0.002120'),
('636/tcp', 'ldapssl', '0.002083'),
('32818/udp', 'unknown', '0.002071'),
('32931/udp', 'unknown', '0.002071'),
('33744/udp', 'unknown', '0.002071'),
('34125/udp', 'unknown', '0.002071'),
('34892/udp', 'unknown', '0.002071'),
('35438/udp', 'unknown', '0.002071'),
('36206/udp', 'unknown', '0.002071'),
('39888/udp', 'unknown', '0.002071'),
('40116/udp', 'unknown', '0.002071'),
('40441/udp', 'unknown', '0.002071'),
('40708/udp', 'unknown', '0.002071'),
('40732/udp', 'unknown', '0.002071'),
('40915/udp', 'unknown', '0.002071'),
('41081/udp', 'unknown', '0.002071'),
('41370/udp', 'unknown', '0.002071'),
('42508/udp', 'candp', '0.002071'),
('45441/udp', 'unknown', '0.002071'),
('47624/udp', 'directplaysrvr', '0.002071'),
('1038/tcp', 'mtqp', '0.002053'),
('38/udp', 'rap', '0.002043'),
('776/udp', 'wpages', '0.002043'),
('2601/tcp', 'zebra', '0.002032'),
('32776/udp', 'sometimes-rpc16', '0.002013'),
('49157/udp', 'unknown', '0.002008'),
('49161/udp', 'unknown', '0.002008'),
('49170/udp', 'unknown', '0.002008'),
('49173/udp', 'unknown', '0.002008'),
('49176/udp', 'unknown', '0.002008'),
('49197/udp', 'unknown', '0.002008'),
('49207/udp', 'unknown', '0.002008'),
('49503/udp', 'unknown', '0.002008'),
('50612/udp', 'unknown', '0.002008'),
('51717/udp', 'unknown', '0.002008'),
('54281/udp', 'unknown', '0.002008'),
('56141/udp', 'unknown', '0.002008'),
('58631/udp', 'unknown', '0.002008'),
('58640/udp', 'unknown', '0.002008'),
('61370/udp', 'unknown', '0.002008'),
('62287/udp', 'unknown', '0.002008'),
('63555/udp', 'unknown', '0.002008'),
('64513/udp', 'unknown', '0.002008'),
('1/tcp', 'tcpmux', '0.001995'),
('7000/tcp', 'afs3-fileserver', '0.001995'),
('217/udp', 'dbase', '0.001993'),
('775/udp', 'acmaint_transd', '0.001993'),
('1012/udp', 'sometimes-rpc1', '0.001993'),
('643/udp', 'sanity', '0.001982'),
('687/udp', 'asipregistry', '0.001982'),
('688/udp', 'realm-rusd', '0.001982'),
('829/udp', 'pkix-3-ca-ra', '0.001982'),
('902/udp', 'ideafarm-door', '0.001982'),
('959/udp', 'unknown', '0.001982'),
('1035/udp', 'mxxrlogin', '0.001982'),
('1040/udp', 'netarx', '0.001982'),
('1042/udp', 'afrog', '0.001982'),
('1064/udp', 'jstel', '0.001982'),
('1069/udp', 'cognex-insight', '0.001982'),
('1901/udp', 'fjicl-tep-a', '0.001982'),
('2160/udp', 'apc-2160', '0.001982'),
('3702/udp', 'ws-discovery', '0.001982'),
('8001/udp', 'vcom-tunnel', '0.001982'),
('8181/udp', 'unknown', '0.001982'),
('9020/udp', 'tambora', '0.001982'),
('9199/udp', 'unknown', '0.001982'),
('16402/udp', 'unknown', '0.001961'),
('16430/udp', 'unknown', '0.001961'),
('16918/udp', 'unknown', '0.001961'),
('17091/udp', 'unknown', '0.001961'),
('17455/udp', 'unknown', '0.001961'),
('17459/udp', 'unknown', '0.001961'),
('17573/udp', 'unknown', '0.001961'),
('17615/udp', 'unknown', '0.001961'),
('17616/udp', 'unknown', '0.001961'),
('17888/udp', 'unknown', '0.001961'),
('17939/udp', 'unknown', '0.001961'),
('17989/udp', 'unknown', '0.001961'),
('18004/udp', 'unknown', '0.001961'),
('18234/udp', 'unknown', '0.001961'),
('18331/udp', 'unknown', '0.001961'),
('18360/udp', 'unknown', '0.001961'),
('18582/udp', 'unknown', '0.001961'),
('18835/udp', 'unknown', '0.001961'),
('18980/udp', 'unknown', '0.001961'),
('19017/udp', 'unknown', '0.001961'),
('19039/udp', 'unknown', '0.001961'),
('19130/udp', 'unknown', '0.001961'),
('19165/udp', 'unknown', '0.001961'),
('19197/udp', 'unknown', '0.001961'),
('19294/udp', 'unknown', '0.001961'),
('19322/udp', 'unknown', '0.001961'),
('19332/udp', 'unknown', '0.001961'),
('19489/udp', 'unknown', '0.001961'),
('19600/udp', 'unknown', '0.001961'),
('19687/udp', 'unknown', '0.001961'),
('19933/udp', 'unknown', '0.001961'),
('20004/udp', 'unknown', '0.001961'),
('20359/udp', 'unknown', '0.001961'),
('21131/udp', 'unknown', '0.001961'),
('21212/udp', 'unknown', '0.001961'),
('21261/udp', 'unknown', '0.001961'),
('21298/udp', 'unknown', '0.001961'),
('21354/udp', 'unknown', '0.001961'),
('21621/udp', 'unknown', '0.001961'),
('21803/udp', 'unknown', '0.001961'),
('21902/udp', 'unknown', '0.001961'),
('22055/udp', 'unknown', '0.001961'),
('22341/udp', 'unknown', '0.001961'),
('22692/udp', 'unknown', '0.001961'),
('22695/udp', 'unknown', '0.001961'),
('22739/udp', 'unknown', '0.001961'),
('22799/udp', 'unknown', '0.001961'),
('22914/udp', 'unknown', '0.001961'),
('23040/udp', 'unknown', '0.001961'),
('23176/udp', 'unknown', '0.001961'),
('23354/udp', 'unknown', '0.001961'),
('23531/udp', 'unknown', '0.001961'),
('23557/udp', 'unknown', '0.001961'),
('23608/udp', 'unknown', '0.001961'),
('23679/udp', 'unknown', '0.001961'),
('23781/udp', 'unknown', '0.001961'),
('23965/udp', 'unknown', '0.001961'),
('23980/udp', 'unknown', '0.001961'),
('24007/udp', 'unknown', '0.001961'),
('24279/udp', 'unknown', '0.001961'),
('24511/udp', 'unknown', '0.001961'),
('24594/udp', 'unknown', '0.001961'),
('24606/udp', 'unknown', '0.001961'),
('24644/udp', 'unknown', '0.001961'),
('24854/udp', 'unknown', '0.001961'),
('24910/udp', 'unknown', '0.001961'),
('25003/udp', 'icl-twobase4', '0.001961'),
('25157/udp', 'unknown', '0.001961'),
('25240/udp', 'unknown', '0.001961'),
('25280/udp', 'unknown', '0.001961'),
('25337/udp', 'unknown', '0.001961'),
('25462/udp', 'unknown', '0.001961'),
('25541/udp', 'unknown', '0.001961'),
('25546/udp', 'unknown', '0.001961'),
('25709/udp', 'unknown', '0.001961'),
('25931/udp', 'unknown', '0.001961'),