Rust development environment for MIPS on NT4

Overview

Summary

This is a project which allows us to run Rust "shellcode" in a MIPS environment on NT 4.0.

TL;DR

Setup NT

Install NT 4.0 MIPS in QEMU using the command you see in qemu/run.sh.

Create disk and run system

qemu-img create –f qcow2 nt4.disk 2G
./qemu/run.sh

Setup system so you can access CD

Run Setup > Initialize system > Set default configuration > (choose your res)
    > Floppy 3.5
    > Second floppy: No
    > SCSI host ID 7

Setup ethernet address so network works in Windows

Run Setup > Initialize system > Set ethernet address
    > Pick an address (MUST BE A UNICAST MAC ADDRESS OR WINDOWS GETS MAD)
    > I used be2d08345673 with great success

Boot partition

You must configure a small boot partition for the bootloader

Go to run program:

cd:\mips\arcinst

A 5 MiB partition will do

Install Windows

cd:\mips\setupldr

Configure time

The time in Windows doesn't persist, set it inside Windows to something reasonable otherwise you'll get weird errors and cl.exe will not work so you won't be able to compile anything.

Use the tool

Deploy server.exe and client.exe to the system, then run server.exe inside QEMU.

Install felfserv to your path cd felfserv && cargo install --path .

Run felfserv (supplies code to guest over network and stdout prints from Rust running in guest) felfserv 0.0.0.0:1234 ./out.felf

Run make to build and deploy to MIPS!

Optionally run cargo watch -- make to get your code to re-deploy and run every time you change the Rust project.

Toolchain

To use this you need to copy the shellcode_client into a MIPS guest build and run server.exe (included without any backdoors).

The server binds to 0.0.0.0:42069 and waits for a TCP connection. Upon a TCP connection the server inside the guest will launch client.exe in the same directory in a new process, which will then connect to the host via 192.168.1.2:1234 to download the payload.

The reason we have client.exe in a separate process is so that we can crash it without problems on the server. This provides a seamless development experience when you use something like cargo watch -- make which will automatically use nc to tickle the server, causing the client to connect to the hosted felfserv which then causes the payload to execute in the guest.

The comms from the guest are sent to the felfserv over the socket that was used to download the shellcode.

Felfserv

felfserv is a server for FELF files. You can find the FELF converter at elfloader. You need to install this to your path as the Makefile invokes elfloader to convert the MIPS ELF into MIPS shellcode in the FELF file format.

felfserv simply runs like felfserv 0.0.0.0:1234 ./out.felf. It will listen to connections on IP and port you specified, and when connected to will serve up the specific felf over a very basic protocol. This is what the client.exe in the guest communicates with to download the Rust shellcode.

You might also like...
Leetcode Solutions in Rust, Advent of Code Solutions in Rust and more

RUST GYM Rust Solutions Leetcode Solutions in Rust AdventOfCode Solutions in Rust This project demostrates how to create Data Structures and to implem

Simple autoclicker written in Rust, to learn the Rust language.

RClicker is an autoclicker written in Rust, written to learn more about the Rust programming language. RClicker was was written by me to learn more ab

Rust programs written entirely in Rust

mustang Programs written entirely in Rust Mustang is a system for building programs built entirely in Rust, meaning they do not depend on any part of

Rust 核心库和标准库的源码级中文翻译,可作为 IDE 工具的智能提示 (Rust core library and standard library translation. can be used as IntelliSense for IDE tools)

Rust 标准库中文版 这是翻译 Rust 库 的地方, 相关源代码来自于 https://github.com/rust-lang/rust。 如果您不会说英语,那么拥有使用中文的文档至关重要,即使您会说英语,使用母语也仍然能让您感到愉快。Rust 标准库是高质量的,不管是新手还是老手,都可以从中

A library for extracting #[no_mangle] pub extern "C" functions (https://docs.rust-embedded.org/book/interoperability/rust-with-c.html#no_mangle)

A library for extracting #[no_mangle] pub extern "C" functions In order to expose a function with C binary interface for interoperability with other p

clone of grep cli written in Rust. From Chapter 12 of the Rust Programming Language book

minigrep is a clone of the grep cli in rust Minigrep will find a query string in a file. To test it out, clone the project and run cargo run body poem

Rust-blog - Educational blog posts for Rust beginners

pretzelhammer's Rust blog 🦀 I write educational content for Rust beginners and Rust advanced beginners. My posts are listed below in reverse chronolo

Learn-rust-the-hard-way - "Learn C The Hard Way" by Zed Shaw Converted to Rust

Learn Rust The Hard Way This is an implementation of Zed Shaw's Learn X The Hard Way for the Rust Programming Language. Installing Rust TODO: Instruct

Learn to write Rust procedural macros [Rust Latam conference, Montevideo Uruguay, March 2019]
Learn to write Rust procedural macros [Rust Latam conference, Montevideo Uruguay, March 2019]

Rust Latam: procedural macros workshop This repo contains a selection of projects designed to learn to write Rust procedural macros — Rust code that g

Owner
null
A cargo subcommand to fetch the $OUT_DIR environment variable from build scripts

cargo-outdir A cargo subcommand to fetch the $OUT_DIR variable from build scripts. This is extremely useful to inspect the output of automatically gen

null 2 Sep 29, 2022
The ray tracer challenge in rust - Repository to follow my development of "The Raytracer Challenge" book by Jamis Buck in the language Rust

The Ray Tracer Challenge This repository contains all the code written, while step by implementing Ray Tracer, based on the book "The Ray Tracer Chall

Jakob Westhoff 54 Dec 25, 2022
Rust, cargo and QEMU setup for multi-architecture OS development.

rust-osdev-jumpstart Rust, cargo and QEMU setup for multi-architecture OS development. Goal This repo should give you a boost in starting a bare-metal

Alister Lee 27 Nov 20, 2022
The source code that accompanies Hands-on Rust: Effective Learning through 2D Game Development and Play by Herbert Wolverson

Hands-on Rust Source Code This repository contains the source code for the examples found in Hands-on Rust. These are also available from my publisher

Herbert 261 Dec 14, 2022
Code to follow along the "Zero To Production" book on API development in Rust.

Zero To Production / Code (Chapter 10 - Part 1) Zero To Production In Rust is an opinionated introduction to backend development using Rust. This repo

Luca Palmieri 2.8k Dec 31, 2022
Game development practices with Rust programming language. I want to use different crates for this.

Hazır Oyun Motorlarını Kullanarak Rust Dili Yardımıyla Oyunlar Geliştirmek Rust programlama dilinde oyun geliştirmek için popüler birkaç hazır çatıyı

Burak Selim Senyurt 16 Dec 27, 2022
A collection of crates to make minecraft development (client, server) with rust possible.

rust-craft rust-craft is a collection of crates to make minecraft development (client, server) with rust possible. Motivation There's no better way of

João Victor 15 Mar 23, 2023
An inquiry into nondogmatic software development. An experiment showing double performance of the code running on JVM comparing to equivalent native C code.

java-2-times-faster-than-c An experiment showing double performance of the code running on JVM comparing to equivalent native C code ⚠️ The title of t

xemantic 49 Aug 14, 2022
A new blockchain architecture under active development, with a strong focus on scalability, privacy and safety

Project Slingshot Accelerating trajectory into interstellar space. Slingshot is a new blockchain architecture under active development, with a strong

Stellar 378 Dec 18, 2022
This blog provides detailed status updates and useful information about Theseus OS and its development

The Theseus OS Blog This blog provides detailed status updates and useful information about Theseus OS and its development. Attribution This blog was

Theseus OS 1 Apr 14, 2022