Unfortunately no one can be told what fun_plug is - you have to see it for yourself.
You are not logged in.
I have access to my DNS-323 via SSH login and would like to tighten up security on the device by shutting down the normal DNS-323 webs interface. If I need to reconfigure the device, I'd like to then be able to restart the webs interface from my SSH session and then shut it down agains when I'm through.
Anyone have any ideas? I can kill the webs services, but they just seem to restart themselves after awhile.
Thanks in advance for any tips.
Offline
well, another way you can do is to close port 80 into your dns323. That way nobody will be able to access into this webserver. When you want to use it, open back port 80. Even better method is to use port forwarding, create a port like 12345 to forward to port 80 into your dns323. That way only you know the port number and able to access it.
Most basic modem/router is able to do this.
Offline
Easy, just kill the /web/webs program. If you want it on again, just start it. You could even write a simple script to do this and have a start / stop command after it.
EDIT - Note: Don't forget to chroot it when you want to start it up, or it will stop as soon as you close your telnet session.
chroot / /web/webs
Last edited by bq041 (2008-05-19 23:55:39)
Offline
For clarification, I want to disable the DNS-323 webs http server on my internal network (i.e. inside my router/firewall). So, manipulation of my router and port forwarding won't solve my problem.
Also, it seems that every time I stop the /webs/webs service it restarts itself within a few minutes. Is there a special way to shutdown this service so it won't restart itself. I read somewhere else in the forum that D-Link may have some kind of "watchdog" service looking to see if the /webs/webs service is running and if not it starts it again.
Offline
jayas had done something like this in an attempt to improve security in a school environment. maybe he could shed some light
http://dns323.kood.org/forum/t1524-Auto … -sort.html
Offline
I think? the /usr/sbin/chkbutton process is responsible for being
the web server (webs) watchdog
/ # strings /usr/sbin/chkbutton | grep webs kill -9 `pidof webs` touch /tmp/webs-reload /web/webs& ps | grep /web/webs > /tmp/web_chk webs re-execute /web/webs &
Offline
Another possible solution from jayas:
"If you do a "ls -l /web", you will see that /web/web and /web/webs are links to respective files in crfs. You can use fun_plug to link these to something else, say /tmp so that after you kill webs, even if it gets restarted, it will not find it."
Offline
web interface on this device should be rewriten from scratch. its just so unsecure.
i would recommend everyone to turn this off and turn it on just when needed...
Offline
I think we've known for awhile that the web interface is insecure - however, and I know that not everyone agrees with me - given the intended SOHO usage of the device, I don't see it as being such a problem.
Offline
So what's the final solution of total killing webs ? I've searched the forum and found some solutions, but don't know which works correctly. I need totally kill of webs process with option sometime enable it.
Offline
#!/ffp/bin/sh # PROVIDE: kickwebs # REQUIRE: LOGIN #if [ -z ${MAIL} ]; then # #setup the ENV variables if not found # #this can happen when running from crontab # echo "Environment variables not found, including fun_plug defaults." # . /ffp/etc/profile #fi . /ffp/etc/ffp.subr name="kickwebs" start_cmd="kickwebs_start" #stop_cmd="kickwebs_stop" status_cmd="kickwebs_status" original_link=/sys/crfs/web/webs new_link=/dev/null kickwebs_start() { echo -n "Kicking webs ..." killall webs ln -sf $new_link /web/webs echo "done." } kickwebs_stop() { if [ `kickwebs_temp_status` = "running" ]; then echo "INFO: webs already running! Nothing to do." exit 1 fi echo -n "Starting webs ..." ln -sf $original_link /web/webs #/web/webs& echo "done." } kickwebs_status() { if [ -n "$(pidof webs)" ]; then echo "webs running." else echo "webs stopped." fi } kickwebs_temp_status() { if [ -n "$(pidof webs)" ]; then echo "running" else echo "stopped" fi } case "$2" in webs) if [ "$1" == "stop" ]; then kickwebs_stop fi ;; *) run_rc_command "$1" ;; esac
# ./kickwebs start
will kill webs and it will not run again
# ./kickwebs stop
will run webs again
having this script +x in /ffp/start direcotry will kick webs on every boot.
Last edited by SilentException (2008-12-04 21:42:04)
Offline
Hello,
Thank you for super nice script. I didn't mention that I want to kill webs (config interface of DNS323), but not to kill lighttpd. So I added one line:
SilentException wrote:
Code:
#!/ffp/bin/sh # PROVIDE: kickwebs # REQUIRE: LOGIN # BEFORE: lighttpd ^^^^^^^^^^^^^^ ........
and it seems like everything is working just fine. Thank you very very much !
alpha
Offline
SilentException wrote:
Code:
#!/ffp/bin/sh kickwebs_start() { echo -n "Kicking webs ..." killall webs ln -sf $new_link /web/webs echo "done." }
Would it be better to create the link *before* killing the webs processes to avoid the (theoretical?) race condition of the dns-323 restarting webs before you make the null link?
Offline
alpha wrote:
Hello,
Thank you for super nice script. I didn't mention that I want to kill webs (config interface of DNS323), but not to kill lighttpd. So I added one line:SilentException wrote:
Code:
#!/ffp/bin/sh # PROVIDE: kickwebs # REQUIRE: LOGIN # BEFORE: lighttpd ^^^^^^^^^^^^^^ ........and it seems like everything is working just fine. Thank you very very much !
alpha
I'm not sure I understand why this has to happen before lighttpd. Do you need to kill webs before lighttpd starts because of a port or resource conflict?
Offline
Hello,
puterboy wrote:
I'm not sure I understand why this has to happen before lighttpd. Do you need to kill webs before lighttpd starts because of a port or resource conflict?
I kill webs before lighttpd just because lighttpd won't start after this script. You need manually start lighttpd OR write some line of starting lighttpd in this given script. If I run this script without "#BEFORE lighttpd" directive I have no lighttpd server started automatically.
Regards,
alpha
Offline
OK. But not clear to me why that is the case though.
Offline