How can i compile CVE-2017-0213











up vote
-1
down vote

favorite












i would like to know how to compile the CVE-2017-0213.cpp file. The source code is this:



https://github.com/WindowsExploits/Exploits/blob/master/CVE-2017-0213/Source/CVE-2017-0213.cpp



I want to compile it to get a .exe file, because i want to make a change: create a reverse Shell. I was following this tutorial but i could not compile it, and there is no clue about it:
https://alamot.github.io/tally_writeup/ .



I tried using "cl" command in Visual Studio 2017, and Kali commands such as "i686-w64-mingw32-g++" but i do not know if there is other option i am missing. I had problems in "Security - Stack Exchange" because it was off-topic, if it is off-topic also here i am sorry, i Will delete .



The output from "cl /EHcs a.cpp", where "a.cpp" is the exploit code, is:



a.cpp (436): C2664 error: 'UINT GetWindowsDirectoryA (LPSTR, UINT)': argument 1 can not be converted from 'WCHAR [260]' to 'LPSTR'
a.cpp (436): note: The types indicated are not related; conversion requires reinterpret_cast, C style conversion or function style conversion
a.cpp (452): error C2664: 'DWORD QueryDosDeviceA (LPCSTR, LPSTR, DWORD)': argument 1 can not be converted from 'WCHAR [3]' to 'LPCSTR'
a.cpp (452): note: The types indicated are not related; conversion requires reinterpret_cast, C style conversion or function style conversion
a.cpp (471): error C2664: 'DWORD GetModuleFileNameA (HMODULE, LPSTR, DWORD)': argument 2 can not be converted from 'WCHAR [260]' to 'LPSTR'
a.cpp (471): note: The types indicated are not related; conversion requires reinterpret_cast, C style conversion or function style conversion
a.cpp (478): C2664 error: 'DWORD GetModuleFileNameA (HMODULE, LPSTR, DWORD)': argument 2 can not be converted from 'WCHAR [260]' to 'LPSTR'
a.cpp (478): note: The types indicated are not related; conversion requires reinterpret_cast, C style conversion or function style conversion
a.cpp (479): error C2664: 'BOOL PathRemoveFileSpecA (LPSTR)': argument 1 can not be converted from 'WCHAR [260]' to 'LPSTR'
a.cpp (479): note: The types indicated are not related; conversion requires reinterpret_cast, C style conversion or function style conversion
a.cpp (703): error C2664: 'HRESULT StringCchPrintfA (STRSAFE_LPSTR, size_t, STRSAFE_LPCSTR, ...)': argument 1 can not be converted from 'WCHAR [16]' to 'STRSAFE_LPSTR'
a.cpp (703): note: The types indicated are not related; conversion requires

a.cpp (732): error C2440: '=': conversion from 'const wchar_t [16]' to 'LPSTR' can not be performed
a.cpp (732): note: The types indicated are not related; conversion requires reinterpret_cast, C style conversion or function style conversion
a.cpp (735): error C2664: 'BOOL CreateProcessAsUserA (HANDLE, LPCSTR, LPSTR, LPSECURITY_ATTRIBUTES, LPSECURITY_ATTRIBUTES, BOOL, DWORD, LPVOID, LPCSTR, LPSTARTUPINFOA, LPPROCESS_INFORMATION)': argument 3 can not be converted from 'WCHAR [8] 'a' LPSTR '
a.cpp (736): note: The types indicated are not related; conversion requires reinterpret_cast, C style conversion or function style conversion
a.cpp (761): warning C4477: 'printf': the format string '% ls' requires an argument of type 'wchar_t *', but the variadic argument 1 has the type 'const TCHAR *'
a.cpp (761): note: consider the use of '% hs' in the format string
a.cpp (761): note: consider the use of '% s' in the format string
a.cpp (761): note: consider the use of


New error code:



Error C2440 '=': conversion from 'const wchar_t [16]' to 'LPWSTR' can not be performedenter code here










share|improve this question









New contributor




aaaaaa aaaaaaaaaaaaa is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • use Use Unicode Character Set in your project
    – RbMm
    Nov 10 at 18:16










  • Thank you! Now i only got " Error C2440 '=': conversion from 'const wchar_t [16]' to 'LPWSTR' can not be performed", and adding a cast with const_cast<LPWSTR>(…) lets me compile it but it does not work
    – aaaaaa aaaaaaaaaaaaa
    Nov 10 at 19:47















up vote
-1
down vote

favorite












i would like to know how to compile the CVE-2017-0213.cpp file. The source code is this:



https://github.com/WindowsExploits/Exploits/blob/master/CVE-2017-0213/Source/CVE-2017-0213.cpp



I want to compile it to get a .exe file, because i want to make a change: create a reverse Shell. I was following this tutorial but i could not compile it, and there is no clue about it:
https://alamot.github.io/tally_writeup/ .



I tried using "cl" command in Visual Studio 2017, and Kali commands such as "i686-w64-mingw32-g++" but i do not know if there is other option i am missing. I had problems in "Security - Stack Exchange" because it was off-topic, if it is off-topic also here i am sorry, i Will delete .



The output from "cl /EHcs a.cpp", where "a.cpp" is the exploit code, is:



a.cpp (436): C2664 error: 'UINT GetWindowsDirectoryA (LPSTR, UINT)': argument 1 can not be converted from 'WCHAR [260]' to 'LPSTR'
a.cpp (436): note: The types indicated are not related; conversion requires reinterpret_cast, C style conversion or function style conversion
a.cpp (452): error C2664: 'DWORD QueryDosDeviceA (LPCSTR, LPSTR, DWORD)': argument 1 can not be converted from 'WCHAR [3]' to 'LPCSTR'
a.cpp (452): note: The types indicated are not related; conversion requires reinterpret_cast, C style conversion or function style conversion
a.cpp (471): error C2664: 'DWORD GetModuleFileNameA (HMODULE, LPSTR, DWORD)': argument 2 can not be converted from 'WCHAR [260]' to 'LPSTR'
a.cpp (471): note: The types indicated are not related; conversion requires reinterpret_cast, C style conversion or function style conversion
a.cpp (478): C2664 error: 'DWORD GetModuleFileNameA (HMODULE, LPSTR, DWORD)': argument 2 can not be converted from 'WCHAR [260]' to 'LPSTR'
a.cpp (478): note: The types indicated are not related; conversion requires reinterpret_cast, C style conversion or function style conversion
a.cpp (479): error C2664: 'BOOL PathRemoveFileSpecA (LPSTR)': argument 1 can not be converted from 'WCHAR [260]' to 'LPSTR'
a.cpp (479): note: The types indicated are not related; conversion requires reinterpret_cast, C style conversion or function style conversion
a.cpp (703): error C2664: 'HRESULT StringCchPrintfA (STRSAFE_LPSTR, size_t, STRSAFE_LPCSTR, ...)': argument 1 can not be converted from 'WCHAR [16]' to 'STRSAFE_LPSTR'
a.cpp (703): note: The types indicated are not related; conversion requires

a.cpp (732): error C2440: '=': conversion from 'const wchar_t [16]' to 'LPSTR' can not be performed
a.cpp (732): note: The types indicated are not related; conversion requires reinterpret_cast, C style conversion or function style conversion
a.cpp (735): error C2664: 'BOOL CreateProcessAsUserA (HANDLE, LPCSTR, LPSTR, LPSECURITY_ATTRIBUTES, LPSECURITY_ATTRIBUTES, BOOL, DWORD, LPVOID, LPCSTR, LPSTARTUPINFOA, LPPROCESS_INFORMATION)': argument 3 can not be converted from 'WCHAR [8] 'a' LPSTR '
a.cpp (736): note: The types indicated are not related; conversion requires reinterpret_cast, C style conversion or function style conversion
a.cpp (761): warning C4477: 'printf': the format string '% ls' requires an argument of type 'wchar_t *', but the variadic argument 1 has the type 'const TCHAR *'
a.cpp (761): note: consider the use of '% hs' in the format string
a.cpp (761): note: consider the use of '% s' in the format string
a.cpp (761): note: consider the use of


