-
Notifications
You must be signed in to change notification settings - Fork 1
/
limited_port_scan.py
executable file
·40 lines (25 loc) · 1.08 KB
/
limited_port_scan.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
from portscan import businessunit
from portscan import email
import argparse
import os
FULL_PATH = os.path.dirname(os.path.realpath(__file__)) + "/"
UNIX_LIKE = True
BUSINESS_PATH = "/scanning/Kali_Port_Scanning/external.csv"
parser = argparse.ArgumentParser(description='Lets scan some ports')
parser.add_argument("business_unit", help="The business unit the scan will be performed on")
parser.add_argument("-b", "--businessName", help="Additional information for more verbose emails")
parser.add_argument("-o", "--org", help="Additional information on the organization for this scan")
args = parser.parse_args()
bs = org = ""
if args.businessName:
bs = args.businessName
if args.org:
org = args.org
business_unit = businessunit.BusinessUnit(args.business_unit, FULL_PATH, bs, org)
# At this point the object is substantiated and all dependencies have been resolved.
business_unit.ReadPorts()
business_unit.ReadBase()
business_unit.Scan()
business_unit.Collect(BUSINESS_PATH)
if len(business_unit.emails) > 0 or len(business_unit.mobile) > 0:
email.SendMail(business_unit)