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 2008-09-24 19:32:09

Opperpanter
Member
From: Eindhoven, Netherlands.
Registered: 2008-08-11
Posts: 89

how does kickwebs work?

Hi,

I am using the kickwebs approach to have lighttpd use port 80. this pushes the default web interface of my DNS-323 (Actually a CH3SNAS) to port 81.

I want to know more on how this works. THe killwebs.sh just kills the defaults webservice. I suppose the default webservice is restarted then and will switch to port 81 because port 80 is already in use by lighttpd by then.

Where is the port for the default webservice configured? Where is it configured that it switches to port 81 if port 80 fails?

The problem I have with the kickwebs method is that if for some reason the lighttpd fails to start after a reboot, than the default webservice will again be available at port 80 and thus to the whole internet.

Maybe there's some simple other service I could start at port 80 after lighttpd. If lighttpd start fails, then this simple service will occupy port 80 and prevent the default interface to become available?

Any ideas?

Offline

 

#2 2008-09-24 19:55:07

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: how does kickwebs work?

Opperpanter wrote:

Where is the port for the default webservice configured? Where is it configured that it switches to port 81 if port 80 fails?

gohead sources, LINUX/main.c
http://dns323.kood.org/forum/p1499-2007 … html#p1499

Opperpanter wrote:

Maybe there's some simple other service I could start at port 80 after lighttpd.

Sure, 33 lines of C code.


Attachments:
Attachment Icon port80.c, Size: 566 bytes, Downloads: 243

Offline

 

#3 2008-09-24 19:55:43

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: how does kickwebs work?

binary


Attachments:
Attachment Icon port80, Size: 5,426 bytes, Downloads: 249

Offline

 

#4 2008-09-25 13:54:18

Opperpanter
Member
From: Eindhoven, Netherlands.
Registered: 2008-08-11
Posts: 89

Re: how does kickwebs work?

Thanks. Since it's hardcoded

Code:

static int                      port = 80;                                              /* Server port */
static int                      retries = 5;                                    /* Server port retries */

/* 
*      Open the web server on the given port. If that port is taken, try
*      the next sequential port for up to "retries" attempts.
*/
        websOpenServer(port, retries);

(Is it the same on ch3snas?)

Your nice little c program will be needed.Should I put a wait/sleep in there or is the accept a blocking call?

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB