Go Back   Wireless and Wifi Forums > News > Newsgroups > alt.computer.security
Register FAQ Forum Rules Members List Calendar Search Today's Posts Advertise Mark Forums Read

 
Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-04-2011, 10:18 AM
Ebenezer Scrooge
Guest
 
Posts: n/a
Default What's this? SSH hack?

Found this shell script on a server:

#!/bin/bash
# cracker ssh backdoor - by AppleJuice
if [ -f /usr/sbin/sshd ]; then
FILE=/usr/sbin/sshd
NR=`strings $FILE | grep --line-number "ssh_mpmzm_pow" | awk -F ":"
'{print $1}'`
_SNF=`expr $NR + 1`
_PASS=`expr $NR + 2`
SNF=`strings $FILE | head -n $_SNF | tail -n 1`
PASS=`strings $FILE | head -n $_PASS | tail -n 1`
echo "first string: $SNF"
echo "second string: $PASS"
fi


The server was obviously hacked, but I don't understand how the script
came on the server and its usage and purpose

Reply With Quote
  #2 (permalink)  
Old 02-04-2011, 06:48 PM
VanguardLH
Guest
 
Posts: n/a
Default Re: What's this? SSH hack?

Ebenezer Scrooge wrote:

> Found this shell script on a server:
>
> #!/bin/bash
> # cracker ssh backdoor - by AppleJuice
> if [ -f /usr/sbin/sshd ]; then
> FILE=/usr/sbin/sshd
> NR=`strings $FILE | grep --line-number "ssh_mpmzm_pow" | awk -F ":"
> '{print $1}'`
> _SNF=`expr $NR + 1`
> _PASS=`expr $NR + 2`
> SNF=`strings $FILE | head -n $_SNF | tail -n 1`
> PASS=`strings $FILE | head -n $_PASS | tail -n 1`
> echo "first string: $SNF"
> echo "second string: $PASS"
> fi
>
> The server was obviously hacked, but I don't understand how the script
> came on the server and its usage and purpose


