You are not logged in.

#1 2008-12-27 21:26:18

ptchinster
Member
Registered: 2008-12-27
Posts: 47

Finding the source to a given ELF file

So i decided to teach myself something about abs, patching, and making your own packages, etc. I was thinking of what to change just for the hell of it, and thought the login prompt when you login via ssh should change from "login as:" to "username:" .

However, i cannot, for the life of me, find the code that has "login as:" in it. I figure /bin/login is whats doing it, which is owned by the pam package. Got the source through abs, cannot find 'login as:' anywhere in it. I've also used ldd /bin/login to see what modules it uses and searched through those, nothing. I have no idea what im doing wrong.

Offline

#2 2008-12-27 22:15:06

Procyon
Member
Registered: 2008-05-07
Posts: 1,819

Re: Finding the source to a given ELF file

Isn't it agetty that displays that?

Offline

#3 2008-12-27 22:18:13

ptchinster
Member
Registered: 2008-12-27
Posts: 47

Re: Finding the source to a given ELF file

from the man page
agetty opens a tty port, prompts for a login name and invokes the /bin/login command.

Also, after strings /sbin/agetty | grep "login as" still nothing.

Offline

#4 2008-12-27 22:22:23

Procyon
Member
Registered: 2008-05-07
Posts: 1,819

Re: Finding the source to a given ELF file

--> strings agetty | grep "login"
 login:

Isn't that it?

Offline

#5 2008-12-27 22:24:34

ptchinster
Member
Registered: 2008-12-27
Posts: 47

Re: Finding the source to a given ELF file

Yes, it contains the string "login:"

However. When i ssh into my box, it prompts
"login as:"

"login as:" != "login:"

Offline

#6 2008-12-27 22:26:56

string
Member
Registered: 2008-11-03
Posts: 286

Re: Finding the source to a given ELF file

SSHD doesn't use /bin/login unless you explicitly tell it to.

Last edited by string (2008-12-27 22:27:24)

Offline

#7 2008-12-27 22:30:03

ptchinster
Member
Registered: 2008-12-27
Posts: 47

Re: Finding the source to a given ELF file

So then the question is, how could i do that, and why doesn't it be default? (they must have good reason to rewrite code thats already written).

Offline

#8 2008-12-27 22:32:06

Procyon
Member
Registered: 2008-05-07
Posts: 1,819

Re: Finding the source to a given ELF file

Try this:

for file in /bin/* /sbin/* /usr/bin/*; do strings "$file" | grep "login as" && echo $file ; done

Offline

#9 2008-12-27 22:33:30

string
Member
Registered: 2008-11-03
Posts: 286

Re: Finding the source to a given ELF file

Here's an idea: fetch the SSHD source and read it. Linux fans love to brag about the open source nature of their beloved OS and tools but most don't bother actually reading the source.

Offline

#10 2008-12-27 22:38:08

ptchinster
Member
Registered: 2008-12-27
Posts: 47

Re: Finding the source to a given ELF file

Did that already. Heres the output:

[ptchinster@slash openssh]$ find . -exec strings -f {} \; | grep -i 'login as'
[ptchinster@slash openssh]$ pwd
/home/ptchinster/abs/openssh
[ptchinster@slash openssh]$

Offline

#11 2008-12-27 23:30:41

ptchinster
Member
Registered: 2008-12-27
Posts: 47

Re: Finding the source to a given ELF file

Haha. This solves it:

strings putty.exe | grep 'login as'

Last edited by ptchinster (2008-12-27 23:31:28)

Offline

Board footer

Powered by FluxBB