FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python-masscan/example.py at master · MyKings/python-masscan · GitHub
MyKings
/
python-masscan
Public
Notifications
You must be signed in to change notification settings
Fork
58
Star
284
Code
Issues
4
Pull requests
2
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
python-masscan
/
example.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
23 lines (19 loc) · 628 Bytes
Breadcrumbs
python-masscan
/
example.py
Copy path
File metadata and controls
23 lines (19 loc) · 628 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# -*- coding: utf-8 -*-
"""Example to use python-masscan."""
import
sys
import
masscan
try
:
mas
=
masscan
.
PortScanner
()
except
masscan
.
PortScannerError
:
print
(
"masscan binary not found"
,
sys
.
exc_info
()[
0
])
sys
.
exit
(
1
)
except
:
print
(
"Unexpected error:"
,
sys
.
exc_info
()[
0
])
sys
.
exit
(
1
)
print
(
"masscan version: {}"
.
format
(
mas
.
masscan_version
))
mas
.
scan
(
'192.168.1.1'
,
ports
=
'T:80,1900'
)
print
(
"masscan command line: {}"
.
format
(
mas
.
command_line
))
print
(
'maascan has_host: {}'
.
format
(
mas
.
has_host
(
"192.168.1.1"
)))
print
(
mas
.
scan_result
)
for
host
in
mas
.
all_hosts
:
print
(
"Host: %s %s"
%
(
host
,
mas
[
host
]))
Back
|
FazBrowse Home
|
New Git URL