New error code:



Error C2440 '=': conversion from 'const wchar_t [16]' to 'LPWSTR' can not be performedenter code here










share|improve this question









New contributor




aaaaaa aaaaaaaaaaaaa is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • use Use Unicode Character Set in your project
    – RbMm
    Nov 10 at 18:16










  • Thank you! Now i only got " Error C2440 '=': conversion from 'const wchar_t [16]' to 'LPWSTR' can not be performed", and adding a cast with const_cast<LPWSTR>(…) lets me compile it but it does not work
    – aaaaaa aaaaaaaaaaaaa
    Nov 10 at 19:47













up vote
-1
down vote

favorite









up vote
-1
down vote

favorite











i would like to know how to compile the CVE-2017-0213.cpp file. The source code is this:



https://github.com/WindowsExploits/Exploits/blob/master/CVE-2017-0213/Source/CVE-2017-0213.cpp



I want to compile it to get a .exe file, because i want to make a change: create a reverse Shell. I was following this tutorial but i could not compile it, and there is no clue about it:
https://alamot.github.io/tally_writeup/ .



I tried using "cl" command in Visual Studio 2017, and Kali commands such as "i686-w64-mingw32-g++" but i do not know if there is other option i am missing. I had problems in "Security - Stack Exchange" because it was off-topic, if it is off-topic also here i am sorry, i Will delete .



The output from "cl /EHcs a.cpp", where "a.cpp" is the exploit code, is:



a.cpp (436): C2664 error: 'UINT GetWindowsDirectoryA (LPSTR, UINT)': argument 1 can not be converted from 'WCHAR [260]' to 'LPSTR'
a.cpp (436): note: The types indicated are not related; conversion requires reinterpret_cast, C style conversion or function style conversion
a.cpp (452): error C2664: 'DWORD QueryDosDeviceA (LPCSTR, LPSTR, DWORD)': argument 1 can not be converted from 'WCHAR [3]' to 'LPCSTR'
a.cpp (452): note: The types indicated are not related; conversion requires reinterpret_cast, C style conversion or function style conversion
a.cpp (471): error C2664: 'DWORD GetModuleFileNameA (HMODULE, LPSTR, DWORD)': argument 2 can not be converted from 'WCHAR [260]' to 'LPSTR'
a.cpp (471): note: The types indicated are not related; conversion requires reinterpret_cast, C style conversion or function style conversion
a.cpp (478): C2664 error: 'DWORD GetModuleFileNameA (HMODULE, LPSTR, DWORD)': argument 2 can not be converted from 'WCHAR [260]' to 'LPSTR'
a.cpp (478): note: The types indicated are not related; conversion requires reinterpret_cast, C style conversion or function style conversion
a.cpp (479): error C2664: 'BOOL PathRemoveFileSpecA (LPSTR)': argument 1 can not be converted from 'WCHAR [260]' to 'LPSTR'
a.cpp (479): note: The types indicated are not related; conversion requires reinterpret_cast, C style conversion or function style conversion
a.cpp (703): error C2664: 'HRESULT StringCchPrintfA (STRSAFE_LPSTR, size_t, STRSAFE_LPCSTR, ...)': argument 1 can not be converted from 'WCHAR [16]' to 'STRSAFE_LPSTR'
a.cpp (703): note: The types indicated are not related; conversion requires

