Use python to find files using extensions Malware finder 01


SUBMITTED BY: alemotta

DATE: Aug. 22, 2017, 2:58 p.m.

UPDATED: Aug. 22, 2017, 3:16 p.m.

FORMAT: Text only

SIZE: 660 Bytes

HITS: 479

  1. #Use python to find files using extensions i use this tool find malware with extensions like
  2. # .php.,.suspected,.php.jpg...
  3. import os
  4. bdire = input("base dire : ")
  5. myext = input("type extension : ")
  6. txtoutput = input("file output : ")
  7. def sessionSsave(nSess):
  8. sessFile = open(txtoutput,"a+")
  9. #sessnum = sessFile.readlines()
  10. #numer = len(sessnum)
  11. sessFile.write(str(nSess))
  12. sessFile.close()
  13. for root, dirs, files in os.walk(bdire):
  14. for file in files:
  15. if file.endswith(myext):
  16. print(os.path.join(root, file))
  17. tosave = os.path.join(root, file)+"\n"
  18. sessionSsave(tosave)

comments powered by Disqus