{"id":1486,"date":"2022-05-26T12:35:02","date_gmt":"2022-05-26T10:35:02","guid":{"rendered":"https:\/\/www.boettrich.info\/blog\/?p=1486"},"modified":"2022-05-26T14:31:20","modified_gmt":"2022-05-26T12:31:20","slug":"pfsense-ntopng-custom-application","status":"publish","type":"post","link":"https:\/\/www.boettrich.info\/blog\/technik\/pfsense-ntopng-custom-application\/","title":{"rendered":"pfSense &#8211; ntopNG &#8211; Custom application"},"content":{"rendered":"\n<p>This week i set up a pfSense box with a ntopng instance enabled to get some insights on some traffic captured via a SPAN port. As expected &#8211; works great! pfsense and the installable ntopng package do a great job :-)<\/p>\n\n\n\n<p>As is saw a significant amount of traffic marked as &#8222;UNKNOWN&#8220; i asked myself if there is a way to get this traffic also &#8222;labeled&#8220; &#8211; let&#8217;s say as &#8222;backup&#8220; or something like that&#8230;<\/p>\n\n\n\n<p>And indeed there is way &#8211; with the steps below one can create a file where some custom rules can be placed in.<\/p>\n\n\n\n<p>Credits go to &#8222;RedieRoBo&#8220;, as he posted the steps in the thread <a href=\"https:\/\/www.reddit.com\/r\/PFSENSE\/comments\/qkq7ns\/custom_applications_in_pfsesne_ntopng\/\">Custom Applications in pfsesne ntopng : PFSENSE (reddit.com)<\/a>.<\/p>\n\n\n\n<p>So, all these commands can be run at &#8222;Diagnostics&#8220; => &#8222;Command Prompt&#8220; in a &#8222;copy-paste&#8220; style:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>mkdir \/var\/lib\/ntopng<\/li><li>touch \/var\/lib\/ntopng\/protos.txt<\/li><li>chown -R ntopng:ntopng \/var\/lib\/ntopng<\/li><\/ul>\n\n\n\n<p>The following additional parameter has to be added with &#8222;Diagnostics&#8220; => &#8222;Edit File&#8220;.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Add &#8218;-p \/var\/lib\/ntopng\/protos.txt&#8216; to the parameter list in \/usr\/local\/etc\/rc.d\/ntopng.sh<\/li><\/ul>\n\n\n\n<p>My modified &#8222;ntopng.sh&#8220; looks like this:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.boettrich.info\/blog\/wp-content\/uploads\/2022\/05\/image.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"741\" src=\"https:\/\/www.boettrich.info\/blog\/wp-content\/uploads\/2022\/05\/image-1024x741.png\" alt=\"\" class=\"wp-image-1487\" srcset=\"https:\/\/www.boettrich.info\/blog\/wp-content\/uploads\/2022\/05\/image-1024x741.png 1024w, https:\/\/www.boettrich.info\/blog\/wp-content\/uploads\/2022\/05\/image-300x217.png 300w, https:\/\/www.boettrich.info\/blog\/wp-content\/uploads\/2022\/05\/image-768x556.png 768w, https:\/\/www.boettrich.info\/blog\/wp-content\/uploads\/2022\/05\/image-1536x1112.png 1536w, https:\/\/www.boettrich.info\/blog\/wp-content\/uploads\/2022\/05\/image-2048x1483.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption>Added parameter<\/figcaption><\/figure>\n\n\n\n<p>Afterwards you have to restart the ntopng service &#8211; do it with &#8222;Status&#8220; => &#8222;Services&#8220;:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.boettrich.info\/blog\/wp-content\/uploads\/2022\/05\/image-1.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"48\" src=\"https:\/\/www.boettrich.info\/blog\/wp-content\/uploads\/2022\/05\/image-1-1024x48.png\" alt=\"\" class=\"wp-image-1488\" srcset=\"https:\/\/www.boettrich.info\/blog\/wp-content\/uploads\/2022\/05\/image-1-1024x48.png 1024w, https:\/\/www.boettrich.info\/blog\/wp-content\/uploads\/2022\/05\/image-1-300x14.png 300w, https:\/\/www.boettrich.info\/blog\/wp-content\/uploads\/2022\/05\/image-1-768x36.png 768w, https:\/\/www.boettrich.info\/blog\/wp-content\/uploads\/2022\/05\/image-1-1536x72.png 1536w, https:\/\/www.boettrich.info\/blog\/wp-content\/uploads\/2022\/05\/image-1-2048x95.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p><strong>(!) <\/strong>Bear in mind, thart the additional parameter in &#8222;ntopng.sh&#8220; gets deleted when you modifiy the ntopng settings under &#8222;Diagnostics&#8220; => &#8222;ntopng Settings&#8220;. <strong>(!)<\/strong><\/p>\n\n\n\n<p>A good start writing new custom protocol definitions is <a href=\"https:\/\/github.com\/ntop\/nDPI\/blob\/dev\/example\/protos.txt\">nDPI\/protos.txt at dev \u00b7 ntop\/nDPI \u00b7 GitHub<\/a><\/p>\n\n\n\n<p>One can edit the &#8222;protos.txt&#8220; file via &#8222;File Editor&#8220; or one can add new protocols directly via the ntopng GUI.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This week i set up a pfSense box with a ntopng instance enabled to get some insights on some traffic captured via a SPAN port. As expected &#8211; works great! pfsense and the installable ntopng package do a great job :-) As is saw a significant amount of traffic marked as &#8222;UNKNOWN&#8220; i asked myself&hellip;&nbsp;<a href=\"https:\/\/www.boettrich.info\/blog\/technik\/pfsense-ntopng-custom-application\/\" rel=\"bookmark\">Weiterlesen &raquo;<span class=\"screen-reader-text\">pfSense &#8211; ntopNG &#8211; Custom application<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"neve_meta_sidebar":"","neve_meta_container":"","neve_meta_enable_content_width":"","neve_meta_content_width":0,"neve_meta_title_alignment":"","neve_meta_author_avatar":"","neve_post_elements_order":"","neve_meta_disable_header":"","neve_meta_disable_footer":"","neve_meta_disable_title":"","footnotes":""},"categories":[10,6],"tags":[],"class_list":["post-1486","post","type-post","status-publish","format-standard","hentry","category-netzwerk","category-technik"],"_links":{"self":[{"href":"https:\/\/www.boettrich.info\/blog\/wp-json\/wp\/v2\/posts\/1486","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.boettrich.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.boettrich.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.boettrich.info\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.boettrich.info\/blog\/wp-json\/wp\/v2\/comments?post=1486"}],"version-history":[{"count":7,"href":"https:\/\/www.boettrich.info\/blog\/wp-json\/wp\/v2\/posts\/1486\/revisions"}],"predecessor-version":[{"id":1496,"href":"https:\/\/www.boettrich.info\/blog\/wp-json\/wp\/v2\/posts\/1486\/revisions\/1496"}],"wp:attachment":[{"href":"https:\/\/www.boettrich.info\/blog\/wp-json\/wp\/v2\/media?parent=1486"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.boettrich.info\/blog\/wp-json\/wp\/v2\/categories?post=1486"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.boettrich.info\/blog\/wp-json\/wp\/v2\/tags?post=1486"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}