Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jan 11th, 2007, 1:38 PM   #1
BinarySurfer
Programmer
 
BinarySurfer's Avatar
 
Join Date: Dec 2006
Posts: 53
Rep Power: 0 BinarySurfer is an unknown quantity at this point
Java Server

I'm thinking about making a Java server for a series of clients to conect to. All that it is suppose to do is relay the incoming strings to the other clients. It was brought to my attention that it can be hacked and who knows what else can happen afterwords. Is running this server a hackers dream or an overstatement?
BinarySurfer is offline   Reply With Quote
Old Jan 11th, 2007, 1:51 PM   #2
Arevos
Programming Guru
 
Arevos's Avatar
 
Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5 Arevos is on a distinguished road
Um... It depends entirely how you go about implementing it.

The only things I can think of that would make this insecure is whether you need to keep track of who is sending which string, and whether you care that the strings could be intercepted.

Both of these problems can be solved relatively easily.
Arevos is offline   Reply With Quote
Old Jan 12th, 2007, 12:09 PM   #3
BinarySurfer
Programmer
 
BinarySurfer's Avatar
 
Join Date: Dec 2006
Posts: 53
Rep Power: 0 BinarySurfer is an unknown quantity at this point
I don't intend to keep track of anything and the strings aren't sensitive, it just allows connection with the proper password, and sends whatever other strings comes it way to the other clients.
It was also brought to my attention that allowing the server through the firewall leaves my computer vulnerable through the port it uses because it's exposed/open. Is that true?
BinarySurfer is offline   Reply With Quote
Old Jan 12th, 2007, 2:18 PM   #4
Arevos
Programming Guru
 
Arevos's Avatar
 
Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5 Arevos is on a distinguished road
Quote:
Originally Posted by BinarySurfer View Post
I don't intend to keep track of anything and the strings aren't sensitive, it just allows connection with the proper password, and sends whatever other strings comes it way to the other clients.
If it has a password, and you don't want unauthorised people to access it, then you'll need some encryption. There's a number of Java libraries out there that provide good crypto, and quite a bit of functionality in the standard Java libraries. If you look around, you may even find a system that does most of the work for you - encrypting network data streams is a very common problem.

Quote:
Originally Posted by BinarySurfer View Post
It was also brought to my attention that allowing the server through the firewall leaves my computer vulnerable through the port it uses because it's exposed/open. Is that true?
I don't know who you're talking to, but at best, we're only talking about potential vulnerabilities. Opening a port and running a server off it doesn't magically make your system vulnerable. You need to first screw something up, and your program seems simple enough that this would be relatively difficult.

I'll give you an example of a potential vulnerability that a program could have, just so you have some idea of what makes a system vulnerable to attack. Let's say you've made a file server, which people can use to download files off you. You probably don't want to give them access to your entire hard drive, so you limit them to a single directory, like so:

String filenameUserRequested = getFilenameFromUser();

String filenameOnDisk = "C:\\My Shared Folder\\" + filenameUserRequested;

At first glance, this may look okay. But what if someone requests a file called "..\\My Private Folder\\My_bank_account_password.txt". The ".." at the beginning will cause the operating system to skip up a folder, so:
C:\My Shared Folder\..\My Private Folder\My_bank_account_password.txt
Is the same as:
C:\My Private Folder\My_bank_account_password.txt
Oops! The user has escaped the shared folder, and is now loose on your filesystem. He can now read any file you have on your hard drive, which from a security point of view, is a disaster.

But there's nothing magical about how the attacker broke in. All the attacker can do is to try and trick your server with strange inputs. A key rule of computer security is to always check your user's data thoroughly. This may sound simple, but it's one of the prime causes of computer vulnerabilities. Again, I should emphasis that hackers aren't magicians; they break into servers by capitalizing on your mistakes.

However, your system is simple, and you don't appear to need to let the users access files on the hard drives or anything like that. This vastly reduces the points at which a malicious user might gain entry. The more features a server has, the more points where mistakes can be made, and more points where vulnerabilities could potentially show. However, assuming you also use some encryption to guard your, it's safe to say that it shouldn't be too hard to make your server more-or-less utterly impregnable.
Arevos is offline   Reply With Quote
Old Jan 12th, 2007, 3:24 PM   #5
BinarySurfer
Programmer
 
BinarySurfer's Avatar
 
Join Date: Dec 2006
Posts: 53
Rep Power: 0 BinarySurfer is an unknown quantity at this point
Ah, I see. Thank you! That defiantly cleared up a lot of confusion.
BinarySurfer is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Programming with Java: Tutorial ReggaetonKing Java 7 May 20th, 2008 10:58 AM
Special browser in Java (Project) stalefish Java 3 Feb 9th, 2008 4:22 PM
Java socket Server compile errors.. n3o_X Java 3 Nov 18th, 2007 12:39 AM
java echo server cwl157 Java 3 May 20th, 2005 12:10 PM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 10:34 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC