Skip to content

Commit 9acefb2

Browse files
committed
add jwt
1 parent e4190d6 commit 9acefb2

File tree

3 files changed

+22
-1
lines changed

3 files changed

+22
-1
lines changed

java-sec-code.iml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,5 +221,6 @@
221221
<orderEntry type="library" name="Maven: commons-beanutils:commons-beanutils:1.9.4" level="project" />
222222
<orderEntry type="library" name="Maven: io.jsonwebtoken:jjwt:0.9.1" level="project" />
223223
<orderEntry type="library" name="Maven: com.auth0:java-jwt:4.0.0" level="project" />
224+
<orderEntry type="library" name="Maven: cn.hutool:hutool-all:5.8.10" level="project" />
224225
</component>
225226
</module>

pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,12 @@
300300
<version>4.0.0</version>
301301
</dependency>
302302

303+
<dependency>
304+
<groupId>cn.hutool</groupId>
305+
<artifactId>hutool-all</artifactId>
306+
<version>5.8.10</version>
307+
</dependency>
308+
303309
</dependencies>
304310

305311
<dependencyManagement>

src/main/java/org/joychou/controller/SSRF.java

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package org.joychou.controller;
22

3+
import cn.hutool.http.HttpUtil;
34
import org.joychou.security.SecurityUtil;
45
import org.joychou.security.ssrf.SSRFException;
56
import org.joychou.service.HttpService;
@@ -273,7 +274,7 @@ public String HttpSyncClients(@RequestParam("url") String url) {
273274

274275

275276
/**
276-
* http://127.0.0.1:8080/ssrf/restTemplate/vuln?url=http://www.baidu.com <p>
277+
* http://127.0.0.1:8080/ssrf/restTemplate/vuln1?url=http://www.baidu.com <p>
277278
* Only support HTTP protocol. <p>
278279
* Redirects: GET HttpMethod follow redirects by default, other HttpMethods do not follow redirects<p>
279280
* User-Agent: Java/1.8.0_102 <p>
@@ -294,5 +295,18 @@ public String RestTemplateUrl(String url){
294295
}
295296

296297

298+
/**
299+
* http://127.0.0.1:8080/ssrf/hutool/vuln?url=http://www.baidu.com <p>
300+
* UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36 Hutool<p>
301+
* Redirects: Do not follow redirects <p>
302+
*
303+
* @param url url
304+
* @return contents of url
305+
*/
306+
@GetMapping("/hutool/vuln")
307+
public String hutoolHttp(String url){
308+
return HttpUtil.get(url);
309+
}
310+
297311

298312
}

0 commit comments

Comments
 (0)