Let’s take a look at the main functions of the PHPoC debugger, software used to develop and manage PHPoC devices.
You must install this program before using PHPoC. About the debugger itself, we already had a lot of material “PHPoC Debugger” on our site pages.
Uploading files to PHPoC
Php files on the local computer can be uploaded to PHPoC.
Ways to add files to the file list
1. Drag & Drop
Select and drag files in the window explorer to the file list window.
2. Menu “Add”
Clicking the Add button after right-clicking on the file list will create a window for selecting files. The files selected in the windows are added to the file list.
Uploading files
Files from the file list will be uploaded to the P4S-341 by clicking the upload button (
). If the download is complete, both files in the file list and in the P4S-341 are synchronized and the icons change to ().
Loading an integrated .poc file
You can download an integrated file (.poc) using the procedures below.
1. Click [File] > [Upload a poc file] on the menu.
2. Click [Open] after selection .poc-file.
3. Press the button [Upload flash files]…
4. Choose “yes” or “no” to delete existing flash files.
Attention: If you choose [Да], all flash files saved in PHPoC will be deleted.
5. Click [OK]to complete the file upload .poc…
Download files to PC
1. Select files in the file list
2. Click [File] > [Save selected file(s)] on the menu
3. Select a path and click the button [OK]…
Saving as an integrated file (.poc)
If you want to save all files in the file list as one file, use the menu [Save a poc file] (Save the .poc file).
“.poc” is the filename extension. Enter a file name and click [Save]…
Practice
Creating init.php
Note: PHPoC exploitation
PHPoC looking for a file init.php after loading. If PHPoC does not find a file named init.php, it doesn’t run the code. Therefore, you need to compose or download init.php to the PHPoC file system.
You can write the main script in init.phpbut PHPoC only runs the file once. If you want to run their code more than once, write the main script to another file and load the file using the command
php
system function. The file loaded by the system function is started repeatedly, and even execution is terminated.
Right click on the file list and select menu [New] (Create).
Enter init in the file name field.
select a file init.php in the file list.
Enter the following command lines into the editor.
<?php
echo "Hello, PHPoCrn";
?>
Click the download button (
).
After PHPoC finishes downloading the files, the icon will change from
on …
Run script
PHPoC automatically runs the script when the file system is started or loaded. You can find the result in the PHPoC debugger output window.
If the option is enabled [PHP debug mode] (PHP debug mode) of PHPoC debugger, PHPoC does not automatically execute the script. You can manually run the script by clicking the Run button
…
Using PSP examples
PHPoC Support Package (PSP, PHPoC Support Package) contains libraries and code examples.
This package is designed to help you use PHPoC comfortably. Download it to your local computer before starting the trial run.
Sample selection
PSP contains many examples of using different sensors. Select the example you are interested in and upload the files to PHPoC. There are three categories.
- Examples of basic tasks. These examples require downloading as “init.php“and”task0.php“.
- Examples of web tasks. These examples require downloading “index.php“and a set of image files, if any.
- Examples of both basic and web tasks. These examples require downloading “init.php“,”task0.php“and”index.php“, including a set of image files, if any.
Using examples
Find and download an example 00.hello in the folder p4s / 01.php_task…
Immediately after downloading the files, you can find a message about the result.