Skip to content

abd3-13/hostsocket

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Warning : this module works on elvated privilage, use at your on risk

HostSocket Shell

HostSocket Shell is a interactive PTY-backed shell over a UNIX socket for Android devices. It supports both root and non-root (shell) users. This is designed to be run via a KernelSU module or similar privileged service.

Created mainlly to have access to andorid shell form isolated container running on android (Droidspaces ).


Features

  • PTY-backed shell with full job control (hmm... has some issues)
  • Supports root and non-root users
  • Auto-reconnect wrapper for stability
  • Minimal dependencies (works on Alpine and other minimal containers)
  • Logs daemon activity for debugging

⚠️ Security Warning

This module exposes a UNIX socket that can provide root shell access to the host system.

  • Any process with access to the socket may gain elevated privileges
  • Mounting /data into containers effectively exposes this interface
  • Misconfiguration can lead to full device compromise

Be responsible and use this only in trusted environments and at your on risk.


Installation

  1. Copy the module folder to /data/adb/modules/hostsocket (or equivalent path for KernelSU).
  2. Ensure service.sh and daemon.sh are executable:

or

Install module file on your root solutions

chmod +x service.sh daemon.sh bin/socat
  1. Enable the module via KernelSU manager and reboot or start service manually:
/data/adb/modules/hostsocket/service.sh

Note: The socat binary included in bin/ is provided courtesy of static-toolbox.


Usage

Connecting from a container

# User shell (default)
./socket-shell.sh

# Root shell
./socket-shell.sh root

# Custom socket path
./socket-shell.sh /media/DataHost/local/host.user.sock
  • Exit: Press Ctrl+C to quit immediately, or type exit inside the shell to close the connection.
  • Reconnect: Wrapper will prompt for reconnect if the connection drops unexpectedly.
  • CWD & PATH: The initial working directory and PATH can be configured inside daemon.sh per socket.

File Structure

hostsocket/
├── bin/
│   └── socat            # prebuilt static socat binary (from static-toolbox)
├── daemon.sh            # kernel service socket daemon
├── service.sh           # watchdog + daemon launcher
├── socket-shell.sh      # client wrapper with reconnect
├── module.prop          # KernelSU module metadata and status
└── README.md

Requirements

  • Android device with KernelSU or Magisk-like module support
  • socat binary with PTY support (included in bin/ for convenience, credit: static-toolbox)
  • Minimal shell environment (busybox sh works)

Notes

  • Non-root shell uses UID 2000 (shell) for safety
  • Root shell has full system access — use responsibly
  • Minimal Alpine containers may require a prebuilt socat binary for full PTY support
  • Logs are written to /data/local/hostsocket_watchdog.log by default

License

MIT License

About

A socket to the host enviroment

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages