Author Topic: EricL's FTP IM + my attempt to save it for what is worth  (Read 6508 times)

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
EricL's FTP IM + my attempt to save it for what is worth
« on: January 02, 2017, 09:45:29 PM »
I cannot really see why EricL FTP based IM was abandoned other then security concerns.

If there are other reasons please do tell.

Also, is there any way to give each user a unique username and password? That in combination with not letting people mess with the source code should eliminate any security issues. I think.

Any ideas?

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Re: EricL's FTP IM + my attempt to save it for what is worth
« Reply #1 on: January 03, 2017, 07:16:35 AM »
At the time my concerns were:

1.  There's no way to limit the size of the directory the FTP dumps to on the server.  If the server runs out of disk space, Bad Things(tm) happen.  And we usually only figure it out after the fact.

2.  It doesn't scale well to lots and lots of users.

3.  It probably was against the terms and conditions of our server.

Now, I was not and am not a webdev, so these things might not be true!  Especially at the time I didn't understand Linux very well at all, which made it frustrating to do anything on the server, and when Eric was around we were using a hosting service (GoDaddy).  Now that we have our own server linuxbox, we can pretty much do whatever we want.  And I've certainly grown as a programmer over the last few years and since I started working at Google I've had to become more adept at linux stuff.

So, thinking about it now, we might be able to limit the size of the FTP folder using this method.  I'll try to dick around with it at some point in the next month maybe.

On the scaling issue, there might be some cleverness the clients can do to make it less of an issue.  And certainly it's not something we have to worry about if the number of simulations is counted in the dozens.  I think the FTP protocol itself is certainly capable of scaling up enough for our needs.

...

I think we can tie in the FTP accounts with forum accounts, so we can be at least be sure if something gets abused who to blame.  That I'm less sure of, as it would require some magic to connect the forum database with the FTP logins, which I think might be tied to system users.

...

If you want to start playing around with setting up a FTP based IM again, I'll see if I can get things kosher for it on the server.

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Re: EricL's FTP IM + my attempt to save it for what is worth
« Reply #2 on: January 03, 2017, 09:24:27 AM »
It is good to know that this may actually work  8)

I am not there yet as I have not started applying the exploit fixes yet.

I mainly asked to make sure I have a backup plan incase my attempt to port does not work.

Also we will need to figure out the whole open source thing. I am really not sure if we should let users mess with the source while connected to IM.
  For example:

 I was thinking of an IM mode where no 'repopulating' robots allowed. This IM is restricted not to teleport anything if there are not enough plants reproducing. The reason it is restricted is to not have fruitflys kill everything on all servers without letting enough self-sustaining plants teleport. If we let a user mess with code, the user can simply comment out this rule. We may catch this user in the act but the damage will be done. I.e. Say hello to unrestricted fruitfly starving itself after killing everything in IM.
« Last Edit: January 03, 2017, 09:27:04 AM by Botsareus »

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Re: EricL's FTP IM + my attempt to save it for what is worth
« Reply #3 on: January 03, 2017, 04:47:59 PM »
Quote
If you want to start playing around with setting up a FTP based IM again, I'll see if I can get things kosher for it on the server.

Numsgil, what do you think of my idea of not having future versions of DB open source?

Also I think I can call it something more funky then "DB2.5"

Offline Peter

  • Bot God
  • *****
  • Posts: 1177
    • View Profile
Re: EricL's FTP IM + my attempt to save it for what is worth
« Reply #4 on: January 03, 2017, 04:55:46 PM »
The FTP username/password shouldn't be in the sourcecode, rather in something like a property file which is not commited with the sourcecode, but does contain the credentials. So anyone without the password running it just from source can't use IM.

What are the security issues in the FTP solution of EricL?
Oh my god, who the hell cares.

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Re: EricL's FTP IM + my attempt to save it for what is worth
« Reply #5 on: January 03, 2017, 05:20:55 PM »
So I just have to put in the real credentials when compiling code. And no other users will be able to compile code and use IM without it. That is kinda brilliant Peter. Thanks. But what if someone hacks for credentials? I need Numsgils input on this as well.

No real security issues beyond that. But I still want to keep track of users with a username and password. Have no idea how to do it though.

I may end up actually implementing my current list of changes since I feel better about the whole thing. The list got rather big. But that will be during my time off from college. I also want to try a little money making project first during my time off. So it will be a while.

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Re: EricL's FTP IM + my attempt to save it for what is worth
« Reply #6 on: January 03, 2017, 06:03:58 PM »
I would imagine it's relatively trivial for someone to portsnoop their own computer and find the FTP credentials from a running version of DB, so it's not like making even the entire thing closed source would necessarily mean no one has the FTP login.

Best bet is a separate config file attached to the binary like Peter is saying.  Like this.  I'm not sure if something like that exists in VB6 but there's probably clever things we can do even if you can't do that in VB6.  But it just means people won't see the FTP credentials from casual inspection or web browsing.  It doesn't mean the FTP credentials are secure.

In the long run, like I was saying before, it'd be better to have users login with their forum usernames + passwords.  That would make it easy to revoke access to a specific person if they're abusing things.  A concerted troll would still be able to spoil things, but at least it wouldn't be as easy as getting a single set of FTP credentials.  But that's not a trivial undertaking.

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Re: EricL's FTP IM + my attempt to save it for what is worth
« Reply #7 on: January 04, 2017, 09:50:16 AM »
Quote
I would imagine it's relatively trivial for someone to portsnoop their own computer and find the FTP credentials from a running version of DB, so it's not like making even the entire thing closed source would necessarily mean no one has the FTP login

I dig it. Server credentials will be eventually stolen. But what good is credentials if a user can not mess with the source in the first place? That is my philosophy behind it. edit: I plan to do the organism save code from scratch because I want organisms at start of simulation. It will not be comparable with DBII anyway.

Also, I do want to go with individual usernames and passwords. And possible hook up an automatic league runner to this as well.
« Last Edit: January 04, 2017, 11:16:22 AM by Botsareus »

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Re: EricL's FTP IM + my attempt to save it for what is worth
« Reply #8 on: January 04, 2017, 11:40:53 AM »
I may end up just doing it open source 2.49 with more or less EricLs ftp. If I will find myself with nothing better to do. But fair warning this will include my drastic changes to vegys.

Offline Peter

  • Bot God
  • *****
  • Posts: 1177
    • View Profile
Re: EricL's FTP IM + my attempt to save it for what is worth
« Reply #9 on: January 04, 2017, 01:53:13 PM »
I don't know how FTP works in darwinbots, but take a look if the library you use supports FTPS. It's basically FTP, but over SSL.

With SSL, I don't think intercepting credentials is trivial. May have to resort to decompiling or looking in memory for the password.

Forum credentials to log into FTP sounds nice, but I don't know if it's worth that much effort to stop a troll. Do many people want to spend time to troll IM? I think it more efficient to keep the existing system of a single user and ban IP's that abuse it.

Most important, make sure the webserver or even anyone running IM on their computers cannot be harmed.

Was the EricL FTP IM hacked?
Oh my god, who the hell cares.

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Re: EricL's FTP IM + my attempt to save it for what is worth
« Reply #10 on: January 04, 2017, 02:18:33 PM »
It was abandoned primarily for Numsgils concerns listed above. (I think)



I will consider doing 2.49 but I do really want a port to at the least clean up the code. I will post a video I was saving for a year and a half demoing my chloroplast eco system fix first. And by then I'll figure out what I will end up doing.