elseif / MikroTikPatch

MikroTik RouterOS Patch Public Key and Generate License
589 stars 322 forks source link

7.16 python not working, not found error #46

Open capricornxl opened 1 week ago

capricornxl commented 1 week ago

image

image

ahfong2006 commented 1 week ago

same problem :(

Eman753 commented 5 days ago

Problem is still here in 7.15.3, 7.16.1, and 7.17beta2. Multiple tries to make it work, trying another $PATH with /ram/pckg/python3/bin, or moving the binaries in another location.

Pip3, python3-config, ... works, but says python3 is unreachable. Any hidden var in bash / system ?

capricornxl commented 5 days ago

I've tried the same thing you did.

The bash is a symbolic from busybox. It's actually ash.

Feels like something is hijacking the execution of a python binary, seeing it as a bash script

Eman753 commented 5 days ago

By changing the name of the python3 binary, the problem is still the same, what could mark the binary as a bash script ? That's interesting. I also tried to import a python3.11 binary from another x86 system (Debian 12), the same happened.

Executing the binary by doing "./python3.11" neither works.

capricornxl commented 5 days ago
/rw/disk/python/bin # env
LD_LIBRARY_PATH=/pckg/security/lib:/pckg/ppp/lib:/pckg/hotspot/lib:/pckg/extra-nic/lib:/pckg/dhcp/lib:/pckg/python3/lib:/pckg/rose-storage/lib:/lib
SHLVL=1
HOME=/
OLDPWD=/rw/disk/python
arch=i386

arch=i386,is 32bit?

python3.11 open with IDA image

segment para public 'CODE' use64 means is in 64-bit mode.

I'm not sure if that's the problem.

Eman753 commented 4 days ago

The problem seems related to ash :

image

Ash won't let any binary other than the ones in Busybox be executed. I tried with different binaries I imported, even scripts won't work.

Maybe this implementation of ash does an alias each time we enter a command such as "busybox [command]". In this case, this would explain why we aren't able to launch any other binary.

I also tried compiling Python in 32 bits, the problem is the same.