HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: why can not add new service to xinetd
Operating System - Linux
1832928
Members
2463
Online
110048
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2003 10:38 PM
02-18-2003 10:38 PM
i tried to add one new service to xinetd, but failed.procedure as below:
i add one line to /etc/service as :
test 20001/tcp
and edit one programm as the simplest line in main():
test.c:
printf("hello world");
edit file test in /etc/xinetd.d/
service test
{
disable = no
socket_type = stream
protocol = tcp
wait = no
user = nobody
server = /test
log_on_success += USERID
log_on_failure += USERID
}
then run
/etc/init.d/xinetd restart
i can view new service add in /var/log/messages.
but while i nmap localhost, no output from port 20001.
what wrong i made?
thanks,
Frederick
i add one line to /etc/service as :
test 20001/tcp
and edit one programm as the simplest line in main():
test.c:
printf("hello world");
edit file test in /etc/xinetd.d/
service test
{
disable = no
socket_type = stream
protocol = tcp
wait = no
user = nobody
server = /test
log_on_success += USERID
log_on_failure += USERID
}
then run
/etc/init.d/xinetd restart
i can view new service add in /var/log/messages.
but while i nmap localhost, no output from port 20001.
what wrong i made?
thanks,
Frederick
frederick van targero
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2003 10:54 PM
02-18-2003 10:54 PM
Solution
What shows up in /var/log/messages regarding the new service 'test' ?
What dose:
netstat -ntlp | grep 20001
show up?
does "/test" have the executable bit set ?
In any case, you'll need to learn a bit more about socket programming. Using tcp wrappers doesn't mean you can just spit stuff out to STDOUT, and expect it to come out of the socket at the other end.
You can get away with that with some shell languages, but for the most part, it's more complicated than that.
What dose:
netstat -ntlp | grep 20001
show up?
does "/test" have the executable bit set ?
In any case, you'll need to learn a bit more about socket programming. Using tcp wrappers doesn't mean you can just spit stuff out to STDOUT, and expect it to come out of the socket at the other end.
You can get away with that with some shell languages, but for the most part, it's more complicated than that.
One long-haired git at your service...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2003 02:18 AM
02-19-2003 02:18 AM
Re: why can not add new service to xinetd
yes!!!
i found it and i also can telnet hostname 20001 to get response.
however the other question came out: why nmap can not scan all the ports?
the other question: although i can add service with simply by printf, but seems the stdout gone instead of remote socket output, do you know how to identify the local(stdin,stdout,stderr) Vs remote(1,2,3)? in other words, since the xinetd can provide network service even if none socket coding available, how to do use xinetd to provide service without socket operation?
could you give me some tips?
thanks,
Frederick
i found it and i also can telnet hostname 20001 to get response.
however the other question came out: why nmap can not scan all the ports?
the other question: although i can add service with simply by printf, but seems the stdout gone instead of remote socket output, do you know how to identify the local(stdin,stdout,stderr) Vs remote(1,2,3)? in other words, since the xinetd can provide network service even if none socket coding available, how to do use xinetd to provide service without socket operation?
could you give me some tips?
thanks,
Frederick
frederick van targero
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2003 03:01 AM
02-19-2003 03:01 AM
Re: why can not add new service to xinetd
Hi,
Thats because you may have run nmap to scan only well known ports. Instead go for a complete scan.
Your program 'text' does not need to have any socket programming routines in your case.
What happens is xinetd daemon listens on port 20001 for connection requests. If any connection comes it spawns your test program and redirects the output of your program to the network connection. Here xinetd will act like a proxy between your network client and your C program.
since xinetd daemon is the one who directly interacts with sockets , it is not nessecary to have your program defined in server = /test to be sockets programmed.
Eg:
You can write server = /bin/sh and telnet to that port and find shell prompt directly without authentication. This is used as backdooring unix systems.
Where programs like sendmail can be both used with xinetd and can also as standalone daemon in which sendmail program directly listens for conenction requests.
regards,
U.SivaKumar
Thats because you may have run nmap to scan only well known ports. Instead go for a complete scan.
Your program 'text' does not need to have any socket programming routines in your case.
What happens is xinetd daemon listens on port 20001 for connection requests. If any connection comes it spawns your test program and redirects the output of your program to the network connection. Here xinetd will act like a proxy between your network client and your C program.
since xinetd daemon is the one who directly interacts with sockets , it is not nessecary to have your program defined in server = /test to be sockets programmed.
Eg:
You can write server = /bin/sh and telnet to that port and find shell prompt directly without authentication. This is used as backdooring unix systems.
Where programs like sendmail can be both used with xinetd and can also as standalone daemon in which sendmail program directly listens for conenction requests.
regards,
U.SivaKumar
Innovations are made when conventions are broken
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP