Skip to content

Commit

Permalink
Added a flag for filtering Cloudflare records based on scope
Browse files Browse the repository at this point in the history
  • Loading branch information
devplayer55221 committed Oct 14, 2024
1 parent 3f378cf commit b9f7bab
Show file tree
Hide file tree
Showing 3 changed files with 8 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 @@ -21,4 +21,5 @@ class ArgsModel(BaseModel):
subdomain: str = Field(None)
list_: bool = False
list_orgs: bool = False
in_scope: bool = False

2 changes: 1 addition & 1 deletion mantis/modules/dns/Cloudflare.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ async def main(self):
records = cf.zones.dns_records.get(zone['id'], params={'per_page': per_page, 'page': record_page})['result']
for record in records:
domain_dict = {}
if(self.args.ignore_stale == True):
if(self.args.in_scope == True):
print(self.db_assets)
for asset in self.db_assets:
if(asset in record['name']):
Expand Down
6 changes: 6 additions & 0 deletions mantis/utils/args_parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,12 @@ def args_parse() -> ArgsModel:
scan_parser.add_argument('--sub',
dest = 'subdomain',
help='Subdomain to scan')

scan_parser.add_argument('-is', '--in_scope',
dest = 'in_scope',
help = 'List only the records from nameserver that are in scope',
action = 'store_true'
)


list_parser = subparser.add_parser("list", help="List entities present in db", usage=ArgsParse.list_msg())
Expand Down

0 comments on commit b9f7bab

Please sign in to comment.