Skip to content
This repository has been archived by the owner on Dec 6, 2023. It is now read-only.

Added Termux support #569

Merged
merged 1 commit into from Jun 26, 2022
Merged

Added Termux support #569

merged 1 commit into from Jun 26, 2022

Conversation

T1erno
Copy link
Contributor

@T1erno T1erno commented Apr 21, 2022

Before:
Screenshot_2022-04-21-14-49-02-532

After:
Screenshot_2022-04-21-14-54-31-912

cme/first_run.py Outdated
@@ -13,6 +13,8 @@
TMP_PATH = os.path.join('/tmp', 'cme_hosted')
if os.name == 'nt':
TMP_PATH = os.getenv('LOCALAPPDATA') + '\\Temp\\cme_hosted'
if check_output(['uname', '-o']).strip() == b'Android':
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we do something more simple with os.name ?

Copy link
Contributor Author

@T1erno T1erno Jun 19, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In Termux, running os.name gives "posix" as a result, however other platforms like Mac Os, Solaris or FreeBSD, etc, also give "posix" as a result when you run os.name . So if CrackMapExec was installed with os.name = "posix" the paths to the tmp directory would change for Mac Os, Solaris or FreeBSD, etc.

if check_output(['uname', '-o']).strip() == b'Android': is used, we can isolate the directory /data/data/com.termux/files/usr/tmp/ = TMP_PATH only for the Termux system.

Screenshot_2022-06-19-13-30-53-740

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The first resource distinguishes Android from another operating system but the second does not:

Termux:
Screenshot_2022-06-19-14-16-08-527

Gentoo:
Screenshot_20220619_141332

However, to apply the change with that first Stack Overflow response, instead of doing a from sys import exit, you should do an import sys, because you should be able to call sys in the hasattr() function, by this way you would have to modify other parts of the code to be able to use import sys instead of from sys import exit.

Screenshot_2022-06-19-15-04-47-653

Screenshot_2022-06-19-15-04-32-607

Screenshot_2022-06-19-16-54-21-436

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok do it, just import sys

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@T1erno if you want to update go for it, i will release a new version in the next few days. Next release will be in 6 months :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is now changed :^)

@mpgn mpgn merged commit 593062e into byt3bl33d3r:master Jun 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants