docs: updated docs to use cargo make

This commit is contained in:
Andrew Rioux 2023-05-09 21:26:29 -04:00
parent f1e5b2d979
commit 57cd4aa2be
Signed by: andrew.rioux
GPG Key ID: 9B8BAC47C17ABB94
4 changed files with 25 additions and 20 deletions

View File

@ -5,8 +5,13 @@ Developed using libpcap to enable evading local firewalls and with an eye toward
* Packages
** [[./pcap-sys/README.org][pcap-sys]]: A Rust wrapper around the libpcap library for Linux
** [[./nl-sys/README.org][nl-sys]]: A Rust wrapper around the netlink (nl) library on Linux
** sparse-protocol: The definition of various protocols, wrappers, and compositions to allow for a flexible working environment
* Development
To develop or compile this project, open it in GitHub Codespaces or using Visual Studio Code's Dev Container extension (requires Docker to be installed)
* [[./examples/README.org][Check out the examples/proofs of concept used in development]]
To develop or compile this project, open it in GitHub Codespaces or using Visual Studio Code's Dev Container extension (requires Docker to be installed).
Doing so will create an environment which has all the dependencies necessary in order to build and run the code in a more secure environment.
* Proofs of concept
[[./examples/README.org][Check out the examples/proofs of concept used in development]]

View File

@ -2,10 +2,17 @@
This directory is used to highlight proofs of concept and help ease the understanding and development of the sparse framework
Each example/proof of concept listed is listed in the order it was added, and highlights the feature being developed that was supplemented by such a proof of concept
Each example/proof of concept listed is listed in the order it was added, and highlights the feature being developed that was supplemented by such a proof of concept.
To learn more about the project, it is recommended to follow along in the same order when reviewing source code.
* bind-shell
[[./bind-shell/README.org][README]]
* [[./bind-shell/README.org][bind-shell]]
This example was used to set up the dev containers workspace, to verify that the static linking against libpcap was actually possible and feasible, and to see how small binaries could get when statically linked
* [[./reverse-shell/README.org][reverse-shell]]
* reverse-shell
[[./reverse-shell/README.org][README]]
Used to set up nl-sys to allow for better interfacing with the routing tables of the host operating system

View File

@ -2,15 +2,12 @@
This bind shell works through local host firewalls on Linux systems using UDP to receive messages, verify them against a public key, run the commands specified, and return the results and display it over the network.
* Setup
** libpcap
Follow the directions in the main README in order to pull in the libpcap dependency
** Generate keys
In order to build the example backdoor/client, generate public and private keys by going into ~/workspaces/sparse/examples/bind-shell/key-generator~ and run ~cargo run~
** Build the code
Once the previous steps are completed, run ~cargo build --release~ in a terminal.
* Running the code
First, open two shells. In one, run ~docker-compose up examples_bindshell_target~, and in the other run ~docker-compose run examples_bindshell_client~. It will be possible to type in commands to examples_bindshell_client and run them in the target container
In a dev containers terminal, run:
#+BEGIN_SRC shell
cargo make examples-bindshell-run
#+END_SRC
This will build the code, generate the keys, create the environment, and run the service and the client in parallel.
To verify the execution of the environment, try running ~iptables -nL~ and see that the firweall tries to block all packets.

View File

@ -13,8 +13,6 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
use std::fs;
fn main() -> std::io::Result<()> {
cc::Build::new().file("src/bridge.c").compile("bridge");
@ -24,7 +22,5 @@ fn main() -> std::io::Result<()> {
println!("cargo:rustc-link-lib=static=nl-3");
println!("cargo:rustc-link-lib=static=nl-route-3");
fs::remove_file("libnl/configure~")?;
Ok(())
}