Anonymous
Как использовать exec() для запуска chroot() + strace() через Termux?
Сообщение
Anonymous » 17 май 2024, 18:33
Нашел примеры использования exec(), но не удалось на
https://play.google.com/store/apps/deta ... com.termux
Код: Выделить всё
~/ $ cat test.cxx
#include
#include
int main(int argc, char *const* _args) {
char *args[2];
printf("1");
args[0] = "/bin/ls";
args[1] = "-lh";
execve(args[0], args, NULL);
args[1] = "";
execve(args[0], args, NULL);
execve(args[0], NULL, NULL);
args[0] = "/bin/echo";
args[1] = "u";
execve(args[0], args, NULL);
printf("2");
return 0;
}
EOF
~/ $ g++ test.cxx && ./a.out
: unknown program '''
Try ' --help' for more information
~/ $ cat test.cxx
#include
#include
int main(int argc, char *const* _args) {
char *args[2];
printf("1");
args[0] = "/bin/ls";
args[1] = "-lh";
execve(args[0], args, NULL);
args[1] = "";
execve(args[0], args, NULL);
args[0] = "/bin/echo";
args[1] = "u";
execve(args[0], args, NULL);
printf("2");
return 0;
}
EOF
~/ $ g++ test.cxx && ./a.out
12
~/ $
Хотите использовать это для автономного анализа вирусов:
https://github.com/SwuduSusuwu/SubStack ... з.cxx#L162
Мысль будет выполнять команды или выдавать ошибки с достаточным количеством информации, чтобы это исправить.
Подробнее здесь:
https://stackoverflow.com/questions/784 ... ugh-termux
1715960010
Anonymous
Нашел примеры использования exec(), но не удалось на https://play.google.com/store/apps/details?id=com.termux [code]~/ $ cat test.cxx #include #include int main(int argc, char *const* _args) { char *args[2]; printf("1"); args[0] = "/bin/ls"; args[1] = "-lh"; execve(args[0], args, NULL); args[1] = ""; execve(args[0], args, NULL); execve(args[0], NULL, NULL); args[0] = "/bin/echo"; args[1] = "u"; execve(args[0], args, NULL); printf("2"); return 0; } EOF ~/ $ g++ test.cxx && ./a.out : unknown program ''' Try ' --help' for more information ~/ $ cat test.cxx #include #include int main(int argc, char *const* _args) { char *args[2]; printf("1"); args[0] = "/bin/ls"; args[1] = "-lh"; execve(args[0], args, NULL); args[1] = ""; execve(args[0], args, NULL); args[0] = "/bin/echo"; args[1] = "u"; execve(args[0], args, NULL); printf("2"); return 0; } EOF ~/ $ g++ test.cxx && ./a.out 12 ~/ $ [/code] Хотите использовать это для автономного анализа вирусов: https://github.com/SwuduSusuwu/SubStack/blob/trunk/cxx/VirusAnaанализ.cxx#L162 Мысль будет выполнять команды или выдавать ошибки с достаточным количеством информации, чтобы это исправить. Подробнее здесь: [url]https://stackoverflow.com/questions/78496593/how-to-use-exec-to-run-chroot-strace-through-termux[/url]