DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#1 2009-08-13 22:28:15

cerk2006
Member
Registered: 2009-01-29
Posts: 11

Shutfdown NAS from PCH

Hi,

Despite several threads about shuting down the NAS I was not able to do it via bash script from my Popcornhour A110.
I am using this command to login and shutdown:

 

Code:

wget --http-user=user --http-password=password http://192.168.1.100/

but am gatting back:

Code:

--19:23:01--  http://192.168.1.100/web/login.asp?id=2925168
           => `login_2.asp?id=2925168'
Connecting to 192.168.1.100:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]

    [ <=>                                                                                   ] 5,950         --.--K/s

19:23:01 (8.94 MB/s) - `login_2.asp?id=2925168' saved [5950]

or

Code:

root@PCH-A110 /# wget --http-user=admin --http-password=cerk2006 192.168.1.100
--19:24:06--  http://192.168.1.100/
           => `index.html'
Connecting to 192.168.1.100:80... connected.
HTTP request sent, awaiting response... 302 Redirect
Location: http://192.168.1.100/web/login.asp?id=7602488 [following]
--19:24:06--  http://192.168.1.100/web/login.asp?id=7602488
           => `login.asp?id=7602488'
Connecting to 192.168.1.100:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]

    [ <=>                                                                                   ] 5,950         --.--K/s

19:24:06 (8.53 MB/s) - `login.asp?id=7602488' saved [5950]

I think I should first pass through the authentication and only then perform shutdown, but I do not know how to do that ;(
Could you please help me our, guys?

THANKS for yor help,
Uros

Offline

 

#2 2009-08-14 10:58:20

luusac
Member
Registered: 2008-04-29
Posts: 360

Re: Shutfdown NAS from PCH

one way to do this is to authenticate and then simulate the shutdown button click - POST the webform back to the 323.  There are a few ways that the shutdown can be performed (such as writing to a specific file), but I am not sure whether all of them are available in the latest f/w, or indeed whether they are a 'safe' shutdown method.  I have posted on this before (but not about shutting down from another linux box), as have others, did you search this forum or somewhere else?

Offline

 

#3 2009-08-14 18:00:53

cerk2006
Member
Registered: 2009-01-29
Posts: 11

Re: Shutfdown NAS from PCH

Thanks luusac, and yes I have been searching through this form and found posts (your as well wink ) related to shutdown of the NAS, but I was still not able to shut it down wink
I am a newbe at this (but learning), and would therefore ask you to be more specific about authentication and simulation of the shutdown button click (in terms of commands wink)

Thanks again,
Uros

Offline

 

#4 2009-08-15 02:14:20

luusac
Member
Registered: 2008-04-29
Posts: 360

Re: Shutfdown NAS from PCH

Hi,
I haven't done it from a linux shell, so I can't help that much, but maybe you could use something like perl or python on the control box (the one you want to shutdown the nas from).  The post method works because the webinterface for the 323 is based on forms.  The shutdown button sends the request to shutdown by submitting a hidden form on the webpage by the method POST (as opposed to the GET you use when viewing the webpage).

The commandline method that I was referring to is illustrated using plink.exe (a windows .exe), but unix source is available so you can compile it yourself, but I am sure you don't need to go down that route.  See http://dns323.kood.org/forum/viewtopic.php?id=3198 and http://www.dl-support.de/forum/viewtopic.php?t=18954 and http://www.dl-support.de/forum/download … mp;cat=108

All plink does is give you a commandline interface to putty (a telnet/ssh etc client) so you can issue (by a script file if you wish) a series of commands.  In the shutdown tool cited in the links above the following command is issued:

touch /tmp/shutdown
exit

So, (assuming this is possible on your popcorn) why not create a shell script (google unix/linux shell scripts) that logs in to the 323 (you will need to be able to get a shell on the 323 - e.g. telnet or ssh running first - if you don't have this look into ffp - see the howto) and then issues the above command.  All this does is create a file called shutdown in the /tmp directory, the 323 is checking to see whether this file exists.  If it finds it it will shutdown.  However, I do stress that I don't know whether this is a safe way to shutdown the box (it may work but it doesn't mean that it is safe - e.g. the 323 may use this method to shutdown once various other commands have been issued and the box is in a state ready to be shutdown), it has to be safer (or at least you can be sure it is safe) if you simulate the button click by posting the webform.

Offline

 

#5 2009-08-15 16:23:24

cerk2006
Member
Registered: 2009-01-29
Posts: 11

Re: Shutfdown NAS from PCH

Thanks luusac, I very much appreciate the effort for explaining what to do! I'll give it a try wink

BR Uros

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB