Skip to content

Instantly share code, notes, and snippets.

@framirez
Last active August 9, 2019 02:39
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save framirez/17b5e5ebfa2d1a439174df1acb90aa3b to your computer and use it in GitHub Desktop.
Save framirez/17b5e5ebfa2d1a439174df1acb90aa3b to your computer and use it in GitHub Desktop.
"""
Script to download all ruleset matchs
You can download pykoodous from: https://github.com/Koodous/Scripts/blob/master/pykoodous.py
http://koodous.com
@fdrg21
"""
import pykoodous
import requests
token = "**YOUR_TOKEN**"
ruleset = "**YOUR_RULESET**"
path_download_apk = "/tmp/"
a = pykoodous.wmup(token)
cont=0
vcontinue = False
while vcontinue is False:
print("Page {}".format(cont))
ret = a.read_ruleset_detection(ruleset, str(cont), "10")
if ret.status_code is not 200:
vcontinue = False
else:
for row in ret.json()['results']:
print("Downloading {}".format(row["sha256"]))
r_status_code = a.download(row["sha256"], path_download_apk+row["sha256"])
if r_status_code is 429:
print("Api limit exceeded")
exit()
elif r_status_code is not 200:
print("Error downloading sample, status code {}".format(r_status_code))
cont = cont + 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment