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

Add IPRangeEnum specs #77

Closed
wants to merge 1 commit into from
Closed

Conversation

moozzi
Copy link
Member

@moozzi moozzi commented Aug 15, 2023

Waiting for #58

Copy link
Member

@postmodern postmodern left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some early review comments.

describe Ronin::Recon::Net::IPRangeEnum do
describe "#process" do
context "when there are ip in range" do
let(:ip_range) { Ronin::Recon::Values::IPRange.new('192.168.0.1/2') }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use /30 which will only enumerate the last two bits of the IP address.

end
end

context "when there is no ip in range" do
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this edge-case should exist? A Values::IPRange will always cause IPs to be yielded. Even if the IP range is A.B.C.D/32 it will only yield Values::IP.new('A.B.C.D').

end
end
end

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe also add an edge-case with an IPv6 range?

@moozzi moozzi force-pushed the add_ip_range_enum_spec branch 2 times, most recently from 235cb37 to 44dbd65 Compare February 4, 2024 17:57
@moozzi
Copy link
Member Author

moozzi commented Feb 4, 2024

Moved into #107

@moozzi moozzi closed this Feb 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants