🦑Hack with 1 Plug:
Duckyspark v.0.4.1
Translator from USB-Rubber-Ducky payloads (Ducky script) to a Digispark code.
Usage:
in this case the translated payload will be saved in the file "digipayload.ino"
Ducky payloads you can find here: https://github.com/hak5darren/USB-Rubber-Ducky/wiki/Payloads
or here: https://github.com/CedArctic/DigiSpark-Scripts
Or, you can simply write your own payloads using Ducky script
Ducky script syntax: https://github.com/hak5darren/USB-Rubber-Ducky/wiki/Duckyscript
Recently we found the video "Digispark Flashing Guide & Ducky Payload Converters" that shows how to flash Digispark using the payloads generated by our script: https://www.youtube.com/watch?v=Lrn_hgckhGw&lc
Our site: https://awake.pro/
Upd: added 3d models of USB flesh drive to hide Digispark.
You could edit 3d model, or just print on 3d printer ready-for-print .stl models
Duckyspark v.0.4.1
Translator from USB-Rubber-Ducky payloads (Ducky script) to a Digispark code.
Usage:
python3 Duckyspark_translator.py [payload.txt] [output_file]
or
python3 Duckyspark_translator.py [payload.txt]
in this case the translated payload will be saved in the file "digipayload.ino"
Ducky payloads you can find here: https://github.com/hak5darren/USB-Rubber-Ducky/wiki/Payloads
or here: https://github.com/CedArctic/DigiSpark-Scripts
Or, you can simply write your own payloads using Ducky script
Ducky script syntax: https://github.com/hak5darren/USB-Rubber-Ducky/wiki/Duckyscript
Recently we found the video "Digispark Flashing Guide & Ducky Payload Converters" that shows how to flash Digispark using the payloads generated by our script: https://www.youtube.com/watch?v=Lrn_hgckhGw&lc
Our site: https://awake.pro/
Upd: added 3d models of USB flesh drive to hide Digispark.
You could edit 3d model, or just print on 3d printer ready-for-print .stl models
🦑 Example of sFTP Credentials Leak in Private Program
Target Sub-Domain: trc[•]example[•]com
Impact: Full FTP Server Access Obtained
Details: sftp-config.json exposed sensitive credentials.
Severity: 🔴 Critical (9.6)
💡 Stay vigilant for exposed configuration files!
Target Sub-Domain: trc[•]example[•]com
Impact: Full FTP Server Access Obtained
Details: sftp-config.json exposed sensitive credentials.
Severity: 🔴 Critical (9.6)
💡 Stay vigilant for exposed configuration files!
🦑Top ChatGPT extensions for enhancing your productivity and web browsing experience:
1. Monica AI Copilot: A versatile assistant powered by GPT-4, offering functionalities like email drafting, web summaries, PDF chatting, and AI image generation, all while integrating with real-time web browsing.
2. AIPRM for ChatGPT: A powerful tool for marketers and content creators, featuring over 4,500 professional prompts for generating blog titles, ad copy, SEO strategies, and more.
3. Superpower ChatGPT: Adds features like organizing chat folders, custom prompt saving, and downloadable conversations. It’s a great organizational tool for frequent ChatGPT users.
4. Wiseone: Designed for readers, this extension simplifies complex text by providing definitions, context, and summaries directly within your browser.
5. YouTube Summary with ChatGPT & Claude: Summarizes YouTube videos and supports multilingual summaries, complete with timestamps for key points.
6. ChatGPT Writer: Specializes in creating emails and messages based on context, perfect for streamlining communication tasks.
7. Compose AI: Assists with sentence completion, rephrasing, and email replies, making it ideal for improving your writing speed and clarity.
These extensions are available on the Chrome Web Store and are useful for professionals, students, and casual users alike. Let me know if you'd like help with installation or exploring any of these!
1. Monica AI Copilot: A versatile assistant powered by GPT-4, offering functionalities like email drafting, web summaries, PDF chatting, and AI image generation, all while integrating with real-time web browsing.
2. AIPRM for ChatGPT: A powerful tool for marketers and content creators, featuring over 4,500 professional prompts for generating blog titles, ad copy, SEO strategies, and more.
3. Superpower ChatGPT: Adds features like organizing chat folders, custom prompt saving, and downloadable conversations. It’s a great organizational tool for frequent ChatGPT users.
4. Wiseone: Designed for readers, this extension simplifies complex text by providing definitions, context, and summaries directly within your browser.
5. YouTube Summary with ChatGPT & Claude: Summarizes YouTube videos and supports multilingual summaries, complete with timestamps for key points.
6. ChatGPT Writer: Specializes in creating emails and messages based on context, perfect for streamlining communication tasks.
7. Compose AI: Assists with sentence completion, rephrasing, and email replies, making it ideal for improving your writing speed and clarity.
These extensions are available on the Chrome Web Store and are useful for professionals, students, and casual users alike. Let me know if you'd like help with installation or exploring any of these!
Forwarded from Exploiting Crew (Pr1vAt3)
🦑Easiest XSS Testing!! [Basic Recon Tips]
✅Tip: Use Inspect Element to find how the input is handled by the server. i.e. if it is enclosed as ''<your_payload>'' try to escape the closing '' '' by adding ''<your_payload> in the input field. This will break the filters in most cases.
This tip is just a very basic method to bypass filters. There are numerous other ways to bypass the filters and having a little knowledge on javascript will be a advantage for you guys...
I will be sharing next levels of bypassing on my coming posts✅
Source
✅Tip: Use Inspect Element to find how the input is handled by the server. i.e. if it is enclosed as ''<your_payload>'' try to escape the closing '' '' by adding ''<your_payload> in the input field. This will break the filters in most cases.
This tip is just a very basic method to bypass filters. There are numerous other ways to bypass the filters and having a little knowledge on javascript will be a advantage for you guys...
I will be sharing next levels of bypassing on my coming posts✅
Source
Forwarded from Exploiting Crew (Pr1vAt3)
🦑Google Dorks basics:
site:.edu “phone number”– This Dork searches for websites on .edu domains that contain the words “phone number”. student “phone number” – This Dork searches for websites on .edu domains that contain the words “student” and “phone number”.
inurl:edu “login” – This Dork searches for websites on .edu domains that contain the words “login”. This Dork searches for school websites that contain student login information.
“powered by Undercode” site:.edu – This Dork searches for websites on .edu domains that contain the words “powered by Undercode”. This Dork searches for school websites that are running on the Undercode forum software.
“powered by Undercode” site:.gov – This Dork searches for websites on .gov domains that contain the words “powered by Undercode”. This Dork searches for governmental websites that are running on the Undercode forum software.
“powered by Undercode” site:.mil – This Dork searches for websites on .mil domains that contain the words “powered by Undercode”. This Dork searches for military websites that are running on the Undercode forum software.
“powered by Undercode” inurl:.edu – This Dork searches for websites on .edu domains that contain the words “powered by Undercode”. This Dork searches for school websites that are running on the Undercode forum software.
“powered by Undercode” inurl:.mil – This Dork searches for websites on .mil domains that contain the words “powered by Undercode”. This Dork searches for military websites that are running on the Undercode forum software.
inurl:.com “powered by Undercode” – This Dork searches for websites on .com domains that contain the words “powered by Undercode”. This Dork searches for websites that are running on the Undercode forum software.
inurl:.edu “register forum” – This Dork searches for websites on .edu domains that contain the words “register forum”. This Dork searches for school websites that allow you to register for a forum.
inurl:.gov “register forum” – This Dork searches for websites on .gov domains that contain the words “register forum”. This Dork searches for governmental websites that allow you to register for a forum
site:.edu “phone number”– This Dork searches for websites on .edu domains that contain the words “phone number”. student “phone number” – This Dork searches for websites on .edu domains that contain the words “student” and “phone number”.
inurl:edu “login” – This Dork searches for websites on .edu domains that contain the words “login”. This Dork searches for school websites that contain student login information.
“powered by Undercode” site:.edu – This Dork searches for websites on .edu domains that contain the words “powered by Undercode”. This Dork searches for school websites that are running on the Undercode forum software.
“powered by Undercode” site:.gov – This Dork searches for websites on .gov domains that contain the words “powered by Undercode”. This Dork searches for governmental websites that are running on the Undercode forum software.
“powered by Undercode” site:.mil – This Dork searches for websites on .mil domains that contain the words “powered by Undercode”. This Dork searches for military websites that are running on the Undercode forum software.
“powered by Undercode” inurl:.edu – This Dork searches for websites on .edu domains that contain the words “powered by Undercode”. This Dork searches for school websites that are running on the Undercode forum software.
“powered by Undercode” inurl:.mil – This Dork searches for websites on .mil domains that contain the words “powered by Undercode”. This Dork searches for military websites that are running on the Undercode forum software.
inurl:.com “powered by Undercode” – This Dork searches for websites on .com domains that contain the words “powered by Undercode”. This Dork searches for websites that are running on the Undercode forum software.
inurl:.edu “register forum” – This Dork searches for websites on .edu domains that contain the words “register forum”. This Dork searches for school websites that allow you to register for a forum.
inurl:.gov “register forum” – This Dork searches for websites on .gov domains that contain the words “register forum”. This Dork searches for governmental websites that allow you to register for a forum
🦑Advanced Steganography Tool made with Python:
Installation
1. Clone the repository:
2. Install required Python libraries:
How to Use
1. Navigate to the project directory:
2. Encoding/Decoding Files:
- For Audio Files:
- Encoding:
- Decoding:
- For Video Files:
- Encoding:
- Decoding:
- For Image Files:
- Encoding:
- Decoding:
- For Text Files:
- Encoding:
- Decoding:
3. For Help:
For more detailed usage and code, visit the repository [here](https://github.com/Sanjipan/Steganography).
Installation
1. Clone the repository:
kali@kali:~$ git clone https://github.com/Sanjipan/Steganography
2. Install required Python libraries:
kali@kali:~$ pip install argparse
kali@kali:~$ pip install Wave
kali@kali:~$ sudo pip install opencv-python
kali@kali:~$ pip install numpy
kali@kali:~$ pip install Pillow
kali@kali:~$ pip install pytest-shutil
kali@kali:~$ pip install subprocess.run
kali@kali:~$ sudo pip install stegano
How to Use
1. Navigate to the project directory:
kali@kali:~$ cd Steganography
2. Encoding/Decoding Files:
- For Audio Files:
- Encoding:
sudo python3 ./Steganography.py -a -e <location of file>
- Decoding:
sudo python3 ./Steganography.py -a -d <location of file>
- For Video Files:
- Encoding:
sudo python3 ./Steganography.py -v -e <location of file>
- Decoding:
sudo python3 ./Steganography.py -v -d <location of file>
- For Image Files:
- Encoding:
sudo python3 ./Steganography.py -i -e <location of file>
- Decoding:
sudo python3 ./Steganography.py -i -d <location of file>
- For Text Files:
- Encoding:
sudo python3 ./Steganography.py -t -e <location of file>
- Decoding:
sudo python3 ./Steganography.py -t -d <location of file>
3. For Help:
sudo python3 ./Steganography.py -h
sudo python3 ./Steganography.py --help
For more detailed usage and code, visit the repository [here](https://github.com/Sanjipan/Steganography).
GitHub
GitHub - Sanjipan/Steganography: A Advance Steganography Tool made with Python The Program Supports Hiding Secret Text data into…
A Advance Steganography Tool made with Python The Program Supports Hiding Secret Text data into an innocent looking cover file like : .mp4, .wav, .png, .jpeg, .txt through the use of Steganography...
Forwarded from Exploiting Crew (Pr1vAt3)
YouTube
How to Hide Data in Images: Steganography for Ethical Hacking
In this video, we explore steganography—the technique of hiding data within other files. You’ll see how attackers can conceal messages, password files, scripts, and even malware inside seemingly innocent images, all while bypassing antivirus, Data loss protection…
Forwarded from Exploiting Crew (Pr1vAt3)
▁ ▂ ▄ U𝕟𝔻Ⓔ𝐫Ć𝔬𝓓ⓔ ▄ ▂ ▁
🦑Wild! Google announced that their quantum chip Willow was able to do a computation in 5 minutes that would take current top-tier computers 10,000,000,000,000,000,000,000,000 years to figure out 😳
The 105-qubit chip brings insane error correction, focusing on stability rather than just stacking more qubits. The result? A leap toward practical quantum computing that could revolutionize medicine, AI, and energy in the near future.
But here comes the crazy part.
As part of the Willow announcement, Google basically confirmed we're living in a multiverse:
"It lends credence to the notion that quantum computation occurs in many parallel universes, in line with the idea that we live in a multiverse, a prediction first made by David Deutsch."
▁ ▂ ▄ U𝕟𝔻Ⓔ𝐫Ć𝔬𝓓ⓔ ▄ ▂ ▁
🦑Wild! Google announced that their quantum chip Willow was able to do a computation in 5 minutes that would take current top-tier computers 10,000,000,000,000,000,000,000,000 years to figure out 😳
The 105-qubit chip brings insane error correction, focusing on stability rather than just stacking more qubits. The result? A leap toward practical quantum computing that could revolutionize medicine, AI, and energy in the near future.
But here comes the crazy part.
As part of the Willow announcement, Google basically confirmed we're living in a multiverse:
"It lends credence to the notion that quantum computation occurs in many parallel universes, in line with the idea that we live in a multiverse, a prediction first made by David Deutsch."
▁ ▂ ▄ U𝕟𝔻Ⓔ𝐫Ć𝔬𝓓ⓔ ▄ ▂ ▁
▁ ▂ ▄ U𝕟𝔻Ⓔ𝐫Ć𝔬𝓓ⓔ ▄ ▂ ▁
🦑 Hack GraphRAG implementation:
Nano-GraphRAG is a lightweight, efficient, and portable implementation of GraphRAG. It's designed to be more user-friendly and hackable than the official version while retaining the core features.
Key Features
- Small yet powerful: ~1100 lines of core code (excluding tests/prompts).
- Highly portable: Supports integrations with Faiss, Neo4j, Ollama, etc.
- Asynchronous and fully typed: Suitable for modern Python workflows.
- Flexible backends:
- LLM: OpenAI, Amazon Bedrock, Ollama, others.
- Vector DB: Built-in
- Graph Storage: NetworkX (default), Neo4j (optional).
- Incremental and batch data handling: Easy to scale as data grows.
Installation
From Source (Recommended)
From PyPI
Quick Start
1. Set up API Keys:
- OpenAI API:
- For Azure OpenAI or Amazon Bedrock, refer to
2. Download a sample text:
3. Basic Usage:
4. Reuse Stored Contexts:
- Reinitialize with the same
Advanced Features
- Batch Insert:
- Incremental Insert:
- Async Support:
- Customizable Parameters:
- Use
Components and Extensibility
Built-in Components:
- LLM: OpenAI, Amazon Bedrock.
- Vector DB: Nano-vectordb, HNSWlib.
- Graph Storage: NetworkX, Neo4j.
Example Extensions:
- Embedding: Sentence-transformers, custom embeddings.
- Visualization: GraphML-based visualizations.
- Chunking: Token-based or custom splitters.
Benchmarking and Contributions
- Benchmarks for performance comparisons are available under
- Contributions for new components and features are welcomed!
Nano-GraphRAG is ideal for developers seeking a nimble and efficient RAG solution, especially for those who want the flexibility to experiment or build on top of it.
▁ ▂ ▄ U𝕟𝔻Ⓔ𝐫Ć𝔬𝓓ⓔ ▄ ▂ ▁
🦑 Hack GraphRAG implementation:
Nano-GraphRAG is a lightweight, efficient, and portable implementation of GraphRAG. It's designed to be more user-friendly and hackable than the official version while retaining the core features.
Key Features
- Small yet powerful: ~1100 lines of core code (excluding tests/prompts).
- Highly portable: Supports integrations with Faiss, Neo4j, Ollama, etc.
- Asynchronous and fully typed: Suitable for modern Python workflows.
- Flexible backends:
- LLM: OpenAI, Amazon Bedrock, Ollama, others.
- Vector DB: Built-in
nano-vectordb, HNSWlib, Milvus-lite, Faiss.- Graph Storage: NetworkX (default), Neo4j (optional).
- Incremental and batch data handling: Easy to scale as data grows.
Installation
From Source (Recommended)
Clone the repository
git clone https://github.com/gusye1234/nano-graphrag.git
cd nano-graphrag
pip install -e .
From PyPI
pip install nano-graphrag
Quick Start
1. Set up API Keys:
- OpenAI API:
export OPENAI_API_KEY="sk-..."
- For Azure OpenAI or Amazon Bedrock, refer to
.env.example.2. Download a sample text:
curl https://raw.githubusercontent.com/gusye1234/nano-graphrag/main/tests/mock_data.txt > ./book.txt
3. Basic Usage:
from nano_graphrag import GraphRAG, QueryParam
Initialize GraphRAG
graph_func = GraphRAG(working_dir="./dickens")
Insert text data
with open("./book.txt") as f:
graph_func.insert(f.read())
Perform a global search
print(graph_func.query("What are the top themes in this story?"))
Perform a local search for scalability
print(graph_func.query("What are the top themes in this story?", param=QueryParam(mode="local")))
4. Reuse Stored Contexts:
- Reinitialize with the same
working_dir to reload previous contexts.Advanced Features
- Batch Insert:
graph_func.insert(["TEXT1", "TEXT2", ...])
- Incremental Insert:
graph_func.insert("New text to add")
- Async Support:
await graph_func.ainsert("Async text")
await graph_func.aquery("What is this text about?")
- Customizable Parameters:
- Use
help(GraphRAG) and help(QueryParam) to explore.Components and Extensibility
Built-in Components:
- LLM: OpenAI, Amazon Bedrock.
- Vector DB: Nano-vectordb, HNSWlib.
- Graph Storage: NetworkX, Neo4j.
Example Extensions:
- Embedding: Sentence-transformers, custom embeddings.
- Visualization: GraphML-based visualizations.
- Chunking: Token-based or custom splitters.
Benchmarking and Contributions
- Benchmarks for performance comparisons are available under
examples/benchmarks.- Contributions for new components and features are welcomed!
Nano-GraphRAG is ideal for developers seeking a nimble and efficient RAG solution, especially for those who want the flexibility to experiment or build on top of it.
▁ ▂ ▄ U𝕟𝔻Ⓔ𝐫Ć𝔬𝓓ⓔ ▄ ▂ ▁
▁ ▂ ▄ U𝕟𝔻Ⓔ𝐫Ć𝔬𝓓ⓔ ▄ ▂ ▁
🦑Google Dork : intext:"siemens" & inurl:"/portal/portal.mwsl"
locate Siemens S7 PLC (Programmable Logic Controller) web interfaces through publicly accessible search
This Google dork, intext:"siemens" & inurl:"/portal/portal.mwsl", reveals
the web interfaces of Siemens S7 series PLC controllers. These interfaces
provide access to critical control and monitoring functions of industrial
systems. Unauthorized access can lead to significant operational
disruptions and security risks in industrial environments.
Proof Of Concept (PoC):
Steps to Reproduce:
1.Open Google Search.
2.Enter the dork query: intext:"siemens" & inurl:"/portal/portal.mwsl".
3.Review the search results to find URLs of Siemens S7 PLC web interfaces.
4. Click on a search result to access the web interface of the PLC.
5.Attempt to log in using default or commonly known credentials (if login
is required).
▁ ▂ ▄ U𝕟𝔻Ⓔ𝐫Ć𝔬𝓓ⓔ ▄ ▂ ▁
🦑Google Dork : intext:"siemens" & inurl:"/portal/portal.mwsl"
locate Siemens S7 PLC (Programmable Logic Controller) web interfaces through publicly accessible search
This Google dork, intext:"siemens" & inurl:"/portal/portal.mwsl", reveals
the web interfaces of Siemens S7 series PLC controllers. These interfaces
provide access to critical control and monitoring functions of industrial
systems. Unauthorized access can lead to significant operational
disruptions and security risks in industrial environments.
Proof Of Concept (PoC):
Steps to Reproduce:
1.Open Google Search.
2.Enter the dork query: intext:"siemens" & inurl:"/portal/portal.mwsl".
3.Review the search results to find URLs of Siemens S7 PLC web interfaces.
4. Click on a search result to access the web interface of the PLC.
5.Attempt to log in using default or commonly known credentials (if login
is required).
▁ ▂ ▄ U𝕟𝔻Ⓔ𝐫Ć𝔬𝓓ⓔ ▄ ▂ ▁
▁ ▂ ▄ U𝕟𝔻Ⓔ𝐫Ć𝔬𝓓ⓔ ▄ ▂ ▁
🚀 Support & Share: t.me/undercodecommunity
This is the hub for developers and tech enthusiasts:
💻 Topics We Cover:
🔐 CVE News & Databases
📰 Hacker & Tech News
🛡 Cybersecurity, Hacking, and Secret Methods
🌟 Our Mission:
Share your knowledge, collaborate, and grow together in a community designed for innovation and learning.
🔗 Join now: Let's build the future together!
@UndercodeCommunity
▁ ▂ ▄ U𝕟𝔻Ⓔ𝐫Ć𝔬𝓓ⓔ ▄ ▂ ▁
🚀 Support & Share: t.me/undercodecommunity
This is the hub for developers and tech enthusiasts:
💻 Topics We Cover:
🔐 CVE News & Databases
📰 Hacker & Tech News
🛡 Cybersecurity, Hacking, and Secret Methods
🌟 Our Mission:
Share your knowledge, collaborate, and grow together in a community designed for innovation and learning.
🔗 Join now: Let's build the future together!
@UndercodeCommunity
▁ ▂ ▄ U𝕟𝔻Ⓔ𝐫Ć𝔬𝓓ⓔ ▄ ▂ ▁
Telegram
UNDERCODE COMMUNITY
🦑 Undercode Cyber World!
@UndercodeCommunity
FREE
- Hackers Post Monitor:
Latest Bug bounty Methods, Tools Updates, AI, Courses! @Undercode_Testing
- Cyber & Tech NEWS:
@Undercode_News
- CVE: @Daily_CVE
✨Official Web & Services:
→ Undercode.help
@UndercodeCommunity
FREE
- Hackers Post Monitor:
Latest Bug bounty Methods, Tools Updates, AI, Courses! @Undercode_Testing
- Cyber & Tech NEWS:
@Undercode_News
- CVE: @Daily_CVE
✨Official Web & Services:
→ Undercode.help
Forwarded from Exploiting Crew (Pr1vAt3)
▁ ▂ ▄ U𝕟𝔻Ⓔ𝐫Ć𝔬𝓓ⓔ ▄ ▂ ▁
🦑Advanced Hacking: file hijacking caused by directory permissions:
In Windows systems, improper permissions on certain directories or files allow attackers to implant malicious files or execute files in these directories. Since these directories lack effective access control and security review, attackers can exploit vulnerabilities to modify, replace or inject files, or even hijack legitimate processes or services in the system.
Several file hijacking cases to understand the security issues caused by weak permission directories. Before going into specific cases, let's start with the CreateProcess API.
1️⃣. Unsafe use of CreateProcess
CreateProcessThe API is the basic function used to create a new process in Windows. Its working mechanism is crucial to program startup and path resolution. This API has multiple parameters, among which lpApplicationNameand lpCommandLineare key parameters, which together affect the behavior of process creation, especially how to parse and execute the passed executable file path.
CreateProcessBasic usage
CreateProcessThe prototype is as follows:
🦑Advanced Hacking: file hijacking caused by directory permissions:
In Windows systems, improper permissions on certain directories or files allow attackers to implant malicious files or execute files in these directories. Since these directories lack effective access control and security review, attackers can exploit vulnerabilities to modify, replace or inject files, or even hijack legitimate processes or services in the system.
In Windows systems, there are some typical weak-permission directories, such as C:\Windows\Temp, C:\ProgramDataetc. These directories are usually used to store temporary files. However, many applications and users do not set sufficient permission control for these directories when using them. Attackers can implement file hijacking attacks by placing malicious executable files in these directories, thereby executing code or elevating system permissions.
Several file hijacking cases to understand the security issues caused by weak permission directories. Before going into specific cases, let's start with the CreateProcess API.
1️⃣. Unsafe use of CreateProcess
CreateProcessThe API is the basic function used to create a new process in Windows. Its working mechanism is crucial to program startup and path resolution. This API has multiple parameters, among which lpApplicationNameand lpCommandLineare key parameters, which together affect the behavior of process creation, especially how to parse and execute the passed executable file path.
CreateProcessBasic usage
CreateProcessThe prototype is as follows:
BOOL CreateProcess(
LPCWSTR lpApplicationName,
LPWSTR lpCommandLine,
LPSECURITY_ATTRIBUTES lpProcessAttributes,
LPSECURITY_ATTRIBUTES lpThreadAttributes,
BOOL bInheritHandles,
DWORD dwCreationFlags,
LPVOID lpEnvironment,
LPCWSTR lpCurrentDirectory,
LPSTARTUPINFO lpStartupInfo,
LPPROCESS_INFORMATION lpProcessInformation
);
Forwarded from Exploiting Crew (Pr1vAt3)
2️⃣ lpApplicationName: Specifies the path to the application (optional). If NULL, the system will lpCommandLineparse the application path from the first space-delimited item of .
lpCommandLine: Command line arguments passed to the new process. If lpApplicationName, NULLthis argument must include the full path to the application or command name.
lpApplicationNameNULLPath resolution for
When lpApplicationNameis NULL, the system must lpCommandLineparse the executable file path from . This process involves path parsing and processing, which may involve the problem of file names containing spaces.
Path resolution order on the command line:
Let's look at an example from Microsoft's official documentation. Suppose that lpCommandLineit contains something like the following:
3️⃣CreateProcess executes the path without quotes, and lpApplicationNamethe NULLsystem will parse the path in the following order:
c:\program.exe: The system first attempts to parse the path by truncating it from the beginning of the string c:\program.exe.
c:\program files\sub.exe: If the first resolution fails, the system attempts to resolve the path to c:\program files\sub.exe.
c:\program files\sub dir\program.exe: Next, the system tries to resolve the entire path, thinks program.exeit is an executable file name, and tries to execute it.
c:\program files\sub dir\program name.exe: Finally, the system attempts to resolve program nameas an executable file name and appends .exethe extension to it.
lpCommandLine: Command line arguments passed to the new process. If lpApplicationName, NULLthis argument must include the full path to the application or command name.
lpApplicationNameNULLPath resolution for
When lpApplicationNameis NULL, the system must lpCommandLineparse the executable file path from . This process involves path parsing and processing, which may involve the problem of file names containing spaces.
Path resolution order on the command line:
Let's look at an example from Microsoft's official documentation. Suppose that lpCommandLineit contains something like the following:
c:\program files\sub dir\program name
3️⃣CreateProcess executes the path without quotes, and lpApplicationNamethe NULLsystem will parse the path in the following order:
c:\program.exe: The system first attempts to parse the path by truncating it from the beginning of the string c:\program.exe.
c:\program files\sub.exe: If the first resolution fails, the system attempts to resolve the path to c:\program files\sub.exe.
c:\program files\sub dir\program.exe: Next, the system tries to resolve the entire path, thinks program.exeit is an executable file name, and tries to execute it.
c:\program files\sub dir\program name.exe: Finally, the system attempts to resolve program nameas an executable file name and appends .exethe extension to it.
Forwarded from Exploiting Crew (Pr1vAt3)
4️⃣Write a POC program test:
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
int main() {
char *szCmdline = _strdup("c:\\program files\\sub dir\\program name");
// STARTUPINFO PROCESS_INFORMATION
STARTUPINFOA si = {0};
PROCESS_INFORMATION pi = {0};
si.cb = sizeof(si);
// CreateProcessA(ANSI)
if (CreateProcessA(
NULL,
szCmdline,
NULL,
NULL,
FALSE,
0,
NULL,
NULL,
&si,
&pi
)) {
printf("Process created successfully!\n");
WaitForSingleObject(pi.hProcess, INFINITE);
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);
} else {
printf("Failed to create process. Error code: %lu\n", GetLastError());
}
free(szCmdline);
return 0;
}
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
int main() {
char *szCmdline = _strdup("c:\\program files\\sub dir\\program name");
// STARTUPINFO PROCESS_INFORMATION
STARTUPINFOA si = {0};
PROCESS_INFORMATION pi = {0};
si.cb = sizeof(si);
// CreateProcessA(ANSI)
if (CreateProcessA(
NULL,
szCmdline,
NULL,
NULL,
FALSE,
0,
NULL,
NULL,
&si,
&pi
)) {
printf("Process created successfully!\n");
WaitForSingleObject(pi.hProcess, INFINITE);
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);
} else {
printf("Failed to create process. Error code: %lu\n", GetLastError());
}
free(szCmdline);
return 0;
}
Forwarded from Exploiting Crew (Pr1vAt3)
5️⃣This test program attempts to start "c:\program files\sub dir\program name" via CreateProcessA, compile and run the program, and monitor it using Process Monitor.
, you can see that Process Monitor monitors the expected behavior of the program. If program.exe exists in the root directory of drive C, then c:\program.exe will be executed.
, you can see that Process Monitor monitors the expected behavior of the program. If program.exe exists in the root directory of drive C, then c:\program.exe will be executed.
Forwarded from Exploiting Crew (Pr1vAt3)
The safe usage of CreateProcess API should be:
If lpApplicationName is set to NULL , the executable file path in lpCommandLine needs to be quoted. Another API function with similar behavior is CreateProcessAsUser.
LPTSTR szCmdline[] = _tcsdup(TEXT("\"C:\\Program Files\\MyApp\" -L -S"));
CreateProcess(NULL, szCmdline, /*...*/);If lpApplicationName is set to NULL , the executable file path in lpCommandLine needs to be quoted. Another API function with similar behavior is CreateProcessAsUser.
Forwarded from Exploiting Crew (Pr1vAt3)
6️⃣ Directory permissions and file hijacking
Through the CreateProcess test program above, we can see that some irregular coding habits may cause the program to behave unexpectedly, which poses a potential security risk. In this case, if the relevant directory is set to weak permissions, such as c:\program files\sub dir\, the directory permissions are improperly set, resulting in an attacker with normal permissions being able to write malicious files in the directory and use file hijacking to achieve the purpose of privilege escalation. Next, let's use several real CVE cases to explore the possible harm caused by file hijacking caused by weak permission directories.
Through the CreateProcess test program above, we can see that some irregular coding habits may cause the program to behave unexpectedly, which poses a potential security risk. In this case, if the relevant directory is set to weak permissions, such as c:\program files\sub dir\, the directory permissions are improperly set, resulting in an attacker with normal permissions being able to write malicious files in the directory and use file hijacking to achieve the purpose of privilege escalation. Next, let's use several real CVE cases to explore the possible harm caused by file hijacking caused by weak permission directories.