TIP: Click on subject to list as thread! ANSI
echo: alt-comp-anti-virus
to: ALL
from: DAVID W. HODGINS
date: 2015-03-08 07:05:00
subject: Re: How To Make A USB Sti

On Sun, 08 Mar 2015 12:15:16 -0400, (PeteCresswell)  wrote:

> Suppose I am at a trade show and some Nice Person is handing out free
> USB sticks.
> How do I make one of these things "Safe" ?
> Something Linux?

Assuming normal malware, not a firmware hack, in linux
Open any terminal application (konsole, gnome-terminal, etc.).
plug in the usb stick.
Check the final 10 or 15 lines of the output from the command "dmesg",
to determine which drive has been assigned to the usb stick.

For example, when I plug in a usb stick, dmesg shows ...
[259569.195480] usb-storage 3-4:1.0: USB Mass Storage device detected
[259569.195576] scsi18 : usb-storage 3-4:1.0
[259570.285773] scsi 18:0:0:0: Direct-Access              USB DISK 2.0     PMAP
PQ: 0 ANSI: 4
[259571.878000] sd 18:0:0:0: [sde] 15124992 512-byte logical blocks: (7.74
GB/7.21 GiB)
[259571.878623] sd 18:0:0:0: [sde] Write Protect is off
[259571.878626] sd 18:0:0:0: [sde] Mode Sense: 23 00 00 00
[259571.879248] sd 18:0:0:0: [sde] No Caching mode page found
[259571.879250] sd 18:0:0:0: [sde] Assuming drive cache: write through
[259571.882375] sd 18:0:0:0: [sde] No Caching mode page found
[259571.882377] sd 18:0:0:0: [sde] Assuming drive cache: write through
[259571.902776]  sde: sde1
[259571.907504] sd 18:0:0:0: [sde] No Caching mode page found
[259571.907507] sd 18:0:0:0: [sde] Assuming drive cache: write through
[259571.907510] sd 18:0:0:0: [sde] Attached SCSI removable disk

In this case, sde is the device assigned to the usb stick.

Switch to the superuser (aka root user) with the command "su -". Enter
the root password. On most live linux systems, the root user does not
have a password, so just press enter when it asks for the password.

To erase the drive, run the command ...
dd if=/dev/zero or=/dev/sde bs=1M count=2

This will completely erase the mbr, including the partition table.
The data will still be on the drive, but is no longer accessible
without sector level i/o, and will be overwritten, when new partitions
and data are written.

You can then use any partitioning software, such as gparted, sfdisk,
cfdisk, etc., to create a partition table, and partiton(s).

Use the exit command to undo the effects of the "su -" command.

Use the exit command, again, to close the terminal application.

Regards, Dave Hodgins

-- 
Change nomail.afraid.org to ody.ca to reply by email.
(nomail.afraid.org has been set up specifically for
use in usenet. Feel free to use it yourself.)
--- NewsGate v1.0 gamma 2
* Origin: News Gate @ Net396 -Huntsville, AL - USA (1:396/4)

SOURCE: echomail via QWK@docsplace.org

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.