[rancid] Cisco Banner Issue

heasley heas at shrubbery.net
Mon Mar 31 03:57:54 UTC 2014


Fri, Mar 21, 2014 at 11:22:31AM +0100, Per-Olof Olsson:
> Alan McKinnon skrev 2014-03-20 16:26:
> > On 20/03/2014 16:13, Alex DEKKER wrote:
> >> On 20/03/14 09:59, Alan McKinnon wrote:
> >>> On 20/03/2014 11:27, Hans Mueller wrote:
> >>>> *     Auftragsnummer: XY#763743                          *
> >>>> One possibility is ignore lines containing "#" that also have whitespace
> >>>> earlier in the line. Those always seem to be banner text and real-life
> >>>> cli prompts seldom contain whitespace
> >>>>
> >> Yeah, surely the only time that the # is a prompt is when it's the last
> >> character on a line *and* no further output is forthcoming?
> >>
> >> alexd
> >
> >
> >
> > In an ideal, theoretical world that is true. Neither of us live in such
> > a world and prompts are often not what they should be.
> >
> >
> 
> Yes and it's simple to fix.
> 
> *** clogin      2014-03-21 11:14:48.163493260 +0100
> --- clogin.new  2014-03-21 11:06:19.711260482 +0100
> ***************
> *** 572,577 ****
> --- 572,580 ----
>                                    send -- "$passphrase\r"
>                                    exp_continue
>                                  }
> +       -re "\[#>]+\[^\r\n]*\[\r\n]+" {
> +                               exp_continue
> +                               }

i maintain the assertion that you can not rely upon receiving complete
lines.  expect may see

b
or
blah#
or
blah#<space>
or
blah#<space><return><nl>

there is no way to know what will be in the input buffer.  ie: you may get
lucky, but this is not a reliable fix.  the only reliable fixes what i can
think of would be to be more specific about prompt match (eg: a new clogin
setting) for the given device or develop a process to wait to see if
anything follows the # or >, which has its own set of pitfalls.

if you disagree, please explain why.

>          -re "$u_prompt"         {
>                                    send -- "$user\r"
>                                    set uprompt_seen 1
> 
> 
> Also tested and include in hlogin.
> 
> Then you can have how many # and > you like in banners.
> 
> 
> /Peo
> ----------------------------------------------------------
> Per-Olof Olsson               Email: peo at chalmers.se
> Chalmers tekniska högskola    IT-service
> Arvid Hedvalls backe 6        412 96 Göteborg
> Tel: 031/772 6738  Fax: 031/772 8680
> ----------------------------------------------------------
> _______________________________________________
> Rancid-discuss mailing list
> Rancid-discuss at shrubbery.net
> http://www.shrubbery.net/mailman/listinfo/rancid-discuss


More information about the Rancid-discuss mailing list