Welcome to HardwareForumz.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

hacking Synology DS-101

 
Goto page Previous  1, 2, 3, ... 9, 10, 11
   Hardware Problem Solving Community! (Home) -> General Discussion RSS
Next:  S.M.A.R.T. hard drive warning  
Author Message
Waspfactory




Joined: Jun 19, 2005
Posts: 8



(Msg. 16) Posted: Mon Jun 20, 2005 6:28 pm
Post subject: Re: hacking Synology DS-101 - PROGRESS!!! [Login to view extended thread Info.]

rocka wrote:

Maybe it would be usefull to start an SSH deamon on the box (if possible somehow), so we could avoid fighting with "SynoPassword:" ...


There is no SSH installed as far as I can see from exploring the filesystem via php. I haven't got past the SynoPassword thing either. I think I'll need to do more digging about. I did notice while messing about that the root user has /bin/ash set as the shell whereas the admin user has /bin/sh. Perhaps it's worth trying to create a new user on the system and set it up with the same group and shell as the root user and see if the SynoPassword thing still happens.

Cheers,
WF

 >> Stay informed about: hacking Synology DS-101 
Back to top
Login to vote
Waspfactory




Joined: Jun 19, 2005
Posts: 8



(Msg. 17) Posted: Wed Jun 22, 2005 11:13 am
Post subject: Re: hacking Synology DS-101 - PROGRESS!!! [Login to view extended thread Info.]

Okay, I think I've got the root password now - at least it's not coming up Login incorrect. Instead I'm getting that SynoPassword prompt that appears when you try to log in using the Admin account or any other user account.

How annoying. I think I'll just get my Linux box built and use that to do my rsync and SSH stuff - probably quicker!

 >> Stay informed about: hacking Synology DS-101 
Back to top
Login to vote
frl




Joined: Jul 01, 2005
Posts: 8



(Msg. 18) Posted: Fri Jul 01, 2005 4:45 am
Post subject: Re: hacking Synology DS-101 - PROGRESS!!! [Login to view extended thread Info.]

Just got my DS-101 yesterday - thanks to those of you that have already made progress on getting console access to this little puppy...

Can I suggest using PHPTerm? http://phpterm.sourceforge.net/

Download v3.0, copy the phpterm.php, menu.js and phpterm.css filed to the ds-101's web share, rename phpterm.php to phpterm.php3 and browse to http://{ds-101}/phpterm.php3 Do not enter a username or password, just click ok. And there you should have root console access in your browser. Very Happy

Unfortunately running vi seems to break something, and the ds-101 needs to be reset before you can regain access. If anyone has another way of editing files, please shout!

Oh, and does anyone have a copy of the default inetd.conf? In my eagerness I managed to overwrite my backup Sad

frl
 >> Stay informed about: hacking Synology DS-101 
Back to top
Login to vote
jaxe




Joined: Jul 01, 2005
Posts: 11



(Msg. 19) Posted: Fri Jul 01, 2005 5:10 am
Post subject: Re: hacking Synology DS-101 - PROGRESS!!! [Login to view extended thread Info.]

Thanks for the PHPTerminal tip!

I checked out /bin/busybox using 'strings' and it seems to contain the magical 'SynoPassword:' string. Thus, it seems to me that Synology has modified busybox to make the extra password check.

Does anyone have any idea on how to get past this one?

One idea would be to create an unmodified busybox binary, upload it to
the system, make symlink /bin/nopass_sh -> /bin/busybox and change the
shell of the user in /etc/passwd to /bin/nopass_sh.

However, I do not know how to compile an unmodified busybox binary
that would run on DS-101.
 >> Stay informed about: hacking Synology DS-101 
Back to top
Login to vote
jaxe




Joined: Jul 01, 2005
Posts: 11



(Msg. 20) Posted: Fri Jul 01, 2005 5:12 am
Post subject: Re: hacking Synology DS-101 - PROGRESS!!! [Login to view extended thread Info.]

The default inetd.conf is just this one line:

#telnet stream tcp nowait root /usr/sbin/telnetd telnetd
 >> Stay informed about: hacking Synology DS-101 
Back to top
Login to vote
frl




Joined: Jul 01, 2005
Posts: 8



(Msg. 21) Posted: Fri Jul 01, 2005 5:43 am
Post subject: Re: hacking Synology DS-101 - PROGRESS!!! [Login to view extended thread Info.]

Back to top
Login to vote
jaxe




Joined: Jul 01, 2005
Posts: 11



(Msg. 22) Posted: Fri Jul 01, 2005 5:49 am
Post subject: Re: hacking Synology DS-101 - PROGRESS!!! [Login to view extended thread Info.]

