Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trojan Detected #7

Closed
Thesupergrass opened this issue Feb 8, 2020 · 8 comments
Closed

Trojan Detected #7

Thesupergrass opened this issue Feb 8, 2020 · 8 comments

Comments

@Thesupergrass
Copy link

image

This is what I got when I ran the installer. Good thing i'm not an idiot & I ran it in a virtual which I deleted immediately.

@mikeslattery
Copy link
Owner

mikeslattery commented Feb 9, 2020

That was a false positive. The Tunic source code is verifiably not malware.

I did some testing with virustotal.com, and I believe the PS2EXE tool I use from Microsoft's NuGet repo is being falsely detected as malware. I use it to package tunic.ps1 as an executable. I suppose it's possible PS2EXE contains malware, but that would be very surprising given its wide use. I will quickly change how I package tunic to avoid this false detection.

You can verify Tunic isn't malware by downloading source and scanning tunic.ps1 and files directory.

I put a lot of effort into this as a service to the community. This sucks.

Further verificication

It's straightforward, but time consuming, to verify nothing bad is happening, although you'd need to understand powershell well. Some of these steps require a Windows 10 VM.

  • Look at the source and see what it does and see that it's safe. Only tunic.ps1 and file/* are packaged into tunic.exe. tunic.ps1 is where all the logic is.
  • Install 7zip https://www.7-zip.org/download.html
  • In powershell, download tunic.exe, extract files, and run dir. (The .exe is a self extracting .7z file.)
$url='https://github.com/mikeslattery/tunic/releases/download/0.2.1/tunic.exe'
(New-Object System.Net.WebClient).DownloadFile($url, 'tunic.exe')
7z x tunic.exe
dir

Will return something like this. You can compare the extracted files with the files on github to see they weren't tampered with.

Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d-----         2/8/2020   8:37 PM                files
------         2/6/2020   7:50 PM          41111 tunic.ps1
------         2/6/2020   8:02 PM         139264 tunic-script.exe
  • PS2EXE was used to create tunic-script.exe from tunic.ps1. Let's reverse it and verify.
.\tunic-script -extract tunic2.ps1
cmd /c fc tunic.ps1 tunic.ps2

The diff output verifies they are identical (except for some whitespace at the end of the files) and so tunic-script.exe wasn't tampered with.

Comparing files .\tunic.ps1 and .\tunic2.ps1
***** .\tunic.ps1

***** .\tunic2.ps1
*****

Or to to further check, let's rebuild tunic-script.exe:

install-packageprovider -name nuget -force
Install-Module -force -confirm:$false ps2exe
iinvoke-ps2exe -inputfile tunic.ps1 -outputfile tunic-script2.exe -title Tunic -credentialsGui -requireadmin -noconsole -nooutput -noerror
dir tunic-script*

The dir will return something like this. Notice the identical size of tunic-script.exe and tunic-script2.exe (but this verification could fail if the p2exe download differs from the one I'm using).

Mode                LastWriteTime         Length Name
----                -------------         ------ ----
------         2/6/2020   8:02 PM         139264 tunic-script.exe
------         2/8/2020   8:42 PM         139264 tunic-script2.exe

Even given all that, I will need to put a disclaimer in the readme that programs like tunic, that modify your bootloader, often get falsely detected. That likely wasn't the case here, but it may be in the future.

@Thesupergrass
Copy link
Author

Thesupergrass commented Feb 9, 2020

Thanks for the response, I just tried again to follow your steps & I've updated a fresh Win 10 install, this is the 1st exe I've attempted on this install & I can't even run it as it is immediately deleted due to virus detection.. This is less that I was able to do previously as it at least told me what virus it was and asked what I wanted to do (Remove, Quarantine etc).. Watch my screen recording..

https://gofile.io/?c=sKtbCX

@Thesupergrass
Copy link
Author

Tried saving the file instead, same thing, instantly deleted due to virus.. Nobody in their right mind is going to disable their virus protection in order to install a program.. I think you have a roadblock on your hands.

@Thesupergrass
Copy link
Author

One more thing I remembered.. The 1st time yesterday where I got to remove the virus & keep Tunic installed, when I opened it, it had nothing in the dropdown for distros, the dropdown was completely empty.

@mikeslattery
Copy link
Owner

Please check again with latest release. I'm only about 50% sure this will fix your particular issue.
https://github.com/mikeslattery/tunic/releases/tag/0.2.2

@mikeslattery
Copy link
Owner

I made significant change to how Tunic is packaged. I'm now using NSIS. See tunic.nsi and build.ps1 in the develop branch.
This means that ps2exe and 7zip's auto-expander are now no longer part of tunic.exe. These are tools often used by "script kiddies" which is probably why it was flagged.

@Thesupergrass
Copy link
Author

image

Downloaded without issue, no windows defender instant removal.. Just the regular protection due to unknown app & publisher which is normal..

image

Ill leave it at that till I get the chance to test your program out later tonight. Thanks for the swift solving of the issue.

@mikeslattery
Copy link
Owner

mikeslattery commented Feb 10, 2020

Nice! Thank you for the repeated testing. I'll closet this ticket.
Feel free to ask me to re-open it if you (or anyone else) think this is still an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants