First, I don't really see why you would want to scan a block of IP addresses for "open" ftp servers that allow public access, as either you are allowed to access that server and have been told so by the administrator or you aren't and therefore shouldn't.

It is a bad idea as the automatic retrieval of all files stored on that server will cause a bandwidth and IO hit to that server, as you recursively descend through all directories and query their contents - something that is not nice if you're doing it uninvited and just for your personal access.

Thirdly, there are already existing solutions, like http://ftpsearch.lycos.com, that do what you want for sites where the administrator has agreed to have them scanned.

If you still think that scanning an ftp server is a necessary thing, the only thing you will need is Net::FTP, which is an automated ftp client. With it, it's easy to query a ftp server. You will have to parse the output of the ftp server to determine which entry is a directory and which entry is a file.

There is no effective and easy method to find open ftp servers without trying to connect to each IP address in the given range and waiting whether it times out or not.

Please note that even the act of connecting to a system and not heeding the message you get when you connect might get you in trouble.

perl -MHTTP::Daemon -MHTTP::Response -MLWP::Simple -e ' ; # The $d = new HTTP::Daemon and fork and getprint $d->url and exit;#spider ($c = $d->accept())->get_request(); $c->send_response( new #in the HTTP::Response(200,$_,$_,qq(Just another Perl hacker\n))); ' # web

In reply to Re: A perl version of Archie? by Corion
in thread A perl version of Archie? by ChunLi

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.