a.cpp (732): error C2440: '=': conversion from 'const wchar_t [16]' to 'LPSTR' can not be performed
a.cpp (732): note: The types indicated are not related; conversion requires reinterpret_cast, C style conversion or function style conversion
a.cpp (735): error C2664: 'BOOL CreateProcessAsUserA (HANDLE, LPCSTR, LPSTR, LPSECURITY_ATTRIBUTES, LPSECURITY_ATTRIBUTES, BOOL, DWORD, LPVOID, LPCSTR, LPSTARTUPINFOA, LPPROCESS_INFORMATION)': argument 3 can not be converted from 'WCHAR [8] 'a' LPSTR '
a.cpp (736): note: The types indicated are not related; conversion requires reinterpret_cast, C style conversion or function style conversion
a.cpp (761): warning C4477: 'printf': the format string '% ls' requires an argument of type 'wchar_t *', but the variadic argument 1 has the type 'const TCHAR *'
a.cpp (761): note: consider the use of '% hs' in the format string
a.cpp (761): note: consider the use of '% s' in the format string
a.cpp (761): note: consider the use of


New error code:



Error C2440 '=': conversion from 'const wchar_t [16]' to 'LPWSTR' can not be performedenter code here










share|improve this question









New contributor




aaaaaa aaaaaaaaaaaaa is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











i would like to know how to compile the CVE-2017-0213.cpp file. The source code is this:



https://github.com/WindowsExploits/Exploits/blob/master/CVE-2017-0213/Source/CVE-2017-0213.cpp



I want to compile it to get a .exe file, because i want to make a change: create a reverse Shell. I was following this tutorial but i could not compile it, and there is no clue about it:
https://alamot.github.io/tally_writeup/ .



I tried using "cl" command in Visual Studio 2017, and Kali commands such as "i686-w64-mingw32-g++" but i do not know if there is other option i am missing. I had problems in "Security - Stack Exchange" because it was off-topic, if it is off-topic also here i am sorry, i Will delete .



The output from "cl /EHcs a.cpp", where "a.cpp" is the exploit code, is:



a.cpp (436): C2664 error: 'UINT GetWindowsDirectoryA (LPSTR, UINT)': argument 1 can not be converted from 'WCHAR [260]' to 'LPSTR'
a.cpp (436): note: The types indicated are not related; conversion requires reinterpret_cast, C style conversion or function style conversion
a.cpp (452): error C2664: 'DWORD QueryDosDeviceA (LPCSTR, LPSTR, DWORD)': argument 1 can not be converted from 'WCHAR [3]' to 'LPCSTR'
a.cpp (452): note: The types indicated are not related; conversion requires reinterpret_cast, C style conversion or function style conversion
a.cpp (471): error C2664: 'DWORD GetModuleFileNameA (HMODULE, LPSTR, DWORD)': argument 2 can not be converted from 'WCHAR [260]' to 'LPSTR'
a.cpp (471): note: The types indicated are not related; conversion requires reinterpret_cast, C style conversion or function style conversion
a.cpp (478): C2664 error: 'DWORD GetModuleFileNameA (HMODULE, LPSTR, DWORD)': argument 2 can not be converted from 'WCHAR [260]' to 'LPSTR'
a.cpp (478): note: The types indicated are not related; conversion requires reinterpret_cast, C style conversion or function style conversion
a.cpp (479): error C2664: 'BOOL PathRemoveFileSpecA (LPSTR)': argument 1 can not be converted from 'WCHAR [260]' to 'LPSTR'
a.cpp (479): note: The types indicated are not related; conversion requires reinterpret_cast, C style conversion or function style conversion
a.cpp (703): error C2664: 'HRESULT StringCchPrintfA (STRSAFE_LPSTR, size_t, STRSAFE_LPCSTR, ...)': argument 1 can not be converted from 'WCHAR [16]' to 'STRSAFE_LPSTR'
a.cpp (703): note: The types indicated are not related; conversion requires

