OffRAMPS: An FPGA-based Intermediary for Analysis and Modification of Additive Manufacturing Control Systems
Jason Blocklove Md Raz Prithwish Basu Roy Hammond Pearce Prashanth Krishnamurthy Farshad Khorrami Ramesh Karri


 



















































OffRAMPS: An FPGA-based Intermediary 
 for Analysis and Modification of  
 Additive Manufacturing Control Systems
    
Jason Blocklove1, Md Raz1, Prithwish Basu Roy2, Hammond Pearce3,
 Prashanth Krishnamurthy1, Farshad Khorrami1, Ramesh Karri1

1New York University, New York, USA

2NYU Abu Dhabi, Abu Dhabi, UAE

3University of New South Wales, Sydney, Australia

jason.blocklove@nyu.edu, md.raz@nyu.edu, pb2718@nyu.edu, hammond.pearce@unsw.edu.au,
 prashanth.krishnamurthy@nyu.edu, khorrami@nyu.edu, rkarri@nyu.edu


    
====================================================================================================================================================================================================================================================================================================================================================================================================================












Cybersecurity threats in Additive Manufacturing (AM) are an increasing concern as AM adoption continues to grow. AM is now being used for parts in the aerospace, transportation, and medical domains. Threat vectors which allow for part compromise are particularly concerning, as any failure in these domains would have life-threatening consequences. 
A major challenge to investigation of AM part-compromises comes from the difficulty in evaluating and benchmarking both identified threat vectors as well as methods for detecting adversarial actions. In this work, we introduce a generalized platform for systematic analysis of attacks against and defenses for 3D printers. Our “OffRAMPS” platform is based on the open-source 3D printer control board “RAMPS.”
OffRAMPS allows analysis, recording, and modification of all control signals and I/O for a 3D printer.
We show the efficacy of OffRAMPS by presenting a series of case studies based on several Trojans, including ones identified in the literature, and show that OffRAMPS can both emulate and detect these attacks, i.e., it can both change and detect arbitrary changes to the g-code print commands.



Additive Manufacturing, Cybersecurity





§ INTRODUCTION





Additive Manufacturing (AM), also known as 3D printing, is the process of building up a manufactured component by repeatedly adding  material in specific quantities and locations. Subtractive manufacturing, instead, removes raw material until a final part is left.
AM is performed by designing a part using a computer-aided design (CAD) tool such as Autodesk Fusion or Solidworks, then sending the part to a “slicer” program to separate the part into component layers and, based on the target 3D printer, exports  which encodes the print head movements used to create the part (see Figure <ref>).



Declining prices  and  increasing quality of modern 3D printers is making them a common tool in hobbyist and professional spaces. In one form of 3D printing, fused filament fabrication (FFF)—also known as fused deposition modeling (FDM) printing—molten plastic is extruded in layers to build the part.
Other forms of 3D printing include stereolithography (SLA) which is the process of shining a UV light in specific shapes per-layer through UV-curing resin to build a part up and selective laser sintering (SLS) which scans a laser  a bed of reactive powder to fuse particles into solid layers. 

The ubiquity and ease of use of 3D printing has grown its adoption within a variety of safety-critical industry sectors, including in the biomedical domain <cit.>, in robotic components <cit.>, construction <cit.>, aerospace <cit.>, the automotive sector <cit.>, and others.
The varying needs of each industry has prompted both innovation and proliferation of interrelated tools and products, from hobbyist to professional and commercial domains. 






With this growth in usage comes the growth in threats against additive manufacturing systems <cit.>.


The threat landscape in the 3D printing domain encompasses the hardware, software, and supply chain, and can impact every part of the process in Figure <ref>.
Hardware attacks and defenses, which both affect and utilize the integrated circuitry and printed circuit boards used for AM systems, allow for modifications which can internally affect the quality, appearance, or structural integrity of the desired model.
Software-based modifications aim to affect the generated geometry of the design, usually resulting in the export of compromised control commands, known as.
Finally, supply-chain attacks affecting 3D printers  may include compromised slicing programs, defective components, or inherently flawed filaments and raw materials. 

