> For the complete documentation index, see [llms.txt](https://gurpreet-portfolio.gitbook.io/gurpreet06/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gurpreet-portfolio.gitbook.io/gurpreet06/projects/takescreenshot.md).

# TakeScreenShot

takeScreenShot.ps1 is a PowerShell script that captures multi-monitor screens. It can also render screens properly, even with a non-standard monitor configuration, such as stacked vertically, without black bars.

Features:

* Captures multi-monitor screens and sends them to a C2 Server.
* Executes every 30 seconds.
* Sends data to a C2 server.

### Credit

The code used for this script was taken from Stack Overflow.

{% embed url="<https://stackoverflow.com/questions/2969321/how-can-i-do-a-screen-capture-in-windows-powershell>" %}
Link
{% endembed %}

But I have made several modifications to the script.

### Modifications

1. I have added the functionality to send data to an external server.
2. The script runs every 30 seconds, but this can be modified.
3. If the server is not active at the moment, you can decide whether you want to terminate the connection or save the images locally and then send all of them back to the server when it's active.

### POC

{% file src="/files/w4Xd9562nDkPebGPl6B2" %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://gurpreet-portfolio.gitbook.io/gurpreet06/projects/takescreenshot.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
