A Logo

Feel free to include my content in your page via my
RSS feed

Help Irongeek.com pay for
bandwidth and research equipment:

Subscribestar or Patreon

Search Irongeek.com:

Affiliates:
Irongeek Button
Social-engineer-training Button

Help Irongeek.com pay for bandwidth and research equipment:

paypalpixle




IPIterator: Iterate through a set of IPs and run a command

IPIterator: Iterate through a set of IPs and run a command

        I made IPIterator because I wanted to play around with FreeBasic and I needed something that would let me run a command on a series of IPs. IPIterator is multithreaded and fast to run, but not 100% reliable. Hell, its meant to be a quick hack. If you get an error like:

    ipiterator.bas(30) : warning level 0: Passing pointer to scalar, at parameter 2

when you try to compile it don't worry, that's expected.

Syntax:
        ipiterate ip_address,max-thread-count-up-to-1000,some command to run with ~ip token
 

Examples:

        ./ipiterate 192.168.*.1-254,25,"ping ~ip"

The above will ping each of the IPs in the range 192.168.*.1-254, using 25 threads. It's useless, but it's a simple example.

        ./ipiterator 192.168.1.*,250,"cat spam.prn|netcat -q 0 ~ip 9100"

The above will use Netcat to send a print job to all printers using port 9100/tcp in the range 192.168.1.* using 250 threads. Is this the first know reference to printer spam?

        ./ipiterator 192.168.30.129-132,3,"nikto -h ~ip>~ip.txt"

        The above command will run the Nikto web vulnerability scanner on each IP  in the range 192.168.30.129-132 and put the output in a text file named with the corresponding IP.


IPIterator should have a lot of uses, just use your imagination.

Source Code
Linux x86 Binary
Windows x86 Binary

Printable version of this article

15 most recent posts on Irongeek.com:


If you would like to republish one of the articles from this site on your webpage or print journal please contact IronGeek.

Copyright 2020, IronGeek
Louisville / Kentuckiana Information Security Enthusiast