maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Maemo 5 / Fremantle (https://talk.maemo.org/forumdisplay.php?f=40)
-   -   script to wipe all sensitive user data - guinea pigs (/lemmings) wanted, apply within! (https://talk.maemo.org/showthread.php?t=69518)

festivalnut 2011-02-08 16:26

script to wipe all sensitive user data - guinea pigs (/lemmings) wanted, apply within!
 
in my alternate life as an international man of mystery i may at some point have to wipe all my data in an emergency, i know there is a short xterm code to completely erase everything, but i want the phone to still be usable, i was just wondering if there is a xterm code that will wipe all user data but leave the os intact? then i can queen beecon it and if the commies catch me i can hit the button and nobody has to die. yet.

p.s. this post will self destruct in 3hours.

Captwheeto 2011-02-08 16:31

Re: xterm command to wipe all user data?
 
What kind of things did you want deleting? I don't think there's a one-stop-delete-everything-in-a-usable-way command, but it's certainly scriptable.

festivalnut 2011-02-08 16:35

Re: xterm command to wipe all user data?
 
basically everything i've put on there, call records, texts, images and videos, im, gps history. if its scriptable it may be good to not delete my apps and saves etc, but definately anything that could lead the enemy to my secret volcano safehouse... oops, i've said too much already!

jstokes 2011-02-08 16:41

Re: xterm command to wipe all user data?
 
Start with the "Clear device" function already found in Settings. It runs a script: /usr/sbin/osso-app-killer-cud.sh

It doesn't clear everything (esp. settings in ~ by applications created by a 3rd-party, for instance) but it just runs a bunch of scripts in /etc/osso-cud-scripts/

festivalnut 2011-02-08 16:47

Re: xterm command to wipe all user data?
 
Quote:

Originally Posted by jstokes (Post 939129)
Start with the "Clear device" function already found in Settings. It runs a script: /usr/sbin/osso-app-killer-cud.sh

It doesn't clear everything (esp. settings in ~ by applications created by a 3rd-party, for instance) but it just runs a bunch of scripts in /etc/osso-cud-scripts/

thanks, i'm guessing i'd want to edit this to my own settings, so it clears what i want it to, but obviously i'm a bit dubious about how to safely open and edit it, i dont want to accidentally run it prematurely! any tips for playing with this particular fire safely?

ps would a rm /home/user/MyDocs/ command work as root or is it somehow protected? again, testing isn't really an option!

Captwheeto 2011-02-08 16:49

Re: xterm command to wipe all user data?
 
Should work... you should definitely test it though to make sure ;)

jstokes 2011-02-08 16:53

Re: xterm command to wipe all user data?
 
Quote:

Originally Posted by festivalnut (Post 939133)
thanks, i'm guessing i'd want to edit this to my own settings, so it clears what i want it to, but obviously i'm a bit dubious about how to safely open and edit it, i dont want to accidentally run it prematurely! any tips for playing with this particular fire safely?

No? :D

I guess you'd have to go through the scripts and try and figure out what's being deleted. If you have the time, you could use RobbieThe1st's BackupMenu to create a clone of your rootfs and see what gets deleted...

Quote:

ps would a rm /home/user/MyDocs/ command work as root or is it somehow protected? again, testing isn't really an option!
It should work as anyone: MyDocs is just a FAT32 partition with no understanding of UNIX permissions. Though you'd want to make sure that it's error-free so that it's not mounted as read-only! You'd also want to add a "-r" (maybe an "-f" also?) to your rm command so that it deletes subdirectories too

festivalnut 2011-02-08 16:54

Re: xterm command to wipe all user data?
 
Quote:

Originally Posted by Captwheeto (Post 939135)
Should work... you should definitely test it though to make sure ;)

no thanks for you this time captain wheeto! if it wasn't so recently that i had to repopulate my n900 after i got it back from nokia i may be willing to go through all the hassle, but not again so soon!

would this remove the contents of MyDocs, or the actual MyDocs folder itself? and would the n900 create a new MyDocs folder or is it reflash time if that goes?

festivalnut 2011-02-08 17:02

Re: xterm command to wipe all user data?
 
i think what i'll do is try writing a little script and then bring it back for you all to have a look and either approve or show me the error of my ways, is there a command to delete all sub directories like you mentioned but leave the parent folder alone?

