Last active
August 9, 2019 02:39
-
-
Save framirez/17b5e5ebfa2d1a439174df1acb90aa3b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
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