Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Templating: Basics #8

Closed
3 tasks
joohoi opened this issue Jun 23, 2020 · 0 comments · Fixed by #23
Closed
3 tasks

Templating: Basics #8

joohoi opened this issue Jun 23, 2020 · 0 comments · Fixed by #23

Comments

@joohoi
Copy link
Member

joohoi commented Jun 23, 2020

The payload templates can be for example JSON structures that the payload needs to get added into.

pencode tries to read following directories on startup to determine available templates:

  • $HOME/.pencode/templates/
  • /etc/pencode/templates/

The template files which have a file extension .penc will be read into memory and the basename of the template file name will be added to pencode "action" list.

Within the payload template, a keyword #PENCODE# will be replaced with the payload read from stdin or passed from the previous step of the chain.

In the example use case in order to first base64 encode the payload, then add it to a JSON structure in a template, and to URL encode the resulting string:

We have a payload file: /home/username/.pencode/templates/json_template_example.penc, so a new "action" named json_template_example is added for pencode command.

Our command line would hence be: pencode base64 json_template_example urlencode

Subtasks for this issue:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant