Transformers
Safetensors
PEFT
English
text-generation-inference
gemma4
lora
cybersecurity
macos
privilege-escalation
tcc-bypass
sip
apple-security
Instructions to use rezaduty/gemma4-e2b-privesc-macos with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use rezaduty/gemma4-e2b-privesc-macos with Transformers:
# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("rezaduty/gemma4-e2b-privesc-macos", dtype="auto") - PEFT
How to use rezaduty/gemma4-e2b-privesc-macos with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
| base_model: google/gemma-4-e2b-it | |
| tags: | |
| - text-generation-inference | |
| - transformers | |
| - gemma4 | |
| - peft | |
| - lora | |
| - cybersecurity | |
| - macos | |
| - privilege-escalation | |
| - tcc-bypass | |
| - sip | |
| - apple-security | |
| license: apache-2.0 | |
| language: | |
| - en | |
| # Gemma 4 E2B — macOS Privilege Escalation Expert | |
| A QLoRA fine-tuned version of [Gemma 4 E2B Instruct](https://huggingface.co/google/gemma-4-e2b-it) specialized in **macos privilege escalation**. | |
| Specialized in **macOS privilege escalation**: SIP bypass, TCC bypass, LaunchDaemon misconfigurations, dylib injection/hijacking, Keychain attacks, and macOS security hardening. | |
| Part of the [rezaduty cybersecurity model family](https://huggingface.co/rezaduty). | |
| --- | |
| ## Expertise | |
| - macOS security model: SIP, TCC, Gatekeeper, XPC, Sandbox | |
| - SIP bypass: boot arguments, rootless.conf, third-party kext loading | |
| - TCC bypass: SQLite injection, electron app abuse, XPC service exploitation | |
| - LaunchDaemon/LaunchAgent misconfigurations and PLIST injection | |
| - dylib hijacking and injection via DYLD_INSERT_LIBRARIES | |
| - Keychain extraction: security CLI, chain-break attacks | |
| - macOS CVEs: CVE-2022-22583 (powerdir), CVE-2021-30892 (shrootkit) | |
| --- | |
| ## Model Details | |
| | Property | Value | | |
| |---|---| | |
| | **Base model** | google/gemma-4-e2b-it (2B parameters) | | |
| | **Fine-tuning method** | QLoRA (rank 16, α 16) | | |
| | **Domain** | macOS Privilege Escalation | | |
| | **Dataset** | [rezaduty/cybersecurity-qa-v2](https://huggingface.co/datasets/rezaduty/cybersecurity-qa-v2) | | |
| | **License** | Apache 2.0 | | |
| --- | |
| ## Usage | |
| ```python | |
| from transformers import AutoTokenizer, AutoModelForCausalLM | |
| from peft import PeftModel | |
| import torch | |
| base_model = "google/gemma-4-e2b-it" | |
| adapter = "rezaduty/gemma4-e2b-privesc-macos" | |
| tokenizer = AutoTokenizer.from_pretrained(adapter) | |
| model = AutoModelForCausalLM.from_pretrained( | |
| base_model, torch_dtype=torch.bfloat16, device_map="auto" | |
| ) | |
| model = PeftModel.from_pretrained(model, adapter) | |
| messages = [ | |
| {"role": "system", "content": [{"type": "text", "text": "You are an expert in macOS privilege escalation and security. Provide deep technical answers on macOS privesc techniques, TCC bypass, SIP, macOS security internals, and hardening with specific commands, tool names, and CVE references."}]}, | |
| {"role": "user", "content": [{"type": "text", "text": "Your question here"}]}, | |
| ] | |
| inputs = tokenizer.apply_chat_template( | |
| messages, tokenize=True, add_generation_prompt=True, return_tensors="pt" | |
| ).to(model.device) | |
| output = model.generate(inputs, max_new_tokens=512, temperature=0.7, top_p=0.9) | |
| print(tokenizer.decode(output[0][inputs.shape[-1]:], skip_special_tokens=True)) | |
| ``` | |
| --- | |
| ## System Prompt | |
| ``` | |
| You are an expert in macOS privilege escalation and security. Provide deep technical answers on macOS privesc techniques, TCC bypass, SIP, macOS security internals, and hardening with specific commands, tool names, and CVE references. | |
| ``` | |
| --- | |
| ## See Also | |
| - [General cybersecurity model](https://huggingface.co/rezaduty/gemma4-e2b-cybersecurity-interview) | |
| - [Docker & Container Security](https://huggingface.co/rezaduty/gemma4-e2b-docker-container-security) | |
| - [Kubernetes Security](https://huggingface.co/rezaduty/gemma4-e2b-kubernetes-security) | |
| - [AI & LLM Security](https://huggingface.co/rezaduty/gemma4-e2b-ai-llm-security) | |
| - [Cloud IAM & Terraform](https://huggingface.co/rezaduty/gemma4-e2b-cloud-iam-terraform) | |
| - [Active Directory & Red Team](https://huggingface.co/rezaduty/gemma4-e2b-redteam-activedirectory) | |
| - [All rezaduty models](https://huggingface.co/rezaduty) | |