a.cpp (732): error C2440: '=': conversion from 'const wchar_t [16]' to 'LPSTR' can not be performed
a.cpp (732): note: The types indicated are not related; conversion requires reinterpret_cast, C style conversion or function style conversion
a.cpp (735): error C2664: 'BOOL CreateProcessAsUserA (HANDLE, LPCSTR, LPSTR, LPSECURITY_ATTRIBUTES, LPSECURITY_ATTRIBUTES, BOOL, DWORD, LPVOID, LPCSTR, LPSTARTUPINFOA, LPPROCESS_INFORMATION)': argument 3 can not be converted from 'WCHAR [8] 'a' LPSTR '
a.cpp (736): note: The types indicated are not related; conversion requires reinterpret_cast, C style conversion or function style conversion
a.cpp (761): warning C4477: 'printf': the format string '% ls' requires an argument of type 'wchar_t *', but the variadic argument 1 has the type 'const TCHAR *'
a.cpp (761): note: consider the use of '% hs' in the format string
a.cpp (761): note: consider the use of '% s' in the format string
a.cpp (761): note: consider the use of


New error code:



Error C2440 '=': conversion from 'const wchar_t [16]' to 'LPWSTR' can not be performedenter code here







windows security kernel exploit






share|improve this question









New contributor




aaaaaa aaaaaaaaaaaaa is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




aaaaaa aaaaaaaaaaaaa is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited Nov 10 at 19:48





















New contributor




aaaaaa aaaaaaaaaaaaa is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked Nov 10 at 17:28









aaaaaa aaaaaaaaaaaaa

12




12




New contributor




aaaaaa aaaaaaaaaaaaa is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





aaaaaa aaaaaaaaaaaaa is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






aaaaaa aaaaaaaaaaaaa is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












  • use Use Unicode Character Set in your project
    – RbMm
    Nov 10 at 18:16










  • Thank you! Now i only got " Error C2440 '=': conversion from 'const wchar_t [16]' to 'LPWSTR' can not be performed", and adding a cast with const_cast<LPWSTR>(…) lets me compile it but it does not work
    – aaaaaa aaaaaaaaaaaaa
    Nov 10 at 19:47


















  • use Use Unicode Character Set in your project
    – RbMm
    Nov 10 at 18:16










  • Thank you! Now i only got " Error C2440 '=': conversion from 'const wchar_t [16]' to 'LPWSTR' can not be performed", and adding a cast with const_cast<LPWSTR>(…) lets me compile it but it does not work
    – aaaaaa aaaaaaaaaaaaa
    Nov 10 at 19:47
















use Use Unicode Character Set in your project
– RbMm
Nov 10 at 18:16




use Use Unicode Character Set in your project
– RbMm
Nov 10 at 18:16












Thank you! Now i only got " Error C2440 '=': conversion from 'const wchar_t [16]' to 'LPWSTR' can not be performed", and adding a cast with const_cast<LPWSTR>(…) lets me compile it but it does not work
– aaaaaa aaaaaaaaaaaaa
Nov 10 at 19:47




Thank you! Now i only got " Error C2440 '=': conversion from 'const wchar_t [16]' to 'LPWSTR' can not be performed", and adding a cast with const_cast<LPWSTR>(…) lets me compile it but it does not work
– aaaaaa aaaaaaaaaaaaa
Nov 10 at 19:47

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});






aaaaaa aaaaaaaaaaaaa is a new contributor. Be nice, and check out our Code of Conduct.










 

draft saved


draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53241572%2fhow-can-i-compile-cve-2017-0213%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes








aaaaaa aaaaaaaaaaaaa is a new contributor. Be nice, and check out our Code of Conduct.










 

draft saved


draft discarded


















aaaaaa aaaaaaaaaaaaa is a new contributor. Be nice, and check out our Code of Conduct.













aaaaaa aaaaaaaaaaaaa is a new contributor. Be nice, and check out our Code of Conduct.












aaaaaa aaaaaaaaaaaaa is a new contributor. Be nice, and check out our Code of Conduct.















 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53241572%2fhow-can-i-compile-cve-2017-0213%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Xamarin.iOS Cant Deploy on Iphone

Glorious Revolution

Dulmage-Mendelsohn matrix decomposition in Python