Unfortunately, the cybersecurity threat landscape in 3D printing remains under-explored, in part due to the complexity involved in studying attacks which impact the real-world physical aspects of additive manufacturing.

Contributions:
To address these shortcomings, we introduce OffRAMPS, an FPGA-based integrated test-bed which facilitates the analysis and modification of key signals required to drive the functional components of modern fused filament fabrication (FFF) 3D printers.
It leverages the RAMPS open-source 3D printer control platform, which is representative of commercial offerings while allowing device modification.

OffRAMPS is the first platform to support emulationin-hardware analysis of both attacks and defenses. 
OffRAMPS enables in-depth exploration of novel printer attack strategies, useful for the identification of previously unexamined security blindspots, and we provide a suite of representative Trojans for this purpose. 
The analysis capabilities allow for expanding the defensive state of the art, and we present one defense capable of identifying major Trojans from the literature.
OffRAMPS is open-source, available here:<cit.>.







    

The contributions of this work are as follows:

    
  * The first platform for real-time signal monitoring and modification in hardware, aimed at evaluating Trojan attacks and defenses for 3D printers—OffRAMPS.
    
  * A suite of representative Trojans, implemented with the OffRAMPS hardware, inspired by current attacks in the literature.
    
  * A discussion of defensive techniques ...

All source for the OffRAMPS will be available at ... 













§ PRIOR WORK














 §.§ 3D Printing Security Threats






Over the last decade, improvement in the quality of printing materials and printers abetted printing intricate components with ease.
AM found use in diverse fields like aerospace engineering, construction engineering, bio-medical engineering, etc.
With its newly gained popularity, AM has become the target of attackers with malicious intents of sabotage and espionage <cit.>.
In sabotage-motivated attacks, the attackers either aim to compromise the overall printing process or focus on compromising the quality of the printed product such that its longevity is significantly reduced, causing irreparable damage to the victim company's goodwill.
In their work “dr0wned” <cit.>, the authors demonstrated an end-to-end cyber-physical attack that was initiated by introducing malware in the victim's machine.
This malware finds design files in the system, identifies spots that are vulnerable to stress, and inserts sub-millimeter holes in them.
As a demonstration, they compromised the design of a quadcopter drone's propeller, which caused the drone to crash mid-flight.
In another work <cit.>, the authors have modified the Marlin firmware <cit.> to introduce changes ranging from minor modifications of the executing  to the execution of alternative , leading to printing malformed or totally incorrect objects.
The infrequently updated firmware's bootloader becomes an attractive target for stealthy Trojan insertion in the recent study Flaw3D <cit.>.
Authors injected Trojans into the bootloader's flash memory, undermining the quantity of extruded material and compromising the print's quality.

In a different class of attack, the attacker aims to exfiltrate information about Intellectual Properties (IPs) being printed.
A 3D printer has mechanical components, such as motors and heating elements that require specific signals to actuate.
A firmware like Marlin, that resides in the controller of the printer, is responsible for parsing the  and generating these signals.
The attackers have prior information about the type of motors and can analyze these signals and the power consumed <cit.> by the motors to gain insight into the linear movements in different axes, thus partially recovering the executing .
In the papers <cit.>, the authors have exploited a similar correlation between the executing  and the sound emanated by the motors and the actuators to partially reverse engineer the IP.
Attackers can also leverage optical side-channels to recreate  for a design being printed <cit.>.
These findings highlight risks and security concerns in the 3D printing process.   



 §.§ 3D Printing Threat Detection Techniques
 A significant number of the currently available threat detection methods are based on side-channel analysis.
