-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Conversation
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': |
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you check this https://stackoverflow.com/a/70710536 or https://stackoverflow.com/a/66174754 ?
There was a problem hiding this comment.
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:
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
.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is now changed :^)
Before:
After: