{"id":2034,"date":"2021-11-10T10:58:29","date_gmt":"2021-11-10T09:58:29","guid":{"rendered":"http:\/\/clark.tipistrani.it\/?p=2034"},"modified":"2021-11-10T13:52:50","modified_gmt":"2021-11-10T12:52:50","slug":"rkhunter-su-devuan-4","status":"publish","type":"post","link":"http:\/\/clark.tipistrani.it\/?p=2034","title":{"rendered":"Rkhunter su Devuan 4"},"content":{"rendered":"<p><span class=\"VIiyi\" lang=\"it\"><span class=\"JLqJ4b ChMk0b\" data-language-for-alternatives=\"it\" data-language-to-translate-into=\"en\" data-phrase-index=\"0\" data-number-of-phrases=\"9\">Rkhunter di cui ho gi\u00e0 scritto in precedenza significa letteralmente cacciatore di root kit.<br \/>\n<\/span><\/span><span class=\"VIiyi\" lang=\"it\"> <span class=\"JLqJ4b ChMk0b\" data-language-for-alternatives=\"it\" data-language-to-translate-into=\"en\" data-phrase-index=\"1\" data-number-of-phrases=\"9\">Un root kit \u00e8 un insieme di programmi installati dai cracker quando riescono a penetrare in un sistema, un root kit p<\/span><span class=\"JLqJ4b ChMk0b\" data-language-for-alternatives=\"it\" data-language-to-translate-into=\"en\" data-phrase-index=\"2\" data-number-of-phrases=\"9\">u\u00f2 essere installato anche da virus.<br \/>\n<\/span><\/span><span class=\"VIiyi\" lang=\"it\"> <span class=\"JLqJ4b ChMk0b\" data-language-for-alternatives=\"it\" data-language-to-translate-into=\"en\" data-phrase-index=\"3\" data-number-of-phrases=\"9\">Questi programmi hanno lo scopo di inviare informazioni dal sistema infetto alle macchine del cracker o di eseguire qualsiasi comando arbitrario da parte\u00a0 dell&#8217;attaccante in nome del proprietario del sistema infetto.<br \/>\n<\/span> <span class=\"JLqJ4b ChMk0b\" data-language-for-alternatives=\"it\" data-language-to-translate-into=\"en\" data-phrase-index=\"4\" data-number-of-phrases=\"9\">Rkhunter ha un database di root kit conosciuti e cerca qualsiasi traccia di questi root kit.<br \/>\n<\/span> Verifica<span class=\"JLqJ4b ChMk0b\" data-language-for-alternatives=\"it\" data-language-to-translate-into=\"en\" data-phrase-index=\"5\" data-number-of-phrases=\"9\"> anche i fingerprint dei programmi di sistema critici per rilevare eventuali modifiche.<br \/>\n<\/span> <span class=\"JLqJ4b ChMk0b\" data-language-for-alternatives=\"it\" data-language-to-translate-into=\"en\" data-phrase-index=\"6\" data-number-of-phrases=\"9\">Automatizza gli snapshot con apt ad ogni installazione di software aggiuntivi.<\/span><br \/>\n<span class=\"JLqJ4b ChMk0b\" data-language-for-alternatives=\"it\" data-language-to-translate-into=\"en\" data-phrase-index=\"7\" data-number-of-phrases=\"9\">Invia notifiche e-mail quando viene rilevato qualcosa.<br \/>\nAnche qui passando a Chimaera sono cambiate un po di cose seguendo una guida trovata in rete la procedura \u00e8 questa, per prima cosa do a debconf le risposte alle domande che verranno poste dal pacchetto al momento dell&#8217;installazione. Voglio che RKHunter venga eseguito ogni giorno per controllare il mio filesystem, voglio che aggiorni automaticamente il database delle vulnerabilit\u00e0 e voglio che venga eseguito automaticamente dopo l&#8217;installazione di ogni pacchetto per prendere il fingerprint\u00a0\u00a0\u00a0 del pacchetto che si suppone pulito.<br \/>\nQuest&#8217;ultimo pu\u00f2 essere pericoloso se usi apt per installare, aggiornare o rimuovere un pacchetto, attiver\u00e0 automaticamente un nuovo snapshot e legittimer\u00e0 i file correnti.<br \/>\n\u00c8 una scelta calcolata, sono abbastanza certo che non sia facile sfondare e modificare i server di Devuan (anche se con Debian in passato purtroppo \u00e8 successo), non \u00e8 una scelta obbligata quindi se non siete sicuri lasciate stare.<br \/>\necho &#8216;rkhunter rkhunter\/cron_daily_run boolean true&#8217; | debconf-set-selections<br \/>\necho &#8216;rkhunter rkhunter\/cron_db_update boolean true&#8217; | debconf-set-selections<br \/>\necho &#8216;rkhunter rkhunter\/apt_autogen boolean true&#8217; | debconf-set-selections<br \/>\nquindi:<br \/>\n<\/span><\/span><\/p>\n<p>apt-get install -y rkhunter<br \/>\nPrima ancora di configurare rkhunter aggiungo in un file separato dal nome rkhunter.conf.local queste righe:<\/p>\n<p>PKGMGR=DPKG<br \/>\nALLOWPROCDELFILE=\/usr\/sbin\/cron<br \/>\nALLOWPROCDELFILE=\/usr\/bin\/dash<br \/>\nALLOWPROCDELFILE=\/usr\/bin\/run-parts<br \/>\nSCRIPTWHITELIST=\/bin\/egrep<br \/>\nSCRIPTWHITELIST=\/bin\/fgrep<br \/>\nSCRIPTWHITELIST=\/usr\/bin\/which<br \/>\nPORT_PATH_WHITELIST=\/usr\/sbin\/portsentry<br \/>\nALLOW_SSH_ROOT_USER=prohibit-password<br \/>\nla prima serve ad evitare dei warning se un programma \u00e8 stato sostituito ad esempio con uno script, in altre parole evita dei falsi positivi.<br \/>\nPasso alla modifica del file rkhunter.conf vero e proprio di seguito solo le righe modificate o scommentate<\/p>\n<p>UPDATE_MIRRORS=1<br \/>\nMIRRORS_MODE=0<br \/>\nMAIL-ON-WARNING=root<br \/>\nMAIL_CMD=mail -s &#8220;[rkhunter] Warnings found for ${HOST_NAME}&#8221;<br \/>\nTMPDIR=\/var\/lib\/rkhunter\/tmp<br \/>\nDBDIR=\/var\/lib\/rkhunter\/db<br \/>\nSCRIPTDIR=\/usr\/share\/rkhunter\/scripts<br \/>\nUPDATE_LANG=&#8221;en&#8221;<br \/>\nLOGFILE=\/var\/log\/rkhunter.log<br \/>\nUSE_SYSLOG=authpriv.warning<br \/>\nAUTO_X_DETECT=1<br \/>\nALLOW_SSH_PROT_V1=2<br \/>\nENABLE_TESTS=ALL<br \/>\nDISABLE_TESTS=suspscan hidden_ports hidden_procs deleted_files packet_cap_apps apps<br \/>\nSCRIPTWHITELIST=\/bin\/egrep<br \/>\nSCRIPTWHITELIST=\/bin\/fgrep<br \/>\nSCRIPTWHITELIST=\/usr\/bin\/which<br \/>\nSCRIPTWHITELIST=\/usr\/bin\/ldd<br \/>\nSCRIPTWHITELIST=\/usr\/sbin\/adduser<br \/>\nWEB_CMD=wget<br \/>\nINSTALLDIR=\/usr<br \/>\nfacciamo un update del DB con rkhunter &#8211;(sono 2 meno)update<br \/>\n[ Rootkit Hunter version 1.4.6 ]<\/p>\n<p>Checking rkhunter data files&#8230;<br \/>\nChecking file mirrors.dat [ Updated ]<br \/>\nChecking file programs_bad.dat [ No update ]<br \/>\nChecking file backdoorports.dat [ No update ]<br \/>\nChecking file suspscan.dat [ No update ]<br \/>\nChecking file i18n\/cn [ Skipped ]<br \/>\nChecking file i18n\/de [ Skipped ]<br \/>\nChecking file i18n\/en [ No update ]<br \/>\nChecking file i18n\/tr [ Skipped ]<br \/>\nChecking file i18n\/tr.utf8 [ Skipped ]<br \/>\nChecking file i18n\/zh [ Skipped ]<br \/>\nChecking file i18n\/zh.utf8 [ Skipped ]<br \/>\nChecking file i18n\/ja [ Skipped ]<br \/>\ne quindi creiamo lo snapshot iniziale con<\/p>\n<p>rkhunter &#8211;(sono 2 meno)propupd<br \/>\n[ Rootkit Hunter version 1.4.6 ]<br \/>\nFile created: searched for 179 files, found 143<\/p>\n<p>e quindi testiamo il tutto con un :<br \/>\nrkhunter -c &#8211;enable all &#8211;disable none &#8211;skip-keypress<br \/>\nche dopo qualche istante restituisce:<\/p>\n<p>&nbsp;<\/p>\n<p>System checks summary<br \/>\n=====================<\/p>\n<p>File properties checks&#8230;<br \/>\nFiles checked: 143<br \/>\nSuspect files: 0<\/p>\n<p>Rootkit checks&#8230;<br \/>\nRootkits checked : 502<br \/>\nPossible rootkits: 0<\/p>\n<p>Applications checks&#8230;<br \/>\nApplications checked: 4<br \/>\nSuspect applications: 0<\/p>\n<p>The system checks took: 45 seconds<\/p>\n<p>All results have been written to the log file: \/var\/log\/rkhunter.log<\/p>\n<p>No warnings were found while checking the system.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Rkhunter di cui ho gi\u00e0 scritto in precedenza significa letteralmente cacciatore di root kit. Un root kit \u00e8 un insieme di programmi installati dai cracker quando riescono a penetrare in un sistema, un root kit pu\u00f2 essere installato anche da virus. Questi programmi hanno lo scopo di inviare informazioni dal sistema infetto alle macchine del [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[110,14,6],"tags":[],"class_list":["post-2034","post","type-post","status-publish","format-standard","hentry","category-ids","category-networking","category-work"],"_links":{"self":[{"href":"http:\/\/clark.tipistrani.it\/index.php?rest_route=\/wp\/v2\/posts\/2034","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/clark.tipistrani.it\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/clark.tipistrani.it\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/clark.tipistrani.it\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/clark.tipistrani.it\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2034"}],"version-history":[{"count":4,"href":"http:\/\/clark.tipistrani.it\/index.php?rest_route=\/wp\/v2\/posts\/2034\/revisions"}],"predecessor-version":[{"id":2054,"href":"http:\/\/clark.tipistrani.it\/index.php?rest_route=\/wp\/v2\/posts\/2034\/revisions\/2054"}],"wp:attachment":[{"href":"http:\/\/clark.tipistrani.it\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2034"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/clark.tipistrani.it\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2034"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/clark.tipistrani.it\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2034"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}