Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rc-cts-urlscanio-1.0.1 #70

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions rc-cts-urlscanio/rc_cts_urlscanio/components/searcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class UrlScanIoSearcher(BaseComponent):

Test using 'curl':
curl -v -k --header "Content-Type: application/json" --data-binary '{"type":"net.uri","value":"http://example.org"}' 'http://127.0.0.1:9000/cts/usio'
curl -v 'http://127.0.0.1:9000/cts/example/f9acc1b7-6184-5746-873e-e385e6214261'
curl -v 'http://127.0.0.1:9000/cts/usio/{scan_id}'

Test example of a potentially malicious url in urlscan.io search database is "http://detailsindia.in".
Test example of a non-malicious url in urlscan.io search database is "www.bai.org"
Expand Down Expand Up @@ -131,18 +131,20 @@ def _generate_hit_from_search_result(self, search_result):
if result_response.status_code == 200:
result_content = result_response.json()

stats = result_content.get('stats', None)
if stats:
malicious_flag = stats.get('malicious', None)
verdict = result_content.get('verdicts', None)

if malicious_flag == 1:
if verdict:
malicious_flag = verdict.get('urlscan', None).get('malicious', None)

if malicious_flag == True:

# Some malicious scans show as failed, do not include those
if self._verify_for_scan_failed_flag(result_content):
return None

task = result_content.get('task', None)
page = result_content.get('page', None)
stats = result_content.get('stats', None)

png_url = task.get('screenshotURL', None) if task else None
scan_time = task.get('time', None) if task else None
Expand Down
2 changes: 1 addition & 1 deletion rc-cts-urlscanio/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

setup(
name='rc-cts-urlscanio',
version='1.0.0',
version='1.0.1',
url='https://github.com/IBMResilient/resilient-community-apps',
license='MIT',
author='IBM Resilient Labs',
Expand Down