Side-channels are passive mediums that leak information about the printing process due to the operation of various physical components of the printing device.
In the case of a 3D printer, the sound emitted by the rotation of the motors, the change in the magnetic field causing the rotation of motors, the power consumed by the motors, the temperature of the hotend, and video of the overall printing process can be considered as the source of acoustic, magnetic, power, thermal <cit.>, and optical side-channel leakage, respectively.
The assumption for this type of detection is that a good print will have a different side-channel leakage profile than a compromised print. 
In <cit.>, acoustic emission of the motors in a secure setup is used as the golden model and is compared to the acoustic signature of future prints to detect anomalies due to  manipulation.
However, acoustic side-channels have limited accuracy in determining small and rapid moves, which reduces their efficacy.
In <cit.> the power profiles of the four stepper motors for the X, Y, and Z axes plus the extruder are used as a golden reference model against the power profile of future prints.
Power side-channel-based analysis, although effective, requires forty repetitions of each print to nullify the noise and syncing issues, making it expensive and non-scalable.
In <cit.> video feeds (optical side-channel) of numerous printing processes are used to train an ML model and this  model is used to classify the current print as actual or compromised.
The optical side-channels allow visual reconstruction of the  object and thus can detect layer-by-layer anomalies of the printing process as long as it has been trained to capture such errors.
While quite effective, this method requires significant hardware overhead with very specific requirements for camera placement and image capture.
The accuracy of the results is also dependent on the specific features being printed and the machine learning methodology used to detect the anomalies.

AM security can be thought of as a subset of cyber-physical systems security. For surveys of this area, see <cit.>.



§ OFFRAMPS BOARD OVERVIEW

This section details the design of the OffRAMPS board (<Ref>), a PCBprinted circuit board (PCB) which uses a field programmable gate array (FPGA) as a machine-in-the-middle (MITM) in a popular open-source 3D printer control system.
The board is designed to interface with 1) a Digilent Cmod-A7 FPGA development board, 2) an Arduino Mega running Marlin firmware, and 3) a RAMPS 1.4 3D printer control board.
We add jumpers and logic level shifters to allow the signals to be rerouted as necessary for different experiments.
In Figure <ref>, OffRAMPS is located between the Controller (Print Firmware) and the Interface circuits (I/O Hardware), which enables it to detect and interfere with all signals at digital level voltages (lower than 5V).



 §.§ Open Source 3D Printing

In the FFF printing space there are numerous companies which make consumer 3D printers such as Creality, Bambu, Prusa, and Ultimaker; however, open-source printers have been a mainstay in 3D printing and many manufacturers (such as Prusa) continue this tradition by open-sourcing their own designs. 
Many of the open-source design components for printer hardware, mechanical and electrical, fall under the RepRap project <cit.>. 
The low-cost RepRap Arduino Mega Pololu Shield (RAMPS) printer control board is one such component, so named because the original version used an Arduino Mega (ATMEGA2560 Chipset) and Pololu stepper driver modules (A4988 Chipset).
In this work we use version 1.4 of this board, 

which is designed to interface with an Arduino Mega as a hardware-on-top (HAT) device.
The Arduino must run firmware which can interface with a host computer, and for this purpose Marlin is often used as it is another fully open-source piece of the system.
Most designs of RepRap FFF printers can make use of this stack of control boards, making it a prime candidate for evaluation and representative function of other boards.



The broader RepRap project is an endeavor aimed at creating self-replicating 3D printers that are open-source, and has been a major driver for the increased access of additive manufacturing. 
This increased access has also come at a cost, however—clones of these boards are sold by an extensive list of sellers through various online outlets. These clones, which may come with different ICs and functionalities, are of varying quality and provenance. 
Unaware end-users may be impacted negatively by faulty control boards, which may be caused by inferior counterfeit components with undersirable changes to the originals. 








 §.§ OffRAMPS: Design Motivation



A common threat model for AM comes from malicious third parties modifying the controller printed circuit boards (PCBs)PCBs <cit.> to feature firmware or hardware Trojans. Other attacks come from the software space, where CAD programs may be compromised <cit.>.
It is thus desirable to support emulation of hardware, firmware, and software Trojans in a single platform, as well as provide capabilities to analyze signals passing from the firmware runningon the control CPU to the driving components. 

