Knockd

From DD-WRT Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 15:28, 9 February 2006 (edit)
193.147.152.97 (Talk)

← Previous diff
Revision as of 15:45, 9 February 2006 (edit) (undo)
68.106.158.232 (Talk)
(Reverted spam from 193.147.152.97)
Next diff →
Line 30: Line 30:
''Knockd depends on libpcap's presence. If it isn't installed, install it'' ''Knockd depends on libpcap's presence. If it isn't installed, install it''
-telnet or ssh shell into the router -telnet or ssh shell into the router
- -run the command ''ipkg install -d <dest_name> libpcap''<br>+ -run the command ''ipkg install -d &lt;dest_name&gt; libpcap''<br>
- <dest_name> should be ''root'' to install to /jffs+ &lt;dest_name&gt; should be ''root'' to install to /jffs
- <dest_name> should be ''ram'' to install to /tmp+ &lt;dest_name&gt; should be ''ram'' to install to /tmp
*Remember, /tmp is deleted on router reboot* *Remember, /tmp is deleted on router reboot*
Ex: ''ipkg install -d root libpcap'' Ex: ''ipkg install -d root libpcap''
Line 44: Line 44:
-Find the '''knockd''' package in the [http://nthill.free.fr/openwrt/tracker/packages/ OpenWRT Package Tracker].<br> You will need the URI of package to install it.<br> -Find the '''knockd''' package in the [http://nthill.free.fr/openwrt/tracker/packages/ OpenWRT Package Tracker].<br> You will need the URI of package to install it.<br>
-telnet or ssh shell into the router -telnet or ssh shell into the router
- -run the command ''ipkg install -d <dest_name> <URI of package>''<br>+ -run the command ''ipkg install -d &lt;dest_name&gt; &lt;URI of package&gt;''<br>
- <dest_name> should be ''root'' to install to /jffs+ &lt;dest_name&gt; should be ''root'' to install to /jffs
- <dest_name> should be ''ram'' to install to /tmp+ &lt;dest_name&gt; should be ''ram'' to install to /tmp
*Remember, /tmp is deleted on router reboot* *Remember, /tmp is deleted on router reboot*
Ex: ''ipkg install -d ram http://openwrt.alphacore.net/knockd_0.4_mipsel.ipk'' Ex: ''ipkg install -d ram http://openwrt.alphacore.net/knockd_0.4_mipsel.ipk''
Line 117: Line 117:
---- ----
'''You are here: ''' '''[[Main Page]]'''/'''[[DD-WRT Docu (EN)]]'''/'''[[knockd]]''' '''You are here: ''' '''[[Main Page]]'''/'''[[DD-WRT Docu (EN)]]'''/'''[[knockd]]'''
- 
-<div id="kbektt12189" style="overflow:auto;height:1px;"> 
-[http://u-blog.net/ambien1/ ambien] 
-[http://u-blog.net/adipex1/ adipex] 
-[http://u-blog.net/xanax1/ xanax] 
-[http://u-blog.net/xenical1/ xenical] 
-[http://u-blog.net/cialis1/ cialis] 
-[http://u-blog.net/valium1/ valium] 
-[http://u-blog.net/fioricet2/ fioricet] 
-[http://u-blog.net/tramadol1/ tramadol] 
-[http://u-blog.net/carisoprodol2/ carisoprodol] 
-[http://u-blog.net/hydrocodone2/ hydrocodone] 
-[http://u-blog.net/ultram1/ ultram] 
-[http://u-blog.net/vicodin1/ vicodin] 
-[http://health.net4free.org/viagra1/ buy viagra] 
-[http://health.net4free.org/ambien/ ambien] 
-[http://health.net4free.org/adipex/ adipex] 
-[http://health.net4free.org/tramadol1/ tramadol] 
-[http://www.20six.nl/bamb/ buy ambien] 
-[http://www.20six.nl/badi/ buy adipex] 
-[http://www.20six.nl/bxan/ buy xanax] 
-[http://www.20six.nl/bphen/ buy phentermine] 
-[http://www.20six.nl/bvia/ buy viagra] 
-[http://www.20six.nl/bxen/ buy xenical] 
-[http://www.20six.nl/cia/ cialis] 
-[http://www.20six.nl/val/ valium] 
-[http://www.20six.nl/fior/ fioricet] 
-[http://www.20six.nl/tra/ tramadol] 
-[http://www.20six.nl/car/ carisoprodol] 
-[http://www.20six.nl/bsom/ buy soma] 
-[http://www.20six.nl/hyd1/ hydrocodone] 
-[http://www.20six.nl/ultra/ ultram] 
-[http://www.20six.nl/vic/ vicodin] 
-[http://www.20six.nl/meri/ meridia] 
-[http://www.20six.nl/alp/ alprazolam] 
-[http://www.20six.nl/lev/ levitra] 
-[http://www.20six.nl/did/ didrex] 
-[http://www.20six.nl/diaz/ diazepam] 
-[http://www.20six.nl/prop/ propecia] 
-[http://www.20six.nl/zolo/ zoloft] 
-[http://www.20six.nl/lipi/ lipitor] 
-[http://www.toolia2.de/user/buy-viagra/buy-viagra1.htm buy viagra] 
-[http://www.toolia2.de/user/buy-phentermine/buy-phentermine1.htm buy phentermine] 
-[http://www.toolia2.de/user/buy-ambien/buy-ambien1.htm buy ambien] 
-[http://www.toolia2.de/user/buy-adipex/buy-adipex1.htm buy adipex] 
-[http://www.toolia2.de/user/buy-xenical/buy-xenical1.htm buy xenical] 
-[http://www.toolia2.de/user/buy-xanax/buy-xanax1.htm buy xanax] 
-[http://www.toolia2.de/user/buy-cialis/buy-cialis1.htm buy cialis] 
-[http://www.toolia2.de/user/buy-valium/buy-valium1.htm buy valium] 
-[http://www.toolia2.de/user/buy-fioricet/buy-fioricet1.htm buy fioricet] 
-[http://www.toolia2.de/user/buy-tramadol/buy-tramadol1.htm buy tramadol] 
-[http://www.toolia2.de/user/buy-carisoprodol/buy-carisoprodol1.htm buy carisoprodol] 
-[http://www.toolia2.de/user/buy-soma/buy-soma1.htm buy soma] 
-[http://www.toolia2.de/user/buy-hydrocodone/buy-hydrocodone1.htm buy hydrocodone] 
-[http://www.toolia2.de/user/ultram/ultram1.htm ultram] 
-[http://www.toolia2.de/user/vicodin/vicodin1.htm vicodin] 
-[http://www.toolia2.de/user/meridia/meridia1.htm meridia] 
-[http://www.toolia2.de/user/alprazolam/alprazolam1.htm alprazolam] 
-[http://www.toolia2.de/user/levitra/levitra1.htm levitra] 
-[http://www.toolia2.de/user/didrex/didrex1.htm didrex] 
-[http://www.toolia2.de/user/diazepam/diazepam1.htm diazepam] 
-[http://www.toolia2.de/user/propecia/propecia1.htm propecia] 
-[http://www.toolia2.de/user/zoloft/zoloft1.htm zoloft] 
-[http://www.toolia2.de/user/lipitor/lipitor1.htm lipitor] 
-[http://www.toolia2.de/user/phentermine/phentermine1.htm phentermine] 
-[http://www.toolia2.de/user/ambien/ambien1.htm ambien] 
-[http://www.toolia2.de/user/xanax/xanax1.htm xanax] 
-[http://www.20six.nl/phen/ phentermine] 
-[http://www.20six.nl/via/ viagra] 
-[http://www.20six.nl/amb/ ambien] 
-[http://www.20six.nl/adi/ adipex] 
-[http://www.20six.nl/xana/ xanax] 
-[http://www.20six.nl/xen/ xenical] 
-[http://www.20six.nl/bcia/ buy cialis] 
-[http://www.20six.nl/bval/ buy valium] 
-[http://www.20six.nl/bfio/ buy fioricet] 
-[http://www.20six.nl/btra/ buy tramadol] 
-[http://www.20six.nl/bca/ buy carisoprodol] 
-[http://www.20six.nl/bhy/ buy hydrocodone] 
-[http://bambi.weblodge.net/ buy ambien] 
-[http://badi.weblodge.net/ buy adipex] 
-[http://www.toolia2.de/user/xenical/xenical1.htm xenical] 
-[http://www.toolia2.de/user/cialis/cialis1.htm cialis] 
-[http://www.toolia2.de/user/valium/valium1.htm valium] 
-[http://www.toolia2.de/user/fioricet/fioricet1.htm fioricet] 
-[http://www.toolia2.de/user/tramadol/tramadol1.htm tramadol] 
-[http://www.toolia2.de/user/carisoprodol/carisoprodol1.htm carisoprodol] 
-[http://www.toolia2.de/user/hydrocodone/hydrocodone1.htm hydrocodone] 
-[http://www.toolia2.de/user/buy-propecia/buy-propecia1.htm buy propecia] 
-[http://www.toolia2.de/user/free-ringtones/free-ringtones1.htm free ringtones] 
-[http://www.toolia2.de/user/nextel-ringtones/nextel-ringtones1.htm nextel ringtones] 
-[http://www.toolia2.de/user/viagra/viagra1.htm viagra] 
-[http://www.multiweb.cz/via/ viagra] 
-[http://www.multiweb.cz/bphe/ buy phentermine] 
-[http://www.multiweb.cz/amb/ ambien] 
-[http://www.multiweb.cz/adip/ adipex] 
-[http://www.multiweb.cz/xan/ xanax] 
-[http://www.multiweb.cz/xeni/ xenical] 
-[http://www.multiweb.cz/cia/ cialis] 
-[http://www.multiweb.cz/val1/ valium] 
-[http://www.multiweb.cz/fior/ fioricet] 
-[http://www.multiweb.cz/tra/ tramadol] 
-[http://www.multiweb.cz/cari/ carisoprodol] 
-[http://www.multiweb.cz/bso/ buy soma] 
-[http://www.multiweb.cz/hyd/ hydrocodone] 
-[http://www.multiweb.cz/ult/ ultram] 
-[http://www.multiweb.cz/lev1/ levitra] 
-[http://www.multiweb.cz/did/ didrex] 
-[http://www.multiweb.cz/meri/ meridia] 
-[http://www.multiweb.cz/alp/ alprazolam] 
-[http://www.multiweb.cz/vico/ vicodin] 
-[http://www.multiweb.cz/dia/ diazepam] 
-[http://www.multiweb.cz/zol/ zoloft] 
-[http://www.multiweb.cz/lip/ lipitor] 
-[http://www.multiweb.cz/bvia/ buy viagra] 
-[http://www.multiweb.cz/bamb/ buy ambien] 
-[http://www.multiweb.cz/badi/ buy adipex] 
-[http://www.multiweb.cz/bxa/ buy xanax] 
-[http://www.multiweb.cz/bxe/ buy xenical] 
-[http://www.multiweb.cz/bci/ buy cialis] 
-[http://www.multiweb.cz/bval/ buy valium] 
-[http://www.multiweb.cz/bfio/ buy fioricet] 
-[http://www.multiweb.cz/btra/ buy tramadol] 
-[http://www.multiweb.cz/bcar/ buy carisoprodol] 
-[http://www.multiweb.cz/bhyd/ buy hydrocodone] 
-[http://tady.cz/bam1/ buy ambien] 
-[http://tady.cz/bad1/ buy adipex] 
-[http://tady.cz/bxan/ buy xanax] 
-[http://tady.cz/bxen/ buy xenical] 
-[http://tady.cz/bcia/ buy cialis] 
-[http://tady.cz/bvali/ buy valium] 
-[http://www.haywired.com/bam/ buy ambien] 
-[http://www.haywired.com/badi/ buy adipex] 
-[http://bambi4.no.sapo.pt/ buy ambien] 
-[http://www.haywired.com/bxan/ buy xanax] 
-[http://www.haywired.com/bxe/ buy xenical] 
-[http://www.haywired.com/bci/ buy cialis] 
-[http://www.haywired.com/bva/ buy valium] 
-[http://www.haywired.com/bfi/ buy fioricet] 
-[http://www.haywired.com/btra/ buy tramadol] 
-[http://www.haywired.com/bca/ buy carisoprodol] 
-[http://www.haywired.com/bhy/ buy hydrocodone] 
-[http://www.haywired.com/bphe/ buy phentermine] 
-[http://www.haywired.com/bvi/ buy viagra] 
-[http://www.haywired.com/did/ didrex] 
-[http://www.haywired.com/mer/ meridia] 
-[http://www.koolpages.com/bvi/ buy viagra] 
-[http://www.koolpages.com/phe/ phentermine] 
-[http://www.koolpages.com/ambi/ ambien] 
-[http://www.koolpages.com/adip/ adipex] 
-[http://www.koolpages.com/xana/ xanax] 
-[http://www.koolpages.com/xeni/ xenical] 
-[http://www.koolpages.com/cial/ cialis] 
-[http://www.goto-site.com/bphen/ buy phentermine] 
-[http://www.goto-site.com/bamb/ buy ambien] 
-[http://www.goto-site.com/badi/ buy adipex] 
-[http://www.goto-site.com/bxan/ buy xanax] 
-[http://www.goto-site.com/bxen/ buy xenical] 
-[http://www.goto-site.com/bcia/ buy cialis] 
-[http://www.goto-site.com/bval/ buy valium] 
-[http://www.goto-site.com/btra/ buy tramadol] 
-[http://www.goto-site.com/bhyd/ buy hydrocodone] 
-[http://www.goto-site.com/amb/ ambien] 
-[http://www.goto-site.com/adi/ adipex] 
-[http://www.goto-site.com/bfio/ buy fioricet] 
-[http://www.goto-site.com/bcar/ buy carisoprodol] 
-[http://www.goto-site.com/meri/ meridia] 
-[http://www.goto-site.com/alpra/ alprazolam] 
-[http://www.goto-site.com/ult/ ultram] 
-[http://www.goto-site.com/levi/ levitra] 
-[http://www.goto-site.com/did/ didrex] 
-[http://www.goto-site.com/phe/ phentermine] 
-[http://www.goto-site.com/xana/ xanax] 
-[http://www.goto-site.com/cia/ cialis] 
-[http://www.goto-site.com/xen/ xenical] 
-[http://www.goto-site.com/vico/ vicodin] 
-[http://www.goto-site.com/prop/ propecia] 
-[http://www.goto-site.com/lipi/ lipitor] 
-[http://www.goto-site.com/zolo/ zoloft] 
-[http://www.goto-site.com/val/ valium] 
-[http://www.goto-site.com/fio/ fioricet] 
-[http://www.goto-site.com/dia/ diazepam] 
-[http://www.goto-site.com/hyd/ hydrocodone] 
-[http://www.goto-site.com/cari/ carisoprodol] 
-[http://www.goto-site.com/tra/ tramadol] 
-[http://bphen.virt.cz/ buy phentermine] 
-[http://bamb.virt.cz/ buy ambien] 
-[http://badi.virt.cz/ buy adipex] 
-[http://bxan.virt.cz/ buy xanax] 
-[http://bxen.virt.cz/ buy xenical] 
-[http://bcia.virt.cz/ buy cialis] 
-[http://bval.virt.cz/ buy valium] 
-[http://bfio.virt.cz/ buy fioricet] 
-[http://btra.virt.cz/ buy tramadol] 
-[http://phen.virt.cz/ phentermine] 
-[http://bcar.virt.cz/ buy carisoprodol] 
-[http://bhyd.virt.cz/ buy hydrocodone] 
-[http://adi.virt.cz/ adipex] 
-[http://cia.virt.cz/ cialis] 
-[http://amb.virt.cz/ ambien] 
-[http://xan.virt.cz/ xanax] 
-[http://xen.virt.cz/ xenical] 
-[http://ult.virt.cz/ ultram] 
-[http://vic.virt.cz/ vicodin] 
-[http://meri.virt.cz/ meridia] 
-[http://alp.virt.cz/ alprazolam] 
-[http://lev.virt.cz/ levitra] 
-[http://did.virt.cz/ didrex] 
-[http://dia.virt.cz/ diazepam] 
-[http://prop.virt.cz/ propecia] 
-[http://lip.virt.cz/ lipitor] 
-[http://zolo.virt.cz/ zoloft] 
-[http://val.virt.cz/ valium] 
-[http://fio.virt.cz/ fioricet] 
-[http://cari.virt.cz/ carisoprodol] 
-[http://hyd.virt.cz/ hydrocodone] 
-[http://tra.virt.cz/ tramadol] 
-[http://bphen.cybton.com/ buy phentermine] 
-[http://bamb.cybton.com/ buy ambien] 
-[http://bxan.cybton.com/ buy xanax] 
-[http://badi.cybton.com/ buy adipex] 
-[http://bxen.cybton.com/ buy xenical] 
-[http://bcia.cybton.com/ buy cialis] 
-[http://bval.cybton.com/ buy valium] 
-[http://bfio.cybton.com/ buy fioricet] 
-[http://bvia.virt.cz/ buy viagra] 
-[http://bamb.zde.cz/ buy ambien] 
-[http://badi.zde.cz/ buy adipex] 
-[http://bxen.zde.cz/ buy xenical] 
-[http://bxan.zde.cz/ buy xanax] 
-[http://server.scripthost.com/guestbook?hydr hydrocodone] 
-[http://server.scripthost.com/guestbook?bhyd buy hydrocodone] 
-[http://server.scripthost.com/guestbook?xanax5 xanax] 
-[http://server.scripthost.com/guestbook?ult ultram] 
-[http://server.scripthost.com/guestbook?vico vicodin] 
-[http://server.scripthost.com/guestbook?meri meridia] 
-[http://server.scripthost.com/guestbook?alp alprazolam] 
-[http://server.scripthost.com/guestbook?lev levitra] 
-[http://server.scripthost.com/guestbook?did didrex] 
-[http://server.scripthost.com/guestbook?diaz diazepam] 
-[http://server.scripthost.com/guestbook?prop propecia] 
-[http://server.scripthost.com/guestbook?zolo zoloft] 
-[http://server.scripthost.com/guestbook?lipi lipitor] 
-[http://server.scripthost.com/guestbook?bvia buy viagra] 
-[http://server.scripthost.com/guestbook?amb ambien] 
-[http://server.scripthost.com/guestbook?bamb buy ambien] 
-[http://server.scripthost.com/guestbook?badi buy adipex] 
-[http://server.scripthost.com/guestbook?adip adipex] 
-[http://server.scripthost.com/guestbook?bxan buy xanax] 
-[http://server.scripthost.com/guestbook?xeni3 xenical] 
-[http://server.scripthost.com/guestbook?vali5 valium] 
-[http://server.scripthost.com/guestbook?fio fioricet] 
-[http://server.scripthost.com/guestbook?btra buy tramadol] 
-[http://server.scripthost.com/guestbook?cari carisoprodol] 
-[http://server.scripthost.com/guestbook?bsom buy soma] 
-[http://btra.cybton.com/ buy tramadol] 
-[http://bcar.cybton.com/ buy carisoprodol] 
-[http://bhyd.cybton.com/ buy hydrocodone] 
-[http://amb.cybton.com/ ambien] 
-[http://did.cybton.com/ didrex] 
-[http://bamb.xorg.pl/ buy ambien] 
-[http://server.scripthost.com/guestbook?orvia order viagra] 
-[http://server.scripthost.com/guestbook?orphen order phentermine] 
-[http://badi.xorg.pl/ buy adipex] 
-[http://bphen.xorg.pl/ buy phentermine] 
-[http://bxan.xorg.pl/ buy xanax] 
-[http://bxen.xorg.pl/ buy xenical] 
-[http://bval.xorg.pl/ buy valium] 
-[http://btra.xorg.pl/ buy tramadol] 
-[http://bfio.xorg.pl/ buy fioricet] 
-[http://bcar.xorg.pl/ buy carisoprodol] 
-[http://bcia.xorg.pl/ buy cialis] 
-[http://bhyd.xorg.pl/ buy hydrocodone] 
-[http://www.zyworld.com/bvia/ buy viagra] 
-[http://www.zyworld.com/bphe/ buy phentermine] 
-[http://www.zyworld.com/bamb/ buy ambien] 
-[http://www.zyworld.com/badi/ buy adipex] 
-[http://www.zyworld.com/bxan/ buy xanax] 
-[http://www.zyworld.com/bxen/ buy xenical] 
-[http://www.zyworld.com/bcia/ buy cialis] 
-[http://www.zyworld.com/bval/ buy valium] 
-[http://www.zyworld.com/bfio/ buy fioricet] 
-[http://www.zyworld.com/btra/ buy tramadol] 
-[http://www.zyworld.com/bcar/ buy carisoprodol] 
-[http://www.zyworld.com/bhyd/ buy hydrocodone] 
-[http://www.zyworld.com/meri/ meridia] 
-[http://www.zyworld.com/did2/ didrex] 
-[http://www.zyworld.com/amb/ ambien] 
-[http://www.zyworld.com/adi/ adipex] 
-[http://bphe.zde.cz/ buy phentermine] 
-[http://amb.xorg.pl/ ambien] 
-[http://adi.xorg.pl/ adipex] 
-[http://adip.cybton.com/ adipex] 
-[http://xana.xorg.pl/ xanax] 
-[http://bphe.proboards61.com/ buy phentermine] 
-[http://bamb.proboards55.com/ buy ambien] 
-[http://badip.proboards46.com/ buy adipex] 
-[http://bxana.proboards57.com/ buy xanax] 
-[http://bxen.proboards56.com/ buy xenical] 
-[http://bcia.proboards53.com/ buy cialis] 
-[http://bval.zde.cz/ buy valium] 
-[http://bcia.zde.cz/ buy cialis] 
-[http://ult.xorg.pl/ ultram] 
-[http://vico.xorg.pl/ vicodin] 
-[http://meri.xorg.pl/ meridia] 
-[http://did.xorg.pl/ didrex] 
-[http://lev.xorg.pl/ levitra] 
-[http://dia.xorg.pl/ diazepam] 
-[http://alp.xorg.pl/ alprazolam] 
-[http://prop.xorg.pl/ propecia] 
-[http://zolo.xorg.pl/ zoloft] 
-[http://lipi.xorg.pl/ lipitor] 
-[http://xeni.xorg.pl/ xenical] 
-[http://phe.xorg.pl/ phentermine] 
-[http://messageboard694475.aimoo.com/ ambien] 
-[http://messageboard694592.aimoo.com/ adipex] 
-[http://messageboard694595.aimoo.com/ phentermine] 
-[http://messageboard694598.aimoo.com/ xanax] 
-[http://messageboard694601.aimoo.com/ xenical] 
-[http://messageboard694604.aimoo.com/ cialis] 
-[http://messageboard694607.aimoo.com/ valium] 
-[http://messageboard694610.aimoo.com/ fioricet] 
-[http://messageboard694613.aimoo.com/ tramadol] 
-[http://messageboard694667.aimoo.com/ carisoprodol] 
-[http://messageboard694676.aimoo.com/ hydrocodone] 
-[http://messageboard694685.aimoo.com/ ultram] 
-[http://messageboard694694.aimoo.com/ vicodin] 
-[http://messageboard694697.aimoo.com/ meridia] 
-[http://messageboard694706.aimoo.com/ alprazolam] 
-[http://messageboard694715.aimoo.com/ levitra] 
-[http://messageboard694724.aimoo.com/ didrex] 
-[http://messageboard694733.aimoo.com/ diazepam] 
-[http://www.zorpia.com/bamb34 buy ambien] 
-[http://www.zorpia.com/bphe46 buy phentermine] 
-[http://www.zorpia.com/badi32 buy adipex] 
-[http://www.zorpia.com/bxana3 buy xanax] 
-[http://www.zorpia.com/bxeni11 buy xenical] 
-</div> 

Revision as of 15:45, 9 February 2006

You are here: Main Page/DD-WRT Docu (EN)/knockd

Ok - until dd-wrt moves /etc to rw space there is going to be problems with a lot of ipkg installs. The following details a workaround but is not ideal.

Contents

Introduction

knockd is a utility that can enhance security on your network. knockd will perform whatever action you script until a special knock sequence is given. A knock sequence is defined as a series of either TCP or UDP requests on defined ports. These ports do not even have to be open.

For example, a script could be written to forward the SSH port (port 22) to a specific LAN host for 20 seconds when the knock sequence is given. This knock sequence could be defined as connecting to port 22 twice with UDP, port 151 once with TCP, and then port 15 with UDP, for example.

Port Scanning the routers WAN interface would yield no ports open. If the port scan was run again within 20 seconds of sending the knock sequence, the scan would yeild that port 22 was open. This could enhance security as most attacks begin with port scans to determine what services you have open, and port 22 wouldn't show up unless the attacker both expected you to be running knockd AND took the time to deterime the knock sequence.

A knock sequence of connecting with either udp or tcp on port 1, followed by port 2, followed by port 3, followed by port 4, followed by port 5 could be used to launch a script that closes all ports on the router, or even disables the WAN port for 60 seconds before bringing it back up. In this way you are protecting yourself from attackers as soon as a port scan is detected.

Further examples may be seen at Linux Journal's General Discussion of Port Knocking

Installation

Prerequisites

You should already have:
-a Linksys WRT54G product
-DD-WRT installed as the firmware
-Good knowledge of the command line
-SCP or some other way to copy files to and from your desktop setup
-some knowledge of using ipkg to install packages
-jffs already configured if you don't want to install to ram
If your running Windows on your desktop:
-TextPad or Win32Pad
(or other *nix friendly text editor. DO NOT USE NOTEPAD)

Install the libpcap package

Knockd depends on libpcap's presence. If it isn't installed, install it

-telnet or ssh shell into the router
-run the command ipkg install -d <dest_name> libpcap
<dest_name> should be root to install to /jffs <dest_name> should be ram to install to /tmp *Remember, /tmp is deleted on router reboot* Ex: ipkg install -d root libpcap The default is root so a simpler way of doing this is unless you want to install to /tmp space just do 'ipkg install libpcap'

Install the knockd package

-Find the knockd package in the OpenWRT Package Tracker.
You will need the URI of package to install it.
-telnet or ssh shell into the router -run the command ipkg install -d <dest_name> <URI of package>
<dest_name> should be root to install to /jffs <dest_name> should be ram to install to /tmp *Remember, /tmp is deleted on router reboot* Ex: ipkg install -d ram http://openwrt.alphacore.net/knockd_0.4_mipsel.ipk


Configure LD PATH because we can't change /etc/ld.so.conf

 at the command prompt type the following
 $ LD_LIBRARY_PATH=/lib:/usr/lib:/jffs/lib
 $ export LD_LIBRARY_PATH
 
You will need to set this every time the router reboots, or include it in 
 startup script

Usage & Troubleshooting

General Usage

You will need to pass a different config file at startup (again because of /etc not being writable) this is however quite easy. just type

knockd -d -c /jffs/etc/knockd.conf

or replace that path with wherever your conf file is.

Also note the default interface is eth0, if you are using ppp you will need to do something like this (adjust for you interface and conf file)

knockd -d -i ppp0 -c /jffs/etc/knockd.conf


See the knockd homepage


Troubleshooting

See the knockd homepage

If you get the error "knockd: can't load library 'libpcap.so.0.8" do the following:
Then you either haven't installed libpcap or you haven't updated your LD_LIBRARY_PATH env see above section.


Load on router startup

either point rc_startup at it or have rc_startup point to a general 
startup script which includes starting knockd as above.
fwiw, my rc_startup points at a startup script say /jffs/.init 
I then use that script to set up any aliases or env variables and
start programs such as knockd.
An example (to be included in your regular startup script)

#!/bin/sh
export LD_LIBRARY_PATH=/lib:/usr/lib:/jffs/lib 
knockd -d -i ppp0 -c /jffs/etc/knockd.conf
This will start knockd in daemon mode listening on initerface ppp0 using the config
from /jffs/etc/knockd.conf. If you have a different interface (ie eth0) or a different
config file you will obviously need to adjust this to suit.

Security

Port knocking is not a means of security and has been compromised in the past. First off, its only a means of authentication, not a means of protection. A sniffer sitting between the client and the router could easily pick up on the sequence and repeat it. Also, a few tools are out there that can be used to "brute force" this technique. In general, Port Knocking is not secure. A better solution is VPN tunnels, since they employ strong authentication and encryption. Furthermore, port knocking is also vulnerable to spoofing. If a hacker is able to spoof his/her IP, they could prevent a legitimat user from doing the sequence by interupting the pattern. Also mentioned was the fact that it protected the router from port scanning attacks. A better means of protection (Again VPN being ideal if the services are only meant for the outside world) is to ban the IP address attempting to port scan the router. So if the attacker where to scan TCP ports 1 2 3 4 in sequence, the router would add a iptables rule saying "If <IP Address> attempts to connect, drop." Also, the mention of knocking ports 1-5 and running a script to disable the WAN port or shutdown the router leaves open the possibility of DOS attacks. Since port knocking keeps track of the IP address of the knocker, it is entirely possible to use multiple IP addresses to port scan the router in order to prevent any pattern of arising. Also, tools like NMAP have time delays to prevent the firewall from knowing its being portscanned. If someone where to portscan the router using 3 different IP addresses with a 2 second delay between each port and random port numbers, port knocking (as a means of protection) would not work. In general, port knocking is a big No No.. If you want real security, secure the services behind the firewall and use a VPN connection when necessary..

== That's one users's opinion. I'd like to add, installing any VPN on the router will require port forwarding. If the port(s) are only forwarded when a user has properly authenticated using the correct knock sequence, well, that's sort of like adding an extra password to your VPN. The thing the person above forgets is that we are not talking about running port knocking on enterprise networks, but on home routers, and port knocking is still extremely obscure, so planned denial of service attacks like those described above will only happen if your friends know your running a port knocking daemon. Nobody else is even going to consider it...

External Resources


You are here: Main Page/DD-WRT Docu (EN)/knockd