jcpunk has asked for the wisdom of the Perl Monks concerning the following question:
my problems stem from the inconsistencys of expects loging functionality. ie occassionally /bin/sh will be logged as /\nbin/sh. And to top it off dispite having duplicated every case i can thing would effect my output and compensate for the problems no luck was achieved.
hopefully my code will help explain my question more clearly
the output that I get is$exp->log_file(\&formatoutput); $exp->send("$CAT /etc/passwd\n"); ...... sub formatoutput { my $input = shift; chomp($input); $input =~ tr/\r//; if( ($input ne "$CAT /etc/passwd ") || ($input ne '/bin/sh') || ($input ne "/bin/sh") || ($input ne '\$ ') || ($input ne "\$ ") || ($input ne '/') || ($input ne "/") || ($input ne 'bin/sh') || ($input ne "bin/sh") ) { print"${input}\n\n"; } }
neither of the $'s or the / or bin/sh should be showing up and last run i had the $ and /bin/sh which should also have not shown up, right?/ bin/sh $ root:x:0:1::/:/sbin/sh daemon:x:1:1::/: bin:x:2:2::/usr/bin: sys:x:3:3 +::/: adm:x:4:4:Admin:/var/adm: lp:x:71:8:Line Printer Admin:/usr/spoo +l/lp: uucp:x:5:5:uucp Admin:/usr/lib/uucp: nuucp:x:9:9:uucp Admin:/va +r/spool/uucppublic:/usr/lib/uucp/uucico listen:x:37:4:Network Admin:/ +usr/net/nls: nobody:x:60001:60001:Nobody:/: noaccess:x:60002:60002:No + Access User:/: nobody4:x:65534:65534:SunOS 4.x Nobody:/: fast:x:204: +1:FastTrack Server:/web:/bin/sh postfix:x:100:1:postfix:/dev/null:/bi +n/false vscan:x:1001:10:Amavis User:/usr/local/encap/amavis-perl-11:/ +bin/sh sshd:x:22000:22000:SSHD privsep User:/var/empty:/bin/false $
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: inconsisntency, if, expect, logs
by Thelonius (Priest) on Jun 13, 2003 at 18:17 UTC | |
by waswas-fng (Curate) on Jun 13, 2003 at 19:47 UTC | |
|
Re: inconsisntency, if, expect, logs
by waswas-fng (Curate) on Jun 13, 2003 at 17:30 UTC | |
by jcpunk (Friar) on Jun 13, 2003 at 18:48 UTC | |
by waswas-fng (Curate) on Jun 13, 2003 at 19:15 UTC | |
by jcpunk (Friar) on Jun 13, 2003 at 19:28 UTC | |
by waswas-fng (Curate) on Jun 13, 2003 at 19:40 UTC | |
|