mirror of
https://github.com/gnh1201/welsonjs.git
synced 2024-11-26 15:31:42 +00:00
Create portscan.py
This commit is contained in:
parent
6d4d224e86
commit
90182f2af2
19
app/assets/py/portscan.py
Normal file
19
app/assets/py/portscan.py
Normal file
|
@ -0,0 +1,19 @@
|
|||
#-*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import nmap
|
||||
from optparse import OptionParser
|
||||
import json
|
||||
|
||||
def main(args):
|
||||
parser = OptionParser()
|
||||
parser.add_option("-H", "--hosts", type="string", dest="hosts")
|
||||
(options, args) = parser.parse_args()
|
||||
|
||||
nm = nmap.PortScanner(nmap_search_path=('bin/nmap-7.92/nmap',))
|
||||
result = nm.scan(hosts=options.hosts, arguments='-sV')
|
||||
|
||||
print(json.dumps(result))
|
||||
|
||||
if __name__ == "__main__":
|
||||
main(sys.argv)
|
Loading…
Reference in New Issue
Block a user