{"id":423,"date":"2014-03-31T16:30:30","date_gmt":"2014-03-31T14:30:30","guid":{"rendered":"http:\/\/www.instruyete.org\/?p=423"},"modified":"2014-03-31T16:30:30","modified_gmt":"2014-03-31T14:30:30","slug":"immutable-files-auf-linux","status":"publish","type":"post","link":"https:\/\/www.instruyete.org\/?p=423","title":{"rendered":"Immutable Files auf Linux"},"content":{"rendered":"<p>Wenn sich ein File auf einem Linux System nicht mal mit Hilfe eines root-accounts l\u00f6schen l\u00e4sst, dann sollte man mal die sog. <strong>I-node flags<\/strong> (Extended Filesystem Attributes) genauer anschauen. Der Befehl dazu lautet<\/p>\n<p><code>lsattr &lt;FILE&gt;<\/code><\/p>\n<p>Falls in der Ausgabe der Character <strong>i<\/strong> vorkommt, dann ist das sog. <em>FS_IMMUTABLE_FL<\/em> flag gesetzt worden, welches eine Modifikation des i-Nodes g\u00e4nzlich unterbindet (d.h. weder inhaltliche Ver\u00e4nderung noch eine \u00c4nderung von Metadaten ist erlaubt).<br \/>\nEin Setzen des Flags mit<\/p>\n<p><code>chattr +i &lt;FILE&gt;<\/code><\/p>\n<p>erfordert die <em>CAP_LINUX_IMMUTABLE<\/em> capability. Programmatisch erfolgt dieselbe Operation mit <strong>ioctl<\/strong><\/p>\n<p><code>if (ioctl(fd,FS_IOC_GETFLAGS,&attributes)==-1) errExit(\"fetching attributes\");<br \/>\nattributes |= FS_IMMUTABLE_FL;<br \/>\nif (ioctl(fd,FS_IOC_SETFLAGS,&attr) == -1) errExit(\"setting attributes\");<\/code><\/p>\n<p>Dieses i-node flag ist unter Linux seit Kernel 2.6.19 Filesystem-\u00fcbergreifend implementiert. Es kann bspw. zum tempor\u00e4ren Schutz von Dateien in Systemverzeichnissen genutzt werden, aber auch von Rootkits die Schadsoftware ins System eingeschleust haben. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Wenn sich ein File auf einem Linux System nicht mal mit Hilfe eines root-accounts l\u00f6schen l\u00e4sst, dann sollte man mal die sog. I-node flags (Extended Filesystem Attributes) genauer anschauen. Der Befehl dazu lautet lsattr &lt;FILE&gt; Falls in der Ausgabe der Character i vorkommt, dann ist das sog. FS_IMMUTABLE_FL flag gesetzt worden, welches eine Modifikation des &hellip; <a href=\"https:\/\/www.instruyete.org\/?p=423\" class=\"more-link\"><span class=\"screen-reader-text\">Immutable Files auf Linux<\/span> weiterlesen<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9,7],"tags":[],"class_list":["post-423","post","type-post","status-publish","format-standard","hentry","category-linux","category-unix"],"_links":{"self":[{"href":"https:\/\/www.instruyete.org\/index.php?rest_route=\/wp\/v2\/posts\/423","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.instruyete.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.instruyete.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.instruyete.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.instruyete.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=423"}],"version-history":[{"count":0,"href":"https:\/\/www.instruyete.org\/index.php?rest_route=\/wp\/v2\/posts\/423\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.instruyete.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=423"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.instruyete.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=423"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.instruyete.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=423"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}