rpwnage / EggShell-Community-Fork

Community fork of the eggshell iOS/macOS/Linux Remote Administration Tool
GNU General Public License v2.0
31 stars 6 forks source link

Perhaps isolated issues #9

Open acheong08 opened 3 years ago

acheong08 commented 3 years ago

[*] [Errno 2] No such file or directory: 'resources/esplmacos' Should we compile it ourselves?

acheong08 commented 3 years ago

Many commands such as 'whoami' and other shell commands do not seem to be working

acheong08 commented 3 years ago

persistence install also not working

acheong08 commented 3 years ago

Modules appear to work properly when using pre-compiled esplmacos from the original repo

acheong08 commented 3 years ago

Why was esplmacos removed in https://github.com/RPwnage/EggShell-Community-Fork/commit/937fcb9cd59b1919603bc308e5ec1d6099edba17#diff-41d311a605520fc7b8b9a980a79437a26e26cebcbfdd569dd78d30f7cb3e7237 ?

rpwnage commented 3 years ago

https://github.com/RPwnage/EggShell-Community-Fork/releases/tag/0.1

rpwnage commented 3 years ago

persistence install also not working

Yes, I'm aware of some persistence scripts being broken right now. I'm fixing them right now, and will push a fix soon.

[*] [Errno 2] No such file or directory: 'resources/esplmacos' Should we compile it ourselves?

Yes, some versions don't include prebult binaries.

acheong08 commented 3 years ago

New binaries continue to have issues with executing shell commands

acheong08 commented 3 years ago

How do you compile the esplios?

