So, I was recently installing a PlugBot and decided to use the latest version of Raspbian instead of the older version Jesse + Pixel. This meant that a few of the installation steps either did not work or just failed as I went through the installation.

If you don’t know what a PlugBot is then go here: https://www.redteamsecure.com/the-plugbot-hardware-botnet-research-project/

The first thing to note is that the current steps had me using “PhP5” which has some weird issues when you use the latest version of Raspbian. Below are the commands I had to run to resolve various errors as I was setting it up:

PhP Installation and Setup

1. Do not install “php5-mysql” as it fails on installation
2. Modify all installation options for “PhP5” to be “PhP7.0” instead

Phpmyadmin Installation and Setup

1. Had permission denied creating databases as “phpmyadmin” account. In terminal run:

mysql --user=root mysql
CREATE USER 'phpmyadmin'@'localhost' IDENTIFIED BY 'some_pass';
GRANT ALL PRIVILEGES ON *.* TO 'phpmyadmin'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;

2. Re-login into the “phpmyadmin” site and permission is now restored

Plugbot Installation and Setup

1. Had specific issues with initial site not loading “/index.php/home/setup“, had to add “.htaccess“, with the following:

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteBase /
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>

<IfModule !mod_rewrite.c>
  ErrorDocument 404 /index.php
</IfModule>

2. Had to then modify the following:

nano /var/www/pb/application/config/database.php
Change $db['default']['dbdriver'] = 'mysql'; to be $db['default']['dbdriver'] = 'mysqli';

3. Site failed with “mcrypt” extension error, resolved by making sure the latest version is installed then doing this:

nano /etc/php/7.0/cli/php.ini
add "extension=mcrypt.so"
nano /etc/php/7.0/apache2/php.ini
add "extension=mcrypt.so"
service apache2 restart

The PlugBot now loads as expected. Note also that some of these commands will need to be done on the Command Center if you are using a Raspberry PI.