DISCLAIMER
This Tool was not designed for Malicious Intent. By Using this tool you agree and acknowledge the author (me) does not hold any responsibilty for it's use. This Tool comes with ABSOLUTELY NO WARRANTY. Use at your Own Risk...
Introduction
The Article discusses The Working of an application Shoveller...The Program is called "Shove" and it emulates a netCat (nc.exe) feature called a "Shell Shoveler". Allows a User to Access the Command Prompt (or any console application) of a Remote Machine.
Background
The Following Code also Uses I/O Streams, Sockets, Binding Ports, and The Reverse Connect Back Method...The Reader is Assumed to know what they mean.
How to Build
javac interfaceShove.java StreamShovel.java ShoveWrap.java Shove.java
How to Use Shove
Unless you make a jar file...you have to run shove by the following (make sure all "class" files are in same dir)
usage: Shove [-pPORT] [-aAPPLICATION] [-hREMOTEHOST]
1) Bind Shell
c:\[DIR]>java -classpath . Shove
c:\[DIR]>java -classpath . Shove -p53
2) Reverse Connect
c:\[DIR]>java -classpath . Shove -p90 -acmd.exe -h200.200.200.2
Why Reverse Connect Method?
The Reverse Connect Method is Used to Circumvent Firewalls, NAT Traversal, etc. Since Our Incoming Attempts to connect to the host will fail in case of a firewall, we ask the host to connect to us (since the firewall "should" allow outgoing connections). It's Usually used in Exploits. But, For shove it has to be manually set up. So you don't need to add new Rules to your Firewall and compromise.
How it Works?
For Every Process there are 3 Streams Stdin,StdOut,StdErr
.
For a Console Application, The Stdin refers to Keyboard input. The StdOut and StdErr Point the Console Window. There are Methods of Redirecting the Streams to Different Streams For eg. ( dir *.* > list.txt
)
This way The Output Stream (stdout,stderr) are redirected to the file input stream (list.txt). In a Similar way, Sockets have an InputStream and an OutputStream. Shove Simply redirects the OutputStream of The Socket to the InputStream of The Process (Stdin) and InputStream of The Socket to OutputStream of the Process (stdout,stderr). So when the socket recieves the data, it is sent to the process, the output from the process is sent back through the socket to a remote user...
Points of Interest
The Utility is Inspired from a Single Feature of NetCat (by Hobbit) - The Swiss Army Knife of Networking.
Author's Notes
Now, java programs are supposed to be platform independent,but I don't have Access to another OS to test it out, but i'm curious to whether it will work on any other OS. So I request people of CP to test it out and post their feedback.
History
Original Draft : 2 March 2008