File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 1
1
""" darkbox nmap command """
2
2
3
3
from darkbox .commands .template import Command
4
+ from darkbox .static .ports import tcp_ports
4
5
5
6
import sys
6
7
import time
@@ -138,19 +139,18 @@ def run(self):
138
139
if port_str :
139
140
ports = self .parse_port_str (port_str )
140
141
else :
141
- print ("No port range specified." )
142
- return
143
-
142
+ ports = tcp_ports
143
+
144
144
self .validate_ports (ports )
145
145
146
- results = 'PORT STATE\n '
146
+ results = '\n PORT STATE\n '
147
147
for p in ports :
148
148
s = socket .socket (socket .AF_INET , socket .SOCK_STREAM )
149
149
c = s .connect_ex ((ip , p ))
150
150
socket .setdefaulttimeout (0.5 )
151
151
state = 'open' if not c else 'closed'
152
152
results += '{:<9} {:<7}\n ' .format (str (p )+ '/tcp' , state )
153
- print (results . rstrip () )
153
+ print (results )
154
154
155
155
end_time = time .time ()
156
156
t_delta = end_time - start_time
You can’t perform that action at this time.
0 commit comments