Splunk SOAR

How can I download arbitrary files from the Internet using Phantom?

AlexBryant
Path Finder

I have written a custom code block that outputs URLs of files on the Internet that I'd like Phantom to download and use later in the playbook. Given one of these lists of URLs, how can I have Phantom download those files and place them into the vault to be referenced by a later block?

Labels (3)
Tags (1)
0 Karma
1 Solution

rgresham_splunk
Splunk Employee
Splunk Employee

Alex,

It would be my recommendation that you use the HTTP app to pull the file (link text
However, you will need to get the source code to modify it to get it to handle data file saves to the vault.

Currently, there is no prebuilt way to do this. You could continue your process and use the requests library to pull the files and save them using the phantom.add_vault() API call. (This would not be the best practice (as an app would be) due to the processing and delays that it puts under the decide daemon.

View solution in original post

0 Karma

rgresham_splunk
Splunk Employee
Splunk Employee

Alex,

It would be my recommendation that you use the HTTP app to pull the file (link text
However, you will need to get the source code to modify it to get it to handle data file saves to the vault.

Currently, there is no prebuilt way to do this. You could continue your process and use the requests library to pull the files and save them using the phantom.add_vault() API call. (This would not be the best practice (as an app would be) due to the processing and delays that it puts under the decide daemon.

0 Karma

cblumer_splunk
Splunk Employee
Splunk Employee

This is a beta "wget App for Phantom" which can perform this action. Ask about it in the phantom-community.slack.com workspace.

AlexBryant
Path Finder

I got a copy off of slack and will let you know how it goes...thanks!

0 Karma

AlexBryant
Path Finder

The app appears to fail when wgetting an Internet resource that doesn't have a file extension. So a URL that ends in .htm or .txt or .jpg works fine, but something like pastebin[.]com/raw/dStYKpUb (a chocolate chip cookie recipe) fails. Maybe it's treating the filename as a folder since it doesn't have an extension, but I'm still researching:

{"app_name":"wget","asset_name":"wget","param":{"context": {"guid": "XXX", "artifact_id": 0, "parent_action_run": []}, "target_url": "https://pastebin.com/raw/dStYKpUb"},"status":"failed","message":"handle_action exception occurred. Error string: '[Errno 2] No such file or directory: '/opt/phantom/vault/tmp/pastebin_12-10-2019_09-16-09.com/raw/dStYKpUb''"}]

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...