Note to self: PlugBot on Raspberry PI (Raspbian) + PhP7, fixes

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.

Liam Cleary

I began my career as a Trainer of all things computer related. However, I very quickly realized that programming, breaking, and hacking was a lot more fun. I then spent the next few years working on core infrastructure and security services, until I found SharePoint. I am now the founder and owner of SharePlicity, a consulting company that focuses on all areas of Technology. My role within SharePlicity is to help organizations implement technology that will enhance internal and external collaboration, document and records management, automate business processes and of course security controls and protection. I am also an eleven-time Microsoft MVP focusing on Architecture but also cross the boundary into Development. My specialty over the past few years has been security in SharePoint and its surrounding platforms. I can also be found at user groups or conferences speaking, offering advice, spending time in the community, teaching my kids how to code, raspberry PI programming, hacking the planet or building Lego robots.

You may also like...