Eli Fulkerson .com HomeProjectsWarpzone
 

Welcome to Warp Zone!

Description:

Warpzone is a *nix shell program that enables you to "warp back" to a parent shell in order to execute a piped command in that context rather than your current environment.

It functions by inserting itself in your input stream and giving you a child shell (bash only at the moment). It appends a green pipe symbol to your bash prompt in order to remind you that it is present.

The hotkey to activate warpzone is alt-| (technically alt-\, because I did not want to enforce shift-alt-\). When you press alt-| a green | will be drawn. At that point you are chaining commands for the parent shell. Once you hit enter, warpzone will send an enter to the child shell (to execute the commands to the left of the green |, wait until the output from that shell has been idle for 0.2 seconds, and then send that output to the parent shell to be piped through the commands that were to the right of the green |. The output from that pipestream will then be visible on your stdout.

The short version - once you're inside of warpzone, if you use alt-| to pipe commands, they run as if you were in the parent shell that you launched warpzone from.

The intended use case is (for instance) to be able to use advanced unix string utilities despite being in a more restrictive environment. Specifically, I wrote this too to enable me to use my custom utilities such as ips, macdb and no (not to mention actual honest-to-god grep) while shelled into Cisco equipment.

Caveats:

This is very much a 0.1 version, expect bugs. In particular - there are a lot of bits and boops involved in passing control correctly and settings between TTYs that I simply don't understand. It seems to work ok for my prime use case - which is to go one shell deeper and use a very basic (in terms of terminal codes, goofy vt100 drawing, anything like that) shell. If any gray beards would like to pop in and school me on how to make this flawless I'd be more than happy to say hello.

Screenshot:


Cisco-ASA# show arp | macdb

outside (ip redacted) a493.4cxx.xxxx 7925 OUI: (hex) Cisco Systems, Inc
inside (ip redacted) 000c.29xx.xxxx 56 OUI: (hex) VMware, Inc.
inside (ip redacted) 406c.8fxx.xxxx 100 OUI: (hex) Apple, Inc.
inside (ip redacted) 0015.faxx.xxxx 9530 OUI: (hex) Cisco Systems, Inc
dmz (ip redacted) 000c.29xx.xxxx 1 OUI: (hex) VMware, Inc.
dmz (ip redacted) 000c.29xx.xxxx 3 OUI: (hex) VMware, Inc.
dmz (ip redacted) 000c.29xx.xxxx 4 OUI: (hex) VMware, Inc.
dmz (ip redacted) 000c.29xx.xxxx 8 OUI: (hex) VMware, Inc.
dmz (ip redacted) 000c.29xx.xxxx 10 OUI: (hex) VMware, Inc.
dmz (ip redacted) 000c.29xx.xxxx 14 OUI: (hex) VMware, Inc.

Download:


Listing directory https://download.elifulkerson.com/files/warpzone/0.1: Makefile October 28 2018 18:28:43 105 makefile script, ASCII text warpzone.c October 28 2018 18:25:46 10012 C source, ASCII text warpzone.c.asc October 28 2018 18:25:54 801 GnuPG signature warpzone.c.md5 October 28 2018 18:25:54 45 MD5 checksum warpzone.c.sha1 October 28 2018 18:25:54 53 SHA1 checksum warpzone.c.sha256 October 28 2018 18:25:54 77 SHA256 checksum warpzone.c.sha512 October 28 2018 18:25:54 141 SHA512 checksumBrowse the download server

To compile: gcc -o warpzone.exe warpzone.c

Additional Notes:

I would like to thank R. Koucha for his pty examples (http://rachid.koucha.free.fr/tech_corner/pty_pdip.html) on which this program was based.