and just to save me some homework does anyone know off the top of their heads the locations of:

saved texts
saved im
call records
fmms images
web bookmarks
web history
cache
saved passwords etc.

Captwheeto 2011-02-08 17:08

Re: xterm command to wipe all user data?
 
Bwaahaaha.

Anyway, that would delete the directory + everything in it (if it was rm -r).
If you wanted to keep the folder but delete the contents you'd do

rm -r /home/user/MyDocs/*

But why make it easy for them to get your super secret volcano hideout? (Ps. I know where it is)

#!/bin/bash
for ((a=0;a<3;a++))
dd if=/dev/zero of=/home/user/MyDocs
done

festivalnut 2011-02-08 17:14

Re: xterm command to wipe all user data?
 
Quote:

Originally Posted by Captwheeto (Post 939150)
But why make it easy for them to get your super secret volcano hideout? (Ps. I know where it is)

no you dont! (shhhh! or i may have to kill you!)
Quote:

#!/bin/bash
for ((a=0;a<3;a++))
dd if=/dev/zero of=/home/user/MyDocs
done
i'm not sure i even wanna know what that does, it looks kinky! :/
just realising how noobish i am once i start venturing back into xterm, but is bash the built in one or is that a seperate install i probably dont have?

Captwheeto 2011-02-08 17:17

Re: xterm command to wipe all user data?
 
bookmarks are

/home/user/.bookmarks/*

history seems to be

/home/user/.browser_typed_urls

I dunno if you want contacts but they seem to be here

/home/user/.osso-abook/

and emails are

/home/user/.modest/


I'm not sure if I'm completely right, this was in a few seconds of poking around,


Bash isn't built in, you can change that to /bin/sh, sorry!

Also it just wipes all the data with 0's three times.

festivalnut 2011-02-08 17:26

Re: xterm command to wipe all user data?
 
okay first attempt...

sudo gainroot
rm -r -f home/user/MyDocs/Private
rm -r -f home/user/MyDocs/.images/*
rm -r -f home/user/MyDocs/.sounds/*
rm -r -f home/user/MyDocs/.videos/*
rm -r -f home/user/MyDocs/DCIM/*
rm -r -f home/user/MyDocs/Downloads
rm -r -f home/user/.bookmarks/*
rm -r -f home/user/.cache/*
rm -r -f home/user/.fmms/*
rm -r -f home/user/.modest/cache/*
rm -r -f home/user/.modest/images/*
rm -r -f home/user/.modest/local-folders/*
rm -r -f home/user/.modest/outboxes
rm -r -f home/user/.skype/*
rm -r -f home/user/.thumbnails/*

hows that look? will it work? have i missed anything? how 'tarded is my attempt at coding?

the wiping with 0's sounds like a good idea, just in case these commies get the serious tech out to sniff the deleted data (is that even doable on flash based memory?), can it be done without bash?

festivalnut 2011-02-08 17:29

Re: xterm command to wipe all user data?
 
i've definately missed something, text and call records for one, i'll have to dig deeper....

jstokes 2011-02-08 17:34

Re: xterm command to wipe all user data?
 
Nuke /home/user/.rtcom-eventlogger for those

Cue 2011-02-08 17:40

Re: xterm command to wipe all user data?
 
I'm not sure but I think they are stored in
/home/user/.rtcom-eventlogger/el.db
/home/user/.rtcom-eventlogger/el-v1.db

or something like that.
Why don't you just encrypt your file, or do you fear brutal interrogation from the commies?

Cue 2011-02-08 17:41

Re: xterm command to wipe all user data?
 
Quote:

Originally Posted by jstokes (Post 939181)
Nuke /home/user/.rtcom-eventlogger for those

beaten to the punch. :D

festivalnut 2011-02-08 17:44

Re: xterm command to wipe all user data?
 
Quote:

Originally Posted by Cue (Post 939187)
I'm not sure but I think they are stored in
/home/user/.rtcom-eventlogger/el.db
/home/user/.rtcom-eventlogger/el-v1.db

or something like that.
Why don't you just encrypt your file, or do you fear brutal interrogation from the commies?

interrogation is inevitable, brutality doubly so. and i dont trust encryption tbh, it can always be undone, never mind i'll fold under interrogation so quick it may not have finished encrypting by the time i tell them, deletion is quick and easy, like the cyanide pill! ;)

festivalnut 2011-02-08 17:47

Re: xterm command to wipe all user data?
 
i've added event logger and also memory card, and appended a / to the front of all the directories (thats right isn't it? damn i'm so noob i'm ready to slap myself!)

so draft 2 looks like:

Code:

sudo gainroot
rm -r -f /home/user/MyDocs/Private
rm -r -f /home/user/MyDocs/.images/*
rm -r -f /home/user/MyDocs/.sounds/*
rm -r -f /home/user/MyDocs/.videos/*
rm -r -f /home/user/MyDocs/DCIM/*
rm -r -f /home/user/MyDocs/Downloads
rm -r -f /home/user/.bookmarks/*
rm -r -f /home/user/.cache/*
rm -r -f /home/user/.fmms/*
rm -r -f /home/user/.modest/cache/*
rm -r -f /home/user/.modest/images/*
rm -r -f /home/user/.modest/local-folders/*
rm -r -f /home/user/.modest/outboxes/*
rm -r -f /home/user/.skype/*
rm -r -f /home/user/.thumbnails/*
rm -r -f /home/user/.rtcom-eventlogger/*
rm -r -f /media/mmc1/*

yes? no? maybe? and if there is an empty/missing directory for any reason, such as missing mmc, will it ignore and carry on or halt with an error?

sorry for so many questions guys ur all being so helpful!

panta 2011-02-08 17:49

Re: xterm command to wipe all user data?
 
Add autocomplete dictionaries to your list
/home/user/.osso/dictionaries/

festivalnut 2011-02-08 17:53

Re: xterm command to wipe all user data?
 
Quote:

Originally Posted by panta (Post 939199)
Add autocomplete dictionaries to your list
/home/user/.osso/dictionaries/

ahhhh! them devious reds could deduce passwords or names and adresses that way! well spotted! :)

vi_ 2011-02-08 18:02

Re: xterm command to wipe all user data?
 
echo "rm -r /*" | sudo gainroot


























warning: dont actually do this.

festivalnut 2011-02-08 18:11

Re: xterm command to wipe all user data?
 
Quote:

Originally Posted by vi_ (Post 939210)
echo *************
warning: dont actually do this.

no, definately dont, thats the command i was talking about in the first post, and was hesitant to even write it because there ALWAYS someone who just has to see what it does.

p.s. i've already mentioned several times i'm a bit noobish, but is your sig basically a linux version of russian roullette?

casketizer 2011-02-08 18:27

Re: xterm command to wipe all user data?
 
root
rm -rf /home/user/.*
rm -rf /home/user/Mydocs/.*
rm -rf ~/.*

should wipe any and all user data but leave OS and (most?) apps intact....

vi_ 2011-02-08 18:31

Re: xterm command to wipe all user data?
 
more or less...wanna play?

linux in scotland, no rules, life is cheap.

festivalnut 2011-02-08 18:35

Re: xterm command to wipe all user data?
 
Quote:

Originally Posted by casketizer (Post 939234)
root
rm -rf /home/user/.*
rm -rf /home/user/Mydocs/.*
rm -rf ~/.*

should wipe any and all user data but leave OS and (most?) apps intact....

thanks, but i think the somewhat bloated (and possibly non functioning - did you have a look? could use suggestions!) script i wrote will remove most if not all of my sensitive data without too much collateral damage, i've been worrying that removing system created folders might not be automatically replaced, leading to no such directory errors and so need a reflash. i may be wrong but still.

festivalnut 2011-02-08 18:37

Re: xterm command to wipe all user data?
 
Quote:

Originally Posted by vi_ (Post 939239)
more or less...wanna play?

linux in scotland, no rules, life is cheap.

lol! i like it!

i would play... but if it deleted my porn i'd be inconsolable, may as well have been the /home folder

ammyt 2011-02-08 18:50

Re: <s>xterm command</s> script to wipe <s>all</s> sensitive user data?
 
Open Xterm:
rm /*
p.s. don't try this

festivalnut 2011-02-08 18:52

Re: <s>xterm command</s> script to wipe <s>all</s> sensitive user data?
 
Quote:

Originally Posted by ammyt (Post 939256)
Open Xterm:
****
p.s. don't try this

we've covered this lesson already... :/

casketizer 2011-02-08 18:52

Re: xterm command to wipe all user data?
 
Quote:

Originally Posted by festivalnut (Post 939243)
thanks, but i think the somewhat bloated (and possibly non functioning - did you have a look? could use suggestions!) script i wrote will remove most if not all of my sensitive data without too much collateral damage, i've been worrying that removing system created folders might not be automatically replaced, leading to no such directory errors and so need a reflash. i may be wrong but still.

Normally there shouldnt be anything but user data in the ~/.* dirs.
Certainly your selective approach might be safer, depending how the apps you use play by the rules.
If I had stuff to hide and wanted to wipe my N900 asap w/o being prepared for it in advance, I'd punch in those lines I wrote....

Joorin 2011-02-08 19:04

Re: <s>xterm command</s> script to wipe <s>all</s> sensitive user data?
 
Don't forget to clean out the gconf store of user settings (including passwords and the such).

Have a look in /var/lib/gconf for a hint at how tricky it might be to delete only the things you want deleted... If you pick the wrong parts, installed applications, including NOKIA ones, might get really upset and fail to function.

festivalnut 2011-02-08 19:10

Re: xterm command to wipe all user data?
 
Quote:

Originally Posted by casketizer (Post 939262)
Normally there shouldnt be anything but user data in the ~/.* dirs.
Certainly your selective approach might be safer, depending how the apps you use play by the rules.
If I had stuff to hide and wanted to wipe my N900 asap w/o being prepared for it in advance, I'd punch in those lines I wrote....

there arent many/any apps i use which would have information useful to the enemy, my plan was to be sufficiently prepared in advance to press the button and worry no more, yet be able to pick up my n900 and use it as normal straight afterward, reconfiguring or reinstalling all my apps would be a nuisance to say the least.



anyway moving on... if theres no more suggestions for sensitive areas i may be ready to turn it into a script, so to do this i would...

save the command as say- panic.sh
somewhere that won't be deleted by the script (/home/user/panicscript/panic.sh for example)
chmod 777 /home/user/panicscript/panic.sh
then i just have to root panic.sh in xterm

is this correct?

festivalnut 2011-02-08 19:22

Re: <s>xterm command</s> script to wipe <s>all</s> sensitive user data?
 
Quote:

Originally Posted by Joorin (Post 939270)
Don't forget to clean out the gconf store of user settings (including passwords and the such).

Have a look in /var/lib/gconf for a hint at how tricky it might be to delete only the things you want deleted... If you pick the wrong parts, installed applications, including NOKIA ones, might get really upset and fail to function.

i'm trying not to delete the wrong parts specifically so they dont get upset!

i had a look and yeah, i'm already puzzled, are these the passwords microB stores for web pages or just the applications themselves?

i've added var/lib/ ... facebook, hermes, modest, osso/bookmark

Alfred 2011-02-08 19:43

Re: <s>xterm command</s> script to wipe <s>all</s> sensitive user data?
 
The commies have come to You. I'm from Russia, it's panic time!

festivalnut 2011-02-08 19:48

Re: <s>xterm command</s> script to wipe <s>all</s> sensitive user data?
 
Quote:

Originally Posted by Alfred (Post 939314)
The commies have come to You. I'm from Russia, it's panic time!


mwahahaha, as long as u remain in russia and nowhere near me and my n900, i think panic time may be a while away yet! ;)

Alfred 2011-02-08 19:56

Re: <s>xterm command</s> script to wipe <s>all</s> sensitive user data?
 
Quote:

Originally Posted by festivalnut (Post 939319)
mwahahaha, as long as u remain in russia and nowhere near me and my n900, i think panic time may be a while away yet! ;)

I just got 586 miles closer to You in 10 minutes (it's 586 Mi since You live in Scotland=), moved to Germany. About more than half an our, and i'll get you=)!

Joorin 2011-02-08 21:56

Re: <s>xterm command</s> script to wipe <s>all</s> sensitive user data?
 
Quote:

Originally Posted by festivalnut (Post 939295)
i'm trying not to delete the wrong parts specifically so they dont get upset!

Then this is a place where you really need to be careful.

Quote:

i had a look and yeah, i'm already puzzled, are these the passwords microB stores for web pages or just the applications themselves?
Any application can use gconf to store integers, booleans and strings containing whatever they like.

Some of the interesting parts are passwords for WiFi AccessPoints and different settings for applications. Browse around a bit in there and see if you find anything tasty. grep is a useful tool if you have some idea about what you're looking for.

Quote:

i've added var/lib/ ... facebook, hermes, modest, osso/bookmark
That might be enough. But I wouldn't count on it, depending on how determined The Enemy is.

festivalnut 2011-02-09 01:10

Re: <s>xterm command</s> script to wipe <s>all</s> sensitive user data?
 
Quote:

Originally Posted by Joorin (Post 939422)
Some of the interesting parts are passwords for WiFi AccessPoints and different settings for applications. Browse around a bit in there and see if you find anything tasty...

well i'm not really bothered about wifi passwords, if the enemy is within range of my routers then the sharks with frickin laser beams on their heads will get em! besides if their determined enough to get the passwords this way they'd be as well hacking the router. i did have a quick peek and the email and facebook/hermes passwords i think are sufficient to foil their plans without the risk of killing anything important.

festivalnut 2011-02-09 01:45

Re: <s>xterm command</s> script to wipe <s>all</s> sensitive user data?
 
1 Attachment(s)
okay here's version 0.3

Code:

sudo gainroot
rm -r -f /home/user/MyDocs/Private
rm -r -f /home/user/MyDocs/.documents
rm -r -f /home/user/MyDocs/.images/*
rm -r -f /home/user/MyDocs/.sounds/*
rm -r -f /home/user/MyDocs/.videos/*
rm -r -f /home/user/MyDocs/DCIM/*
rm -r -f /home/user/MyDocs/Downloads
rm -r -f /home/user/.bookmarks/*
rm -r -f /home/user/.cache/*
rm -r -f /home/user/.fmms/*
rm -r -f /home/user/.modest/cache/*
rm -r -f /home/user/.modest/images/*
rm -r -f /home/user/.modest/local-folders/*
rm -r -f /home/user/.modest/outboxes/*
rm -r -f /home/user/.osso/dictionaries/*
rm -r -f /home/user/.skype/*
rm -r -f /home/user/.thumbnails/*
rm -r -f /home/user/.rtcom-eventlogger/*
rm -r -f /var/lib/gconf/apps/maemo/facebook/*
rm -r -f /var/lib/gconf/apps/maemo/hermes/*
rm -r -f /var/lib/gconf/apps/modest
rm -r -f /var/lib/gconf/apps/osso/bookmark/*
rm -r -f /media/mmc1/*

now unless anyone has some sudden realisation that it'll break something, or just won't work, it may suddenly become 1.0 - to that end;

who wants to be a guinea pig?

no really, anyone recently reflashed and fancy giving it a whirl? just to make it a little bit easier i've attached a .txt ;)

if you haven't been reading along please don't do it, the whole purpose of this script is to delete your entire memory card, images, videos, documents, texts, email, call logs, Private folder, and other things as you can see above.

if you have been reading you'll know that i dont know s**t, haven't tried this (which is why i'm selfishly asking you to!), theres a possibility it might break something, and theres really no good reason for you to test it for me.

but if someone who knows what their doing, has recently reflashed and doesn't mind possibly having to do so again would like to try it out you'll have my eternal gratitude (or at least a weeks worth of gratitude anyway!)

also if any other spies (not enemy spies though) want to use/modify/whatever by all means feel free.

Cue 2011-02-09 01:52

Re: xterm command to wipe all user data?
 
Quote:

Originally Posted by festivalnut (Post 939278)
there arent many/any apps i use which would have information useful to the enemy, my plan was to be sufficiently prepared in advance to press the button and worry no more, yet be able to pick up my n900 and use it as normal straight afterward, reconfiguring or reinstalling all my apps would be a nuisance to say the least.

dpkg --get-selections > mypackages
dpkg --set-selections < mypackages

:D


All times are GMT. The time now is 01:08.

vBulletin® Version 3.8.8