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

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

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/Kerrisk2017/07_Instrumentary (последним исправлял пользователь FrBrGeorge 2017-10-24 09:49:29)