Skip to content

Sample Uploads

The Sample Uploads service collection provides operations for uploading and managing sample files for cloud analysis. Upload archives and individual samples, manage extraction operations, retrieve uploaded samples, and delete files when no longer needed.

LanguageLast Update
Pythonv1.6.5
PowerShellv2.2.9
Gov0.22.0
TypeScriptv0.6.0
Rustv0.7.1
Rubyv1.4.0

This service collection has code examples posted to the repository.



OperationDescription
ArchiveDeleteV1
delete_archive
Delete an archive that was uploaded previously
ArchiveGetV1
get_archive
Retrieves the archives upload operation statuses.
ArchiveListV1
list_archive
Retrieves the archives files in chunks.
ArchiveUploadV1
upload_archive_v1
Uploads an archive and extracts files list from it.
deprecated
ArchiveUploadV2
upload_archive
Uploads an archive and extracts files list from it.
DeleteSampleV3
delete_sample
Removes a sample, including file, meta and submissions from the collection
ExtractionCreateV1
create_extraction
Extracts files from an uploaded archive and copies them to internal storage making it available for content analysis.
ExtractionGetV1
get_extraction
Retrieves the files extraction operation statuses.
ExtractionListV1
list_extraction
Retrieves the files extractions in chunks.
GetSampleV3
get_sample
Retrieves the file associated with the given ID (SHA256)
UploadSampleV3
upload_sample
Upload a file for further cloud analysis.

Delete an archive that was uploaded previously

Method DELETE
Route /archives/entities/archives/v1
Scope Sample uploads: WRITE
PEP 8 delete_archive
id query · string
The archive SHA256.
parameters query · dictionary
Full query string parameters payload in JSON format. Not required when using other keywords.
from falconpy import SampleUploads
falcon = SampleUploads(client_id=CLIENT_ID,
client_secret=CLIENT_SECRET
)
response = falcon.delete_archive(id="string")
print(response)
{
"errors": [
{
"code": 0,
"id": "string",
"message": "string"
}
],
"meta": {
"pagination": {
"limit": 0,
"offset": 0,
"total": 0
},
"powered_by": "string",
"query_time": 0.0,
"trace_id": "string",
"writes": {
"resources_affected": 0
}
}
}


Retrieves the archives upload operation statuses.

Method GET
Route /archives/entities/archives/v1
Scope Sample uploads: READ
PEP 8 get_archive
id query · string
The archive SHA256.
include_files query · boolean
If true includes processed archive files in response.
parameters query · dictionary
Full query string parameters payload in JSON format. Not required when using other keywords.
from falconpy import SampleUploads
falcon = SampleUploads(client_id=CLIENT_ID,
client_secret=CLIENT_SECRET
)
response = falcon.get_archive(id="string", include_files=boolean)
print(response)
[
{
"error": "string",
"files": [],
"mime_type": "string",
"name": "string",
"sha256": "string",
"size": 0,
"status": "string",
"upload_timestamp": "string"
}
]


Retrieves the archives files in chunks.

Method GET
Route /archives/entities/archive-files/v1
Scope Sample uploads: READ
PEP 8 list_archive
id query · string
The archive SHA256.
limit query · integer
Max number of files to retrieve.
offset query · string
Offset from where to get files.
parameters query · dictionary
Full query string parameters payload in JSON format. Not required when using other keywords.
from falconpy import SampleUploads
falcon = SampleUploads(client_id=CLIENT_ID,
client_secret=CLIENT_SECRET
)
response = falcon.list_archive(id="string", limit=integer, offset="string")
print(response)
[
"string"
]


Uploads an archive and extracts files list from it.

Method POST
Route /archives/entities/archives/v1
Scope Sample uploads: WRITE
PEP 8 upload_archive_v1
body body · dictionary
Full body payload as JSON formatted dictionary.
name query · string
Name of the archive.
password query · string
Archive password.
is_confidential query · boolean
Defines visibility of this file, either via the API or the Falcon console. - true: File is only shown to users within your customer account - false: File can be seen by other CrowdStrike customers Default: true.
Available values (2)
true
File is only show to users within your customer account
false
File can be seen by other CrowdStrike customers
comment query · string
A descriptive comment to identify the file for other users.
parameters query · dictionary
Full query string parameters payload in JSON format. Not required when using other keywords.
file_type body · string
Archive file format. “zip”, “7zip”. Defaults to “zip”.
from falconpy import SampleUploads
falcon = SampleUploads(client_id=CLIENT_ID,
client_secret=CLIENT_SECRET
)
response = falcon.upload_archive_v1(comment="string",
name="string",
file_type="string",
is_confidential=boolean,
password="string")
print(response)
[
{
"error": "string",
"files": [],
"mime_type": "string",
"name": "string",
"sha256": "string",
"size": 0,
"status": "string",
"upload_timestamp": "string"
}
]


