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

Adding simple value-sharing mechanism between templates #1162

Closed
Tracked by #1164
ehsandeep opened this issue Oct 21, 2021 · 2 comments · Fixed by #2576
Closed
Tracked by #1164

Adding simple value-sharing mechanism between templates #1162

ehsandeep opened this issue Oct 21, 2021 · 2 comments · Fixed by #2576
Assignees
Labels
Priority: High After critical issues are fixed, these should be dealt with before any further issues. Status: Completed Nothing further to be done with this issue. Awaiting to be closed. Type: Enhancement Most issues will probably ask for additions or changes.
Milestone

Comments

@ehsandeep
Copy link
Member

Please describe your feature request:

A mechanism to define and share values between other templates during scan time using extractors, the idea is is to have information saved and accessible globally during the scan time regardless of the type of templates, which enabled to write complex workflows using a combination of multi-type templates, i.e read values from DNS template to be used in HTTP or network.

Describe the use case of this feature:

  • Write a template to "login into the website" and store the session in a global variable and reuse the same session to run multiple other authenticated templates.
  • Run DNS template, get some values to use with other HTTP templates or Network templates.

Example templates:-

Login Template
id: wordpress-login

info:
  name: Test RAW Template
  author: pdteam
  severity: info

requests:
  - raw:
      - |
        GET / HTTP/1.1
        Host: {{Hostname}}

      - |
        POST /wp-login.php HTTP/1.1
        Host: {{Hostname}}
        Content-Type: application/x-www-form-urlencoded
        
        log=wordpress&pwd=Hacker%40321&rememberme=forever&wp-submit=Log+In

    matchers-condition: and
    matchers:
      - type: word
        name: wordpress-login
        part: header
        words:
          - "/wp-admin/"

    extractors:
      - type: regex
        name: session
        internal: true
        part: header
        regex:
          - "wordpress_[a-z0-9]+=([A-Za-z0-9%]+)"
Authenthicated Template
id: admin

info:
  name: Test RAW Template
  author: pdteam
  severity: info

requests:
  - raw:
      - |
        GET /wp-admin/ HTTP/1.1
        Host: {{Hostname}}
        Cookie: {{kb_get("wordpress-login:session", Input)}}

    matchers:
      - type: word
        name: admin-dashboard
        words:
          - "Dashboard"
@ehsandeep ehsandeep added the Type: Enhancement Most issues will probably ask for additions or changes. label Oct 21, 2021
@ehsandeep ehsandeep linked a pull request Oct 21, 2021 that will close this issue
@forgedhallpass forgedhallpass added the Priority: High After critical issues are fixed, these should be dealt with before any further issues. label Oct 26, 2021
@forgedhallpass forgedhallpass added Status: Completed Nothing further to be done with this issue. Awaiting to be closed. Status: In Progress This issue is being worked on, and has someone assigned. and removed Status: Completed Nothing further to be done with this issue. Awaiting to be closed. labels Oct 26, 2021
@Ice3man543 Ice3man543 linked a pull request Dec 2, 2021 that will close this issue
4 tasks
@ehsandeep ehsandeep added Status: On Hold Similar to blocked, but is assigned to someone and removed Status: In Progress This issue is being worked on, and has someone assigned. labels Dec 16, 2021
@forgedhallpass
Copy link
Contributor

Blocked by #1277

@forgedhallpass forgedhallpass added Status: Blocked There is some issue that needs to be resolved first. and removed Status: On Hold Similar to blocked, but is assigned to someone labels Dec 16, 2021
@ehsandeep ehsandeep linked a pull request Sep 24, 2022 that will close this issue
4 tasks
@ehsandeep ehsandeep removed the Status: Blocked There is some issue that needs to be resolved first. label Sep 25, 2022
@Ice3man543 Ice3man543 removed their assignment Sep 26, 2022
@Mzack9999 Mzack9999 self-assigned this Sep 27, 2022
@Mzack9999
Copy link
Member

Should be covered by #2576

@ehsandeep ehsandeep added the Status: Completed Nothing further to be done with this issue. Awaiting to be closed. label Oct 3, 2022
@ehsandeep ehsandeep added this to the v2.7.8 milestone Oct 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: High After critical issues are fixed, these should be dealt with before any further issues. Status: Completed Nothing further to be done with this issue. Awaiting to be closed. Type: Enhancement Most issues will probably ask for additions or changes.
Projects
None yet
4 participants