|
2 | 2 | from ReversingLabs.SDK.a1000 import A1000
|
3 | 3 |
|
4 | 4 |
|
5 |
| -VERSION = "v2.4.0" |
| 5 | +VERSION = "v2.4.4" |
6 | 6 | USER_AGENT = f"ReversingLabs XSOAR A1000 {VERSION}"
|
7 | 7 | HOST = demisto.getParam('host')
|
8 | 8 | TOKEN = demisto.getParam('token')
|
@@ -427,11 +427,12 @@ def get_classification(a1000):
|
427 | 427 | """
|
428 | 428 | hash_value = demisto.getArg('hash')
|
429 | 429 | local_only = argToBoolean(demisto.getArg('localOnly'))
|
| 430 | + av_scanners = argToBoolean(demisto.getArg('avScanners')) |
430 | 431 |
|
431 | 432 | try:
|
432 | 433 | response_json = a1000.get_classification_v3(hash_value,
|
433 | 434 | local_only=local_only,
|
434 |
| - av_scanners=True).json() |
| 435 | + av_scanners=av_scanners).json() |
435 | 436 | except Exception as e:
|
436 | 437 | return_error(str(e))
|
437 | 438 |
|
@@ -1211,36 +1212,41 @@ def sample_classification_output(resp_json, action, av_scanners, sample_hash):
|
1211 | 1212 | markdown = f"""## ReversingLabs A1000 sample classification - {action}\n"""
|
1212 | 1213 |
|
1213 | 1214 | if action == "GET CLASSIFICATION":
|
1214 |
| - markdown = markdown + f"""**Classification**: {resp_json.get("classification")} |
1215 |
| - **Risk score**: {resp_json.get("riskscore")} |
1216 |
| - **First seen**: {resp_json.get("first_seen")} |
1217 |
| - **Last seen**: {resp_json.get("last_seen")} |
1218 |
| - **Classification result**: {resp_json.get("classification_result")} |
1219 |
| - **Classification reason**: {resp_json.get("classification_reason")} |
1220 |
| - **SHA-1**: {resp_json.get("sha1")} |
1221 |
| - **SHA-256**: {resp_json.get("sha256")} |
1222 |
| - **MD5**: {resp_json.get("md5")} |
1223 |
| - """ |
1224 |
| - if av_scanners: |
1225 |
| - scanners_table = tableToMarkdown("Scanner results", resp_json.get("av_scanners")) |
1226 |
| - markdown = markdown + f"\n{scanners_table}" |
| 1215 | + if resp_json.get("classification"): |
| 1216 | + markdown = markdown + f"""**Classification**: {resp_json.get("classification")} |
| 1217 | + **Risk score**: {resp_json.get("riskscore")} |
| 1218 | + **First seen**: {resp_json.get("first_seen")} |
| 1219 | + **Last seen**: {resp_json.get("last_seen")} |
| 1220 | + **Classification result**: {resp_json.get("classification_result")} |
| 1221 | + **Classification reason**: {resp_json.get("classification_reason")} |
| 1222 | + **SHA-1**: {resp_json.get("sha1")} |
| 1223 | + **SHA-256**: {resp_json.get("sha256")} |
| 1224 | + **MD5**: {resp_json.get("md5")} |
| 1225 | + """ |
| 1226 | + if av_scanners: |
| 1227 | + scanners_table = tableToMarkdown("Scanner results", resp_json.get("av_scanners")) |
| 1228 | + markdown = markdown + f"\n{scanners_table}" |
| 1229 | + |
| 1230 | + d_bot_score = classification_to_score(resp_json.get("classification").upper()) |
| 1231 | + dbot_score = Common.DBotScore( |
| 1232 | + indicator=sample_hash, |
| 1233 | + indicator_type=DBotScoreType.FILE, |
| 1234 | + integration_name='ReversingLabs A1000 v2', |
| 1235 | + score=d_bot_score, |
| 1236 | + malicious_description=resp_json.get("classification_result"), |
| 1237 | + reliability=RELIABILITY |
| 1238 | + ) |
1227 | 1239 |
|
1228 |
| - d_bot_score = classification_to_score(resp_json.get("classification").upper()) |
1229 |
| - dbot_score = Common.DBotScore( |
1230 |
| - indicator=sample_hash, |
1231 |
| - indicator_type=DBotScoreType.FILE, |
1232 |
| - integration_name='ReversingLabs A1000 v2', |
1233 |
| - score=d_bot_score, |
1234 |
| - malicious_description=resp_json.get("classification_result"), |
1235 |
| - reliability=RELIABILITY |
1236 |
| - ) |
| 1240 | + indicator = Common.File( |
| 1241 | + md5=resp_json.get("md5"), |
| 1242 | + sha1=resp_json.get("sha1"), |
| 1243 | + sha256=resp_json.get("sha256"), |
| 1244 | + dbot_score=dbot_score |
| 1245 | + ) |
1237 | 1246 |
|
1238 |
| - indicator = Common.File( |
1239 |
| - md5=resp_json.get("md5"), |
1240 |
| - sha1=resp_json.get("sha1"), |
1241 |
| - sha256=resp_json.get("sha256"), |
1242 |
| - dbot_score=dbot_score |
1243 |
| - ) |
| 1247 | + else: |
| 1248 | + markdown = markdown + "There were no results for the given hash." |
| 1249 | + indicator = None |
1244 | 1250 |
|
1245 | 1251 | command_results = CommandResults(
|
1246 | 1252 | outputs_prefix="ReversingLabs",
|
|
0 commit comments