Skip to content

Commit

Permalink
samples modified
Browse files Browse the repository at this point in the history
  • Loading branch information
whitel1st committed Sep 24, 2019
1 parent f1cba51 commit f26dcaf
Show file tree
Hide file tree
Showing 20 changed files with 21 additions and 20 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@

сф
```
_|_|_|
_| _| _|_| _|_|_| _|_| _|_|_| _|_|
_| _| _| _| _| _|_|_|_| _| _| _|
_| _| _| _| _| _| _| _| _|
_|_|_| _|_| _|_|_| _|_|_| _| _| _|
version 1.1
version 1.3
```


Expand All @@ -28,7 +28,7 @@ To create such documents with embedded payloads there is a famous tool called [o
But. It is not convinient to use `oxml_xxe` when you need to create hundreds of documents with payloads in different places.
So there it goes - Docem.

It works like that: You specify sample document - that is a doc that has some `magic_symbols` (in this case it is ``) that will be replaced by your refernce to a payload in case of XXE payload, or will be replaces by your XSS payload.
It works like that: You specify sample document - that is a doc that has some `magic_symbols` (in illustratuin it is `` (in program it is constant `XXCb8bBA9XX`)) that will be replaced by your refernce to a payload in case of XXE payload, or will be replaces by your XSS payload.

Also there are three different types of `payload_type` - every type determine how every `magic_symbol` will be processed for a given file in a document.
Every `payload_type` described in section `Usage`.
Expand Down
9 changes: 5 additions & 4 deletions docem.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ def document_copy_dir(paths):
# }
def document_tree_embedding_points(paths, tree, magic_symbol):

print('\nCount magic symbols')
print('\n======== Count magic symbols ========')

count_places = 0

Expand Down Expand Up @@ -423,7 +423,7 @@ def interface_print_logo():
_|_|_| _|_| _|_|_| _|_|_| _| _| _|
'''
version = '1.1'
version = '1.3'
print(logo)
print('Current version: %s\n'%version)

Expand Down Expand Up @@ -479,13 +479,14 @@ def interface_print_example():
# in future
paths = document_prepare_initial_paths(path_to_complex_file)

print('\npaths in the beginning\n',paths)
# For dubug
#print('\npaths in the beginning\n',paths)

# Create tmp directory if it is not exists
if not os.path.exists(paths["path_to_tmp"]):
os.mkdir(paths["path_to_tmp"])

print('\nCurrent setup')
print('\n=========== Current setup ===========')
print('sample file:\t\t',args.sample)
print('sample is it dir:\t',paths['sample_type_is_folder'])
print('payload mode:\t\t',args.payload_mode)
Expand Down
2 changes: 1 addition & 1 deletion samples/xss/docx/xss_sample_0_docx/[Content_Types].xml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Types xmlns="፨http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="፨xml" ContentType="application/xml"/><Default Extension="፨rels" ContentType="፨application/vnd.openxmlformats-package.relationships+xml"/><Override PartName="፨/customXml/itemProps1.xml" ContentType="application/vnd.openxmlformats-officedocument.customXmlProperties+xml"/><Override PartName="፨/docProps/app.xml" ContentType="፨application/vnd.openxmlformats-officedocument.extended-properties+xml"/><Override PartName="/docProps/core.xml" ContentType="application/vnd.openxmlformats-package.core-properties+xml"/><Override PartName="/docProps/custom.xml" ContentType="application/vnd.openxmlformats-officedocument.custom-properties+xml"/><Override PartName="፨/word/document.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml"/><Override PartName="/word/fontTable.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml"/><Override PartName="/word/settings.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml"/><Override PartName="/word/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml"/><Override PartName="/word/theme/theme1.xml" ContentType="application/vnd.openxmlformats-officedocument.theme+xml"/></Types>
<Types xmlns="XXCb8bBA9XXhttp://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="XXCb8bBA9XXxml" ContentType="application/xml"/><Default Extension="XXCb8bBA9XXrels" ContentType="XXCb8bBA9XXapplication/vnd.openxmlformats-package.relationships+xml"/><Override PartName="XXCb8bBA9XX/customXml/itemProps1.xml" ContentType="application/vnd.openxmlformats-officedocument.customXmlProperties+xml"/><Override PartName="XXCb8bBA9XX/docProps/app.xml" ContentType="XXCb8bBA9XXapplication/vnd.openxmlformats-officedocument.extended-properties+xml"/><Override PartName="/docProps/core.xml" ContentType="application/vnd.openxmlformats-package.core-properties+xml"/><Override PartName="/docProps/custom.xml" ContentType="application/vnd.openxmlformats-officedocument.custom-properties+xml"/><Override PartName="XXCb8bBA9XX/word/document.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml"/><Override PartName="/word/fontTable.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml"/><Override PartName="/word/settings.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml"/><Override PartName="/word/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml"/><Override PartName="/word/theme/theme1.xml" ContentType="application/vnd.openxmlformats-officedocument.theme+xml"/></Types>
2 changes: 1 addition & 1 deletion samples/xss/docx/xss_sample_0_docx/_rels/.rels
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="፨rId4" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="፨word/document.xml"/><Relationship Id="rId2" Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" Target="docProps/core.xml"/><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties" Target="docProps/app.xml"/><Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties" Target="docProps/custom.xml"/></Relationships>
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="XXCb8bBA9XXrId4" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="XXCb8bBA9XXword/document.xml"/><Relationship Id="rId2" Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" Target="docProps/core.xml"/><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties" Target="docProps/app.xml"/><Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties" Target="docProps/custom.xml"/></Relationships>
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="፨rId1" Type="፨http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXmlProps" Target="፨itemProps1.xml"/></Relationships>
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="XXCb8bBA9XXrId1" Type="XXCb8bBA9XXhttp://schemas.openxmlformats.org/officeDocument/2006/relationships/customXmlProps" Target="XXCb8bBA9XXitemProps1.xml"/></Relationships>
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ds:datastoreItem ds:itemID="{B1977F7D-205B-4081-913C-38D41E755F92}" xmlns:ds="፨http://schemas.openxmlformats.org/officeDocument/2006/customXml"><ds:schemaRefs><ds:schemaRef ds:uri="http://www.wps.cn/officeDocument/2013/wpsCustomData"/></ds:schemaRefs></ds:datastoreItem>
<ds:datastoreItem ds:itemID="XXCb8bBA9XX{B1977F7D-205B-4081-913C-38D41E755F92}" xmlns:ds="XXCb8bBA9XXhttp://schemas.openxmlformats.org/officeDocument/2006/customXml"><ds:schemaRefs><ds:schemaRef ds:uri="http://www.wps.cn/officeDocument/2013/wpsCustomData"/></ds:schemaRefs></ds:datastoreItem>
2 changes: 1 addition & 1 deletion samples/xss/docx/xss_sample_0_docx/docProps/app.xml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties" xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"><Template>፨Normal.dotm</Template><Pages>፨1</Pages><Words>፨0</Words><Characters>፨0</Characters><Lines>፨0</Lines><Paragraphs>0</Paragraphs><ScaleCrop>false</ScaleCrop><LinksUpToDate>false</LinksUpToDate><CharactersWithSpaces>0</CharactersWithSpaces><Application>፨WPS Office Community_10.1.0.5707_F1E327BC-269C-435d-A152-05C5408002CA</Application><DocSecurity>0</DocSecurity></Properties>
<Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties" xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"><Template>XXCb8bBA9XXNormal.dotm</Template><Pages>XXCb8bBA9XX1</Pages><Words>XXCb8bBA9XX0</Words><Characters>XXCb8bBA9XX0</Characters><Lines>XXCb8bBA9XX0</Lines><Paragraphs>0</Paragraphs><ScaleCrop>false</ScaleCrop><LinksUpToDate>false</LinksUpToDate><CharactersWithSpaces>0</CharactersWithSpaces><Application>XXCb8bBA9XXWPS Office Community_10.1.0.5707_F1E327BC-269C-435d-A152-05C5408002CA</Application><DocSecurity>0</DocSecurity></Properties>
2 changes: 1 addition & 1 deletion samples/xss/docx/xss_sample_0_docx/docProps/core.xml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<cp:coreProperties xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:dcmitype="http://purl.org/dc/dcmitype/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><dcterms:created xsi:type="፨dcterms:W3CDTF">፨2018-07-18T17:59:00Z</dcterms:created><dc:creator>፨x3nt</dc:creator><cp:lastModifiedBy>x3nt</cp:lastModifiedBy><dcterms:modified xsi:type="dcterms:W3CDTF">2018-07-18T18:06:19Z</dcterms:modified><cp:revision/></cp:coreProperties>
<cp:coreProperties xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:dcmitype="http://purl.org/dc/dcmitype/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><dcterms:created xsi:type="XXCb8bBA9XXdcterms:W3CDTF">XXCb8bBA9XX2018-07-18T17:59:00Z</dcterms:created><dc:creator>XXCb8bBA9XXx3nt</dc:creator><cp:lastModifiedBy>x3nt</cp:lastModifiedBy><dcterms:modified xsi:type="dcterms:W3CDTF">2018-07-18T18:06:19Z</dcterms:modified><cp:revision/></cp:coreProperties>
2 changes: 1 addition & 1 deletion samples/xss/docx/xss_sample_0_docx/docProps/custom.xml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/custom-properties" xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"><property fmtid="{D5CDD505-2E9C-101B-9397-08002B2CF9AE}" pid="2" name="KSOProductBuildVer"><vt:lpwstr>፨1033-10.1.0.5707</vt:lpwstr></property></Properties>
<Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/custom-properties" xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"><property fmtid="XXCb8bBA9XX{D5CDD505-2E9C-101B-9397-08002B2CF9AE}" pid="2" name="KSOProductBuildVer"><vt:lpwstr>XXCb8bBA9XX1033-10.1.0.5707</vt:lpwstr></property></Properties>
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="፨rId5" Type="፨http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable" Target="፨fontTable.xml"/><Relationship Id="rId4" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml" Target="../customXml/item1.xml"/><Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme" Target="theme/theme1.xml"/><Relationship Id="rId2" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings" Target="settings.xml"/><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml"/></Relationships>
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="XXCb8bBA9XXrId5" Type="XXCb8bBA9XXhttp://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable" Target="XXCb8bBA9XXfontTable.xml"/><Relationship Id="rId4" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml" Target="../customXml/item1.xml"/><Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme" Target="theme/theme1.xml"/><Relationship Id="rId2" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings" Target="settings.xml"/><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml"/></Relationships>
2 changes: 1 addition & 1 deletion samples/xss/docx/xss_sample_0_docx/word/document.xml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<w:document xmlns:wpc="፨http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:wp14="http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:w14="http://schemas.microsoft.com/office/word/2010/wordml" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:w15="http://schemas.microsoft.com/office/word/2012/wordml" xmlns:wpg="http://schemas.microsoft.com/office/word/2010/wordprocessingGroup" xmlns:wpi="http://schemas.microsoft.com/office/word/2010/wordprocessingInk" xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml" xmlns:wps="http://schemas.microsoft.com/office/word/2010/wordprocessingShape" xmlns:wpsCustomData="http://www.wps.cn/officeDocument/2013/wpsCustomData" mc:Ignorable="፨w14 w15 wp14"><w:body><w:p><w:pPr/><w:r><w:t>፨Test</w:t></w:r></w:p><w:p><w:pPr><w:rPr><w:b/><w:bCs/></w:rPr></w:pPr><w:bookmarkStart w:id="፨0" w:name="፨_GoBack"/><w:r><w:rPr><w:b/><w:bCs/></w:rPr><w:t>፨Test_bold</w:t></w:r></w:p><w:bookmarkEnd w:id="፨0"/><w:p><w:pPr><w:rPr><w:u w:val="single"/></w:rPr></w:pPr><w:r><w:rPr><w:u w:val="፨single"/></w:rPr><w:t>፨Test_underscore</w:t></w:r></w:p><w:sectPr><w:pgSz w:w="፨11906" w:h="16838"/><w:pgMar w:top="1440" w:right="1800" w:bottom="1440" w:left="1800" w:header="851" w:footer="992" w:gutter="0"/><w:cols w:space="425" w:num="1"/><w:docGrid w:type="፨lines" w:linePitch="፨312" w:charSpace="0"/></w:sectPr></w:body></w:document>
<w:document xmlns:wpc="XXCb8bBA9XXhttp://schemas.microsoft.com/office/word/2010/wordprocessingCanvas" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:wp14="http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:w14="http://schemas.microsoft.com/office/word/2010/wordml" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:w15="http://schemas.microsoft.com/office/word/2012/wordml" xmlns:wpg="http://schemas.microsoft.com/office/word/2010/wordprocessingGroup" xmlns:wpi="http://schemas.microsoft.com/office/word/2010/wordprocessingInk" xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml" xmlns:wps="http://schemas.microsoft.com/office/word/2010/wordprocessingShape" xmlns:wpsCustomData="http://www.wps.cn/officeDocument/2013/wpsCustomData" mc:Ignorable="XXCb8bBA9XXw14 w15 wp14"><w:body><w:p><w:pPr/><w:r><w:t>XXCb8bBA9XXTest</w:t></w:r></w:p><w:p><w:pPr><w:rPr><w:b/><w:bCs/></w:rPr></w:pPr><w:bookmarkStart w:id="XXCb8bBA9XX0" w:name="XXCb8bBA9XX_GoBack"/><w:r><w:rPr><w:b/><w:bCs/></w:rPr><w:t>XXCb8bBA9XXTest_bold</w:t></w:r></w:p><w:bookmarkEnd w:id="XXCb8bBA9XX0"/><w:p><w:pPr><w:rPr><w:u w:val="single"/></w:rPr></w:pPr><w:r><w:rPr><w:u w:val="XXCb8bBA9XXsingle"/></w:rPr><w:t>XXCb8bBA9XXTest_underscore</w:t></w:r></w:p><w:sectPr><w:pgSz w:w="XXCb8bBA9XX11906" w:h="16838"/><w:pgMar w:top="1440" w:right="1800" w:bottom="1440" w:left="1800" w:header="851" w:footer="992" w:gutter="0"/><w:cols w:space="425" w:num="1"/><w:docGrid w:type="XXCb8bBA9XXlines" w:linePitch="XXCb8bBA9XX312" w:charSpace="0"/></w:sectPr></w:body></w:document>
Loading

0 comments on commit f26dcaf

Please sign in to comment.