RAMPS 1.4 is an open-source control PCB for 3D printers, designed by RepRap, made to interface with an Arduino Mega by plugging into the top as a HAT device (Figures <ref>, <ref>).
We make use of this setup for the OffRAMPS as a representation of control boards used throughout the industry, as all FFF printers will ultimately require the same set of signals.
OffRAMPS allows the Arduino/RAMPS stack to function normally when in a standard configuration, but enables the FPGA to analyze and modify the signals passing between the original boards with simple jumper changes (the yellow highlighted banks in <Ref>).
These can redirect signals from normal operation to MITM operation, changing source and destination as needed. 
Meanwhile, the FPGA is used as a reconfigurable platform to enable adversarial and defensive techniques to be tested, analyzed, and verified in hardware.
<Ref> shows the three signal path configurations possible with the added MITM FPGA.




 §.§ Primary OffRAMPS Printed Circuit Board Design

OffRAMPS has the following major components:



  §.§.§ Digilent Cmod-A7




The Cmod-A7 FPGA development board <cit.> has a Xilinx Artix-7 35T FPGA, LEDs and two push buttons. It is used as the MITM deployment platform between the Arduino and the RAMPS boards.



To intercept all 3D printer control signals between the Arduino and RAMPS boards, all GPIO headers were used, save one pin which was broken out to assist in debugging or external signal insertion.
Additionally, the Artix-7 has an onboard analog-to-digital converter (ADC) which can be used alongside an off-chip digital-to-analog converter (DAC) and opamp to read and modify analog signals like the voltage level through the thermistors on the 3D printer.






  §.§.§ Arduino Mega

The Arduino Mega <cit.> in this system is configured to run the popular 3D-printer open-source  Marlin firmware <cit.>.
It receives  generated by a slicer such as Cura or Slic3r and sends signals to drive components on the connected 3D printer.
These include (1) step and direction ( and ) signals for each of the stepper motors on the printer— axis movement and filament extrusion; (2) fan speed control for the part cooling fan, (3) heating element control for both the heated bed and hotend, and (4) UART signals to interact with a connected display/control board.
Marlin implements some safety features such as checks for thermal runaway.



  §.§.§ RAMPS 1.4

The RAMPS board controls the actuator functions of the printer directly with stepper motor drivers, fan control circuity, and heating element circuitry—all driven by the aforementioned signals sent from the Arduino.
In turn this board sends back signals for the endstops of the axes and the thermistors for both the heated bed and hotend of the printer.
The display/control board also connects through the RAMPS using UART to allow a user to interact with the printer directly without having a connected host computer.

RAMPS has onboard configuration jumpers to micro step the stepper motor drivers, but otherwise all control for the onboard devices is managed by the Arduino.
The stepper motor drivers are also modular, we opted to use the default A4988 drivers shipped with RAMPS.
These are inexpensive and popular, representative of components common to commercial 3D printers.









  §.§.§ Logic level shifting
 Both the Arduino and RAMPS 1.4 boards require a 5V logic level for their signals. 
The Cmod-A7, however, can only support voltages up to 3.3V. To accommodate this necessary level shift for the FPGA I/O bidirectional logic level shifters and enhanced field effect transistors (FETs) are integrated on board to allow the 5V logic to be shifted to a usable 3.3V for the FPGA, and then re-converted back to 5V for the Arduino and RAMPS boards.





  §.§.§ Board Power
 The RAMPS board receives its power from the 3D printer's 24V power supply. 


The Arduino and FPGA need a separate power source, which can come from either the USB ports on each board or can be externally and separately provided. 
By separating the power systems and allowing their source to be selected, the OffRAMPS can function without a host computer—a common deployment strategy for many 3D printers.



































 §.§ Test Environment



The test environment used for validating and experimenting with the OffRAMPS consisted of a modified Prusa i3 MK3S+ 3D printer <cit.> and a host computer running Ubuntu 22.04.
The Prusa i3 MK3S+ is an incredibly popular hobbyist-grade 3D printer compliant with the RepRap project.
A small modification had to be made to the Prusa to add mechanical endstops as this is a more common method of homing than the more advanced sensorless homing that the Prusa control board supports natively.
The RAMPS required small modifications to ensure compatibility with a 24V power supply—this was done according to the instructions for this conversion from RepRap.
All prints were sliced with Ultimaker Cura and  control was done with Repetier Host.


§ OFFRAMPS FOR TROJAN INSERTION

    
    

 §.§ Objective and Relevance

    The OffRAMPS presents several advantages over conventional firmware and  based Trojans: the FPGA leveraged as the MITM allows for both fine-grained logic and timing level modification of all control signals at the resolution of the FPGA clock speed (100MHz).
    We present several Trojans which take advantage of these benefits and the direct access to fundamental control signals. 

    

 §.§ Methodology and Design Considerations

    
    The OffRAMPS was evaluated for its ability to implement Trojans mimicking common 3D printer issues as well as Trojans which maliciously compromise the  printer hardware itself, as outlined in <Ref>.
    These Trojans are designed to modify the part,  deny access to certain printer elements, or damage the part or the printer itself.
    
    
    
    
    
    


 A  framework for the insertion of  Trojans was created using VHDL. This framework allows for both standard operation of the printer via signal bypass or malicious operation through the Trojan module. Several sub-modules were created to control the insertion of Trojans as follows:

    Pulse Generation Module handles the generation of pulses for the stepper motor drivers, and allows for the customization of both frequency and pulse width, along with input parameters for micro stepping determined by the printer configuration.
     
    Edge Detection Module implements an edge detector to identify events such as print head movements or extrusions via observation of the  and  stepper motor driver signals from the Arduino or endstop actuation for homing detection.

    Homing Detection Module is a state machine which tracks actuation of the endstops in a defined order to determine when the print head has homed. This is the first action taken at the start of print and can determine when to activate Trojans.
    
    Trojan Control Module has logic to enable or disable each of the Trojans (<Ref>), along with control units for each Trojan. The modified signals produced by this module are multiplexed with the original control signals so the Trojans can be dynamically activated or deactivated.


    

 §.§ Results and Analysis of Effectiveness

























































Golden Print (<Ref>: T0), was created by setting the FPGA in `bypass' mode. The control signals from the Arduino pass through, without modification, to the RAMPS board. The printed part shows no deformation, structural compromise, or dimensional inaccuracy.

Trojan T1 implements an arbitrary shift along the X and Y axes every ten seconds. This print shows extensive shift along both axes, affecting dimensional accuracy and part practicality. The FPGA on the OffRAMPS allows to injection stepper motor pulses in between the original control pulses, causing longer travel motions of the print head. This effect is used by the Trojan to add extra steps without adding extra print time.

Trojan T2 modifies the amount of material extruded during printing, similar to a `flow' parameter used when slicing a STL model. The Trojaned part, was printed while masking half of extruder stepper motor pulses sent to the RAMPS board, reducing the flow and amount of material extruded by 50%. This implements reduction Trojans from Flaw3D.

Trojan T3 mimics a type of problem which can occur from improper settings when slicing a model into . Retraction refers to the amount of filament that is pulled back during certain movements. By affecting extruder steps during some movements we can cause over or under extrusion in a way that could appear to a user as if part settings were incorrect when sliced. This Trojan is shown with over extrusion in <Ref>: T3.

Trojan T4 implements a Z-wobble Trojan. Z-wobble is  common build issue with 3D printers, where the frame holding the Z-axis is not rigid; thus, the print head can shift during printing. Trojan T4 emulates this error by adding steps on one axis during printing causing layer shifts.

Trojan T5 causes an arbitrarily sized shift on the Z-axis, causing poor layer adhesion or, in severe cases, layer delamination. This mimics improper slicing settings if the layer spacing is modified throughout the print, and poor hardware setup if a shift is done at the start of print, causing the part to fail to adhere to build plate. 
        
Trojan T6: 3D printers have multiple heating elements including a heated bed, to assist with part adhesion to the build plate, and a hotend for extruding molten material. Should these heating elements be unable to reach the necessary temperature, the 3D printer may be unable to begin a print or if the temperature should suddenly drop mid-print the part quality could be severely negatively impacted. This can also cause the firmware to throw a thermal runaway error and halt all operation. This Trojan was observed to successfully turn off the PID controlled MOSFETs employed in providing power to the heating elements, causing the Marlin firmware to enter an error state and end the print prematurely.
        
