I want to make this script working automatic and get target from file.txt

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • madomokhtar
    Banned
    New Member
    • Oct 2012
    • 1

    I want to make this script working automatic and get target from file.txt

    Code:
    #!/usr/bin/perl
    
    use HTTP::Request;
    use LWP::UserAgent;
    
    system('cls');
    system "color 0a";
    print"\n";
    
    print " Please Enter IP\n Example: [url]192.168.1.1[/url] or 192.168.1.1/path\n-> ";
    $site=<STDIN>;
    chomp $site;
    
    print "\n";
    print "source code\n\n 1 = php\n\n-> ";
    $code=<STDIN>;
    chomp($code);
    
    if ( $site !~ /^http:/ ) {
    $site = 'http://' . $site;
    }
    if ( $site !~ /\/$/ ) {
    $site = $site . '/';
    }
    print "\n";
    
    print "-> Target: $site\n";
    print "-> Site source code: $code\n";
    =============== =============
    this script make me put the website manual and site by site
    how ican make it take alot of site's from file.txt
    Last edited by Rabbit; Oct 8 '12, 03:07 PM. Reason: Please use code tags when posting code.
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    Please use code tags when posting code.

    What you want to do is open a file handler and loop through the file reading it line by line.

    Comment

    • numberwhun
      Recognized Expert Moderator Specialist
      • May 2007
      • 3467

      #3
      In order to do what you want, your going to have to populate a file with the URL's (preferably one per line). Then, read in the file and process each URL in turn.

      The things your going to research on how to use are things like the open function and also how to read a file into an array (or just how to read each line from a file in turn. hint: foreach would work).

      If you get stuck, post your code here with questions and any errors.

      Regards,

      Jeff

      Comment

      Working...