I am trying to create a script that generates a list of IP addresses based on a users input for a start and end IP range. For example, they could enter 192.168.1.25 & 192.168.1.50. The list would then be fed into scapy to test for open ports. I think I have the list generated, but I am stuck on getting the individual IP's out and into the rest of my code. I think I am trying to use the whole list vs. an item in the list. If there is a better way of doing this, that is fine. I am doing this mainly to improve my understanding of Python.
Thanks!
from scapy.all import *
ip_start = raw_input('Please provide the starting IP address for your scan --> ')
start_list = ip_start.split(".")
ip_end = raw_input('Please provide the ending IP address for your scan --> ')
end_list = ip_end.split(".")
top = int(start_list[3])
bot = int(end_list[3])
octet_range = range(top,bot)
#print octet_range
for i in octet_range:
#new_ip_start = ip_start.replace(str(top),str(i))
start_list[3] = i
#print top
#print i
print type(start_list)
src_port = RandShort()
dst_port = 80
scan = sr1(IP(dst=str(start_list))/TCP(sport=src_port,dport=dst_port,flags="S"),timeout=10)