|
8 | 8 | logger = logging.getLogger("fireeye") |
9 | 9 |
|
10 | 10 | class Detection: |
11 | | - """The Detection class allows your app to communicate with FireEye's Detection On Demand service.add() |
12 | | - |
13 | | - The Detection On Demand service provides the ability for you to submit files and md5sum hashes for malware analysis.add() |
| 11 | + """The Detection class allows your app to communicate with FireEye's Detection On Demand service.add() |
| 12 | + |
| 13 | + The Detection On Demand service provides the ability for you to submit files and md5sum hashes for malware analysis.add() |
14 | 14 |
|
15 | | - This client handles constructing and sending HTTP requests to Detection On Demand as well as parsing any responses received. |
| 15 | + This client handles constructing and sending HTTP requests to Detection On Demand as well as parsing any responses received. |
16 | 16 |
|
17 | 17 |
|
18 | | - Keyword Arguments: |
19 | | - key {string} -- The API key provided to you by the Detection On Demand service. |
| 18 | + Keyword Arguments: |
| 19 | + key {string} -- The API key provided to you by the Detection On Demand service. |
20 | 20 |
|
21 | 21 |
|
22 | | - Example of sending a file in for malware analysis. |
23 | | - ```python |
24 | | - import fireeyepy |
| 22 | + Example of sending a file in for malware analysis. |
| 23 | + ```python |
| 24 | + import fireeyepy |
25 | 25 |
|
26 | | - detection = fireeyepy.Detection(key="yourapikeyhere") |
| 26 | + detection = fireeyepy.Detection(key="yourapikeyhere") |
27 | 27 |
|
28 | | - result = detection.submit_file( |
29 | | - files={ |
30 | | - "file": ("filenamehere.txt", open(path/to/filenamehere.txt", "r")) |
31 | | - } |
32 | | - ) |
33 | | - ``` |
| 28 | + result = detection.submit_file( |
| 29 | + files={ |
| 30 | + "file": ("filenamehere.txt", open("path/to/filenamehere.txt", "r")) |
| 31 | + } |
| 32 | + ) |
| 33 | + ``` |
| 34 | + ------------------------------ |
34 | 35 |
|
35 | | - Example of getting a file result from a previous analysis |
36 | | - ```python |
37 | | - import fireeyepy |
| 36 | + Example of getting a file result from a previous analysis |
| 37 | + ```python |
| 38 | + import fireeyepy |
38 | 39 |
|
39 | | - detection = fireeyepy.Detection(key="yourapikeyhere") |
| 40 | + detection = fireeyepy.Detection(key="yourapikeyhere") |
40 | 41 |
|
41 | | - result = detection.get_file_result("yoursubmissionkey") |
42 | | - ``` |
| 42 | + result = detection.get_file_result("yoursubmissionkey") |
| 43 | + ``` |
| 44 | + ------------------------------ |
43 | 45 |
|
44 | | - Example of getting the results of a hash that was previously analyzed. |
45 | | - ```python |
46 | | - import fireeyepy |
| 46 | + Example of getting the results of a hash that was previously analyzed. |
| 47 | + ```python |
| 48 | + import fireeyepy |
47 | 49 |
|
48 | | - detection = fireeyepy.Detection(key="yourapikeyhere") |
| 50 | + detection = fireeyepy.Detection(key="yourapikeyhere") |
49 | 51 |
|
50 | | - result = detection.get_hash_lookup(hash="md5sumhashhere") |
51 | | - ``` |
52 | | - """ |
| 52 | + result = detection.get_hash_lookup(hash="md5sumhashhere") |
| 53 | + ``` |
| 54 | + """ |
53 | 55 | def __init__(self,key=None): |
54 | 56 | self.api_key = key or os.environ.get("FIREEYE_API_KEY", None) |
55 | 57 | self.api_host = "feapi.marketplace.apps.fireeye.com" |
|
0 commit comments