Skip to content

Demo page

This page demonstrates how placeholders can be used. You can view the relevant files on GitHub:

  • docs/demo.md: the page's markdown with the placeholders and the input fields.
  • placeholder-plugin.yaml: Defines the page's placeholders. The relevant values are named DEMO_* and are at/near the top of the file.

Inputs

Expand to show general placeholder settings

Enter the values for your variables here:

Variable Value
Server IP
Server port
Binding to port requires sudo
File name to transfer
Netcat binary
HTTP client

These are your variables. They are also set for all other page (like the test page). However after changing them, you need to may need to reload the page to show the new values (depends on the configuration, here it should not be required).

Below you can see the placeholders in action.

Transfer files

You can transfer various files on Linux systems using common command line tools. This assumes, that you want to transfer the file "xDEMO_FILENAMEx" to/from the server with the IP address xDEMO_SERVER_IPx. To successfully transfer the files, you need shell access (for example via SSH) to both systems (the server and the client).

netcat

upload (client -> server)

On the server run:

xDEMO_SUDOxxDEMO_NETCATx -lnp xDEMO_SERVER_PORTx | tee xDEMO_FILENAMEx

Then run the following on the client:

cat xDEMO_FILENAMEx | xDEMO_NETCATx xDEMO_SERVER_IPx xDEMO_SERVER_PORTx

download (server -> client)

On the server run:

cat xDEMO_FILENAMEx | xDEMO_SUDOxxDEMO_NETCATx -lnp xDEMO_SERVER_PORTx

Then run the following on the client:

xDEMO_NETCATx xDEMO_SERVER_IPx xDEMO_SERVER_PORTx | tee xDEMO_FILENAMEx

download with curl & python (server -> client)

This can be used to transfer files from the server to the client. Start an HTTP server on the server. Do not start it in your home directory, since all files in the directory will be made available:

mkdir public
cd public
cp ../xDEMO_FILENAMEx .
xDEMO_SUDOxpython -m http.server xDEMO_SERVER_PORTx

On the client run:

xDEMO_HTTP_CLIENT_COMMANDx

Computed placeholders demo

Computed placeholders automatically derive their value from other placeholders using your own JavaScript function. This allows you to do more complex operations, such as comparing or encoding values and much more.

For example you can enter text here:

After you press enter, the placeholders below get updated:

Encoding scheme Value
Original value xVALUE_TO_ENCODEx
Hex xVALUE_HEXx
Base64 xVALUE_BASE64x
URL xVALUE_URLx
HTML xVALUE_HTMLx