Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Match and Filter IP/CIDR support #48

Closed
brenocss opened this issue Jan 5, 2022 · 0 comments · Fixed by #87 or #90
Closed

Match and Filter IP/CIDR support #48

brenocss opened this issue Jan 5, 2022 · 0 comments · Fixed by #87 or #90
Assignees
Labels
Priority: Medium This issue may be useful, and needs some attention. Status: Completed Nothing further to be done with this issue. Awaiting to be closed. Type: Enhancement Most issues will probably ask for additions or changes.
Milestone

Comments

@brenocss
Copy link

brenocss commented Jan 5, 2022

Is your feature request related to a problem? Please describe.

For the cases, where we have known list of IPs/CIDRs that I wanted to match or filter to have desired list of IPs/CIDRs to process/scan as output and would be good addition for the project.

Describe the solution you'd like

This can be done by introducing 2 additional CLI flag to accept IP/CIDR to perform said action, for example:

   -mi, -match-ip string[]  IP/CIDR/FILE containing list of IP/CIDR to match (comma-separated, file input)
   -fi, -filter-ip string[] IP/CIDR/FILE containing list of IP/CIDR to filter (comma-separated, file input)

Match IP/CIDR

Display IPs from input that belongs to given IP/CIDR ranges.

$ mapcidr -cidr 192.168.1.0/24 -mi 192.168.1.253,192.168.1.252

192.168.1.252
192.168.1.253

More input examples:

$ mapcidr -cidr 192.168.1.0/24 -mi 192.168.1.0/25
$ mapcidr -cidr 192.168.1.0/24 -mi cidrs.txt

Filter IP/CIDR

Filter IPs from input that belongs to given IP/CIDR ranges.

$ mapcidr -cidr 192.168.1.224/28 -fi 192.168.1.233,192.168.1.234

192.168.1.224
192.168.1.225
192.168.1.226
192.168.1.227
192.168.1.228
192.168.1.229
192.168.1.230
192.168.1.231
192.168.1.232
192.168.1.235
192.168.1.236
192.168.1.237
192.168.1.238
192.168.1.239

More input examples:

$ mapcidr -cidr 192.168.1.0/24 -fi 192.168.1.0/25
$ mapcidr -cidr 192.168.1.0/24 -fi cidrs.txt

Note:

Currently available ip/il cli flag was introduced as part of the feature request in #4 to match the IPs, which is same as m/match feature, as such as per this change ip/il can be deprecated to avoid any possible confusion.

@ehsandeep ehsandeep changed the title [Feature] Match and Exclude results based on ips and ip ranges Match and Filter IP/CIDR support Jun 5, 2022
@ehsandeep ehsandeep added Type: Enhancement Most issues will probably ask for additions or changes. Priority: Medium This issue may be useful, and needs some attention. labels Jun 5, 2022
@ehsandeep ehsandeep added this to the v1.0.0 milestone Jun 5, 2022
@ehsandeep ehsandeep modified the milestones: v1.0.0, v1.0.1 Jun 8, 2022
@LuitelSamikshya LuitelSamikshya self-assigned this Jun 17, 2022
@ehsandeep ehsandeep added Status: Revision Needed Submitter of PR needs to revise the PR related to the issue. Status: Review Needed The issue has a PR attached to it which needs to be reviewed and removed Status: Revision Needed Submitter of PR needs to revise the PR related to the issue. labels Jun 28, 2022
@ehsandeep ehsandeep added Status: Completed Nothing further to be done with this issue. Awaiting to be closed. and removed Status: Review Needed The issue has a PR attached to it which needs to be reviewed labels Jul 10, 2022
@ehsandeep ehsandeep linked a pull request Jul 10, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: Medium This issue may be useful, and needs some attention. Status: Completed Nothing further to be done with this issue. Awaiting to be closed. Type: Enhancement Most issues will probably ask for additions or changes.
Projects
None yet
3 participants