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

Make android payload buildable on Windows 11 #739

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

soroshsabz
Copy link

@soroshsabz soroshsabz commented Jan 10, 2025

ITNOA

Make buildable with JDK 1.8 and Windows 11

  • resolve problem when multiple android SDK installed on system (modern SDK)
  • resolve problem when modern JDK installed on system
  • resolve plugin problem on Windows with modern maven
  • resolve maven command problem on Windows
  • update some minor docs for building payload directly on Windows

see #732

@soroshsabz
Copy link
Author

@smcintyre-r7 do you can review my PR?

thanks

@soroshsabz
Copy link
Author

@dledda-r7

@soroshsabz
Copy link
Author

soroshsabz commented Jan 10, 2025

Why this CI does not trigger Metasploit Framework Meterppreter Acceptance like below?

image

like #734

@bwatters-r7
Copy link
Contributor

Why this CI does not trigger Metasploit Framework Meterppreter Acceptance like below?

image

like #734

It does not run because this is your first contribution, so a committer has to approve the CI run manually. I've approved the run.

@bwatters-r7
Copy link
Contributor

You can check the build failure, but it is:

[ERROR] Failed to execute goal com.simpligility.maven.plugins:android-maven-plugin:4.4.3:generate-sources (default-generate-sources) on project Metasploit-AndroidPayload: Execution default-generate-sources of goal com.simpligility.maven.plugins:android-maven-plugin:4.4.3:generate-sources failed: Invalid SDK: Build-tools 29.0.3 not found. Check your Android SDK to install the build tools 29.0.3 -> [Help 1]

This is because in our build infrastructure we do not have that version of the SDK. I strongly encourage you to use the Docker image to build like we do. See https://github.com/rapid7/metasploit-payloads/blob/master/docker/Dockerfile

@soroshsabz
Copy link
Author

@bwatters-r7 Could you re-run CI please?

@bwatters-r7
Copy link
Contributor

@bwatters-r7 Could you re-run CI please?

@soroshsabz re-run'ed

[ERROR] Failed to execute goal com.simpligility.maven.plugins:android-maven-plugin:4.4.3:generate-sources (default-generate-sources) on project Metasploit-AndroidPayload: Execution default-generate-sources of goal com.simpligility.maven.plugins:android-maven-plugin:4.4.3:generate-sources failed: Invalid SDK: Build-tools 23.0.3 not found. Check your Android SDK to install the build tools 23.0.3 -> [Help 1]

@adfoster-r7 do we use the dockerfile submitted as the build, or do we maintain the build separately from the repo?

@adfoster-r7
Copy link
Contributor

adfoster-r7 commented Jan 11, 2025

do we use the dockerfile submitted as the build, or do we maintain the build separately from the repo?

The acceptance tests use the latest published version of the Meterpreter docker image (i.e. rapid7/msf-ubuntu-x64-meterpreter:latest), and not the dockerfile from this PR

https://github.com/rapid7/metasploit-framework/blob/982401e8033559aceaf9024b548b12e8d5eeb5c9/.github/workflows/shared_meterpreter_acceptance.yml#L49-L52

@soroshsabz
Copy link
Author

soroshsabz commented Jan 12, 2025

@adfoster-r7 build-tools-23.0.0 has been deprecated and build-tools-23.0.3 replace that

how to update rapid7/msf-ubuntu-x64-meterpreter:latest ? for example where is repo? I can make PR to update docker image

thanks

@soroshsabz
Copy link
Author

@adfoster-r7 @bwatters-r7 Do you want I downgrade version and make this PR CI green and change docker later?

@soroshsabz
Copy link
Author

any update?

@adfoster-r7
Copy link
Contributor

Sorry for the delay; I think we'd be good to grab the 23.0.3 version bump, does it need Java 1.8 or is it backwards compatible with 1.7?

And just to take a step back - it looks like the initial goal of this PR was to add support for compiling the android payloads on a windows 11 host - but it looks like this is currently already possible by building the payloads using Docker.

i.e. Since it looks like it's possible to build on windows 11 via docker, would this PR still needed - or is this PR adding something additional that's needed 👀

@soroshsabz
Copy link
Author

soroshsabz commented Jan 21, 2025

Thanks for reply

This PR resolve some problems to build payload directly on Windows that make easy development on Windows (docker file changes only for consistency and try to change CI behavior before that I understand using docker hub image for CI not repo based image)

  • resolve problem when multiple android SDK installed on system (modern SDK)
  • resolve problem when modern JDK installed on system
  • resolve plugin problem on Windows with modern maven
  • resolve maven command problem on Windows
  • update some minor docs for building payload directly on Windows

after this PR merging, I try to improve android payload building and migrate to gradle see #741 for preparing to support more modern SDK and tools

@soroshsabz
Copy link
Author

@adfoster-r7 I hope to answer your questions :)

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

Successfully merging this pull request may close these issues.

3 participants