Python Forum
IP string manipulation problem
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
IP string manipulation problem
#12
(Feb-01-2019, 10:56 AM)perfringo Wrote: It this real life scenario? My 'back-of-the-napkin' calculation gives that range 10.0.0.0-11.0.0.0 should be around 256 * 256 * 256 = 16,77M ip addresses. You want to write it to .csv file?

I can say that the chances of bumping into a /7 network range are very close to zero. Also because the IPs need to be contiguous. So basically, if there is only one missing IP at any point of the range, the list would be split.

My list come out of a vulnerability scanner (Qualys by the way). It is telling me the IPs that have been scanned. Just that the scanner ingests CVS files, but then gives back those "-" separated ranges, making things hard if I want to check what was scanned, generate reports, repeat the scan, etc.

Let's say I look at the 10.0.0.0-11.255.255.255 range (so a I have addresses in the whole /7 range), but the only missing IP is 10.255.255.255.
In that case, the output from the scanner would be: 10.0.0.0-10.255.255.254,11.0.0.0-11.255.255.255
Very very unlikely, but theoretically it could happen.

In real life, I honestly do not expect to see anything larger than a /22 range. So I would say that just checking the last 2 octets (making it a /16 range) would make me feel very safe.
Reply


Messages In This Thread
IP string manipulation problem - by TheRealNoob - Jan-29-2019, 10:03 AM
RE: IP string manipulation problem - by buran - Jan-29-2019, 10:23 AM
RE: IP string manipulation problem - by perfringo - Jan-29-2019, 01:40 PM
RE: IP string manipulation problem - by TheRealNoob - Jan-30-2019, 07:01 AM
RE: IP string manipulation problem - by perfringo - Jan-30-2019, 07:40 AM
RE: IP string manipulation problem - by TheRealNoob - Jan-30-2019, 11:55 AM
RE: IP string manipulation problem - by perfringo - Jan-30-2019, 01:48 PM
RE: IP string manipulation problem - by TheRealNoob - Jan-31-2019, 07:03 AM
RE: IP string manipulation problem - by perfringo - Jan-31-2019, 10:42 AM
RE: IP string manipulation problem - by TheRealNoob - Feb-01-2019, 07:22 AM
RE: IP string manipulation problem - by perfringo - Feb-01-2019, 10:56 AM
RE: IP string manipulation problem - by TheRealNoob - Feb-01-2019, 01:54 PM
RE: IP string manipulation problem - by perfringo - Feb-04-2019, 09:29 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Convert string to float problem vasik006 8 3,496 Jun-03-2022, 06:41 PM
Last Post: deanhystad
  Problem in list manipulation CyKlop 6 2,372 Oct-18-2021, 09:03 AM
Last Post: DeaD_EyE
  f string concatenation problem growSeb 3 2,306 Jun-28-2021, 05:00 AM
Last Post: buran
Question Problem with string and \n Falassion 6 2,750 Jun-15-2021, 03:59 PM
Last Post: Falassion
  how to deal with problem of converting string to int usthbstar 1 2,016 Jan-05-2021, 01:33 PM
Last Post: perfringo
  optimization problem for dataframe manipulation fimmu 0 1,494 Aug-31-2020, 06:02 PM
Last Post: fimmu
  string problem Mathisdlg 6 2,928 Aug-05-2020, 09:31 AM
Last Post: Mathisdlg
  Unicode string index problem luoheng 6 3,096 Nov-23-2019, 03:04 PM
Last Post: luoheng
  simple string & input problem kungshamji 5 3,726 Jun-23-2019, 03:54 PM
Last Post: kungshamji
  Problem with inserting a string in to Sqlite db darktitan 3 4,563 Mar-03-2019, 06:30 PM
Last Post: stranac

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020