Makefile:1: /makefiles/common.mk: No such file or directory
Makefile:18: /tool.mk: No such file or directory
make: *** No rule to make target `/tool.mk'.  Stop.
acheong08 commented 3 years ago

Nevermind. Have to install THEOS. But now this error shows up

 $ make ios       
Compiling iOS Sources (tool)...
==> Cleaning…
==> Notice: Build may be slow as Theos isn’t using all available CPU cores on this computer. Consider upgrading GNU Make: https://github.com/theos/theos/wiki/Parallel-Building
> Making all for tool esplios…
==> Compiling src/main.mm (arm64)…
src/main.mm:9:9: fatal error: 'Foundation/Foundation.h' file not found
#import <Foundation/Foundation.h>
        ^~~~~~~~~~~~~~~~~~~~~~~~~
src/main.mm:9:9: note: did not find header 'Foundation.h' in framework
      'Foundation' (loaded from '/System/Library/Frameworks')
1 error generated.
make[4]: *** [/Users/ac/EggShellCF/src/esplios/.theos/obj/debug/arm64/src/main.mm.de5776f6.o] Error 1
make[3]: *** [/Users/ac/EggShellCF/src/esplios/.theos/obj/debug/arm64/esplios] Error 2
make[2]: *** [internal-tool-all_] Error 2
make[1]: *** [esplios.all.tool.variables] Error 2
dpkg-deb: error: failed to read archive 'packages/*': No such file or directory
mv: new/usr/bin/esplios: No
rpwnage commented 3 years ago

Do you have Theos installed with the correct SDKs? If you’re using the precompiled binaries there’s no need to

make

rpwnage commented 3 years ago

If you’re just trying to use it just run eggshell.py. There’s no need to compile if you’re not planing on modifying the code etc

acheong08 commented 3 years ago

Do you have Theos installed with the correct SDKs? If you’re using the precompiled binaries there’s no need to

make

I have installed Theos following the instructions from https://github.com/theos/theos/wiki/Installation-macOS

acheong08 commented 3 years ago

I got my SDKs from https://github.com/xybp888/iOS-SDKs

acheong08 commented 3 years ago
Compiling iOS Sources (tool)...
==> Cleaning…
==> Notice: Build may be slow as Theos isn’t using all available CPU cores on this computer. Consider upgrading GNU Make: https://github.com/theos/theos/wiki/Parallel-Building
> Making all for tool esplios…
==> Compiling src/main.mm (arm64)…
src/main.mm:77:5: error: use of undeclared identifier 'OPENSSL_init_ssl'
    OPENSSL_init_ssl(0, NULL);
    ^
src/main.mm:78:34: error: use of undeclared identifier 'TLS_client_method'; did
      you mean 'TLSv1_client_method'?
    ssl_client_ctx = SSL_CTX_new(TLS_client_method());
                                 ^~~~~~~~~~~~~~~~~
                                 TLSv1_client_method
/opt/theos/vendor/include/openssl/ssl.h:1488:13: note: 'TLSv1_client_method'
      declared here
SSL_METHOD *TLSv1_client_method(void);  /* TLSv1.0 */
            ^
2 errors generated.
make[4]: *** [/Users/ac/EggShellCF/src/esplios/.theos/obj/debug/arm64/src/main.mm.401803e7.o] Error 1
make[3]: *** [/Users/ac/EggShellCF/src/esplios/.theos/obj/debug/arm64/esplios] Error 2
make[2]: *** [internal-tool-all_] Error 2
make[1]: *** [esplios.all.tool.variables] Error 2
dpkg-deb: error: failed to read archive 'packages/*': No such file or directory
mv: new/usr/bin/esplios: No such file or directory
make: *** [ios] Error 1
acheong08 commented 3 years ago

Replaced 'TLS_client_method' with 'TLSv1_client_method' and OPENSSL_init_ssl(0, NULL); with SSL_load_error_strings(); SSL_library_init(); OpenSSL_add_all_algorithms(); Now this happens:

 $ make ios
Compiling iOS Sources (tool)...
make[1]: Entering directory '/Users/ac/EggShellCF/src/esplios'
==> Cleaning…
make[1]: Leaving directory '/Users/ac/EggShellCF/src/esplios'
make[1]: Entering directory '/Users/ac/EggShellCF/src/esplios'
> Making all for tool esplios…
==> Compiling src/main.mm (arm64)…
==> Compiling src/espl.m (arm64)…
==> Linking tool esplios (arm64)…
Undefined symbols for architecture arm64:
  "_OPENSSL_add_all_algorithms_noconf", referenced from:
      connectToServer(NSDictionary*) in main.mm.401803e7.o
  "_SSL_library_init", referenced from:
      connectToServer(NSDictionary*) in main.mm.401803e7.o
  "_SSL_load_error_strings", referenced from:
      connectToServer(NSDictionary*) in main.mm.401803e7.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[4]: *** [/opt/theos/makefiles/instance/tool.mk:20: /Users/ac/EggShellCF/src/esplios/.theos/obj/debug/arm64/esplios] Error 1
make[3]: *** [/opt/theos/makefiles/instance/tool.mk:20: /Users/ac/EggShellCF/src/esplios/.theos/obj/debug/arm64/esplios] Error 2
make[2]: *** [/opt/theos/makefiles/instance/tool.mk:11: internal-tool-all_] Error 2
make[1]: *** [/opt/theos/makefiles/master/rules.mk:117: esplios.all.tool.variables] Error 2
make[1]: Leaving directory '/Users/ac/EggShellCF/src/esplios'
dpkg-deb: error: failed to read archive 'packages/*': No such file or directory
mv: new/usr/bin/esplios: No such file or directory
make: *** [makefile:3: ios] Error 1
rpwnage commented 3 years ago

You should put the correct openssl libs into your theos library folder ($THEOOS/lib)

acheong08 commented 3 years ago

I'm sorry, a bit new at compiling for IOS. Where do I get the openssl libs? I have openssl@1.0 and openssl@1.1 installed with homebrew.

rpwnage commented 3 years ago

You need to install the OpenSSL libs for the correct architectures (arm64, arm64e). I will create a script to install them automatically and link it.