Trojan T7: The inverse of Trojan T6, Trojan T7 forces the heated elements to continue heating regardless of the firmware temperature control. By implementing this Trojan in hardware we are not only able to force overheating, but also able to ignore the firmware's thermal runaway panic and continue heating the elements. This is a purely destructive Trojan which can not only severely degrade part quality but can damage or destroy components of the printer itself. This Trojan was observed to successfully enable power MOSFETs for the heating elements permanently, bypassing all thermal control and fail-safes from the firmware, heating the element past the working specification. Furthermore, since the MOSFETs are fully turned on at a 100% duty cycle, the temperature of the hot-end was observed to rise extremely fast, passing the intended temperature within a few seconds of activation.

Trojan T8: Each stepper motor driver has an input signal  which determines if the motor is engaged and able to be moved. By actuating this signal throughout the print we can disable stepper motor movements strategically to fail a print. This emulates issues with stepper motor drivers or the motors as they can be made to arbitrarily cease functioning.
        
Trojan T9 affects the part-cooling fan on the printer and causes either over- or under-cooling during printing. Depending on the print material and the stage of printing, the cooling fan runs at various speeds, determined by the . Control signals for this fan are passed through the FPGA for full control. Print quality can be degraded by either over- or under-cooling. It can fail  if excessively cooled at the first layer causing it to pull off the build plate.

Trojans T1 - T5 produce prints with visible or structural anomalies and were printed using the OffRAMPS with a Prusa i3 MK3S+ printer, shown in <Ref>.
Trojans T6 - T9 affect aspects of the 3D printer which either prevent printing a part or would be destructive to the printer hardware; they were validated on our printer but did not produce parts we could show.



 §.§ Key Takeaways

Low-level access to all control signals afforded by the OffRAMPS board is a powerful capability to implement many different types of Trojans (the listed Trojans are not exhaustive of all possibilities). The FPGA also allows for the insertion of arbitrary combinations of Trojans along with their triggers.  Accessibility and granular control for interception and modification of signals makes the OffRAMPS board a powerful tool in inserting and testing 3D printer Trojans.
    


§ OFFRAMPS FOR PRINT MONITORING

