execve()究竟做了什麼?我試着看文檔(http://linux.die.net/man/2/execve),但鑑於我對linux非常陌生,並且這種編程並沒有多大意義。我想要做的是能夠執行此命令:execve()做什麼?
nc -l -p someport -e /bin/sh
我可以這樣做以下(其中someport是一個數字,如4444)
char *command[2];
command[0] = "nc -l -p someport -e /bin/sh"
execve(command[0], name, NULL);
我是否正確地假設在「porthere」之後應該有逗號? – Nosrettap 2012-04-09 02:52:51
對不起,是的,這是一個錯字。定影。 – geekosaur 2012-04-09 02:55:54
下面的答案好多了 – 2014-05-05 16:53:40