Expand description
§🔥 firehazard 🔥
Create a fire hazard by locking down your (Microsoft) Windows so nobody can escape (your security sandbox.)
Unopinionated low level API bindings focused on soundness, safety, and stronger types over raw FFI.
You may be at hazard of being fired (or worse) for relying on this crate for security:
§⚠️ Warnings ⚠️
0.0.0-yyyy-mm-dd
doesn’t follow semver.- I’m not subscribed to any security lists.
- I don’t have anything alerting me to CVEs.
- This crate is probably not 100% sound. Bug reports welcome.
- I don’t have any PGP keys for you to securely send me security bugs.
- Keep flammable materials away from heaters and other ignition sources.
- This isn’t backed by a team or company. Nor me, frankly.
- I have no code reviewers.
- I haven’t fuzz tested anything.
- My test coverage is mediocre.
- There is no red team.
- I haven’t made a proper attempt to bypass even the example sandbox.
- Just because you’re paranoid, doesn’t mean that they aren’t out to get you.
- Rust has made me overconfident.
- Rust has made you overconfident.
- Keep emergency exits accessible and usable to avoid fire safety hazards.
- The false sense of security - that using this code will lure you into - may be worse than nothing at all.
- Test your fire alarms. The batteries are probably dead.
§Quickstart
## Cargo.toml
[dependencies]
firehazard.git = "https://github.com/MaulingMonkey/firehazard"
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
Modules§
- access
- [docs.microsoft.com] ACCESS_MASK generic types, functions, and constants
- ace
- [docs.microsoft.com]
ACL
/ACE_HEADER
related types and manipulation functions - acl
- [docs.microsoft.com]
ACL
related types and manipulation functions - alloc
- Allocators, deallocators, etc.
- debug
- Debugger APIs from debugapi.h,
dbgeng.h(not yet) - desktop
- [docs.microsoft.com] Desktop APIs
- handle
- [docs.microsoft.com]
Generic Kernel Object
HANDLE
wrapping types and functions. - io
- I/O APIs (pipe handles and fns)
- job
- [docs.microsoft.com] Job Object types and fns
- policy
- [docs.microsoft.com] Process mitigation policy types and functions
- privilege
- [docs.microsoft.com] Privilege related types and functions
- process
- [docs.microsoft.com]
Process
OwnedHandle
and related fns - security
- [docs.microsoft.com]
Attributes
,Descriptor
,DescriptorBuilder
, etc. - sid
- [docs.microsoft.com]
SID
related types and manipulation functions - thread
- [docs.microsoft.com]
Thread
OwnedHandle
and related fns - token
- [docs.microsoft.com] Access token handle types and related functions
- winsta
- [docs.microsoft.com] Window Station APIs
Macros§
Structs§
- Error
- [docs.microsoft.com] DWORD/u32, typically from GetLastError, representing an error code, hresult, or ntstatus
- Luid
- [docs.microsoft.com] LUID (~ a 32-bit aligned
u64
/ “Locally Unique IDentifier”)
Functions§
- adjust_
token_ privileges_ disable_ if - [docs.microsoft.com]
AdjustTokenPrivileges(self, FALSE, ...)
Disable the specified privileges of the token.
Disabled privileges can be re-enabled - this guards against accidents, not malware!
 - adjust_
token_ privileges_ enable_ if - [docs.microsoft.com]
AdjustTokenPrivileges(self, FALSE, ...)
Enable only the specified privileges of the token.
Disabled privileges can be re-enabled - this guards against accidents, not malware!
 - adjust_
token_ privileges_ remove_ if - [docs.microsoft.com]
AdjustTokenPrivileges(self, FALSE, ...)
Remove the specified privileges of the token.
Discarded privileges cannot be reapplied.
 - adjust_
token_ privileges_ retain_ if - [docs.microsoft.com]
AdjustTokenPrivileges(self, FALSE, ...)
Keep only the specified privileges of the token.
Discarded privileges cannot be reapplied.
 - check_
remote_ debugger_ present - [docs.microsoft.com] CheckRemoteDebuggerPresent
- continue_
debug_ event - [docs.microsoft.com] ContinueDebugEvent
- convert_
sid_ to_ string_ sid_ a - [docs.microsoft.com] ConvertSidToStringSidA
- convert_
sid_ to_ string_ sid_ w - [docs.microsoft.com] ConvertSidToStringSidW
- convert_
string_ sid_ to_ sid_ a - [docs.microsoft.com]
ConvertStringSidToSidA - convert e.g.
"S-1-0-0"
tosid::Box
- convert_
string_ sid_ to_ sid_ w - [docs.microsoft.com]
ConvertStringSidToSidW - convert e.g.
"S-1-0-0"
tosid::Box
- debug_
active_ process - [docs.microsoft.com] DebugActiveProcess
- debug_
active_ process_ stop - [docs.microsoft.com] DebugActiveProcessStop
- debug_
break - [docs.microsoft.com] DebugBreak
- is_
debugger_ present - [docs.microsoft.com] IsDebuggerPresent
- lookup_
privilege_ name_ a - [docs.microsoft.com] LookupPrivilegeNameA
- lookup_
privilege_ value_ a - [docs.microsoft.com] LookupPrivilegeValueA
- output_
debug_ string_ a - [docs.microsoft.com] OutputDebugStringA
- output_
debug_ string_ w - [docs.microsoft.com] OutputDebugStringW
- read_
process_ âšmemory - [docs.microsoft.com] ReadProcessMemory
- sleep_
ms - [docs.microsoft.com] Sleep
- sleep_
ms_ ex - [docs.microsoft.com] SleepEx
- wait_
for_ debug_ event - [docs.microsoft.com] WaitForDebugEvent
- wait_
for_ debug_ event_ ex - [docs.microsoft.com] WaitForDebugEventEx