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 2007-02-16 03:02:40

sgabello
New member
Registered: 2007-02-16
Posts: 4

Change http port

Hi all,
I'm a new DNS-323 user big_smile
Do you think that I can change default http port (80) to another one (ex.323 big_smile). I have already a web server on my network. So to grant access from WAN I need to use another port on my router.

Can anyone help me?

thanks!
Andrea

Offline

 

#2 2007-02-16 03:22:44

Aaron
Member
Registered: 2007-02-09
Posts: 53

Re: Change http port

If your router supports port forwarding you could just forward the port that way. Examp> HTTP Port Forwarded from 80(External) to 80(internal) for webserver, and then Forward port 323(External) to port 80(internal) for the DNS-323 ip address.

-Aaron

Offline

 

#3 2007-02-16 03:39:06

sgabello
New member
Registered: 2007-02-16
Posts: 4

Re: Change http port

I know... i know...
With my OLD Alcatel SpeedTouchHome@Pro I could make it. But my actual router (Netgear DG834G) don't support this feature... only address translation... 80 on WAN is 80 on LAN sad

Offline

 

#4 2007-02-16 05:42:31

tobyg
Member
Registered: 2007-01-31
Posts: 42

Re: Change http port

Not easily.

Here is the 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);

So it sounds like if you could find something else to run on port 80, you could kill webs (that's the name of the server, /web/webs), start something else to run on 80, then rerun /web/webs and it should flip to 81.

Untested of course, but that would probably be your only possibility.  We can't recompile the webserver because a lot of the code DLINK has added to the web server is not public.

Offline

 

#5 2007-02-16 08:12:38

sala
Member / Site Admin
From: Estonia
Registered: 2006-07-28
Posts: 731
Website

Re: Change http port

I can confirm this method works on DSM-G600.


DSM-G600 - NetBSD hdd-boot - 80GB Samsung SP0802N
NSA-220 - Gentoo armv5tel 20110121 hdd-boot - 2x 2TB WD WD20EADS

Offline

 

#6 2007-02-16 11:28:44

sgabello
New member
Registered: 2007-02-16
Posts: 4

Re: Change http port

I think it's the perfect solution... Only one more question: I'm really new about this NAS... can you tell me where I must put that code? A link to a guide is really appreciated big_smile

Offline

 

#7 2007-02-16 12:08:54

Apskaft
Member
From: Karlskrona, Sweden
Registered: 2007-01-09
Posts: 165

Re: Change http port

Start of by reading the fun_plug in our wiki. NetCat can be found in the KRH archive.  I suppose the script could look something like this:

Code:

#!/bin/sh
kill -9 `pidof webs`

#
# I guess there are better solutions than nc, will give strange results if HTTP client access
#
/mnt/HD_a2/nc -l -p 80 -e /bin/sh &

/web/webs &

I think that there is also a http deamon available in at least of one of the busybox varians floating around, check the busybox3 in the KRH archive. Could be used, I suppose, instead of nc to serve a 301 redirect page to a http client accesing port 80.

Also, please note that there are some kind of watchdog checking the presence of the webs service which means that the port 80 listeneer needs to be on-line all the time in the case of restart of the webs application.

Good luck,
/Apan

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB