Comments (9)
Hi @dogasantos,
Thank you for sharing feedback and insights on what you trying to do, just to make sure I get the idea that looks something like this:-
cat ips.txt | mapcidr -l cidr.txt
This will print only IPs from ips.txt
that belongs to CIDR range cidr.txt
? also, do you prefer to get value printed or boolean flag to print true
or false
? let me know if this is what are you looking for, if not can you please share some examples.
from mapcidr.
On hold until #6 is merged (it adds in memory cidr support)
from mapcidr.
Hi !
Thanks for your response!
I have a prefix.txt file with 1372 lines, each one is a CIDR. Some large, some small.
I also have a list of single ips (/32) that I would like to check if they belong to any of those CIDR prefixes.
As result, I should have a filtered list of ips that are directly related with the ASN.
cat ips.txt | mapcidr -l cidr.txt
This seems to be very close, although it will require a bash loop for each cidr right?
Also, ips.txt also needs to contain CIDR (I've tested here and I got a [FTL] invalid CIDR address: 192.168.1.1 as example)
I've created a small snippet you can find here:
https://github.com/dogasantos/prefixcheck
Once again, thanks guys!
from mapcidr.
Hi @dogasantos,
Also, ips.txt also needs to contain CIDR (I've tested here and I got a [FTL] invalid CIDR address: 192.168.1.1 as example)
that's not supported yet, I was just sharing an example of how it will look like :D and thank you for sharing the project, I guess I got this right, so now we will discuss this and see if we can add support for this mapCIDR itself, for sure useful for cases like you mentioned.
cat ips.sample
200.200.200.200
192.168.2.2
192.168.2.99
192.168.70.33
192.168.1.240
192.168.240.1
10.0.0.22
10.0.1.33
10.0.90.9
172.16.45.1
172.16.43.1
172.16.47.1
cat cidr.sample
192.168.1.0/24
10.0.0.0/24
172.16.0.0/17
./prefixcheck cidr.sample ips.sample
# Takes input of CIDR and IPs and prints IPs belongs to known CIDR only.
10.0.0.22
192.168.1.240
172.16.45.1
172.16.49.240
172.16.47.1
172.16.43.1
from mapcidr.
Thank you @bauthard !
It would be fantastic!
from mapcidr.
@dogasantos this support is added into mapCIDR dev branch with #8
Here is an example of how you can make use of this:-
# Prints IP belongs to input CIDRs
./mapcidr -ips ip-list.txt -l cidrs.txt
# Prints IP belongs to input CIDRs
cat cidrs.txt | ./mapcidr -ips ip-list.txt
from mapcidr.
@ehsandeep
Fantastic!
Thanks for the update!
from mapcidr.
@dogasantos with the latest release, now we can look for both match and filter IPs from input and slight update in CLI flag as well, see https://github.com/projectdiscovery/mapcidr#match--filter-ips-from-cidr for the details.
from mapcidr.
fantastic!
thank you @ehsandeep !!
from mapcidr.
Related Issues (20)
- Rename test folder
- ASN via URL or FIle as RIPE query is limited HOT 2
- Create a global default asn.DefaultClient
- Add Autorelease gh workflow
- Add update check and self-update option
- Maps CIDR Range of Not Specified Range in List HOT 2
- [Issue] This project has too many dependencies. HOT 2
- when get to install it, give me blank terminal!
- [Issue] Converting an IPv4 to decimal form returns the representation for the same address but in the IPv6 space
- Increment project version before tag creation
- All pre-build assets have gone from Release-tag (latest) on github
- The tag creation does not take into account the commit for version bumping HOT 1
- static pre compiled assets gone after v1.1.19. HOT 1
- [FTL] invalid character '<' looking for beginning of value HOT 1
- Update asnmap
- fix index out of range err
- [Issue] Multiple bugs with AggregateApproxIPV4s and CoalesceCIDRs when used as library
- [Issue] IPv6 approximate aggregation is broken HOT 1
- Get "https://api.asnmap.sh/api/v1/asnmap?asn=15133": dial tcp: lookup api.asnmap.sh on 172.16.42.2:53: no such host
- ..
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mapcidr.