Save time by developing a Python script to read and modify IP addresses

แชร์
ฝัง
  • เผยแพร่เมื่อ 18 ก.ย. 2024
  • Do you have enough time in the day for manual data entry? I certainly do not. In fact I never have enough time, so I write a script for nearly every task performed in and out of the work place.
    Today we cover a Python script I developed in order to save me hours of my day manually writing IP addresses based on ranges provided from a system administrator. This file contained hundreds of lines and in each of those lines were ranges of private IP's. That is great and all but I needed each individual IP for the task I was looking to accomplish. So, instead of reading each range and writing each one down, I created this script.
    This script will look in each line. If the line contains a range using a - between two IP addresses, the script will find the prefix and the required range. It will then assign each individual IP in that range to the prefix. If it finds a / in the line, specifying a subnet, it will use built in functions to accomplish the same thing.
    The script is not perfect, but that is the point. It is not a program, it is a script. A script I may only use a few times. This script took under an hour to write and already saved me hours of work reading in multiple files.
    Have you started learning Python? If not, I suggest you do. Regardless of what part of the industry you are tied to. Weather that be penetration testing or system administration, Python can save you time. A lot of the guys and girls who have been in the industry a long time opt out, but I urge you to opt in. Take the time to learn the language and spend that time elsewhere learning other things.
    github : github.com/Cyb...
    I hope you enjoyed this video, do not forget to drop a like and subscribe for more.
    As always, Never Stop Learning!

ความคิดเห็น •