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

exploit-apk not working on windows #384

Open
DarkSurferZA opened this issue Jul 1, 2021 · 0 comments
Open

exploit-apk not working on windows #384

DarkSurferZA opened this issue Jul 1, 2021 · 0 comments

Comments

@DarkSurferZA
Copy link

qark --apk app-debug.apk --report-type html --exploit-apk --sdk-path apkpathgoeshere
....
Finish writing report to c:\programdata\miniconda3\envs\qark\lib\site-packages\qark\report\report.html ...
Building exploit APK...
Error running command %s
Traceback (most recent call last):
  File "c:\programdata\miniconda3\envs\qark\lib\site-packages\qark\apk_builder.py", line 115, in _build_apk
    subprocess.call(shlex.split(command))
  File "c:\programdata\miniconda3\envs\qark\lib\subprocess.py", line 172, in call
    return Popen(*popenargs, **kwargs).wait()
  File "c:\programdata\miniconda3\envs\qark\lib\subprocess.py", line 394, in __init__
    errread, errwrite)
  File "c:\programdata\miniconda3\envs\qark\lib\subprocess.py", line 644, in _execute_child
    startupinfo)
WindowsError: [Error 193] %1 is not a valid Win32 application
Traceback (most recent call last):
  File "c:\programdata\miniconda3\envs\qark\lib\runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "c:\programdata\miniconda3\envs\qark\lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File "C:\ProgramData\Miniconda3\envs\qark\Scripts\qark.exe\__main__.py", line 7, in <module>
  File "c:\programdata\miniconda3\envs\qark\lib\site-packages\click\core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "c:\programdata\miniconda3\envs\qark\lib\site-packages\click\core.py", line 782, in main
    rv = self.invoke(ctx)
  File "c:\programdata\miniconda3\envs\qark\lib\site-packages\click\core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "c:\programdata\miniconda3\envs\qark\lib\site-packages\click\core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "c:\programdata\miniconda3\envs\qark\lib\site-packages\click\decorators.py", line 21, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "c:\programdata\miniconda3\envs\qark\lib\site-packages\qark\qark.py", line 102, in cli
    exploit_builder.build()
  File "c:\programdata\miniconda3\envs\qark\lib\site-packages\qark\apk_builder.py", line 76, in build
    self._build_apk()
  File "c:\programdata\miniconda3\envs\qark\lib\site-packages\qark\apk_builder.py", line 116, in _build_apk
    subprocess.call(shlex.split(command))
  File "c:\programdata\miniconda3\envs\qark\lib\subprocess.py", line 172, in call
    return Popen(*popenargs, **kwargs).wait()
  File "c:\programdata\miniconda3\envs\qark\lib\subprocess.py", line 394, in __init__
    errread, errwrite)
  File "c:\programdata\miniconda3\envs\qark\lib\subprocess.py", line 644, in _execute_child
    startupinfo)
WindowsError: [Error 193] %1 is not a valid Win32 application

Problem seems to be in this file: c:\programdata\miniconda3\envs\qark\lib\site-packages\qark\apk_builder.py

After inspecting the file, line 115 is attempting to launch ./gradlew. this obviously isnt suitable to Windows environments and would have to be changed to gradlew.bat

Suggested change in the project is to include an if os.name == 'nt': check and then make use of either ./gradlew or gradlew.bat.

Willing to create a pull request, but not sure of other impacts this may have.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant