Networking :: Using A Perl Script To Test For A Socket Listening On A UDP Port On A Remote Host?
Mar 10, 2011
is it possible using a perl script to test for a socket listening on a UDP port on a remote host ?I work in an environment where netcat is not allowed and from time to time I need to see if a UDP port is open on a remote host.
I am learning network prgramming in linux in c,and try to build a server and in this server I want to bind the listening socket to a paricular Ip address and port.Bind function is showing error,I did not want to use wild card. Here is the code.
I'm trying to connect with my server via telnet, but when i sent the command (telnet xxx.xxx.xxx.xxx Port) doesn't works and shows then follow error: Unable to connect to remote host: Connection refused, It happens with any port. Is strange but my telnet services works (telnet xxx.xxx.xxx.xxx), In addition, i tried with firewall enabled and disabled and the problem still happens. My centOS run on virtualbox.
I make an application on GNU/Linux which listening on a MULTICAST stream, so I open my unconnected socket, bind it on a MULTICAST address and a port, join the multicast group with the "setsockopt (IP_ADD_MEMBERSHIP)", then I receive datagram on my socket.
Now I've two different instances of the same application that run with their own MULTICAST address and port. And what I found strange is that, after a misconfiguration, I switch the ports, for example:
Emitting on 126.96.36.199/23451 and 188.8.131.52/23452 Receiving on 184.108.40.206/23452 and 220.127.116.11/23451
And my receiving part doesn't care about the MULTICAST address, it looks like the socket is listening on the port number only! I mean that the receiver [18.104.22.168/23452] take its datagrams from emitter [22.214.171.124/23452] and vice-versa!
Our requirement is not to use the default SSH port, So I have edited /etc/ssh/sshd_config file and changed the default port 22 to 2022, and I have restarted the sshd daemon. Now port 2022 is open in all servers however when I ssh to the remote hosts I cannot login directly. I have to use the below command to connect to the remote server, I don't want to provide SSH port number info while login to remote servers, How to achieve this. ssh -p 2022 server02
VERY new to linux, erm but I have an issue that needs solving!I recently moved to university, where their network blocks sftp port 22, this means that I cannot connect to my FTP server which is running a version of linux.Now I've got this ftp server connected to a seedbox and it was created using the following walk through..Code:I have written this guide for a friend, but I though it would be useful for others as well.
There are several guides floating around, but I found that most always cock up in some way. This one is tried and tested to work on Debian Etch (on an OVH rps, but should apply to most servers).If there is a new stable release of rtorrent/libtorrent then I will update this guide to show you how to update it (without reinstalling the whole server).
At the bottom there are also instructions to install ftp access & some network monitoring software.Basically, I would really like someone to be able to construct the commands on how to change the listen port for sftp connection on linux or add another port to the list that Linux would use so that I could put in through putty.
If I open a raw SCTP socket, am I able to bind to a specific port? (I only want to see SCTP packets from a particular IP address AND port.) Or, any raw SCTP socket, regardless of port binding , will get all SCTP packets received by the OS from that IP address? The port doesn't matter and is ignored.
I'm trying to create a PF_PACKET socket and send a frame to another host, I know the destination's mac address and interface index, and I want to use my own protocol no., so I defined a PROTONO as 0x2323, here's the code of sender
I have a customer who is complaining that they can connect to prt y on IP x with telnet. They are seeing the following:
telnet x.x.x.x y Trying x.x.x.x... Connected to x.x.x.x. Escape character is '^]'.
after some time the connection of course times out. Connection closed by foreign host. There is no telnet service running on this port so they cannot do anything, but they are complaining tht the fact that telnet "connects" is a security risk. I am having difficulty explaining why they are able to connect with telnet. I know it has to do with the socket layer API in Linux but I am having difficulty explaining this sufficiently. I also can't just say "this is the way linux works" to them. I am looking through "UNIX Network Programming" by W.
I have an x application I am trying to run under gnome. It assumes a fixed ip address and exclusive use of the eth0. I have run it under gnome on RHEL 5.3. I set the ip address and ifconfig confirms the correct address. When I run it I get "SocketConnect() error:
Resource temporarily unavailabele, port 8005. (on the terminal that I started it)
This is indicative that it has failed to make a connection to the outside world. One difference I notice between the non-working and the working is that, the error message seems to stop coming out on the fedora gnome, almost immediately, whereas on the other installations it will come out indefinitely until it connects. is virb0 interferring. What is different in the networking on fedora 11 then RHEL?
I'm working on testing some software, and I have a question. We have several files of binary data that we need to push through our application to test. It communicates via simple TCP sockets. Is there a way I can send this data to the socket from the command line? I tried doing something like this, but telnet never picked up the data.
I am running vsftp on one of my systems and when trying to connect to it it errors out with this: vendion@Loki:~> ftp 192.168.1.100 Connected to 192.168.1.100. 500 OOPS: could not bind listening IPv6 socket
I have tried stopping the firewall and even disabling IPv6 nothing changed, any clues as to what is going on?
I'm using iptables with modules ip_contrack_ftp to be able to use passive ftp. It works well as long as port 21 is being used as listening port. Is there any way to make it work when I configure my ftp server (vsftpd) to listen on an alternative port, lets say 21001 or something? The helper module only seems to be working properly with the standard port, so I was wondering whether there was a way to "tell it" that another port is being used? I mean, of course I make a rule in fw to allow traffic to the alternative port.
But once it's time to start passive connection, then the iptable module cannot handle it properly. I could solve the problem by making a range of passive ports in the ftp-server configuration and allow the incoming traffic to them, but then using helper modules doesn't make any sense. I just want to allow the traffic to the listening port and then want the ip_contrack_ftp module to take care of the rest. This is what I do today - but only port 21 seems to be working. Is there a way to do this with a non-standard ftp port?
Lets say i have two machines on public ips. If i get incoming traffic on machine #1 on port 55242 i would just like to forward it to machine #2 on port 35000.I would just like to use machine #1 same way as a dns server works. It just redirects the traffic and tells the client where to go.
I see three separate intermittent symptoms on the 10.0.0.0 network. 1) Both machines will cut off in the middle of the data transfer (rsync) if it takes too long. 2) Both machines will claim that the RSA key host has changed on the other...this will happen every few minutes. 3) Both machines will, at times, disallow login from the other...ssh prompts for password but will not accept the password.
Performing any operation between the same machines via the 192.168.1.0 subnet has no issue (as of yet).From what I can see, the routing tables are set correctly. Machines were exact clones of each other. Machine 2 is a recently rebuilt machine with a fresh suse11 distro install. Symptoms on Machine 2 appeared immediately. I had this exact setup but reversed ip addresses before Machine 2 burned out without issue. All networks but the 126.96.36.199 are internal and there hasn't been any indication of attack.At times, running ssh-keygen -R <ipaddress> will fix issues 1-3, other times only 1-2.
have fedora 10 and am having problems with ssh. For some reason I can't connect via a remote host to my ssh. Local network connections do work just fine. I have been looking for a log of what is going on but have not had luck seeing anything.Things I have tried:
-Modify hosts.allow to allow ssh to all -generated rsa1 key identity tryed specifying that with the -i option on the guest computer