refactor: Rename SAS IPC event name to be more specific
This commit is contained in:
parent
3344644d2e
commit
5b091dee56
3 changed files with 7 additions and 6 deletions
|
|
@ -46,6 +46,7 @@ enum
|
||||||
namespace deskflow::common {
|
namespace deskflow::common {
|
||||||
|
|
||||||
const auto kCloseEventName = "Global\\DeskflowClose";
|
const auto kCloseEventName = "Global\\DeskflowClose";
|
||||||
|
const auto kSendSasEventName = "Global\\DeskflowSendSAS";
|
||||||
|
|
||||||
}
|
} // namespace deskflow::common
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -760,11 +760,11 @@ bool MSWindowsKeyState::fakeCtrlAltDel()
|
||||||
// History: It used to be possible to use `PostMessage` to send `MOD_CONTROL | MOD_ALT, VK_DELETE`
|
// History: It used to be possible to use `PostMessage` to send `MOD_CONTROL | MOD_ALT, VK_DELETE`
|
||||||
// as a backup but this ability was removed by Microsoft for security in favor of requiring the
|
// as a backup but this ability was removed by Microsoft for security in favor of requiring the
|
||||||
// `SendSAS` event to be used, which makes DoS and social engineering attacks more difficult.
|
// `SendSAS` event to be used, which makes DoS and social engineering attacks more difficult.
|
||||||
HANDLE hEvtSendSas = OpenEvent(EVENT_MODIFY_STATE, FALSE, "Global\\SendSAS");
|
HANDLE hSendSasEvent = OpenEvent(EVENT_MODIFY_STATE, FALSE, deskflow::common::kSendSasEventName);
|
||||||
if (hEvtSendSas) {
|
if (hSendSasEvent) {
|
||||||
LOG_DEBUG("found SendSAS event, simulating ctrl+alt+del");
|
LOG_DEBUG("found SendSAS event, simulating ctrl+alt+del");
|
||||||
SetEvent(hEvtSendSas);
|
SetEvent(hSendSasEvent);
|
||||||
CloseHandle(hEvtSendSas);
|
CloseHandle(hSendSasEvent);
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
LOG_ERR("couldn't find SendSAS event, unable to simulate ctrl+alt+del");
|
LOG_ERR("couldn't find SendSAS event, unable to simulate ctrl+alt+del");
|
||||||
|
|
|
||||||
|
|
@ -567,7 +567,7 @@ void MSWindowsWatchdog::sendSas() const
|
||||||
throw XArch("SendSAS function not initialized");
|
throw XArch("SendSAS function not initialized");
|
||||||
}
|
}
|
||||||
|
|
||||||
HANDLE sendSasEvent = CreateEvent(nullptr, FALSE, FALSE, "Global\\SendSAS");
|
HANDLE sendSasEvent = CreateEvent(nullptr, FALSE, FALSE, deskflow::common::kSendSasEventName);
|
||||||
if (sendSasEvent == nullptr) {
|
if (sendSasEvent == nullptr) {
|
||||||
LOG_ERR("could not create SendSAS event");
|
LOG_ERR("could not create SendSAS event");
|
||||||
throw XArch(new XArchEvalWindows());
|
throw XArch(new XArchEvalWindows());
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue