Discussion:
[rancid] clogin vs. ascii-art banners with ####es
Alexander Bochmann
2013-11-06 11:07:46 UTC
Permalink
Hi,

I just upgraded our ancient RANCID installation (2.3.2a8) to 2.3.8, and it
seems enable-mode detection in clogin now barfs on a couple of login banners
that contain ascii-art made from hash signs. (Yes, I know, those should be easy
to change, but it seems login ascii-art is serious business...)

clogin doesn't detect that it's not in enable mode yet when hitting such a
banner, and just starts sending commands, although there still is a > prompt...

The logic in clogin has changed enough between those two versions that I
neither understand why that used to work in 2.3.2, nor why it doesn't now...

Any hints what I could tweak to get around this problem?

Best regards,

Alex Bochmann
Per-Olof Olsson
2013-11-06 18:14:05 UTC
Permalink
Post by Alexander Bochmann
Hi,
I just upgraded our ancient RANCID installation (2.3.2a8) to 2.3.8, and it
seems enable-mode detection in clogin now barfs on a couple of login banners
that contain ascii-art made from hash signs. (Yes, I know, those should be easy
to change, but it seems login ascii-art is serious business...)
clogin doesn't detect that it's not in enable mode yet when hitting such a
banner, and just starts sending commands, although there still is a > prompt...
The logic in clogin has changed enough between those two versions that I
neither understand why that used to work in 2.3.2, nor why it doesn't now...
Any hints what I could tweak to get around this problem?
Tested out login when banner page have # and > on HP's (hlogin).
Just added

-re "\[#>]+.*\[\n\r]+" {
exp_continue
}

before where prompter is matched in expect login loop.


Login loop will continue if there is return or line feed after # or >.
A normal prompter will not have any return or line feed after # or > it just wait for input.

Think I also tested this on cisco but can't find any trace of this now.
Post by Alexander Bochmann
Best regards,
Alex Bochmann
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo/rancid-discuss
/Peo
----------------------------------------------------------
Per-Olof Olsson Email: ***@chalmers.se
Chalmers tekniska högskola IT-service
Hörsalsvägen 5 412 96 Göteborg
Tel: 031/772 6738 Fax: 031/772 8680
----------------------------------------------------------
Alexander Bochmann
2013-11-07 15:54:04 UTC
Permalink
Hi,
Post by Per-Olof Olsson
Post by Alexander Bochmann
seems enable-mode detection in clogin now barfs on a couple of login banners
that contain ascii-art made from hash signs. (Yes, I know, those should be easy
Just added
-re "\[#>]+.*\[\n\r]+" {
exp_continue
}
before where prompter is matched in expect login loop.
Great, thanks - seems I actually was on the right track there already,
because I was fiddling with something similar - but my regex was just not
good enough.

Attached patch works for me, at least.

Best regards,

Alex Bochmann.

Loading...