Skip to content

Commit

Permalink
pass requests through proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
ajinabraham committed Nov 9, 2024
1 parent 6903d59 commit 8eeebcc
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions mobsf/DynamicAnalyzer/views/android/frida_server_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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')
Expand Down

0 comments on commit 8eeebcc

Please sign in to comment.