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
windows security kernel exploit
New contributor
add a comment |
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
windows security kernel exploit
New contributor
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
add a comment |
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
windows security kernel exploit
New contributor
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
windows security kernel exploit
New contributor
New contributor
edited Nov 10 at 19:48
New contributor
asked Nov 10 at 17:28
aaaaaa aaaaaaaaaaaaa
12
12
New contributor
New contributor
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
add a comment |
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
add a comment |
active
oldest
votes
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.
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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