Binaries compiled for Linksys NSLU2 seem to run on DS-101.

I downloaded and extracted busybox from:

http://ipkgfind.nslu2-linux.org/details.php?package=busybox-base

This seems to run on DS-101 without problems.

However, changing the shell of a user to point to this new binary did not help to overcome the "SynoPassword" problem. I believe now that the prompt is presented by telnetd (/usr/sbin/telnetd) which is also provided by busybox.

As the busybox compiled for NSLU2 does not seem to contain telnetd functionality, so far I haven't figured out how to replace telnetd with a non-synology one. An alternative could be to install sshd.
 >> Stay informed about: hacking Synology DS-101 
Back to top
Login to vote
rocka




Joined: May 09, 2005
Posts: 5



(Msg. 23) Posted: Fri Jul 01, 2005 6:45 am
Post subject: Re: hacking Synology DS-101 - PROGRESS!!! [Login to view extended thread Info.]

great that there is some progress here!
does anyone know how to bring an SSH deamon to run on that box?
 >> Stay informed about: hacking Synology DS-101 
Back to top
Login to vote
frl




Joined: Jul 01, 2005
Posts: 8



(Msg. 24) Posted: Fri Jul 01, 2005 6:51 am
Post subject: Re: hacking Synology DS-101 - PROGRESS!!! [Login to view extended thread Info.]

Given the DS-101 is (from what I understand) based on very similar hardware to the NSLU2, jaxe's appraoch of looking at the hack's already done to that box seems sensible.

I've got the dropbear ssh files from here:

http://ipkgfind.nslu2-linux.org/details.php?package=dropbear&official=&format=

onto the DS-101, but there seems to be some dependancy issues when running it, involving libutil.

Promising stuff though.
 >> Stay informed about: hacking Synology DS-101 
Back to top
Login to vote
jaxe




Joined: Jul 01, 2005
Posts: 11



(Msg. 25) Posted: Fri Jul 01, 2005 9:59 am
Post subject: Re: hacking Synology DS-101 - PROGRESS!!! [Login to view extended thread Info.]

Dropbear would be sweet. I believe that we are getting very close.

One major item that is missing is a way to recover if the box is unable to reboot due to some mistakes made to configuration. Without that, there is slightly too a high risk involved in experimenting with the box...

With, for example, NSLU2, there seems to be several methods. http://www.nslu2-linux.org/wiki/HowTo/HomePage

Any ideas?
 >> Stay informed about: hacking Synology DS-101 
Back to top
Login to vote
jaxe




Joined: Jul 01, 2005
Posts: 11



(Msg. 26) Posted: Fri Jul 01, 2005 10:29 am
Post subject: Re: hacking Synology DS-101 - PROGRESS!!! [Login to view extended thread Info.]

Hmm, "hacking" SynoPassword was too easy. The code to calculate it is right there in the source code distributed by Synology, in source\busybox100p2\loginutils\login.c function ErrSYNOICheckPasswd.

The password changes daily. The code for today is 707-0101

The following program creates a new password for each day:

Code:

#include <time.h>
#include <sys/time.h>

int main()
{
   struct timeval tvTime;
   struct tm tmOutput;
   char szPasswd[9];
   int i;
   gettimeofday(&tvTime, 0);
   localtime_r(&(tvTime.tv_sec), &tmOutput);
   tmOutput.tm_mon += 1;
   szPasswd[8] = 0;
   if (tmOutput.tm_mon < 10)
      szPasswd[0] = '0' + tmOutput.tm_mon;
   else
      szPasswd[0] = 'a' + tmOutput.tm_mon - 10;
   szPasswd[1] = '0' + tmOutput.tm_mon / 10;
   szPasswd[2] = '0' + tmOutput.tm_mon % 10;
   szPasswd[3] = '-';
   szPasswd[4] = '0' + tmOutput.tm_mday / 16;
   if (tmOutput.tm_mday % 16 < 10)
      szPasswd[5] = '0' + tmOutput.tm_mday % 16;
   else
      szPasswd[5] = 'a' + tmOutput.tm_mday % 16 - 10;
   for (i = 12; i > 0; i--) {
      if (!(tmOutput.tm_mon % i) && !(tmOutput.tm_mday % i)) {
    break;
      }
   }
   szPasswd[6] = '0' + i / 10;
   szPasswd[7] = '0' + i % 10;
   printf("%s\n", szPasswd);
   return 0;
}

 >> Stay informed about: hacking Synology DS-101 
Back to top
Login to vote
Waspfactory




Joined: Jun 19, 2005
Posts: 8



