I don't think anyone who should write their own looking glass needs to be shown example how to do it.
You are literally allowing anyone to inject data to your control-plane, it needs to be done right. I can immediately say you're not doing it right because you're not passing binary and arguments separately. On 18 May 2017 at 18:04, R. Scott Evans <[email protected]> wrote: > On 05/18/17 10:03, Patrick M. Hausen wrote: >> >> Hi, all >> >> can anyone recommend a free looking-glass tool >> to run on my own NOC server for my own core routers? >> >> My problem is finding a software that is preferably written in >> Perl or PHP and >> >> * not unmaintained for years >> * breaking with current versions (5.24) of Perl >> * only supporting telnet instead of ssh >> * ... >> >> I've been spending almost a day already chasing dead links >> on historic sites like traceroute.org, downloading, configuring, >> testing ... >> >> So, any hints? >> >> I had set up routerproxy to hand my less IOS-savvy colleagues a >> tool to quickly check some things, but that one goes in the >> "breaks with Perl 5.24" category ... >> >> Thanks! >> Patrick > > > Hi Patrick, > > If you prefer perl, are using a unix flavor, don't mind using a little > bourne shell within it, and are comfortable coding, write your own... the > relevant bits would look like: > > $output = `( sleep 1; > echo $login; sleep 1; > echo $password; sleep 1; > echo term leng 0; sleep 1; > echo "** YOUR COMMAND **"; sleep 3; > echo "** 2nd COMMAND IF NEEDED **"; sleep 3; > echo exit; sleep 1; > ) | /usr/bin/telnet $ip 2>&1`; > > or > > $output = `( sleep 1; > echo $login; sleep 1; > echo en; sleep 1; > echo $enable; sleep 1; > echo term leng 0; sleep 1; > echo "** YOUR COMMAND **"; sleep 3; > echo exit; sleep 1; > ) | /usr/bin/telnet $ip 2>&1`; > > Alternatively if you are only using IOS or IOS-XE, not IOS-XR, and have > netcat (nc) on your server I'd recommend using it in place of telnet as you > can run the commands without specifying the sleep needed for the responses > which greatly speeds up the program. There may be a way to make XR work > with it, but I've had no luck... > $output = `( > echo $login; > echo $password; > echo term leng 0; > echo "** YOUR COMMAND **"; > echo exit; > ) | /usr/bin/nc $ip 23 2>&1`; > > Regards, > Scott > > > _______________________________________________ > cisco-nsp mailing list [email protected] > https://puck.nether.net/mailman/listinfo/cisco-nsp > archive at http://puck.nether.net/pipermail/cisco-nsp/ -- ++ytti _______________________________________________ cisco-nsp mailing list [email protected] https://puck.nether.net/mailman/listinfo/cisco-nsp archive at http://puck.nether.net/pipermail/cisco-nsp/
