Skip to content

Instantly share code, notes, and snippets.

@bwesterb
Created August 8, 2014 09:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bwesterb/b537cd42f96fedf24947 to your computer and use it in GitHub Desktop.
Save bwesterb/b537cd42f96fedf24947 to your computer and use it in GitHub Desktop.
import os
import os.path
# Tests for suspicious folders used by finfisher.
# Source:
# http://belsec.skynetblogs.be/archive/2014/08/07/check-your-linuxservers-are-you-infected-with-the-finphisher-8252101.html
first = ['.fontconfig', '.gconf', '.gnome', '.gnome2', '.kde', '.local',
'.qt', '.ssh']
second = ['.config', '.bin', '.sbin', '.etc', '.cfg', '.apps']
ok = True
for home in os.listdir('/home'):
phome = os.path.join('/home', home)
for fn in first:
fp = os.path.join(phome, fn)
if not os.path.exists(fp):
continue
for sn in second:
sp = os.path.join(fp, sn)
if not os.path.exists(sp):
continue
ok = False
print 'Check', sp
if ok:
print 'Everything seems fine'
# vim: sw=4:ts=4:et
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment