Executei o conteúdo do arquivo php no bash, alguns comandos poderiam ser executados?

Executei o conteúdo do arquivo php no bash, alguns comandos poderiam ser executados?

Colei isso acidentalmente no bash como superusuário no servidor de produção.

Agora estou comendo unhas.

Examinei cada linha e a maioria delas produz erros de sintaxe. Mas existe algo maligno que pode danificar o sistema operacional do servidor? ou arquivos? ou nada?

Este é o servidor Ubuntu 14.04.

Como faço para diagnosticar quais comandos foram executados e o que eles fizeram?

A história é um lugar óbvio, mas não mostra o que foi executado e por qual programa. Existe uma maneira de diagnosticar esse tipo de estupidez?

<?php
/**
 * The base configurations of the WordPress.
 *
 * This file has the following configurations: MySQL settings, Table Prefix,
 * Secret Keys, WordPress Language, and ABSPATH. You can find more information
 * by visiting {@link http://codex.wordpress.org/Editing_wp-config.php Editing
 * wp-config.php} Codex page. You can get the MySQL settings from your web host.
 *
 * This file is used by the wp-config.php creation script during the
 * installation. You don't have to use the web site, you can just copy this file
 * to "wp-config.php" and fill in the values.
 *
 * @package WordPress
 */

// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', '');

/** MySQL database username */
define('DB_USER', '');

/** MySQL database password */
define('DB_PASSWORD', '');

/** MySQL hostname */
define('DB_HOST', 'localhost');

/** Database Charset to use in creating database tables. */
define('DB_CHARSET', 'utf8');

/** The Database Collate type. Don't change this if in doubt. */
define('DB_COLLATE', '');

/**#@+
 * Authentication Unique Keys and Salts.
 *
 * Change these to different unique phrases!
 * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}
 * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.
 *
 * @since 2.6.0
 */
define('AUTH_KEY',         'N%___i}IF<(o&h<;|_/0g-OYxEeU)Pq_JM@x!`S^-*[*$$#`|Lp|4R|');
define('SECURE_AUTH_KEY',  '.JyD{}94,kBQB`>&>)sT@4bMl|}SxJQ~ 1NUw^RdQ;QrLVC#].#64k');
define('LOGGED_IN_KEY',    '2ClY{7eA4933w3qEQ(L>o<{`WD|t-b4B<KW;psm6qa_Mmk.f~N1$]8');
define('NONCE_KEY',        ' $QAiTez.wIq_},tNekyQYgU3:;>y-[LT-vR8X{r+kuG-t!C>');
define('AUTH_SALT',        '!#0MnA@UTy]~CN#[Akn-2M<fEuGjSH,*Bu7B[!@@.owHb:G-_PXvP_');
define('SECURE_AUTH_SALT', '%DXWY0|+SkU%!aC.aXG#T{ |YZE|X.VyfVx8QW:bX+2sZ(7cw98i');
define('LOGGED_IN_SALT',   '{d}Pn%i>?B &Q@#Dw+*Xal^eD`xK4wet8=k+F9Tr2}2H75.@+{g+)');
define('NONCE_SALT',       ']3gOf&v-43GEe`hOqnu_1TwZeqU!ZIm-8}Lm1&0;pW7d`,4[QTT');

/**#@-*/

/**
 * WordPress Database Table prefix.
 *
 * You can have multiple installations in one database if you give each a unique
 * prefix. Only numbers, letters, and underscores please!
 */
$table_prefix  = 'wp_';

/**
 * For developers: WordPress debugging mode.
 *
 * Change this to true to enable the display of notices during development.
 * It is strongly recommended that plugin and theme developers use WP_DEBUG
 * in their development environments.
 */
define('WP_DEBUG', false);

/* That's all, stop editing! Happy blogging. */

/** Absolute path to the WordPress directory. */
if ( !defined('ABSPATH') )
    define('ABSPATH', dirname(__FILE__) . '/');

/** Sets up WordPress vars and included files. */
require_once(ABSPATH . 'wp-settings.php');

Responder1

Se isso aconteceu em um diretório com arquivos (não ocultos), então qualquer linha que comece com *será expandida para uma lista de arquivos (não ocultos) no diretório e tentará executar o primeiro como um comando 1 . Se você tiver .no seu PATH, ele tentará executaraquele arquivo; se não for executável, você receberá um erro. Se você não tiver .no seu PATH, ele tentará executar um comando com esse nome. Por exemplo, no caso improvável de seu diretório atual conter os arquivos

rm
romeo
sierra
tango

então o

* The base configurations of the WordPress.

comando irá expandir como

rm romeo sierra tango The base configurations of the WordPress.

Espero que você já tenha notado se isso tivesse acontecido (mas aconselho você a fazer um echo *para ver se o primeiro arquivo é um comando válido).

Há uma preocupação semelhante com as linhas que começam /**, mas isso provavelmente se expandirá para algo como /bin /dev /etc /home /lib …, o que resultará em

bash: /bin: is a directory

No caso improvável de você ter uma variável shell chamada table_prefix, então

$table_prefix  = 'wp_';

irá expandir essa variável e tentar executá-la. Se table_prefixnão estiver definido, o texto acima tentará ser executado =como um comando (e que eu saiba, não existe tal comando em sistemas Unix padrão).

Nada mais me parece um problema.


1   A menos que haja algo mais na linha que torne um erro de sintaxe, como um arquivo ).

informação relacionada