Skip to content

Commit

Permalink
Adding sub option to scan only subdomains
Browse files Browse the repository at this point in the history
  • Loading branch information
Prateek-Thakare committed May 30, 2024
1 parent 9c81f90 commit a984237
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions mantis/models/args_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ class ArgsModel(BaseModel):
delete_logs: bool = False
verbose: bool = False
thread_count: int = 3
subdomain: str = Field(None)

2 changes: 1 addition & 1 deletion mantis/modules/activehostscan/HTTPX.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,6 @@ def parse_report(self, outfile):

async def db_operations(self, tool_output_dict, asset):
await CrudUtils.update_asset(asset=asset, org=self.org, tool_output_dict=tool_output_dict)
if self.third_party_integrations:
if hasattr(self, 'third_party_integrations'):
logging.debug("Inserting Third party integrations")
await CrudUtils.insert_assets(self.third_party_integrations)
7 changes: 7 additions & 0 deletions mantis/utils/args_parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,10 @@ def args_parse() -> ArgsModel:
help = 'List of comma separated aws profiles for Route53',
)

scan_parser.add_argument('--sub',
dest = 'subdomain',
help='Subdomain to scan')


# display help, if no arguments are passed
args = parser.parse_args(args=None if argv[1:] else ['--help'])
Expand Down Expand Up @@ -270,6 +274,9 @@ def args_parse() -> ArgsModel:

if args.thread_count:
parsed_args["thread_count"] = args.thread_count

if args.subdomain:
parsed_args["subdomain"] = args.subdomain


args_pydantic_obj = ArgsModel.parse_obj(parsed_args)
Expand Down
4 changes: 4 additions & 0 deletions mantis/utils/tool_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@ def get_pipeline(self, args):
{"$match" : {"created_timestamp":{"$gte" : datetime.today().strftime('%Y-%m-%d')}}}

)
if args.subdomain:
pipeline.append(
{"$match" : {"asset" : args.subdomain}}
)

return pipeline

Expand Down

0 comments on commit a984237

Please sign in to comment.