Using dd over ssh

Create local binary copy with dd

Binary copies of hard disks or even individual partitions can be created with dd. Typically dd is called locally to create an image or clone a drive or partition. Let's assume that we want to create a binary copy of /dev/xvdc3 and save it in a file /tmp/xvdc3.dd:

sudo dd if=/dev/xvdc3 | dd of=/tmp/xvdc3.dd*

By using pv in the middle of the binary data stream, you can also see the current data rate.

sudo dd if=/dev/xvdc3 | pv | dd of=/tmp/xvdc3.dd

The backup of a partition can quickly cover several GB. So if you want to create an image from a disk on a server, the local free space is usually not sufficient.

Create remote binary copy with dd and store locally using SSH

With SSH you can transfer the binary data stream encrypted over a network. Let us assume that we want to save a binary copy of the /dev/xvdc3 partition from a server with the hostname forensic to the file /tmp/xvdc3.dd locally for a forensic analysis.

ssh admin@forensic "sudo dd if=/dev/xvdc3" | pv | dd of=/tmp/xvdc3.dd

Adding data compression of the data stream:

ssh admin@forensic "sudo dd if=/dev/xvdc3 | gzip" | gunzip | pv | dd of=/tmp/xvdc3.dd

Section Navigation

binsec academy GmbH – Advanced Pentest Training Lab

binsec academy GmbH operates the Pentest Training Lab, a highly practical online platform dedicated to real penetration testing. Simulating complex corporate networks and advanced real-world attack scenarios within isolated lab environments, it is engineered to sharpen the skills of aspiring and professional penetration testers. Upon conquering our rigorous, fully practical examination, participants earn the distinguished Binsec Academy Certified Pentest Professional (BACPP) designation — proving their technical capability to methodically uncover and evaluate vulnerabilities in modern IT infrastructures.

Explore the Pentest Training Lab

binsec GmbH – Experts in Penetration Testing

binsec GmbH is a highly specialized penetration testing provider and the operative pentesting core of the binsec group. Since 2013, the company has focused exclusively on high-end, human-led penetration tests (pentests) and advanced red team simulations. Rejecting automated scans, our team of permanently employed, certified senior pentest experts delivers manual deep-dive assessments of critical digital systems: from web applications and APIs to mobile apps, complex network infrastructures, and cloud environments. As a dedicated assessment partner for highly regulated sectors such as Payment, Banking, and Healthcare, binsec GmbH provides clear risk evaluations and actionable reports to effectively secure business-critical systems.

Get Manual Expert Penetration Testing Services

Contact

binsec GmbH
Clemensstraße 6-8
60487 Frankfurt am Main
Germany

Legal notice

Director: Patrick Sauer
Authorized Officer: Dominik Sauer, Florian Zavatzki
Registration: Frankfurt am Main, HRB97277
Turnover Tax Identification No.: DE290966808