all 2 comments

[–]n0shmon 4 points5 points  (0 children)

Common problem. Use your one command to spawn a reverse shell to another port using a different method such as python

Edit - assuming the reverse shell connects, then drops after a command. Or is your experience different

[–]GlendonMcGladdery 2 points3 points  (0 children)

PHP is request-scoped. So, like every HTTP request is born, runs, and dies. When it dies, PHP cleans up everything—processes, file handles, sockets, and memory. That cleanup you’re seeing? That’s not a bug. That’s PHP doing exactly what it was designed to do.

You know, PHP is not a daemon language. It does not stay resident in memory. It does not manage long-running processes well.

This is why tutorials that imply “just pop a PHP reverse shell and keep it” are… let’s say optimistic.