19 Replies - 989 Views - Last Post: 13 January 2012 - 02:05 AM
#1
Worm resistance
Posted 10 January 2012 - 08:35 AM
I'm working on a server, running on a linux OS.
I'm developing it in C/C++.
Now I read something about worms, so I got worrying.
I've read they send code to the server and the server executes this.
But why should a server-program execute this code?
When a server only reads the client input into a "char*", and handle the bytes, this doesn't get executed, does it?
But because worms have been (and still are) a problem, I wonder why this could be a problem.
I hope someone could explain me something about this topic, so I can make my server resistant.
Thanks in advance,
Sinned
Replies To: Worm resistance
#2
Re: Worm resistance
Posted 10 January 2012 - 11:50 AM
The danger here is that once the program is sitting on a computer it can open up a channel to the attacker and accept commands to do something within the system.
It would be like I give you a program called abc.exe and you (the server) gladly save it to your hard drive. Without you knowing abc.exe then sends itself to your friend to save. At some later time abc.exe executes and does something like launch a virus or open a TCP connection back to me and I tell it to do things for me like monitor for passwords being thrown around on the network or phishing etc.
Worms are typically a bit easier to detect and destroy since they aren't really attached to other executable files. Where a virus attaches itself to other files that may be legit. Worms can also be detected during transit and stopped by packet filtering or at a hardware level in routers etc.
I hope that clears things up for you.
This post has been edited by Martyr2: 10 January 2012 - 11:51 AM
#3
Re: Worm resistance
Posted 10 January 2012 - 01:43 PM
But I still got some questions.
In 2001 there was a worm detected, this was called "Code Red".
Code Red sends requests to web-servers.
And by my knowledge web-servers doesn't store anything coming from the client.
Also, even if the executable worm file was stored on the server, it does not have to get executed. ?
A file is just an amount of bytes, if the server handles it like this, it still has nothing to worry about, does it?
I hope you could explain me a bit more about this?
#4
Re: Worm resistance
Posted 10 January 2012 - 02:10 PM
Quote
Sure.. but remember it's a computer system.. *some how* files are installed on it, right? FTP, drag and drop, email, or even executable code can reside in memory.. or hell just have the computer/server reach out to infected file as the file would reside somewhere else!
Quote
No.. it needs to be executed or at least a process running in memory.
Quote
No.. there's plenty of working to do.
Essentially it means you keep your crap updated... security patches, firewall patches, etc. Limit user access and harden accounts.
#5
Re: Worm resistance
Posted 10 January 2012 - 05:44 PM
Quote
Simple answer - Buffer overflows. (Which boils down to sloppy programming)
That is why you should always make sure your software is up to date. Exploits are found and fixed.
You could use shellcode to root a server or run commands. NOP sleds are interesting.
#6
Re: Worm resistance
Posted 10 January 2012 - 11:36 PM
modi123_1, on 10 January 2012 - 02:10 PM, said:
Quote
No.. it needs to be executed or at least a process running in memory.
I'm sorry, I formulated this question wrong.
I meant: Only a file gets stored, this does never get executed, so what is the problem?
But so you all are saying, the only dangerous things are tools like SSH and FTP?
Or buffer overflow, which I definitely have to prevent in my code.
Then I almost understand it, and how I can protect my server.
But I still don't understand:
How could the overflow in a buffer gets executed?
#7
Re: Worm resistance
Posted 11 January 2012 - 07:46 AM
Quote
You don't have files on your system that get executed? Never? Never is an OS running? Never is a file served? A process that spins up? Nothing at all?
Quote
The traditional way is a buffer is flooded and execution is jumped to a malicious application.
#8
Re: Worm resistance
Posted 11 January 2012 - 08:06 AM
modi123_1, on 11 January 2012 - 07:46 AM, said:
My server isn't built as http-server, but however a server is a server, such as a http-server.
And no, my server isn't accessing any files, only it's own and some shared libraries.
So the only file loading happens native by the OS (loading libraries).
For storing all information I use MySQL databases. (Which is located elsewhere)
And my server really does not call an other executable file on the disk.
modi123_1, on 11 January 2012 - 07:46 AM, said:
Quote
You don't have files on your system that get executed? Never? Never is an OS running? Never is a file served? A process that spins up? Nothing at all?
Such as I said, only the OS, and my only files gets executed.
By my knowledge nobody can add a file to my system, which should possibly could get invoked on start-up.
And the processes which are spinning up is just the OS, and my server, which doesn't execute anything else after it.
modi123_1, on 11 January 2012 - 07:46 AM, said:
Quote
The traditional way is a buffer is flooded and execution is jumped to a malicious application.
I don't really understand why this should get executed, but if so many say it does, I believe it (without knowing why).
But I will do my best to prevent buffer overflow.
But so, my server should be completely safe, and not susceptible for a worm?
This post has been edited by Sinned: 11 January 2012 - 08:07 AM
#9
Re: Worm resistance
Posted 11 January 2012 - 08:29 AM
Quote
Okay dude, I don't get what you are saying. Explain the setup of this box.
Quote
... and that's enough.
Quote
That's enough to exploit.
Quote
That's enough to exploit.
Quote
That's enough to exploit.
Quote
That's enough to exploit.
Quote
Famous last words.
Quote
That's enough to exploit.
Quote
But I will do my best to prevent buffer overflow.
The gist is you push enough of a specific command into a buffer and at the end a file location and an execute command. The buffer jumps through those specific commands and then hits the execute and does it.
Quote
Sure.. yeah.. what ever. Go read up on worms and virus vectors.
#10
Re: Worm resistance
Posted 11 January 2012 - 08:50 AM
So I posted this topic, to let me explain something about it.
But you say:
When a computer is running an Operating System and is connected to the internet, a worm can get in.
And then my server is the second point of worrying.
But this is just the thing I don't understand.
By my knowledge a file only gets executed when someone orders him to do.
And also a file could get written when someone give orders to do that.
modi123_1, on 11 January 2012 - 08:29 AM, said:
Quote
Sure.. yeah.. what ever. Go read up on worms and virus vectors.
Do you have a suggestion where to find information about worms and viruses?
#11
Re: Worm resistance
Posted 11 January 2012 - 08:59 AM
Quote
So I posted this topic, to let me explain something about it.
*sigh* I thought smelled uninformed... So you are just making assumptions and flailing your hands around saying you have taken measures. Ah.. good to know.
You still haven't explained your server box at any level.
Quote
When a computer is running an Operating System and is connected to the internet, a worm can get in.
yes.. a machine can be cracked or exploited.
Quote
By my knowledge a file only gets executed when someone orders him to do.
And also a file could get written when someone give orders to do that.
Yes.. and the person giving those orders is the person attacking your machine... or an idiot user... or a sibling.. or an unpatched process.
Quote
Good is always good. Just search "how does a worm work" and drop the the ones talking about the worms in the dirt. I mean seriously - this is a giant and open topic. It's not some niche subset... the research burden's on you.
#12
Re: Worm resistance
Posted 11 January 2012 - 10:02 AM
#13
Re: Worm resistance
Posted 11 January 2012 - 05:08 PM
Quote
No, your server is the FIRST point of worry; not the OS, not the mouse munching on cheese over in the corner. Your server is what interacts with the internet before your OS.
Quote
But I will do my best to prevent buffer overflow.
It would behoove you to learn about buffer exploits and the many exploits if you are writing a server. Most buffer exploits happen with the stack, since that is the easiest place to overwrite ESP.
#14
Re: Worm resistance
Posted 12 January 2012 - 08:03 AM
GunnerInc, on 11 January 2012 - 05:08 PM, said:
Quote
No, your server is the FIRST point of worry; not the OS, not the mouse munching on cheese over in the corner. Your server is what interacts with the internet before your OS.
I didn't know that.
I thought a machine should only do something, like connecting to the internet, if someone (like the OS) orders him to.
So if a computer doesn't start-up from LAN, why should it connect to the internet?
And mostly I see, when Linux boots, it configures "DHCP" at one of the last things.
I think I understand too little about this part of computer security.
Here is my view on computers (in steps, what is happening by doing something):
#15
Re: Worm resistance
Posted 12 January 2012 - 08:09 AM
Quote
So I don't understand why a worm or hacker can get in the PC.
As I said - the malicious program tells it to! A server has to be administered.. those administration doors create holes that are exploitable.
Quote
If the server program is written good, without leaks, there is no harm.
In an ideal world sure, but code is often not written to perfection... not to mention the intentional holes given by administrators. Then there's updates... people like having new stuff. More efficient.. faster serving.. etc. Those updates then might not work fine with the existing code base... or they might introduce holes. You expect computers to be some sort of closed system - well stop thinking that.
Quote
I don't understand how it can get harmed if everything should work fairly.
Then you should take off the rose colored glasses and get out of the idealized world. The only certain way to not get attacked via your connection is to unplug the system from the net or any network attached to the net.
|
|

New Topic/Question
Reply



MultiQuote






|