From 8eeebcc6217d0293014098d81f7397a015dc13b1 Mon Sep 17 00:00:00 2001 From: Ajin Abraham Date: Fri, 8 Nov 2024 16:01:56 -0800 Subject: [PATCH] pass requests through proxy --- .../views/android/frida_server_download.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/mobsf/DynamicAnalyzer/views/android/frida_server_download.py b/mobsf/DynamicAnalyzer/views/android/frida_server_download.py index be01e3dc4..3765572fc 100644 --- a/mobsf/DynamicAnalyzer/views/android/frida_server_download.py +++ b/mobsf/DynamicAnalyzer/views/android/frida_server_download.py @@ -30,13 +30,17 @@ def clean_up_old_binaries(dirc, version): pass -def download_frida_server(url, version, fname): +def download_frida_server(url, version, fname, proxies): """Download frida-server-binary.""" try: download_dir = Path(settings.DWD_DIR) logger.info('Downloading binary %s', fname) dwd_loc = download_dir / fname - with requests.get(url, timeout=5, stream=True) as r: + with requests.get( + url, + timeout=5, + proxies=proxies, + stream=True) as r: with LZMAFile(r.raw) as f: with open(dwd_loc, 'wb') as flip: copyfileobj(f, flip) @@ -68,7 +72,7 @@ def update_frida_server(arch, version): for item in response.json()['assets']: if item['name'] == f'{fserver}.xz': url = item['browser_download_url'] - return download_frida_server(url, version, fserver) + return download_frida_server(url, version, fserver, proxies) return False except Exception: logger.exception('[ERROR] Fetching Frida Server Release')