LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 09-01-2016, 03:12 PM   #1
xiongnu
Member
 
Registered: Sep 2004
Distribution: Devuan, Void
Posts: 264

Rep: Reputation: 23
http/ftp server security


i setup a http/ftp server on a busybox based embedded system last night at home, it was tested out ok.

however today, when i accessed my test webpage on my http server, browser prompted me to open an 'Photo.scr' file. i didn't understand what it is until i checked the http server, it seems a new file 'Photo.scr' was created in the local directory and my 'index.html' has been modified as well.

when i checked other directories on the embedded system, there's a copy of 'photo.scr' in many other directories. i have setup my home router to forward the httpd/ftpd/telnet port so i could access the ftp/http sever away from home. it worries me that someone has gained access to the ftp server or maybe my router.

anyway to improve the security to fend off malicious 3rd party?
 
Old 09-01-2016, 03:21 PM   #2
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
Telnet?! You can't be serious? Your server is compromised, full reinstall is in order. SFTP and SSH access only.
 
1 members found this post helpful.
Old 09-01-2016, 06:36 PM   #3
xiongnu
Member
 
Registered: Sep 2004
Distribution: Devuan, Void
Posts: 264

Original Poster
Rep: Reputation: 23
thanks for the fair warning!

i disabled ftp and telnet remote access on the router for embedded device and only allowed http port forwarding to the device. would that make the system secure?

on this particular device, only busybox (i.e. ftpd, telnetd, httpd) is installed, no SFTP and SSH running.
 
Old 09-02-2016, 07:58 AM   #4
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,644
Blog Entries: 4

Rep: Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933
You should be running OpenVPN as the only publicly-available service, and use tls-auth (as I have described in other threads in this section) to further make the presence of the OpenVPN server invisible. You should use digital certificates, password-protecting (encrypting) the ones that you take with you.

All other services should "listen" only to the OpenVPN's secure subnet, and be prohibited (and, blocked by firewall rules) from listening directly to the outside world.

Within, you should be running services like sshd, which are only listening to the OpenVPN tunnel, and (as also described elsewhere in this section) these should use only digital certificates, not passwords.

Now, you can enter the machine, and everything that you send to it or receive from it is securely encrypted. But, to anyone else, it is a featureless box with no open ports. Although you can easily access the machine, and even do so without apparent challenge or impediment, everyone else finds a featureless smooth wall with nothing whatsoever to climb. There is literally nothing there for them to attack.

You can enter because you possess the necessary, one-of-a-kind, digital certificates (and, if you wish, the passwords needed to decrypt them). Certificates can be individually issued and revoked.

Last edited by sundialsvcs; 09-02-2016 at 08:00 AM.
 
1 members found this post helpful.
Old 09-03-2016, 04:15 AM   #5
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,294
Blog Entries: 3

Rep: Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719
Quote:
Originally Posted by xiongnu View Post
thanks for the fair warning!

i disabled ftp and telnet remote access on the router for embedded device and only allowed http port forwarding to the device. would that make the system secure?

on this particular device, only busybox (i.e. ftpd, telnetd, httpd) is installed, no SFTP and SSH running.
Any machine that has had ftpd and telnetd running needs to be wiped and reinstalled. Since you must reinstall, you might as well do it safely and leave out the unsecureable daemons. sundialsvcs' suggestion about OpenVPN could help you, or you could stay with SSH which has stronger ciphers. Either way, you'll want to rebuild your busybox so that there is no ftpd or telnetd and that sshd is there instead. If OpenSSH is too big, then you might look at Dropbear, an OpenSSH derivative.
 
1 members found this post helpful.
Old 09-03-2016, 08:51 AM   #6
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian Stable
Posts: 2,546
Blog Entries: 8

Rep: Reputation: 465Reputation: 465Reputation: 465Reputation: 465Reputation: 465
Also, change any passwords you may have typed in during any telnet or ftp session (including initial log in). Telnet and ftp send this in clear text, so any packet sniffers along the way can gather the password data.
 
Old 09-07-2016, 07:38 PM   #7
xiongnu
Member
 
Registered: Sep 2004
Distribution: Devuan, Void
Posts: 264

Original Poster
Rep: Reputation: 23
thanks, guys! much appreciated your inputs on this!

I've set up openSSH server running on the embedded device.
 
Old 09-19-2016, 10:14 PM   #8
Sefyir
Member
 
Registered: Mar 2015
Distribution: Linux Mint
Posts: 634

Rep: Reputation: 316Reputation: 316Reputation: 316Reputation: 316
Quote:
Originally Posted by xiongnu View Post
thanks, guys! much appreciated your inputs on this!

I've set up openSSH server running on the embedded device.
Make sure passwords are disabled and you only use public-key authentication.


Code:
$ ssh-keygen -t rsa -b 4096 
$ ssh-copy-id your_embedded_device
$ ssh your_embedded_device
Code:
/etc/ssh/sshd_config
# Change to no to disable tunnelled clear text passwords
PasswordAuthentication no
...
RSAAuthentication yes
PubkeyAuthentication yes
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Apache HTTP Server Adds HTTP/2 Support for Speed and Security LXer Syndicated Linux News 0 10-19-2015 11:21 PM
[SOLVED] FTP server -> NFS -> HTTP/SQL server Tux-Slack Linux - Networking 4 10-15-2009 03:35 PM
HTTP and FTP server setup FC3 Mirag3 Fedora 2 08-16-2005 10:45 PM
HTTP/FTP server on Virtual PC colelinux Linux - Networking 0 11-14-2003 10:11 AM
cannot conect to ftp or http on server. HELP! ReSync Linux - Networking 8 06-29-2002 03:44 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 07:07 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration