├── fsf-client ├── conf │ ├── __init__.py │ └── config.py └── fsf_client.py ├── fsf-server ├── conf │ ├── __init__.py │ ├── config.py │ └── disposition.py ├── jq │ ├── no_yara_hits.jq │ ├── one_module.jq │ ├── more_than_ten_yara.jq │ ├── exe_in_zip.jq │ ├── many_objects.jq │ ├── vt_match_found.jq │ ├── macro_gt_five_suspicious.jq │ ├── vt_exploit_detections_found.jq │ ├── vt_match_not_found.jq │ ├── pe_recently_compiled.jq │ ├── vt_broadbased_detections_found.jq │ ├── embedded_sfx_rar_w_exe.jq │ └── fresh_vt_scan.jq ├── yara │ ├── ft_elf.yara │ ├── ft_exe.yara │ ├── ft_pdf.yara │ ├── ft_zip.yara │ ├── ft_cab.yara │ ├── ft_gzip.yara │ ├── ft_tar.yara │ ├── ft_rar.yara │ ├── ft_rtf.yara │ ├── ft_java_class.yara │ ├── ft_jar.yara │ ├── misc_pe_signature.yara │ ├── misc_upx_packed_binary.yara │ ├── ft_ole_cf.yara │ ├── misc_ooxml_core_properties.yara │ ├── ft_office_open_xml.yara │ ├── ft_macho.yara │ ├── rules.yara │ ├── ft_swf.yara │ ├── misc_hexascii_pe_in_html.yara │ ├── misc_compressed_exe.yara │ └── misc_no_dosmode_header.yara ├── modules │ ├── __init__.py │ ├── template.py │ ├── META_PDF.py │ ├── SCAN_YARA.py │ ├── EXTRACT_GZIP.py │ ├── EXTRACT_SWF.py │ ├── EXTRACT_HEXASCII_PE.py │ ├── META_VT_INSPECT.py │ ├── EXTRACT_RTF_OBJ.py │ ├── META_BASIC_INFO.py │ ├── META_OOXML.py │ ├── META_OLECF.py │ ├── META_JAVA_CLASS.py │ ├── EXTRACT_UPX.py │ ├── META_ELF.py │ ├── EXTRACT_VBA_MACRO.py │ ├── EXTRACT_TAR.py │ ├── EXTRACT_EMBEDDED.py │ ├── META_MACHO.py │ ├── EXTRACT_RAR.py │ ├── EXTRACT_ZIP.py │ ├── META_PE_SIGNATURE.py │ ├── EXTRACT_CAB.py │ └── META_PE.py ├── scanner.py ├── daemon.py ├── main.py └── processor.py ├── docs ├── Test.zip ├── FSF Process.png ├── Example Test.png ├── FSF Overview.png ├── JQ_EXAMPLES.md ├── JQ_FILTERS.md ├── INSTALL.md └── MODULES.md ├── Docker └── Dockerfile ├── CHANGELOG.md ├── LICENSE └── README.md /fsf-client/conf/__init__.py: -------------------------------------------------------------------------------- 1 | __all__ = ['config'] 2 | -------------------------------------------------------------------------------- /fsf-server/conf/__init__.py: -------------------------------------------------------------------------------- 1 | __all__ = ['config', 'disposition'] 2 | -------------------------------------------------------------------------------- /docs/Test.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmersonElectricCo/fsf/HEAD/docs/Test.zip -------------------------------------------------------------------------------- /docs/FSF Process.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmersonElectricCo/fsf/HEAD/docs/FSF Process.png -------------------------------------------------------------------------------- /docs/Example Test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmersonElectricCo/fsf/HEAD/docs/Example Test.png -------------------------------------------------------------------------------- /docs/FSF Overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmersonElectricCo/fsf/HEAD/docs/FSF Overview.png -------------------------------------------------------------------------------- /fsf-server/jq/no_yara_hits.jq: -------------------------------------------------------------------------------- 1 | # Author: Jason Batchelor 2 | # Company: Emerson 3 | # Description: Simple JQ to see if no Yara signatures hit. 4 | 5 | .Summary.Yara | length == 0 6 | -------------------------------------------------------------------------------- /fsf-server/jq/one_module.jq: -------------------------------------------------------------------------------- 1 | # Author: Jason Batchelor 2 | # Company: Emerson 3 | # Description: Simple JQ to see if only one module was kicked off. 4 | 5 | .Summary.Modules | length == 1 6 | -------------------------------------------------------------------------------- /fsf-server/jq/more_than_ten_yara.jq: -------------------------------------------------------------------------------- 1 | # Author: Jason Batchelor 2 | # Company: Emerson 3 | # Description: Simple JQ to see if more than ten Yara signatures hit on something. 4 | 5 | .Summary.Yara | length > 10 6 | -------------------------------------------------------------------------------- /fsf-server/jq/exe_in_zip.jq: -------------------------------------------------------------------------------- 1 | # Author: Jason Batchelor 2 | # Company: Emerson 3 | # Description: Check if a ZIP contains an EXE 4 | 5 | path(..) | join(" "?) | match("EXTRACT_ZIP Object_.*? SCAN_YARA ft_exe") | .length > 0 6 | -------------------------------------------------------------------------------- /fsf-server/jq/many_objects.jq: -------------------------------------------------------------------------------- 1 | # Author: Jason Batchelor 2 | # Company: Emerson 3 | # Description: Check if an FSF run produced more than ten unique objects 4 | 5 | map(..|.SHA256?)| del(.[] | nulls) | unique | length >= 10 6 | -------------------------------------------------------------------------------- /fsf-server/jq/vt_match_found.jq: -------------------------------------------------------------------------------- 1 | # Author: Jason Batchelor 2 | # Company: Emerson 3 | # Description: Check of VT query contained a match at some level. 4 | 5 | map(..|.META_VT_INSPECT?|.response_code) | del(.[] | nulls) | unique | .[] > 0 6 | -------------------------------------------------------------------------------- /fsf-server/jq/macro_gt_five_suspicious.jq: -------------------------------------------------------------------------------- 1 | # Author: Jason Batchelor 2 | # Company: Emerson 3 | # Description: More than five suspicious macro attributes 4 | 5 | map(..|.EXTRACT_VBA_MACRO?|..|.Suspicious?|select(. != null)| length > 5) | .[] 6 | -------------------------------------------------------------------------------- /fsf-server/jq/vt_exploit_detections_found.jq: -------------------------------------------------------------------------------- 1 | # Author: Jason Batchelor 2 | # Company: Emerson 3 | # Description: Inspect AV output for exploit names. 4 | map(..|.META_VT_INSPECT?.scans|.[]?.result|select(. != null)) | join(" ") | test("CVE|Exploit") 5 | -------------------------------------------------------------------------------- /fsf-server/jq/vt_match_not_found.jq: -------------------------------------------------------------------------------- 1 | # Author: Jason Batchelor 2 | # Company: Emerson 3 | # Description: Check to see of no VT matches were observed when queried 4 | map(..|.META_VT_INSPECT?|.response_code|select(type=="number")) | all (. == 0) and length > 0 5 | -------------------------------------------------------------------------------- /fsf-server/jq/pe_recently_compiled.jq: -------------------------------------------------------------------------------- 1 | # Author: Jason Batchelor 2 | # Company: Emerson 3 | # Description: Check if output contains EXE compiled in the past week. 4 | 5 | (now - 604800) < (map(..|.META_PE?.Compiled|select(. != null)) | .[] | strptime("%a %b %d %H:%M:%S %Y UTC") | mktime) 6 | -------------------------------------------------------------------------------- /fsf-server/jq/vt_broadbased_detections_found.jq: -------------------------------------------------------------------------------- 1 | # Author: Jason Batchelor 2 | # Company: Emerson 3 | # Description: Inspect AV output for trace elements of PUP detection names 4 | map(..|.META_VT_INSPECT?.scans|.[]?.result|select(. != null)) | join(" ") | test("Riskware|PUP|Adware|Toolbar") 5 | -------------------------------------------------------------------------------- /fsf-server/jq/embedded_sfx_rar_w_exe.jq: -------------------------------------------------------------------------------- 1 | # Author: Jason Batchelor 2 | # Company: Emerson 3 | # Description: Check if an embedded file contained a RAR, which itself contained an EXE 4 | 5 | path(..) | join(" "?) | match("EXTRACT_EMBEDDED Object_.*? EXTRACT_RAR Object_.*? SCAN_YARA ft_exe") | .length > 0 6 | -------------------------------------------------------------------------------- /fsf-server/jq/fresh_vt_scan.jq: -------------------------------------------------------------------------------- 1 | # Author: Jason Batchelor 2 | # Company: Emerson 3 | # Description: Signature to see if any VT results contain submissions less than 24 hours old. 4 | 5 | (now - 86400) < (map(..|.META_VT_INSPECT?.scan_date|select(. != null)) | .[] | strptime("%Y-%m-%d %H:%M:%S") | mktime) 6 | -------------------------------------------------------------------------------- /fsf-server/yara/ft_elf.yara: -------------------------------------------------------------------------------- 1 | rule ft_elf 2 | { 3 | meta: 4 | author = "Jason Batchelor" 5 | company = "Emerson" 6 | lastmod = "20160121" 7 | desc = "File magic for ELF files" 8 | 9 | strings: 10 | $magic = { 7f 45 4c 46 } 11 | 12 | condition: 13 | $magic at 0 14 | } 15 | -------------------------------------------------------------------------------- /fsf-server/yara/ft_exe.yara: -------------------------------------------------------------------------------- 1 | rule ft_exe 2 | { 3 | meta: 4 | author = "Jason Batchelor" 5 | company = "Emerson" 6 | lastmod = "20141217" 7 | desc = "Simple signature to trigger on PE files." 8 | 9 | strings: 10 | $mz = "MZ" 11 | 12 | condition: 13 | $mz at 0 14 | } 15 | -------------------------------------------------------------------------------- /fsf-server/yara/ft_pdf.yara: -------------------------------------------------------------------------------- 1 | rule ft_pdf 2 | { 3 | meta: 4 | author = "Jason Batchelor" 5 | company = "Emerson" 6 | lastmod = "20141230" 7 | desc = "Signature to trigger on PDF file magic." 8 | 9 | strings: 10 | $pdf = "%PDF" 11 | 12 | condition: 13 | $pdf in (0 .. 1024) 14 | } 15 | -------------------------------------------------------------------------------- /fsf-server/yara/ft_zip.yara: -------------------------------------------------------------------------------- 1 | rule ft_zip 2 | { 3 | meta: 4 | author = "Jason Batchelor" 5 | company = "Emerson" 6 | lastmod = "20141217" 7 | desc = "File type signature for basic ZIP files." 8 | 9 | strings: 10 | $pk = { 50 4B 03 04 } 11 | 12 | condition: 13 | $pk at 0 14 | } 15 | -------------------------------------------------------------------------------- /fsf-server/yara/ft_cab.yara: -------------------------------------------------------------------------------- 1 | rule ft_cab 2 | { 3 | meta: 4 | author = "Jason Batchelor" 5 | company = "Emerson" 6 | lastmod = "20150723" 7 | desc = "File magic for CABs (Microsoft Cabinet Files)" 8 | 9 | strings: 10 | $cab = { 4D 53 43 46 } 11 | 12 | condition: 13 | $cab at 0 14 | } 15 | -------------------------------------------------------------------------------- /fsf-server/yara/ft_gzip.yara: -------------------------------------------------------------------------------- 1 | rule ft_gzip 2 | { 3 | meta: 4 | author = "Jason Batchelor" 5 | company = "Emerson" 6 | lastmod = "20151116" 7 | desc = "Trigger on magic of GZip compressed files" 8 | 9 | strings: 10 | $magic = { 1f 8b 08 } 11 | 12 | condition: 13 | $magic at 0 14 | } 15 | -------------------------------------------------------------------------------- /fsf-server/yara/ft_tar.yara: -------------------------------------------------------------------------------- 1 | rule ft_tar 2 | { 3 | meta: 4 | author = "Jason Batchelor" 5 | company = "Emerson" 6 | lastmod = "20151116" 7 | desc = "Signature to detect on TAR archive files" 8 | 9 | strings: 10 | $magic = { 75 73 74 61 72 } 11 | 12 | condition: 13 | $magic at 257 14 | } 15 | -------------------------------------------------------------------------------- /fsf-server/yara/ft_rar.yara: -------------------------------------------------------------------------------- 1 | rule ft_rar 2 | { 3 | meta: 4 | author = "James Ferrer" 5 | company = "Emerson" 6 | lastmod = "20150107" 7 | desc = "File type signature for basic .rar files" 8 | 9 | strings: 10 | $Rar = {52 61 72 21 1A 07} 11 | 12 | condition: 13 | 14 | $Rar at 0 15 | } 16 | -------------------------------------------------------------------------------- /fsf-server/yara/ft_rtf.yara: -------------------------------------------------------------------------------- 1 | rule ft_rtf 2 | { 3 | meta: 4 | author = "Jason Batchelor" 5 | company = "Emerson" 6 | lastmod = "20141204" 7 | desc = "Hit on RTF files by triggering on RTF file magic" 8 | 9 | strings: 10 | $rtf = { 7B 5C 72 74 66 } 11 | 12 | condition: 13 | $rtf at 0 14 | } 15 | -------------------------------------------------------------------------------- /fsf-server/yara/ft_java_class.yara: -------------------------------------------------------------------------------- 1 | rule ft_java_class 2 | { 3 | meta: 4 | author = "Jason Batchelor" 5 | company = "Emerson" 6 | lastmod = "20160126" 7 | desc = "File magic for detecting a Java bytecode file." 8 | 9 | strings: 10 | $class = { CA FE BA BE } 11 | 12 | condition: 13 | $class at 0 14 | } 15 | -------------------------------------------------------------------------------- /fsf-server/yara/ft_jar.yara: -------------------------------------------------------------------------------- 1 | rule ft_jar 2 | { 3 | meta: 4 | author = "Jason Batchelor" 5 | company = "Emerson" 6 | lastmod = "20150810" 7 | desc = "Signature to detect JAR files" 8 | 9 | strings: 10 | $pk_header = { 50 4B 03 04 } 11 | $jar = "META-INF/MANIFEST.MF" 12 | 13 | condition: 14 | $pk_header at 0 and $jar 15 | } 16 | -------------------------------------------------------------------------------- /fsf-server/yara/misc_pe_signature.yara: -------------------------------------------------------------------------------- 1 | import "pe" 2 | 3 | rule misc_pe_signature 4 | { 5 | meta: 6 | author = "Jason Batchelor" 7 | company = "Emerson" 8 | lastmod = "20150911" 9 | desc = "Triggers if an authenticode signature is present within a PE file (if the PE is signed for example)" 10 | 11 | condition: 12 | pe.number_of_signatures > 0 13 | } 14 | -------------------------------------------------------------------------------- /fsf-server/yara/misc_upx_packed_binary.yara: -------------------------------------------------------------------------------- 1 | import "pe" 2 | 3 | rule misc_upx_packed_binary 4 | { 5 | meta: 6 | author = "Jason Batchelor" 7 | company = "Emerson" 8 | lastmod = "20150520" 9 | desc = "Detect section names indicative of UPX packed PE files" 10 | 11 | condition: 12 | (pe.sections[0].name == "UPX0" and pe.sections[1].name == "UPX1") 13 | } 14 | -------------------------------------------------------------------------------- /fsf-server/yara/ft_ole_cf.yara: -------------------------------------------------------------------------------- 1 | rule ft_ole_cf 2 | { 3 | meta: 4 | author = "Jason Batchelor" 5 | company = "Emerson" 6 | lastmod = "20141202" 7 | desc = "Detect file magic indicative of OLE CF files (commonly used by early versions of MS Office)." 8 | 9 | strings: 10 | $magic = { D0 CF 11 E0 A1 B1 1A E1 } 11 | 12 | condition: 13 | $magic at 0 14 | } 15 | -------------------------------------------------------------------------------- /fsf-server/yara/misc_ooxml_core_properties.yara: -------------------------------------------------------------------------------- 1 | rule misc_ooxml_core_properties 2 | { 3 | meta: 4 | author = "Jason Batchelor" 5 | company = "Emerson" 6 | lastmod = "20150505" 7 | desc = "Identify meta xml content within OOXML documents" 8 | 9 | strings: 10 | $xml = "
5 | 6 | 7 | ... 8 | 9 | 10 |