Package lib :: Package cuckoo :: Package common :: Module objects :: Class File
[hide private]
[frames] | no frames]

Class File

source code

object --+
         |
        File

Basic file object class with all useful utilities.

Instance Methods [hide private]
 
__init__(self, file_path)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
get_name(self)
Get file name.
source code
 
valid(self) source code
 
get_data(self)
Read file contents.
source code
 
get_chunks(self)
Read file contents in chunks (generator).
source code
 
calc_hashes(self)
Calculate all possible hashes for this file.
source code
 
get_size(self)
Get file size.
source code
 
get_crc32(self)
Get CRC32.
source code
 
get_md5(self)
Get MD5.
source code
 
get_sha1(self)
Get SHA1.
source code
 
get_sha256(self)
Get SHA256.
source code
 
get_sha512(self)
Get SHA512.
source code
 
get_ssdeep(self)
Get SSDEEP.
source code
 
get_type(self)
Get MIME file type.
source code
 
get_content_type(self)
Get MIME content file type (example: image/jpeg).
source code
 
get_exported_functions(self)
Get the exported function names of this PE file.
source code
 
get_imported_functions(self)
Get the imported functions of this PE file.
source code
 
get_apk_entry(self)
Get the entry point for this APK.
source code
 
_yara_encode_string(self, s) source code
 
_yara_matches_177(self, matches)
Extract matches from the Yara output for version 1.7.7.
source code
 
get_yara(self, category='binaries')
Get Yara signatures matches.
source code
 
get_urls(self)
Extract all URLs embedded in this file through a simple regex.
source code
 
get_all(self)
Get all information available.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  YARA_RULEPATH = '/tmp/cuckoo/data/yara/index_%s.yar'
  notified_yara = False
  notified_pefile = False
  notified_androguard = False
  notified_pydeep = True
  yara_rules = {}
Properties [hide private]
  file_data

Inherited from object: __class__

Method Details [hide private]

__init__(self, file_path)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Parameters:
  • file_path - file path.
Overrides: object.__init__

get_name(self)

source code 

Get file name.

Returns:
file name.

get_data(self)

source code 

Read file contents.

Returns:
data.

get_size(self)

source code 

Get file size.

Returns:
file size.

get_crc32(self)

source code 

Get CRC32.

Returns:
CRC32.

get_md5(self)

source code 

Get MD5.

Returns:
MD5.

get_sha1(self)

source code 

Get SHA1.

Returns:
SHA1.

get_sha256(self)

source code 

Get SHA256.

Returns:
SHA256.

get_sha512(self)

source code 

Get SHA512.

Returns:
SHA512.

get_ssdeep(self)

source code 

Get SSDEEP.

Returns:
SSDEEP.

get_type(self)

source code 

Get MIME file type.

Returns:
file type.

get_content_type(self)

source code 

Get MIME content file type (example: image/jpeg).

Returns:
file content type.

get_apk_entry(self)

source code 

Get the entry point for this APK. The entry point is denoted by a package and main activity name.

get_yara(self, category='binaries')

source code 

Get Yara signatures matches.

Returns:
matched Yara signatures.

get_all(self)

source code 

Get all information available.

Returns:
information dict.

Property Details [hide private]

file_data

Get Method:
unreachable.file_data(self)