On 15/02/2020 19:02, Frederick Gotham wrote:
> David Brown wrote:
>
>> You want to create a program on the fly to run as root, and delete
>> it afterwards? Can you imagine a better way to make the program
>> look like malware?
> <interpostal snip>
>> Faff around with creating binaries on the fly, and other weird
>> ideas, and you can be confident that distros will reject it.
>
>
> Are you arguing, in general, that a person who has good intentions
> should refrain from doing something if there is the possibility that
> an observer might think that they are up to no good?
>
No, of course not. That would be a ridiculous generalisation.
But I /am/ arguing you should not do something that is entirely
unnecessary for your good intentions, and uses techniques that are
primarily useful for bad intentions. If we were plotting these aspects
of your idea on a graph with one axis on the "looks like good intentions
vs. looks like bad intentions" and the other as "tried-and-tested,
standard and familiar solution to the problem vs. unusual and
experimental solution", then I am suggesting you stay out of the awkward
corner. I am not suggesting you stay off the graph altogether.
> How do you feel about BitTorrent? Should people who have good
> intentions avoid using BitTorrent for fear that an observer will
> think that they're doing something wrong?
That is a very different case. For one thing, there were perfectly
good, legitimate uses for the technology - it was a great way to spread
network costs for large downloads. And any system which provided that
feature for good purposes would also allow it for bad purposes. (Your
suggested solution is not a good one, and better choices can't be abused
for bad purposes.)
But Bittorrent users should be aware that the huge majority of
Bittorrent traffic is for unlawful (or at least suspicious, given that
laws vary from place to place) activity.
>
> The piece of software that I'm writing is a GUI network analysis
> tool. My application doesn't do anything malicious (like deleting
> users' documents or scrambling the master boot record) nor does it do
> anything invasive of privacy or copyright (e.g. copying a user's
> personal collection of short stories, or online banking passwords, to
> a remote server). My program is benign.
I realise it is benign. That does not mean it is a good idea to use
obfuscation techniques that are classic signs of malware.
>
> When trying to implement functionality in my program, it should not
> matter how much my programming techniques resemble the techniques of
> a hacker with bad intentions. Loading CPU instructions into a shared
> memory object to execute it isn't inherently malicious or in any
> dishonest. It's not like I'm trying to gain root access by deception
> -- I want the user to willingly enter their password to grant
> access.
I think you are wrong here. Yes, it matters that you are using such
techniques, for many reasons:
1. You would be alienating potential users - they will avoid your
software as it uses suspicious techniques.
2. You may cause conflict with protection mechanisms (AppArmor, or other
security systems). This means people can't use your software - or
worse, they must open their system to /real/ malware by disabling their
protections.
3. You encourage people to think it's okay to enter their root password
when a program asks for it. That is a bad precedence to set.
4. You show script kiddies how to make malware, since they can copy your
source and put their own malware in it.
You are trying to claim that the ends justify the means. I don't agree
with that. But whether you do agree with it or not, I hope you accept
that when there are simpler, safer and better ways to get the end
result, then these are preferable.
>
> If users were to start emailing me saying that their anti-virus
> software is quarantining my program, then okay I might have to look
> into that and maybe even contact the antivirus software company to
> inform them that their software is generating a false positive on my
> application. And if the anti-virus company don't reply to me, or if
> they reply to tell me that they won't relax their detector (nor add
> my program to an inclusion list) then I suppose I might have to come
> up with a new idea. Until that happens though, I don't think that I
> should restrict my own programming techniques because of how much or
> how little they resemble the techniques of a person with bad
> intentions. I actually think that the runtime generation of
> executable code is pretty cool.
>
> By the way, these fanciful techniques like playing around with
> interprocess memory and so forth are only for the 'portable' versions
> of my program. I'm happy to also supply the user with a vanilla
> installer for their operating system that does everything in the
> canonical way for their operating system if that's what they want.
>
> I think you're being overly and unnecessarily restrictive by advising
> people not to do something simply because it resembles something
> bad.
>
It's your software and your choice. I'll give the advice that I think
is right, but it's up to you to decide.