О полезных инструментах

Как работает загрузка бинарника?

ld-linux

два ld-linux-а (64 / 32)

ldd (ldd 32-разр)

objdump / readelf

file / иное?

strace

Binfmt

admin-guide/binfmt-misc

# echo ':python:M::# Trusted Python::/usr/bin/python:C' > /proc/sys/fs/binfmt_misc/register
# cat /proc/sys/fs/binfmt_misc/python
 enabled
 interpreter /usr/bin/python
 flags: OC
 offset 0
 magic 23205472757374656420507974686f6e

$ cat /usr/local/bin/pytest
 # Trusted Python
 import os, prctl
 print "eUID %d / UID %d"%(os.geteuid(),os.getuid())
 print "net_admin", prctl.cap_permitted.net_admin
$ /usr/local/bin/pytest
 eUID 500 / UID 500
 net_admin False

$ /usr/local/bin/pytest
 eUID 500 / UID 500
 net_admin False
# chmod +s /usr/local/bin/pytest
$ /usr/local/bin/pytest
 eUID 0 / UID 500
 net_admin False
# chmod -s /usr/local/bin/pytest
# setcap "cap_net_admin+eip" /usr/local/bin/pytest
$ /usr/local/bin/pytest
 eUID 500 / UID 500
 net_admin True

И https://www.altlinux.org/Qemu-user-binfmt_misc то же про qemu-mipsel

LecturesCMC/Linux2017/07_Instruimentary (последним исправлял пользователь eSyr 2017-04-14 13:43:45)