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

Create apache-shenyu-gateway-admin-detect.yaml #10454

Merged
merged 2 commits into from
Aug 14, 2024

Conversation

icarot
Copy link
Contributor

@icarot icarot commented Aug 4, 2024

This nuclei template:

  • Detects a Apache ShenYu Gateway web application, a Java native API Gateway for service proxy, protocol conversion and API governance.
  • References:

https://github.com/apache/shenyu

I've validated this template locally?

  • YES
  • NO

Steps to test:

Apache ShenYu Docker:

  1. Download the Docker images:
    $ docker pull apache/shenyu-admin
    $ docker pull apache/shenyu-bootstrap

  2. Running container:
    $ docker run -d --name shenyu-admin-quickstart -p 9095:9095 --net shenyu apache/shenyu-admin
    $ docker run -d --name shenyu-quickstart -p 9195:9195 -e "shenyu.local.enabled=true" -e SHENYU_SYNC_WEBSOCKET_URLS=ws://shenyu-admin-quickstart:9095/websocket --net shenyu apache/shenyu-bootstrap

  3. Get the IP Address of Apache ShenYu Gateway:
    $ docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' shenyu-admin-quickstart
    $ docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' shenyu-quickstart

  4. Configure the Apache ShenYu:
    $ curl --location --request POST 'http://<shenyu-quickstart_IP_ADDRESS>:9195/shenyu/plugin/selectorAndRules' \ --header 'Content-Type: application/json' \ --header 'localKey: 123456' \ --data-raw '{ "pluginName": "divide", "selectorHandler": "[{\"upstreamUrl\":\"127.0.0.1:8080\"}]", "conditionDataList": [{ "paramType": "uri", "operator": "match", "paramValue": "/**" }], "ruleDataList": [{ "ruleHandler": "{\"loadBalance\":\"random\"}", "conditionDataList": [{ "paramType": "uri", "operator": "match", "paramValue": "/**" }] }] }'

4.And the access URL will be http://<shenyu-admin-quickstart-obteined_inspect_IP_Address>:9095/

Nuclei execution:

$ ~/go/bin/nuclei -t apache-shenyu-gateway-detect.yaml -u "http://<local_machine_or_shenyu-admin-quickstart_IP_Address>:9095" -H "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36"

image

image

Detects a Apache Shenyu Gateway Management System, a Java native API Gateway for service proxy, protocol conversion and API governance.
@ritikchaddha ritikchaddha self-assigned this Aug 4, 2024
@GeorginaReeder
Copy link

Thanks for your contribution @icarot !

@DhiyaneshGeek DhiyaneshGeek added the Done Ready to merge label Aug 14, 2024
@DhiyaneshGeek DhiyaneshGeek self-requested a review August 14, 2024 00:07
@DhiyaneshGeek DhiyaneshGeek merged commit ddcb631 into projectdiscovery:main Aug 14, 2024
3 checks passed
@DhiyaneshGeek
Copy link
Member

Hi @icarot

Thanks for sharing this template to the community and contributing to the template project 😄

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

Successfully merging this pull request may close these issues.

4 participants