Skip to content

Commit

Permalink
Pointing URLs to the new documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
leximagination committed Dec 1, 2023
1 parent 6d3dbc6 commit e2f9d8b
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion admins_guide/adding_users_to_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
def add_users_to_group(apikey, group_id, email_addresses):
"""
Adding users (by their email addresses) to VirusTotal group.
VT API endpoint reference: https://developers.virustotal.com/reference/update-group-users
VT API endpoint reference: https://docs.virustotal.com/reference/update-group-users
"""
url = f"https://www.virustotal.com/api/v3/groups/{group_id}/relationships/users"
headers = {
Expand Down
2 changes: 1 addition & 1 deletion admins_guide/getting_group_users_and_service_accounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def get_users_or_service_accounts(apikey, group_id, relationship):
"""
Getting users or service accounts objects related to a group by group ID and 'users' or 'service_accounts' relationship.
Requested users attributes: first_name,last_name,email.
VT API endpoint reference: https://developers.virustotal.com/reference/groups-relationships
VT API endpoint reference: https://docs.virustotal.com/reference/groups-relationships
"""
users = []
url = f"https://www.virustotal.com/api/v3/groups/{group_id}/{relationship}?attributes=first_name,last_name,email"
Expand Down
2 changes: 1 addition & 1 deletion admins_guide/getting_users_without_2fa.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def get_users_without_2fa(apikey, group_id):
"""
Getting users objects related to a group by group ID, filtering by 2fa_enabled = false.
Requested users attributes: first_name,last_name,email.
VT API endpoint reference: https://developers.virustotal.com/reference/groups-relationships
VT API endpoint reference: https://docs.virustotal.com/reference/groups-relationships
"""

users = []
Expand Down
2 changes: 1 addition & 1 deletion admins_guide/group_api_consumption.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
def get_group_api_consumption(apikey, group_id, start_date, last_date):
"""
Getting VT API group consumption between 2 dates (by group ID). Please note that available data includes only the last 60 natural days so your range dates have to be part of the last 60 natural days.
VT API endpoint reference: https://developers.virustotal.com/reference/group-api-usage
VT API endpoint reference: https://docs.virustotal.com/reference/group-api-usage
"""

url = f"https://www.virustotal.com/api/v3/groups/{group_id}/api_usage?start_date={start_date}&end_date={last_date}"
Expand Down
2 changes: 1 addition & 1 deletion admins_guide/group_enterprise_current_month_consumption.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
def get_group_enterprise_current_month_consumption(apikey, user_id):
"""
Getting current month VT enterprise group consumption by user ID or user API key.
VT API endpoint reference: https://developers.virustotal.com/reference/get-user-overall-quotas
VT API endpoint reference: https://docs.virustotal.com/reference/get-user-overall-quotas
"""

url = f"https://www.virustotal.com/api/v3/users/{user_id}/overall_quotas"
Expand Down
2 changes: 1 addition & 1 deletion admins_guide/managing_users_api_allowance.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
def update_api_cap(apikey, user_id, daily_limit):
"""
Update user API cap (by its user ID).
VT API endpoint reference: https://developers.virustotal.com/reference/patch-user-id
VT API endpoint reference: https://docs.virustotal.com/reference/patch-user-id
"""

url = f"https://www.virustotal.com/api/v3/users/{user_id}"
Expand Down
4 changes: 2 additions & 2 deletions admins_guide/managing_users_privileges.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
def grant_admin_privileges(apikey, group_id, email_addresses):
"""
Granting admin privileges to a list of users (by their email addresses).
VT API endpoint reference: https://developers.virustotal.com/reference/post-group-administrators
VT API endpoint reference: https://docs.virustotal.com/reference/post-group-administrators
"""

url = f"https://www.virustotal.com/api/v3/groups/{group_id}/relationships/administrators"
Expand All @@ -36,7 +36,7 @@ def grant_admin_privileges(apikey, group_id, email_addresses):
def revoke_admin_privileges(apikey, group_id, user_id):
"""
Revoking admin privileges of a user (by its user ID).
VT API endpoint reference: https://developers.virustotal.com/reference/delete-user-group-administrator
VT API endpoint reference: https://docs.virustotal.com/reference/delete-user-group-administrator
"""

url = f"https://www.virustotal.com/api/v3/groups/{group_id}/relationships/administrators/{user_id}"
Expand Down
2 changes: 1 addition & 1 deletion admins_guide/remove_users_from_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
def remove_user_from_group(apikey, group_id, user_id):
"""
Removing user (by its user ID) from VirusTotal group.
VT API endpoint reference: https://developers.virustotal.com/reference/delete-user-from-group
VT API endpoint reference: https://docs.virustotal.com/reference/delete-user-from-group
"""

url = f"https://www.virustotal.com/api/v3/groups/{group_id}/relationships/users/{user_id}"
Expand Down
4 changes: 2 additions & 2 deletions admins_guide/user_api_consumption.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
def get_group_users(apikey, group_id):
"""
Getting group users ID list (by group ID).
VT API endpoint reference: https://developers.virustotal.com/reference/get-group-users
VT API endpoint reference: https://docs.virustotal.com/reference/get-group-users
"""

users = []
Expand All @@ -38,7 +38,7 @@ def get_group_users(apikey, group_id):
def get_user_api_consumption(apikey, user_id, start_date, last_date):
"""
Getting VT API user consumption between 2 dates (by user ID). Please note that available data includes only the last 60 natural days so your range dates have to be part of the last 60 natural days.
VT API endpoint reference: https://developers.virustotal.com/reference/user-api-usage
VT API endpoint reference: https://docs.virustotal.com/reference/user-api-usage
"""

url = f"https://www.virustotal.com/api/v3/users/{user_id}/api_usage?start_date={start_date}&end_date={last_date}"
Expand Down
4 changes: 2 additions & 2 deletions admins_guide/user_enterprise_current_month_consumption.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
def get_group_users(apikey, group_id):
"""
Getting group users ID list (by group ID).
VT API endpoint reference: https://developers.virustotal.com/reference/get-group-users
VT API endpoint reference: https://docs.virustotal.com/reference/get-group-users
"""

users = []
Expand All @@ -38,7 +38,7 @@ def get_group_users(apikey, group_id):
def get_user_vt_enterprise_consumption(apikey, user_id):
"""
Getting current month VT enterprise user consumption by user ID.
VT API endpoint reference: https://developers.virustotal.com/reference/get-user-overall-quotas
VT API endpoint reference: https://docs.virustotal.com/reference/get-user-overall-quotas
"""

url = f"https://www.virustotal.com/api/v3/users/{user_id}/overall_quotas"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ if res and res.get('data', {}).get('type') == 'analysis':

### Get file report <a name="set1.3"></a>

A file’s report is a JSON data structure. For full context on file report structure refer to [File object description](https://developers.virustotal.com/reference/files). The main file report is limited mostly to the file's static properties and AV verdicts. For dynamic properties, refer to the Get file behaviour report section.
A file’s report is a JSON data structure. For full context on file report structure refer to [File object description](https://docs.virustotal.com/reference/files). The main file report is limited mostly to the file's static properties and AV verdicts. For dynamic properties, refer to the Get file behaviour report section.

The code snippet below prints the whole JSON main (or static) report of a given file, based on its SHA256 hash. SHA1 and MD5 hashes can also be used to uniquely identify files.

Expand Down Expand Up @@ -192,9 +192,9 @@ In addition to static analyses and AV verdicts, VirusTotal provides results of a

The file behaviour report for v2 is a unique JSON structure covering all data gathered from detonating the sample in a single sandbox (unique integration available).

Unlike v2, v3 provides multiple sandbox integrations, and reports can be provided by sandbox ([1](https://developers.virustotal.com/reference/get-file-behaviour-id)) or by aggregating the reports from all sandboxes ([2](https://developers.virustotal.com/reference/get-all-behavior-reports-for-a-file)). Another difference is that in v3, the system API calls are not included in the reports. There’s a dedicated endpoint ([Get a detailed HTML behaviour report](https://developers.virustotal.com/reference/get-file-behaviour-html)) for them, which requires the sandbox providing this data to be identified.
Unlike v2, v3 provides multiple sandbox integrations, and reports can be provided by sandbox ([1](https://docs.virustotal.com/reference/get-file-behaviour-id)) or by aggregating the reports from all sandboxes ([2](https://docs.virustotal.com/reference/get-all-behavior-reports-for-a-file)). Another difference is that in v3, the system API calls are not included in the reports. There’s a dedicated endpoint ([Get a detailed HTML behaviour report](https://docs.virustotal.com/reference/get-file-behaviour-html)) for them, which requires the sandbox providing this data to be identified.

❗Please note that not all sandboxes can provide API calls. Refer to [In-house Sandboxes behavioural analysis products](https://support.virustotal.com/hc/en-us/articles/6253253596957-In-house-Sandboxes-behavioural-analysis-products) and [External behavioural engines sandboxes](https://support.virustotal.com/hc/en-us/articles/7904672302877-External-behavioural-engines-sandboxes) that show which sandboxes can provide the “__HTML behaviour report__” under the “**Low Level Report**” feature.
❗Please note that not all sandboxes can provide API calls. Refer to [In-house Sandboxes behavioural analysis products](https://docs.virustotal.com/docs/in-house-sandboxes) and [External behavioural engines sandboxes](https://docs.virustotal.com/docs/external-sandboxes) that show which sandboxes can provide the “__HTML behaviour report__” under the “**Low Level Report**” feature.

#### Get file behaviour report - except API calls <a name="set2.1.1"></a>

Expand Down Expand Up @@ -307,7 +307,7 @@ pprint(res)

### Get URL report <a name="set3.2"></a>

A URL’s report is a JSON data structure. For full context on URL report structure refer to [URL object description](https://developers.virustotal.com/reference/url-object).
A URL’s report is a JSON data structure. For full context on URL report structure refer to [URL object description](https://docs.virustotal.com/reference/url-object).
The code snippet below, prints the whole JSON report of a given URL, that has to be [URL-safe](https://docs.python.org/3/library/base64.html#base64.urlsafe_b64encode) base64 encoded.

```python
Expand All @@ -334,7 +334,7 @@ pprint(report)

### Get domain report <a name="set3.3"></a>

A domain’s report is a JSON data structure. For full context on domain report structure refer to [Domain object description](https://developers.virustotal.com/reference/domains-1).
A domain’s report is a JSON data structure. For full context on domain report structure refer to [Domain object description](https://docs.virustotal.com/reference/domains-object).

The code snippet below prints the whole JSON report for a given domain.

Expand All @@ -359,7 +359,7 @@ pprint(report)

### Get IP address report <a name="set3.4"></a>

A IP address’s report is a JSON data structure. For full context on IP address report structure refer to [IP address object description](https://developers.virustotal.com/reference/ip-object).
A IP address’s report is a JSON data structure. For full context on IP address report structure refer to [IP address object description](https://docs.virustotal.com/reference/ip-object).

The code snippet below, prints the whole JSON report of a given IP address.

Expand Down

0 comments on commit e2f9d8b

Please sign in to comment.