1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

shell script to ssh/telnet multiple ips.txt and run commands

Discussion in 'General Scripting Chat' started by xninja, Dec 10, 2009.

  1. xninja

    xninja Registered Member

    Joined:
    Jan 3, 2009
    Messages:
    56
    Likes Received:
    8
    hello...

    i need a shell script bash/perl/python...any which will take iplist.txt and ssh or telnet one by one with a static or a list of users.txt pass.txt one by one and if logged in then run some commands...it must take "ifconfig eth0" ip and put it in iptables rules and run it...
     
  2. Kaimi

    Kaimi Newbie

    Joined:
    Dec 6, 2009
    Messages:
    35
    Likes Received:
    230
    Home Page:
    Try this perl script http://kaimi.ru/wp-content/uploads/2009/12/ssh.zip It goes through ip list, tries to login using list of logins and passwords, after successfull login executes command and writes output to file