In addition to signal modification in hardware, OffRAMPS also allows for signal extraction, enabling tests for print verification and Trojan detection.
In a sense, the FPGA can act as a rudimentary `digital logic analyzer' for the control signals passing between the Arduino and RAMPS boards.



 §.§ Objective and Relevance

Most 3D printer Trojans rely on maliciously altering a design at a stage prior to the signal transfer between the firmware and the control circuitry.
Flaw3D <cit.>, for example, modifies a design using a malicious bootloader to edit the  as it is sent to the firmware, resulting in prints with reduced structural integrity.
Dr0wned <cit.> creates modified models prior to their slicing, which ultimately will result in improper  being sent to the firmware.
By intercepting the signals after they are decoded by the firmware, we are able to record the real movements of the stepper motors and verify them against a known-good model.

This would be useful, for instance, in safety-critical parts in industrial manufacturing. Typically, randomly-selected parts may undergo destructive testing to validate performance. However, if a small subset of parts are intentionally and maliciously defective, then random testing may not identify them. 
OffRAMPS addresses this through continuous monitoring of prints—all parts will be checked, not just a random subset. Further, parts are checked during production, meaning that large malicious divergences can be detected and aborted early to save machine time and material cost. 




 §.§ Methodology and Design Considerations



To monitor the 3D printer in real-time, the FPGA is programmed to both record and export the relevant control information.
We designed a module to  track the number of steps sent to each stepper driver after homing. This translates into absolute positions within the build volume of the printer and a definite amount of extruded material.
This information is captured for known-good (“golden”) prints and used as a point of comparison against which all other prints would be evaluated.
The detection algorithm works as follows: (1) a “golden” model is captured by verifying a set of . This is done by first performing a print then completing extensive verification through both non-destructive and destructive testing to ensure the part meets the physical demands and constraints of the product. 
(2) Once assured, the pulse profile can be used as a point of comparison for future prints.

To acquire these pulse profiles we created a module to track the absolute position of each motor and use the USB-UART peripheral  on the Cmod-A7 to transmit it.

Axis Tracking: This module analyzes the stepper motor control signals,  and , for each of the axes  and the extruder to determine their positions.
This consists of a set of rising edge detectors and counters, which increment for each  rising edge when  dictated that the motors were moving in the positive direction and decrement when they moved negatively.
By correlating the steps to the movement along each axis—information available with printer setups—we are able to track the absolute position of the print head within the build volume and the amount of filament extruded.

To ensure the step counting always began from 0 in a known location, we leveraged the homing detection module created for Trojan insertion.
When the printer is homed at the beginning of each print, the step counts and UART transaction counter are initialized.
As the number of steps to home is determined by the arbitrary position of the print head at the start of the print, capturing this data was deemed unnecessary for evaluating the Trojans.

UART: For accurate  pulse counts between all tests, the counter to determine the frequency of the UART transactions starts after the print head is homed and the first  edge is found.
This synchronization  significantly increased accuracy over initial tests which did not wait for the first step before beginning the counter.
With the analysis started, the UART control unit sends a 16-byte transaction containing step counts for all of the motors each 0.1 seconds.

Overhead: A detection method which significantly impacts the speed or quality of a print is counterproductive to the goal of verifying that a print is of good quality. We estimated that the maximum propagation delay of any signal captured in the detection design is 12.923ns on the  signal. The ordinary signals between the Arduino and RAMPS boards were measured to have maximum frequencies less than 20kHz with a minimum pulse width of 1μ s. Given these parameters, a 12.923ns delay is negligible and we found no effect on print quality while running our detection hardware.




 §.§ Detecting Trojan-Induced Edits

Our Trojan detection strategy compares the captured pulse counts of a given print against a known-good capture, either derived from a print that was captured and then separately validated or from a simulation of the firmware. In a print without Trojan manipulation the Arduino will always send the same quantity of  and  control signals with approximately the same timing as the known-good print, but where the print commands have been interfered with these counts will change. 
Mismatches outside of a reasonable margin of error occur pointsuggest this kind of interference, and in our study, this translates to the presence of a Trojan. 
Here, the margin of error is due to the previously-discussedchallenge of synchronizing the step counting with the UART transactions.
Some drift in the counts occurs over the course of even known-good test prints.Additive manufacturing systems are asynchronous, so an instruction can take a slightly different amount of time when executed multiple times or across multiple prints.
This variation, referred to as “time noise” <cit.>, means that some drift in the step counts will occur over the course of even known-good test prints.
This drift was, however, always less than a 5% difference in our testing, so for our evaluations we used this 5% margin of error against our ideal profile.
This 5% margin of error can be made significantly smaller with a faster communication protocol, as fewer steps possible per transaction would lower the potential drift in counts.
The concern of having too large of an error margin is also mitigated with a final check with a 0% margin of error, ensuring that the correct number of steps was counted on each axis at the conclusion of the print.


A Python script compares a newly captured print against a “golden” model.
Should a mismatch outside of the 5% margin of error occur the transaction number and mismatching values are printed.
At the termination of the capture file the script then gives a report stating the total number of mismatches, the greatest error found, and the total number of captured transactions—based on these a determination of whether or not a Trojan is suspected is made.
This analysis can also be done in real-time while printing, enabling a user to halt a print as soon as a Trojan is suspected.



 §.§ Analysis of Flaw3D Trojans

To evaluate the Trojan detection methodology we emulated Trojans from Flaw3D <cit.>.
In the original work a modified bootloader was used to change  on the fly to implement one of two types of Trojan: reduction of extruded filament or occasional relocation of filament during the print.
We recreate these Trojans using a Python script which modifies given  in the same way the malicious bootloader does.
This yielded eight Trojans from two categories, each with varying levels of severity as
enumerated in <Ref>.



Each of these Trojans was printed and their pulse profiles were captured using the OffRAMPS.
Those captures were then compared against the known-good reference and the detection program was able to identify all of the Trojans. A selection of the captures and tool output is given in <Ref> showing mismatches outside of the margin of error and the detection tool output identifying them.
Here, the Trojan used was Test Case 7 (<Ref>), which is not a stealthy Trojan.

The stealthiest Trojans tested are Test cases 4 and 8 which reduce extrusion by only 2% and relocate material every 100 moves, respectively.
In both, the Trojan is minimal enough that structural integrity was not noticeably impacted.
However, the detection strategy was still able to identify their presence.



mystyle
    moredelim=[is][]!**!,
    moredelim=[is][]@**@,



We did not use this detection method to evaluate our own Trojans, as both the attacks and defense would be co-located in the same FPGA and we do not believe this would demonstrate any meaningful capabilities.

 


§ DISCUSSION


Evaluation: The OffRAMPS was successfully used to both insert and detect 3D printer Trojans and, with the reconfigurability of the MITM FPGA, could implement more novel Trojans, requiring fine-grained manipulation and analysis of the firmware-produced control signals.
This platform provides a basis for considerable future experimentation, with expansion of both the kinds of attacks which may be undertaken as well as new golden-free methods for detection and even reverse-engineering printed parts from their control signals.

Given the increasing adoption of Additive Manufacturing for safety-critical components and commercial applications, facilitating the analysis of security vulnerabilities in printers and real-time validation of part printing enables designs to be produced safely by providing methods to detect interference.

Limitations: While OffRAMPS was able to detect the tested firmware Trojans from literature, the study still has some design limitations. Firstly, the platform is limited in its ability to relay high-speed information (i.e. a high-frequency data capture) to a host PC due to a lack of circuitry to support a high speed communication interface such as Ethernet or USB, preventing complex analysis strategies.
Though it can emulate them, OffRAMPS is currently unable to detect any Trojans which affect the heating elements, whether implemented in firmware or hardware.
In addition, though the platform is designed with power isolation between the major components and can also support undervolting and brown-out attacks, this study did not explore this area, nor is there suitable circuitry for detecting such an attack.

Many 3D printers are intended to be run while not actively connected to a host computer, which the OffRAMPS cannot currently support for its Trojan detection functionality.


Related platforms: Other methods of attacks and defenses exist but are predominantly based on lossy side-channels such as acoustic, power, electromagnetic emission, or optical analysis.
The OffRAMPS, by connecting directly to control signals, is uniquely able to modify or analyze prints with no loss of data.
Including support for some of these other side-channel techniques is being considered for future revisions, but we have found no examples of other hardware platforms which can be used for 3D printer attacking or modifying in the same manner as the OffRAMPS.

Responsible disclosure: As all studied attacks required modification to the underlying components, no responsible disclosure is necessary for this work.









  


§ CONCLUSION

In this work we present OffRAMPS, a new hardware tool for emulation, evaluation, and detection of 3D printer Trojans.
By using an FPGA in a machine-in-the-middle configuration we are able to dynamically modify 3D printer control signals post-firmware as well as detect Trojans implemented at or before the firmware level. This enables investigation of both attack and defense scenarios, a task otherwise complicated by the relationship between digital and real-world components.

Using OffRAMPS we are able to emulate existing Trojans from the literature in hardware, as well as implement new Trojans which cannot easily be done in firmware. In total we implemented 9 such attacks from simple denial-of-service to subtle part modifications and thermal runaway, the largest suite ever supported by a single platform.
On the defensive side, we present a simple yet effective strategy which can be implemented in OffRAMPS to count the number of pulses over a series of time windows and compare this against a golden series of data (which can come from simulation), this strategy could detect all Trojans from the literature.



  



§ ACKNOWLEDGEMENTS

This work was supported in part by DoE Kansas City. Honeywell Federal Manufacturing & Technologies, LLC operates the Kansas City National Security Campus for the United States Department of Energy / National Nuclear Security Administration under Contract Number DE-NA0002839.

IEEEtran


