Executando comandos através do PHP
Publicado por Perfil removido (última atualização em 01/02/2011)
[ Hits: 8.896 ]
Um simples exemplo de como executar syscalls através do PHP. O retorno do comando é impresso na tela.
[]s
<?php /* * To change this template, choose Tools | Templates * and open the template in the editor. */ /** * Description of PHP_CMD_Exec * * @author ox */ ?> <html> <head> <title> PHPShell </title> </head> <body> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" enctype="multipart/form-data"> <label id="labelCommand" for="inputCommand">Comando: </label> <input type="text" id="inputCommand" name="inputCommand"/> <input type="submit" value="Executar"/> </form> <fieldset> <legend style="font-size: 12px; color: green;">Output</legend> <?php $command = $_POST['inputCommand']; passthru($command); echo $commandReturn; ?> </fieldset> </body> </html>
Lista de Tarefas - Gerenciador de Projeto Simples
Transformar datas para gravar no banco de dados (MySQL, Postgres e outros)
Aprenda a Gerenciar Permissões de Arquivos no Linux
Como transformar um áudio em vídeo com efeito de forma de onda (wave form)
Como aprovar Pull Requests em seu repositório Github via linha de comando
Visualizar arquivos em formato markdown (ex.: README.md) pelo terminal
Dando - teoricamente - um gás no Gnome-Shell do Arch Linux
Como instalar o Google Cloud CLI no Ubuntu/Debian
Mantenha seu Sistema Leve e Rápido com a Limpeza do APT!
Procurando vídeos de YouTube pelo terminal e assistindo via mpv (2025)
Zorin OS - Virtual Box não consigo abrir maquinas virtuais (1)
O que você está ouvindo agora? [2] (180)