Uploads an archive and extracts files list from it.

Method POST
Route /archives/entities/archives/v2
Scope Sample uploads: WRITE
PEP 8 upload_archive
file body · file
Content of the uploaded archive. For example, use —form file=@$FILE_PATH;type= when using cURL. Supported file types are application/zip and application/x-7z-compressed.
password body · string
Archive password. For example, use —form password= when using cURL.
name body · string
Name of the archive. For example, use —form name= when using cURL.
is_confidential body · boolean
Defines visibility of this file in Falcon MalQuery, either via the API or the Falcon console. For example, use —form is_confidential= when using cURL. - true: File is only shown to users within your customer account - false: File can be seen by other CrowdStrike customers Default: true.
Available values (2)
true
File is only show to users within your customer account
false
File can be seen by other CrowdStrike customers
comment body · string
A descriptive comment to identify the file for other users. For example, use —form comment= when using cURL.
file_data body · string
Content of the uploaded archive in binary format. ‘archive’ and ‘file’ are also accepted as this parameter.
file_type body · string
Archive file format. “zip”, “7zip”. Defaults to “zip”.
from falconpy import SampleUploads
falcon = SampleUploads(client_id=CLIENT_ID,
client_secret=CLIENT_SECRET
)
response = falcon.upload_archive(comment="string",
file_data="string",
name="string",
file_type="string",
is_confidential="string",
password="string")
print(response)
[
{
"error": "string",
"files": [],
"mime_type": "string",
"name": "string",
"sha256": "string",
"size": 0,
"status": "string",
"upload_timestamp": "string"
}
]


Removes a sample, including file, meta and submissions from the collection

Method DELETE
Route /samples/entities/samples/v3
Scope Sample uploads: WRITE
PEP 8 delete_sample
ids query · string
The file SHA256.
parameters query · dictionary
Full query string parameters payload in JSON format. Not required when using other keywords.
from falconpy import SampleUploads
falcon = SampleUploads(client_id=CLIENT_ID,
client_secret=CLIENT_SECRET
)
id_list = 'ID1,ID2,ID3' # Can also pass a list here: ['ID1', 'ID2', 'ID3']
response = falcon.delete_sample(ids=id_list)
print(response)
[
"string"
]


Extracts files from an uploaded archive and copies them to internal storage making it available for content analysis.

Method POST
Route /archives/entities/extractions/v1
Scope Sample uploads: WRITE
PEP 8 create_extraction
body body · dictionary
Full body payload as JSON formatted dictionary.
extract_all body · boolean
Flag indicating if all files should be extracted.
files body · array
List of files to be extracted from the archive.
sha256 body · string
SHA256 Archive ID of the archive.
from falconpy import SampleUploads
falcon = SampleUploads(client_id=CLIENT_ID,
client_secret=CLIENT_SECRET
)
files = [
{
"comment": "string",
"is_confidential": True,
"name": "string"
}
]
response = falcon.create_extraction(extract_all=boolean,
files=files,
sha256="string")
print(response)
[
{
"error": "string",
"extract_timestamp": "string",
"files": [],
"id": "string",
"status": "string"
}
]


Retrieves the files extraction operation statuses.

Method GET
Route /archives/entities/extractions/v1
Scope Sample uploads: READ
PEP 8 get_extraction
id query · string
The extraction operation ID.
include_files query · boolean
If true includes processed archive files in response.
parameters query · dictionary
Full query string parameters payload in JSON format. Not required when using other keywords.
from falconpy import SampleUploads
falcon = SampleUploads(client_id=CLIENT_ID,
client_secret=CLIENT_SECRET
)
response = falcon.get_extraction(id="string", include_files=boolean)
print(response)
[
{
"error": "string",
"extract_timestamp": "string",
"files": [],
"id": "string",
"status": "string"
}
]


Retrieves the files extractions in chunks.