(Msg. 27) Posted: Fri Jul 01, 2005 12:24 pm
Post subject: Re: hacking Synology DS-101 - PROGRESS!!! [Login to view extended thread Info.]

Excellent work getting around the SynoPassword. I did start ploughing through the code but you beat me to it! I can successfully log in as root now using the original root password

I've cobbled together a PHP script to do the same. Hopefully I've nailed it together okay but the test will come later in the month I think Wink Save it with a .php3 extension if you're putting it on the DS-101.
Code:

<?php
   $synopass = array();
   $tmOutput = localtime(time(),'1');
   $tmOutput['tm_mon']++;
   $synopass[0] = dechex($tmOutput['tm_mon']);
   $synopass[1] = floor($tmOutput['tm_mon']/10);
   $synopass[2] = $tmOutput['tm_mon'] % 10;
   $synopass[3] = '-';
   $synopass[4] = floor($tmOutput['tm_mday'] / 16);
     $synopass[5] = dechex($tmOutput['tm_mday'] % 16);
   for ($i = 12; $i > 0; $i--)
   {
      if (!($tmOutput['tm_mon'] % $i) && !($tmOutput['tm_mday'] % $i))
      {
         break;
      }
   }
   $synopass[6] =  floor($i/10);
   $synopass[7] = $i % 10;
   $password = implode("",$synopass);
   echo "SynoPassword Today is : $password";
?>


(By the way, the { and } are curly brackets)

Now all I need is SSH and rsync - It's looking really promising. I've got two of these things and want to get them synchronising themselves overnight.
 >> Stay informed about: hacking Synology DS-101 
Back to top
Login to vote
jaxe




Joined: Jul 01, 2005
Posts: 11



(Msg. 28) Posted: Fri Jul 01, 2005 2:47 pm
Post subject: Re: hacking Synology DS-101 - PROGRESS!!! [Login to view extended thread Info.]

How do you get the original root password exactly?
 >> Stay informed about: hacking Synology DS-101 
Back to top
Login to vote
Waspfactory




Joined: Jun 19, 2005
Posts: 8



(Msg. 29) Posted: Fri Jul 01, 2005 3:10 pm
Post subject: Re: hacking Synology DS-101 - PROGRESS!!! [Login to view extended thread Info.]

jaxe wrote:
How do you get the original root password exactly?


It was an inspired lucky guess. I just tried a few obvious ones and nearly fell off my chair when I got to the SynoPassword prompt!!!

Should it be posted here do you think? What's the implications? Probably none unless someone is running a hacked DS-101 with telnet enabled on a public network.
 >> Stay informed about: hacking Synology DS-101 
Back to top
Login to vote
jaxe




Joined: Jul 01, 2005
Posts: 11



(Msg. 30) Posted: Fri Jul 01, 2005 3:30 pm
Post subject: Re: hacking Synology DS-101 - PROGRESS!!! [Login to view extended thread Info.]

Security by obscurity is never of any value - especially if the password is really that easy to guess.

Just post it here, I'd say. If anyone enables telnetd or sshd, they should be aware that their box is wide open.
 >> Stay informed about: hacking Synology DS-101 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Get the Serial Number with Visual Basic - Hi folks, I have to write a Visual Basic 6.0 Program and need to uniquely identify a computer in a network and the user mustn't be able to change that id while my program is running. So the Volume Serial Number of the HDD isn't a possibility, because yo...

which one to get? - I'm looking for a DVD +/- R/RW. These two seem to be a pretty good value. Which one should I get? Plextor PX-708A http://www.plextor.com/english/products/708A.html or Sony DRU510A..

questions about DVD-RAM and 2 sided DVDs - The guy I spoke to at my local Futureshop showed me that LG dvd burner they had that supported DVD-RAM and that some type of DVD-RAM media you could write on both sides. He told me he didn't have them though. I've made a few phone calls at my local..

Subject: Another Slow Hard Drive Issue - Ack, I am having a problem. Access to my hard drive is a tad slow. I am running win 2K sp4, on a 1gig hz machine 768meg ram. I have a Maxtor 200gig hard drive on the second IDE channel. It is plugged into a removable tray. I recently went to device...

Maxtor One Touch USB NTFS Failure - I bought two Maxtor One Touch USB drives and both failed on the NTFS format under Windows XP Home (all current updates applied) The formatting meter gets to 100% but then an error displays that the format failed. Can anyone help? TIA, Dan
   Hardware Problem Solving Community! (Home) -> General Discussion All times are: Pacific Time (US & Canada) (change)
Goto page Previous  1, 2, 3, ... 9, 10, 11
Page 2 of 11

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]