Joined: 07 Mar 2004 Posts: 1048
Location: Dhaka, Bangladesh
Post subject: The principles of Connecting to Daemon or How daemon works?
Has anyone ever worked with daemons?
This daemon I am talking about basically guards a database and decides upon which IP address can connect to the database with what priveleges.
So I need some pointer as to how to connect with a daemon? The rest is easy. Any good article on daemon would be nice as a beginner. Is the IP address is enough to connect to the daemon? What header information needs to be sent to the daemon? _________________
Dust fills my eyes / Clouds roll by / and I roll with them / Centuries cry / Orders fly / and I fall again
Afford best design, implement best solution. Outsource your web design.
Last edited by quantum on Fri Jun 04, 04 2:59 am; edited 1 time in total
Fri Jun 04, 04 1:33 am
Tousif Beginner User
Joined: 25 May 2004 Posts: 20
Location: Nashville, Tennessee, USA
Post subject:
Hi,
I once programed a security deamon for fun -honeyd. Its pretty much the best out there in its field I think. Since I've never worked in database I don't know if this would be relevent to your work but you can check out this website -
[http://www.citi.umich.edu/u/provos/honeyd/]
you will see articles regarding how to connect -it's very easy with honeyd (The article "deploying honeyd in the wild" and the very last one -"open source honeypots" by Lance Spitzer has some examples). I can guarantee, once you know how to use it, you will fall in love with it.
Hope this will be helpful.
Tousif
Fri Jun 04, 04 2:37 am
quantum Site Admin
Joined: 07 Mar 2004 Posts: 1048
Location: Dhaka, Bangladesh
Post subject:
Thank you Tousif.
I am checking it out. In the meantime I have another question. How can you basically convert a .c C program into a windows version?
Are the definitions and functions of the unix version usually compatible and exportable to windows version?
I am basically interested in converting something like this to something that will work with a windows application:
if ((recvMsgSize = recv (sock, dmcBuffer, sizeof (dmcBuffer) - 1, 0)) > 0) {
dmcBuffer[recvMsgSize] = 0x00;
/* We need to skip past the initail '\n', the numeric code, and the
space, to get to the banner proper.
*/
strcpy (msgString, chomp (dmcBuffer)); /* msgString reused */
p = msgString;
while (*p != 0x20)
p++;
strcpy (dmcBuffer, ++p);
Joined: 25 May 2004 Posts: 20
Location: Nashville, Tennessee, USA
Post subject:
Hi quantum,
Well...one thing for sure is that windows doesn't have quivalent library for unistd.h. For sockets, you have to use windows socket library.
However, if you want your code to be platform independent, you have to use #ifdefs to conditionally inclide libraies and execute parts of your code depending on the platform its running on.
Thats the only solution I could think of for the code you've provided..use #ifdef's and rewrite it to make it platform independent.
Hope this helps.
Tousif
Sat Jun 05, 04 5:16 am
quantum Site Admin
Joined: 07 Mar 2004 Posts: 1048
Location: Dhaka, Bangladesh
Post subject:
You are absoltely right. There are exact equivelent functions for socket.h But unistd.h is solely unix property. In windows this function is somewhat mimicked with process.h. But the way this is implemented is totally different.
The application is question is windows based, so I am not worried about platform independency. I am working on to rewrite the whole code in C for windows and implement the functionality without worrying about the exact conversion.