Method GET
Route /archives/entities/extraction-files/v1
Scope Sample uploads: READ
PEP 8 list_extraction
id query · string
The extraction operation ID.
limit query · integer
Max number of file extractions to retrieve.
offset query · string
Offset from where to get file extractions.
parameters query · dictionary
Full query string parameters payload in JSON format. Not required when using other keywords.
from falconpy import SampleUploads
falcon = SampleUploads(client_id=CLIENT_ID,
client_secret=CLIENT_SECRET
)
response = falcon.list_extraction(id="string", limit=integer, offset="string")
print(response)
[
{
"error": "string",
"extract_timestamp": "string",
"name": "string",
"sha256": "string",
"status": "string"
}
]


Retrieves the file associated with the given ID (SHA256)

Method GET
Route /samples/entities/samples/v3
Scope Sample uploads: READ
PEP 8 get_sample
ids query · string
The file SHA256.
password_protected query · boolean
Flag whether the sample should be zipped and password protected with pass=‘infected’
parameters query · dictionary
Full query string parameters payload in JSON format. Not required when using other keywords.
stream body · boolean
Enable streaming download of the file.
from falconpy import SampleUploads
falcon = SampleUploads(client_id=CLIENT_ID,
client_secret=CLIENT_SECRET
)
id_list = 'ID1,ID2,ID3' # Can also pass a list here: ['ID1', 'ID2', 'ID3']
with open("output_file", "wb") as save_file:
response = falcon.get_sample(ids=id_list,
password_protected=boolean,
stream=boolean,
stream=boolean)
save_file.write(response)
{
"errors": [
{
"code": 0,
"id": "string",
"message": "string"
}
],
"meta": {
"pagination": {
"limit": 0,
"offset": 0,
"total": 0
},
"powered_by": "string",
"query_time": 0.0,
"trace_id": "string",
"writes": {
"resources_affected": 0
}
}
}


Upload a file for further cloud analysis.

Method POST
Route /samples/entities/samples/v3
Scope Sample uploads: WRITE
PEP 8 upload_sample
sample body · file
Content of the uploaded sample in binary format. For example, use —data-binary @$FILE_PATH when using cURL. Max file size: 256 MB. Accepted file formats: - Portable executables: .exe, .scr, .pif, .dll, .com, .cpl, etc. - Office documents: .doc, .docx, .ppt, .pps, .pptx, .ppsx, .xls, .xlsx, .rtf, .pub - PDF - APK - Executable JAR - Windows script component: .sct - Windows shortcut: .lnk - Windows help: .chm - HTML application: .hta - Windows script file: .wsf - Javascript: .js - Visual Basic: .vbs, .vbe - Shockwave Flash: .swf - Perl: .pl - Powershell: .ps1, .psd1, .psm1 - Scalable vector graphics: .svg - Python: .py - Linux ELF executables - Email files: MIME RFC 822 .eml, Outlook .msg.
file_name body · string
Name of the file.
comment body · string
A descriptive comment to identify the file for other users.
is_confidential body · boolean
Defines visibility of this file in Falcon MalQuery, either via the API or the Falcon console. - true: File is only shown to users within your customer account - false: File can be seen by other CrowdStrike customers Default: true.
Available values (2)
true
File is only shown to users within your customer account
false
File can be seen by other CrowdStrike customers
file_data body · string
Content of the uploaded sample in binary format. Max file size is 256 MB. ‘sample’ and ‘upfile’ are also accepted as this parameter. Accepted File Formats: Portable executables: .exe, .scr, .pif, .dll, .com, .cpl, etc. Office documents: .doc, .docx, .ppt, .pps, .pptx, .ppsx, .xls, .xlsx, .rtf, .pub PDF APK Executable JAR Windows script component: .sct Windows shortcut: .lnk Windows help: .chm HTML application: .hta Windows script file: .wsf Javascript: .js Visual Basic: .vbs, .vbe Shockwave Flash: .swf Perl: .pl Powershell: .ps1, .psd1, .psm1 Scalable vector graphics: .svg Python: .py Linux ELF executables Email files: MIME RFC 822 .eml, Outlook .msg
from falconpy import SampleUploads
falcon = SampleUploads(client_id=CLIENT_ID,
client_secret=CLIENT_SECRET
)
response = falcon.upload_sample(comment="string",
file_data="string",
file_name="string",
is_confidential="string")
print(response)
[
{
"file_name": "string",
"sha256": "string"
}
]