{"id":162,"date":"2008-08-07T22:02:00","date_gmt":"2008-08-07T22:02:00","guid":{"rendered":"https:\/\/defragged.org\/ossec\/?p=162"},"modified":"2020-07-02T22:03:38","modified_gmt":"2020-07-02T22:03:38","slug":"new-tool-syscheck_control","status":"publish","type":"post","link":"https:\/\/defragged.org\/ossec\/2008\/08\/new-tool-syscheck_control\/","title":{"rendered":"New tool: syscheck_control"},"content":{"rendered":"\n<p>Recently I have been focused on trying to make&nbsp;<a href=\"http:\/\/www.ossec.net\/\">OSSEC<\/a>&nbsp;more friendly and easier to manage. Last version (1.5) we added the&nbsp;<a href=\"http:\/\/www.ossec.net\/dcid\/?p=130\">agent_control<\/a>&nbsp;tool (to manage the agents remotely), and for the v1.6, one of the new features is the&nbsp;<strong>syscheck_control<\/strong>.<\/p>\n\n\n\n<p>Basically, it allows you to manage the integrity checking database that is stored on the server (manager) side. You can list the modified files, get detailed information from each change and even ignore a specific file or zero its auto-ignore counter.<\/p>\n\n\n\n<p><em>*To test it, you will need to get the latest development package (snapshot) available at:&nbsp;<a href=\"https:\/\/www.ossec.net\/files\/snapshots\/ossec-hids-080807.tar.gz\">\/\/www.ossec.net\/files\/snapshots\/ossec-hids-080807.tar.gz<\/a><\/em><\/p>\n\n\n\n<p>How to use it? Let\u2019s look at some examples:<\/p>\n\n\n\n<p><strong>Example 1: Getting help and listing all available agents<\/strong><\/p>\n\n\n\n<p>Exactly like the&nbsp;<em>agent_control<\/em>, you can use the&nbsp;<em>\u201c-l\u201d<\/em>&nbsp;(or&nbsp;<em>-lc<\/em>) flag to list the agents and the&nbsp;<em>\u201c-h\u201d<\/em>&nbsp;flag to get the command line help.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote\"><p>#&nbsp;<strong>\/var\/ossec\/bin\/syscheck_control -h<\/strong><\/p><p>OSSEC HIDS syscheck_control: Manages the integrity checking database.<br>Available options:<br>-h This help message.<br>-l List available (active or not) agents.<br>-lc List only active agents.<br>-u &lt;id&gt; Updates (clear) the database for the agent.<br>-u all Updates (clear) the database for all agents.<br>-i &lt;id&gt; List modified files for the agent.<br>-r -i &lt;id&gt; List modified registry entries for the agent (Windows only).<br>-f &lt;file&gt; Prints information about a modified file.<br>-z Used with the -f, zeroes the auto-ignore counter.<br>-d Used with the -f, ignores that file.<br>-s Changes the output to CSV (comma delimited).<\/p><p>#&nbsp;<strong>\/var\/ossec\/bin\/syscheck_control -lc<\/strong><\/p><p>OSSEC HIDS syscheck_control. List of available agents:<br>ID: 000, Name: enigma.ossec.net (server), IP: 127.0.0.1, Active\/Local<br>ID: 165, Name: esqueleto2, IP: 192.168.2.99, Active<br>ID: 174, Name: lili3win, IP: 192.168.2.0\/24, Active<br>ID: 185, Name: winhome2, IP: 192.168.2.0\/24, Active<\/p><\/blockquote>\n\n\n\n<p><strong>Example 2: Getting a list of modified files<\/strong><\/p>\n\n\n\n<p>To get a list of the modified files, just run the command with the \u201c-i\u201d flag followed by the agent id you want:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote\"><p>#&nbsp;<strong>\/var\/ossec\/bin\/syscheck_control -i 165<\/strong><\/p><p>Integrity changes for agent \u2018esqueleto2 (165) \u2013 192.168.2.190\u2032:<\/p><p>Changes for 2007 Sep 12:<br>2007 Sep 12 21:54:37,0 \u2013 \/var\/ossec\/etc\/ossec.conf<br>2007 Sep 12 21:54:37,0 \u2013 \/var\/ossec\/etc\/internal_options.conf<br>2007 Sep 12 22:01:36,0 \u2013 \/etc\/group-<br>2007 Sep 12 22:01:40,0 \u2013 \/etc\/ld.so.cache<br>2007 Sep 12 22:01:47,0 \u2013 \/etc\/passwd-<br>2007 Sep 12 22:01:48,0 \u2013 \/etc\/syslog.conf<\/p><p>Changes for 2007 Sep 13:<br>2007 Sep 13 00:15:17,0 \u2013 \/etc\/postgresql\/8.1\/main\/log<\/p><p>..<\/p><p>Changes for 2008 Jul 24:<br>2008 Jul 24 12:47:55,0 \u2013 \/etc\/syslog.conf<br>2008 Jul 24 12:47:57,0 \u2013 \/etc\/resolv.conf<br>2008 Jul 24 15:03:27,3 \u2013 \/etc\/ld.so.cache<\/p><\/blockquote>\n\n\n\n<p><strong>Example 3: Getting more information about a file change<\/strong><\/p>\n\n\n\n<p>To get a more detailed view of the changes on a specific file, run the same command as above plus the&nbsp;<em>\u201c-f\u201d<\/em>&nbsp;flag. In the following example we are looking at the resolv.conf file changes:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote\"><p>#&nbsp;<strong>\/var\/ossec\/bin\/syscheck_control -i 165 -f resolv<\/strong><\/p><p>Integrity changes for agent \u2018esqueleto2 (165) \u2013 192.168.2.190\u2032:<br>Detailed information for entries matching: \u2018resolv\u2019<\/p><p>2007 Sep 12 22:01:48,0 \u2013 \/etc\/resolv.conf<br>File added to the database.<br>Integrity checking values:<br>Size: 53<br>Perm: rw-r\u2013r\u2013<br>Uid: 0<br>Gid: 0<br>Md5: 14f49f5a229b80d555100ddab80e42ab<br>Sha1: 0aa08a3fba0b0b8bb926cdb8ee5f2af27c947cbf<\/p><p>2008 Jul 24 12:47:57,0 \u2013 \/etc\/resolv.conf<br>File changed. \u2013 1st time modified.<br>Integrity checking values:<br>Size: &gt;54<br>Perm: rw-r\u2013r\u2013<br>Uid: 0<br>Gid: 0<br>Md5: &gt;ba9ce771e9d760f58ffd30e4ecda669a<br>Sha1: &gt;ce9dbec2368e8e35dea76df9b623824628045dcb<\/p><\/blockquote>\n\n\n\n<p><strong>Example 4: Ignoring or clearing the auto-ignore flags<\/strong><\/p>\n\n\n\n<p>OSSEC by default will ignore files that change too often. You can disable this feature by setting &lt;auto_ignore&gt; to&nbsp;<em>\u201cno\u201d<\/em>&nbsp;in the main config, but sometimes you may want to keep this feature on and deal with each file separately.<\/p>\n\n\n\n<p>In this example, the file squid.conf is being auto-ignored. To remote this flag, just run the same command as above with the&nbsp;<em>\u201c-z\u201d<\/em>&nbsp;flag:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote\"><p>#&nbsp;<strong>\/var\/ossec\/bin\/syscheck_control -i 165 -f \u201c\/squid.conf\u201d<\/strong><\/p><p>2008 Jun 26 22:48:26,4 \u2013 \/etc\/squid\/squid.conf<br>File changed. \u2013 Being ignored (3 or more changes).<br>Integrity checking values:<br>Size: 120362<br>Perm: rw\u2014\u2014-<br>Uid: 0<br>Gid: 0<br>Md5: &gt;a0038eaf46f13cdbbc09c4c1e4994374<br>Sha1: &gt;3e732bcee538f20f02a602b0aec36bbe2fd3617b<\/p><p>#&nbsp;<strong>\/var\/ossec\/bin\/syscheck_control -i 165 -f \u201c\/squid.conf\u201d -z<\/strong><\/p><p>Integrity changes for agent \u2018esqueleto2 (165) \u2013 192.168.2.190\u2032:<br>Detailed information for entries matching: \u2018\/squid.conf\u2019<\/p><p>**Counter updated for file \u2018\/etc\/squid\/squid.conf\u2019<\/p><p># \/var\/ossec\/bin\/syscheck_control -i 165 -f \u201c\/squid.conf\u201d<\/p><p>2008 Jun 26 22:48:26,0 \u2013 \/etc\/squid\/squid.conf<br>File changed. \u2013 1st time modified.<br>Integrity checking values:<br>Size: 120362<br>Perm: rw\u2014\u2014-<br>Uid: 0<br>Gid: 0<br>Md5: &gt;a0038eaf46f13cdbbc09c4c1e4994374<br>Sha1: &gt;3e732bcee538f20f02a602b0aec36bbe2fd3617b<\/p><\/blockquote>\n\n\n\n<p>If you are dealing with the registry files on Windows, make sure to add the&nbsp;<em>\u201c-r\u201d<\/em>&nbsp;flag to all these commands.<\/p>\n\n\n\n<p>As always, suggestions, bug reports and comments are more than welcome!<\/p>\n\n\n\n<p>Thanks,<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Recently I have been focused on trying to make&nbsp;OSSEC&nbsp;more friendly and easier to manage. Last version (1.5) we added the&nbsp;agent_control&nbsp;tool (to manage the agents remotely), and for the v1.6, one of the new features is the&nbsp;syscheck_control. Basically, it allows you to manage the integrity checking database that is stored on the server (manager) side. You [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[5],"tags":[],"_links":{"self":[{"href":"https:\/\/defragged.org\/ossec\/wp-json\/wp\/v2\/posts\/162"}],"collection":[{"href":"https:\/\/defragged.org\/ossec\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/defragged.org\/ossec\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/defragged.org\/ossec\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/defragged.org\/ossec\/wp-json\/wp\/v2\/comments?post=162"}],"version-history":[{"count":1,"href":"https:\/\/defragged.org\/ossec\/wp-json\/wp\/v2\/posts\/162\/revisions"}],"predecessor-version":[{"id":163,"href":"https:\/\/defragged.org\/ossec\/wp-json\/wp\/v2\/posts\/162\/revisions\/163"}],"wp:attachment":[{"href":"https:\/\/defragged.org\/ossec\/wp-json\/wp\/v2\/media?parent=162"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/defragged.org\/ossec\/wp-json\/wp\/v2\/categories?post=162"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/defragged.org\/ossec\/wp-json\/wp\/v2\/tags?post=162"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}