File tree Expand file tree Collapse file tree 6 files changed +70
-2
lines changed
src/main/java/org/joychou Expand file tree Collapse file tree 6 files changed +70
-2
lines changed Original file line number Diff line number Diff line change 6060 <orderEntry type =" library" name =" Maven: mysql:mysql-connector-java:8.0.12" level =" project" />
6161 <orderEntry type =" library" name =" Maven: com.google.protobuf:protobuf-java:2.6.0" level =" project" />
6262 <orderEntry type =" library" name =" Maven: com.alibaba:fastjson:1.2.49" level =" project" />
63- <orderEntry type =" library" name =" Maven: org.jdom:jdom2:2.0.4 " level =" project" />
63+ <orderEntry type =" library" name =" Maven: org.jdom:jdom2:2.0.6 " level =" project" />
6464 <orderEntry type =" library" name =" Maven: org.dom4j:dom4j:2.1.1" level =" project" />
65+ <orderEntry type =" library" name =" Maven: org.apache.shiro:shiro-web:1.3.2" level =" project" />
66+ <orderEntry type =" library" name =" Maven: org.apache.shiro:shiro-core:1.3.2" level =" project" />
6567 <orderEntry type =" library" name =" Maven: com.google.guava:guava:21.0" level =" project" />
6668 <orderEntry type =" library" name =" Maven: commons-collections:commons-collections:3.1" level =" project" />
6769 <orderEntry type =" library" name =" Maven: commons-lang:commons-lang:2.4" level =" project" />
Original file line number Diff line number Diff line change 7171 <artifactId >dom4j</artifactId >
7272 <version >2.1.1</version >
7373 </dependency >
74-
74+
7575
7676 <!-- 获取url根域名-->
7777 <dependency >
Original file line number Diff line number Diff line change 1+ package org .joychou .RMI ;
2+
3+ import java .rmi .registry .LocateRegistry ;
4+ import java .rmi .registry .Registry ;
5+
6+ public class Client {
7+
8+ private Client () {}
9+
10+ public static void main (String [] args ) {
11+ try {
12+ Registry registry = LocateRegistry .getRegistry ("localhost" );
13+ Hello stub = (Hello ) registry .lookup ("Hello" );
14+ String response = stub .sayHello ();
15+ System .out .println ("response: " + response );
16+ } catch (Exception e ) {
17+ System .err .println ("Client exception: " + e .toString ());
18+ e .printStackTrace ();
19+ }
20+ }
21+ }
Original file line number Diff line number Diff line change 1+ package org .joychou .RMI ;
2+
3+ import java .rmi .Remote ;
4+ import java .rmi .RemoteException ;
5+
6+ // 定义远程接口
7+ public interface Hello extends Remote {
8+ String sayHello () throws RemoteException ;
9+ }
Original file line number Diff line number Diff line change 1+ package org .joychou .RMI ;
2+
3+ import java .rmi .registry .LocateRegistry ;
4+ import java .rmi .registry .Registry ;
5+ import java .rmi .server .UnicastRemoteObject ;
6+
7+
8+
9+ public class Server implements Hello {
10+
11+ public String sayHello () {
12+ return "Hello Word!" ;
13+ }
14+
15+ public static void main (String args []) {
16+
17+ try {
18+ Server obj = new Server ();
19+ Hello stub = (Hello ) UnicastRemoteObject .exportObject (obj , 0 );
20+ LocateRegistry .createRegistry (1099 );
21+ Registry registry = LocateRegistry .getRegistry ();
22+ registry .bind ("Hello" , stub );
23+ System .out .println ("绑定1099端口成功" );
24+ } catch (Exception e ) {
25+ System .err .println ("Server exception: " + e .toString ());
26+ e .printStackTrace ();
27+ }
28+ }
29+ }
30+
Original file line number Diff line number Diff line change 11package org .joychou .controller ;
22
33import org .springframework .stereotype .Controller ;
4+ import org .springframework .web .bind .annotation .GetMapping ;
45import org .springframework .web .bind .annotation .RequestMapping ;
6+ import org .springframework .web .bind .annotation .RequestParam ;
57import org .springframework .web .bind .annotation .ResponseBody ;
68
79import javax .servlet .RequestDispatcher ;
2022@ RequestMapping ("/urlRedirect" )
2123public class URLRedirect {
2224
25+ @ GetMapping ("/redirect" )
26+ public String redirect (@ RequestParam ("url" ) String url ) {
27+ return "redirect:" + url ;
28+ }
2329 /**
2430 * @disc: 存在URL重定向漏洞
2531 * @fix: 添加URL白名单 https://github.com/JoyChou93/trident/blob/master/src/main/java/CheckURL.java
You can’t perform that action at this time.
0 commit comments