On quick inspection (I'm no bash script expert) that the script is
trying to find a master password encoded inside the sshd (SSH daemon).
Sorry but I'm also not a *NIX guru to even know if SSH has a backdoor or
master password encoded within it. From a Google search:

http://www.google.com/search?q=%2Bss...or+%2Bpassword

it certainly appears there is a backdoor password. From reading just a
couple of results from the search, and from the example at
http://www.horseb.net/html/7643/7643.html, apparently you can edit an
includes.h file to define your backdoor and recompile. If the script
can find the password, and because I don't see any fancy decoding
scheme, maybe that backdoor password is just plain text. The script
just goes a hunting for the text backdoor password if one got put into
SSH. So you'll want to make sure you have an unmodified SSH
installation.

Another article
(http://www.juniper.net/security/auto...vuln25290.html)
mentions how SSH can be backdoored by using the known parameters used to
build the password. There also seems to be some "port knocking"
vulnerability to SSH (you can Google on that).

Reply With Quote
  #3 (permalink)  
Old 02-04-2011, 07:26 PM
DasFox
Guest
 
Posts: n/a
Default Re: What's this? SSH hack?

On Fri, 4 Feb 2011 13:48:18 -0600, VanguardLH wrote:

> Ebenezer Scrooge wrote:
>
>> Found this shell script on a server:
>>
>> #!/bin/bash
>> # cracker ssh backdoor - by AppleJuice


>From a Google search:
>
> http://www.google.com/search?q=%2Bss...or+%2Bpassword
>
> it certainly appears there is a backdoor password.


WOW...great deducement...did the word *BACKDOOR* clue you up...

And you had to search GOOGLE for that...LOL

THANKS
--
Gays make sick attempt at Harry Potter
http://www.methodshop.com/gadgets/re...-stick/big.jpg
https://ari.jottit.com/ YOU want to be next...? **** with 'FOX then...
https://www.icmag.com/ic/showpost.ph...9&postcount=25
Anybody with an internet connection, 5 grand, an iq above room
temperature and basic literacy can grow outstanding cannabis.

Reply With Quote
  #4 (permalink)  
Old 02-04-2011, 09:11 PM
TheGunslinger
Guest
 
Posts: n/a
Default Re: What's this? SSH hack?

On Fri, 4 Feb 2011 15:26:00 -0500, DasFox <dasfox@hushmail.com> wrote:

>On Fri, 4 Feb 2011 13:48:18 -0600, VanguardLH wrote:
>
>> Ebenezer Scrooge wrote:
>>
>>> Found this shell script on a server:
>>>
>>> #!/bin/bash
>>> # cracker ssh backdoor - by AppleJuice

>
>>From a Google search:
>>
>> http://www.google.com/search?q=%2Bss...or+%2Bpassword
>>
>> it certainly appears there is a backdoor password.

>
>WOW...great deducement...did the word *BACKDOOR* clue you up...
>
>And you had to search GOOGLE for that...LOL
>
>THANKS


ANOTHER HELPFUL BUTTHEAD FOR MY KF...

IMHO,

MJR

Reply With Quote
  #5 (permalink)  
Old 02-05-2011, 10:17 AM
Ebenezer Scrooge
Guest
 
Posts: n/a
Default Re: What's this? SSH hack?

On 04/02/2011 20:48, VanguardLH wrote:
> Ebenezer Scrooge wrote:
>
>> Found this shell script on a server:
>>
>> #!/bin/bash
>> # cracker ssh backdoor - by AppleJuice
>> if [ -f /usr/sbin/sshd ]; then
>> FILE=/usr/sbin/sshd
>> NR=`strings $FILE | grep --line-number "ssh_mpmzm_pow" | awk -F ":"
>> '{print $1}'`
>> _SNF=`expr $NR + 1`
>> _PASS=`expr $NR + 2`
>> SNF=`strings $FILE | head -n $_SNF | tail -n 1`
>> PASS=`strings $FILE | head -n $_PASS | tail -n 1`
>> echo "first string: $SNF"
>> echo "second string: $PASS"
>> fi
>>
>> The server was obviously hacked, but I don't understand how the script
>> came on the server and its usage and purpose

>
> On quick inspection (I'm no bash script expert) that the script is
> trying to find a master password encoded inside the sshd (SSH daemon).
> Sorry but I'm also not a *NIX guru to even know if SSH has a backdoor or
> master password encoded within it. From a Google search:
>
> http://www.google.com/search?q=%2Bss...or+%2Bpassword
>
> it certainly appears there is a backdoor password.


Don't know: fact is, with that script one can see full SSH logins in
plain text with root password...


Reply With Quote
  #6 (permalink)  
Old 02-06-2011, 02:18 PM
Mr. B
Guest
 
Posts: n/a
Default Re: What's this? SSH hack?

VanguardLH wrote:

> Ebenezer Scrooge wrote:
>
>> Found this shell script on a server:
>>
>> #!/bin/bash
>> # cracker ssh backdoor - by AppleJuice
>> if [ -f /usr/sbin/sshd ]; then
>> FILE=/usr/sbin/sshd
>> NR=`strings $FILE | grep --line-number "ssh_mpmzm_pow" | awk -F ":"
>> '{print $1}'`
>> _SNF=`expr $NR + 1`
>> _PASS=`expr $NR + 2`
>> SNF=`strings $FILE | head -n $_SNF | tail -n 1`
>> PASS=`strings $FILE | head -n $_PASS | tail -n 1`
>> echo "first string: $SNF"
>> echo "second string: $PASS"
>> fi
>>
>> The server was obviously hacked, but I don't understand how the script
>> came on the server and its usage and purpose

>
> On quick inspection (I'm no bash script expert) that the script is
> trying to find a master password encoded inside the sshd (SSH daemon).
> Sorry but I'm also not a *NIX guru to even know if SSH has a backdoor or
> master password encoded within it. From a Google search:
>
> http://www.google.com/search?q=%2Bss...or+%2Bpassword


The backdoor only appears to affect older versions of openssh; I just took a
look at the openssh source code on my system, and there does not appear to
be any way to set a backdoor password. I have never heard of anyone setting
such an ssh backdoor, but it certainly appears to have been an option at
some point.

-- B

Reply With Quote
  #7 (permalink)  
Old 02-06-2011, 02:36 PM
Mr. B
Guest
 
Posts: n/a
Default Re: What's this? SSH hack?

Ebenezer Scrooge wrote:

> Found this shell script on a server:
>
> #!/bin/bash
> # cracker ssh backdoor - by AppleJuice
> if [ -f /usr/sbin/sshd ]; then
> FILE=/usr/sbin/sshd
> NR=`strings $FILE | grep --line-number "ssh_mpmzm_pow" | awk -F ":"
> '{print $1}'`
> _SNF=`expr $NR + 1`
> _PASS=`expr $NR + 2`
> SNF=`strings $FILE | head -n $_SNF | tail -n 1`
> PASS=`strings $FILE | head -n $_PASS | tail -n 1`
> echo "first string: $SNF"
> echo "second string: $PASS"
> fi
>
>
> The server was obviously hacked, but I don't understand how the script
> came on the server and its usage and purpose


Are you using openssh, or some other ssh server? Also, which version are
you using? I cannot seem to find the string ssh_mpmzm_pow in the sshd
executable on any of my systems, nor can I find it in the source code for
openssh, nor in libssh*. Those systems are running Fedora; what is yours
running?

-- B

Reply With Quote
  #8 (permalink)  
Old 02-06-2011, 06:51 PM
VanguardLH
Guest
 
Posts: n/a
Default Re: What's this? SSH hack?

Mr. B wrote:

> VanguardLH wrote:
>
>> Ebenezer Scrooge wrote:
>>
>>> Found this shell script on a server:
>>>
>>> #!/bin/bash
>>> # cracker ssh backdoor - by AppleJuice
>>> if [ -f /usr/sbin/sshd ]; then
>>> FILE=/usr/sbin/sshd
>>> NR=`strings $FILE | grep --line-number "ssh_mpmzm_pow" | awk -F ":"
>>> '{print $1}'`
>>> _SNF=`expr $NR + 1`
>>> _PASS=`expr $NR + 2`
>>> SNF=`strings $FILE | head -n $_SNF | tail -n 1`
>>> PASS=`strings $FILE | head -n $_PASS | tail -n 1`
>>> echo "first string: $SNF"
>>> echo "second string: $PASS"
>>> fi
>>>
>>> The server was obviously hacked, but I don't understand how the script
>>> came on the server and its usage and purpose

>>
>> On quick inspection (I'm no bash script expert) that the script is
>> trying to find a master password encoded inside the sshd (SSH daemon).
>> Sorry but I'm also not a *NIX guru to even know if SSH has a backdoor or
>> master password encoded within it. From a Google search:
>>
>> http://www.google.com/search?q=%2Bss...or+%2Bpassword

>
> The backdoor only appears to affect older versions of openssh; I just took a
> look at the openssh source code on my system, and there does not appear to
> be any way to set a backdoor password. I have never heard of anyone setting
> such an ssh backdoor, but it certainly appears to have been an option at
> some point.
>
> -- B


From what I read, the articles that mentioned the source for the sshd
were for OpenSSH. So maybe it was a peculiar "feature" of just that
version of it.

Reply With Quote
  #9 (permalink)  
Old 02-06-2011, 08:26 PM
Mr. B
Guest
 
Posts: n/a
Default Re: What's this? SSH hack?

VanguardLH wrote:

> Mr. B wrote:
>
>> VanguardLH wrote:
>>
>>> Ebenezer Scrooge wrote:
>>>
>>>> Found this shell script on a server:
>>>>
>>>> #!/bin/bash
>>>> # cracker ssh backdoor - by AppleJuice
>>>> if [ -f /usr/sbin/sshd ]; then
>>>> FILE=/usr/sbin/sshd
>>>> NR=`strings $FILE | grep --line-number "ssh_mpmzm_pow" | awk -F ":"
>>>> '{print $1}'`
>>>> _SNF=`expr $NR + 1`
>>>> _PASS=`expr $NR + 2`
>>>> SNF=`strings $FILE | head -n $_SNF | tail -n 1`
>>>> PASS=`strings $FILE | head -n $_PASS | tail -n 1`
>>>> echo "first string: $SNF"
>>>> echo "second string: $PASS"
>>>> fi
>>>>
>>>> The server was obviously hacked, but I don't understand how the script
>>>> came on the server and its usage and purpose
>>>
>>> On quick inspection (I'm no bash script expert) that the script is
>>> trying to find a master password encoded inside the sshd (SSH daemon).
>>> Sorry but I'm also not a *NIX guru to even know if SSH has a backdoor or
>>> master password encoded within it. From a Google search:
>>>
>>> http://www.google.com/search?q=%2Bss...or+%2Bpassword

>>
>> The backdoor only appears to affect older versions of openssh; I just
>> took a look at the openssh source code on my system, and there does not
>> appear to
>> be any way to set a backdoor password. I have never heard of anyone
>> setting such an ssh backdoor, but it certainly appears to have been an
>> option at some point.
>>
>> -- B

>
> From what I read, the articles that mentioned the source for the sshd
> were for OpenSSH. So maybe it was a peculiar "feature" of just that
> version of it.


Like I said, I took a look at the source for openssh on my systems -- some
running CentOS, some running Fedora -- and the method of introducing a
backdoor that was described in the article did not appear to be there, nor
did it appear to be removed by any of the patches that the CentOS and Fedora
teams apply to their packages. The articles seem to refer to older versions
of openssh, which may be in use in some places.

-- B

Reply With Quote
  #10 (permalink)  
Old 02-06-2011, 11:28 PM
Ebenezer Scrooge
Guest
 
Posts: n/a
Default Re: What's this? SSH hack?

On 06/02/2011 16:36, Mr. B wrote:
> Ebenezer Scrooge wrote:
>
>> Found this shell script on a server:
>>
>> #!/bin/bash
>> # cracker ssh backdoor - by AppleJuice
>> if [ -f /usr/sbin/sshd ]; then
>> FILE=/usr/sbin/sshd
>> NR=`strings $FILE | grep --line-number "ssh_mpmzm_pow" | awk -F ":"
>> '{print $1}'`
>> _SNF=`expr $NR + 1`
>> _PASS=`expr $NR + 2`
>> SNF=`strings $FILE | head -n $_SNF | tail -n 1`
>> PASS=`strings $FILE | head -n $_PASS | tail -n 1`
>> echo "first string: $SNF"
>> echo "second string: $PASS"
>> fi
>>
>>
>> The server was obviously hacked, but I don't understand how the script
>> came on the server and its usage and purpose

>
> Are you using openssh, or some other ssh server? Also, which version are
> you using? I cannot seem to find the string ssh_mpmzm_pow in the sshd
> executable on any of my systems, nor can I find it in the source code for
> openssh, nor in libssh*. Those systems are running Fedora; what is yours
> running?


The distro was Debian Lenny, freshly upgraded some days ago. And yep, it
is OpenSSH.

I'm considering also the option of a hacked/tampered sshd file.

Found also this reference from another newsgroup, dunno if it's related:
http://cve.mitre.org/cgi-bin/cvename...=CVE-2007-3108


Reply With Quote
  #11 (permalink)  
Old 02-07-2011, 01:32 AM
Mr. B
Guest
 
Posts: n/a
Default Re: What's this? SSH hack?

Ebenezer Scrooge wrote:

> On 06/02/2011 16:36, Mr. B wrote:
>> Ebenezer Scrooge wrote:
>>
>>> Found this shell script on a server:
>>>
>>> #!/bin/bash
>>> # cracker ssh backdoor - by AppleJuice
>>> if [ -f /usr/sbin/sshd ]; then
>>> FILE=/usr/sbin/sshd
>>> NR=`strings $FILE | grep --line-number "ssh_mpmzm_pow" | awk -F ":"
>>> '{print $1}'`
>>> _SNF=`expr $NR + 1`
>>> _PASS=`expr $NR + 2`
>>> SNF=`strings $FILE | head -n $_SNF | tail -n 1`
>>> PASS=`strings $FILE | head -n $_PASS | tail -n 1`
>>> echo "first string: $SNF"
>>> echo "second string: $PASS"
>>> fi
>>>
>>>
>>> The server was obviously hacked, but I don't understand how the script
>>> came on the server and its usage and purpose

>>
>> Are you using openssh, or some other ssh server? Also, which version are
>> you using? I cannot seem to find the string ssh_mpmzm_pow in the sshd
>> executable on any of my systems, nor can I find it in the source code for
>> openssh, nor in libssh*. Those systems are running Fedora; what is yours
>> running?

>
> The distro was Debian Lenny, freshly upgraded some days ago. And yep, it
> is OpenSSH.


Which version of openssh? I checked versions 4.3 and 5.5, and as I said,
the string ssh_mpmzm_pow was not present in the sshd binary in both cases.

> I'm considering also the option of a hacked/tampered sshd file.


It is possible, although that script would not have done it. Also, if the
sshd binary had been tampered with, there would have been little point to
the script, since the strings it searches for could just be printed by a
modified sshd.

> Found also this reference from another newsgroup, dunno if it's related:
> http://cve.mitre.org/cgi-bin/cvename...=CVE-2007-3108


That does not appear to be relevant to the script you presented; the script
just uses the string ssh_mpmzm_pow to locate two other strings, which
apparently have some constant offset relative to the location of
ssh_mpmzm_pow. To be honest, since I cannot reproduce whatever output you
are getting from that script, I cannot say for sure what it does, other than
that it searches the sshd binary for two ascii strings.

-- B

Reply With Quote
  #12 (permalink)  
Old 02-07-2011, 02:01 AM
Ebenezer Scrooge
Guest
 
Posts: n/a
Default Re: What's this? SSH hack?

On 07/02/2011 03:32, Mr. B wrote:
> Ebenezer Scrooge wrote:
>
>> On 06/02/2011 16:36, Mr. B wrote:
>>> Ebenezer Scrooge wrote:
>>>
>>>> Found this shell script on a server:
>>>>
>>>> #!/bin/bash
>>>> # cracker ssh backdoor - by AppleJuice
>>>> if [ -f /usr/sbin/sshd ]; then
>>>> FILE=/usr/sbin/sshd
>>>> NR=`strings $FILE | grep --line-number "ssh_mpmzm_pow" | awk -F ":"
>>>> '{print $1}'`
>>>> _SNF=`expr $NR + 1`
>>>> _PASS=`expr $NR + 2`
>>>> SNF=`strings $FILE | head -n $_SNF | tail -n 1`
>>>> PASS=`strings $FILE | head -n $_PASS | tail -n 1`
>>>> echo "first string: $SNF"
>>>> echo "second string: $PASS"
>>>> fi
>>>>
>>>>
>>>> The server was obviously hacked, but I don't understand how the script
>>>> came on the server and its usage and purpose
>>>
>>> Are you using openssh, or some other ssh server? Also, which version are
>>> you using? I cannot seem to find the string ssh_mpmzm_pow in the sshd
>>> executable on any of my systems, nor can I find it in the source code for
>>> openssh, nor in libssh*. Those systems are running Fedora; what is yours
>>> running?

>>
>> The distro was Debian Lenny, freshly upgraded some days ago. And yep, it
>> is OpenSSH.

>
> Which version of openssh? I checked versions 4.3 and 5.5, and as I said,
> the string ssh_mpmzm_pow was not present in the sshd binary in both cases.
>
>> I'm considering also the option of a hacked/tampered sshd file.

>
> It is possible, although that script would not have done it. Also, if the
> sshd binary had been tampered with, there would have been little point to
> the script, since the strings it searches for could just be printed by a
> modified sshd.
>
>> Found also this reference from another newsgroup, dunno if it's related:
>> http://cve.mitre.org/cgi-bin/cvename...=CVE-2007-3108

>
> That does not appear to be relevant to the script you presented; the script
> just uses the string ssh_mpmzm_pow to locate two other strings, which
> apparently have some constant offset relative to the location of
> ssh_mpmzm_pow. To be honest, since I cannot reproduce whatever output you
> are getting from that script, I cannot say for sure what it does, other than
> that it searches the sshd binary for two ascii strings.


The second string, when running the script, did point to a file
sshd.proc or something similar, anyway when i cat'd the file, i got a
list of ssh logins, along with respective users and passwords.


Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 06:49 PM.



Powered by vBulletin® Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.6.0 PL2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45