473,788 Members | 2,905 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

socket programming and port scans

rbt
I don't fully understand sockets, I just know enough to be dangerous.
The below is not detected by nmap, but is affected by iptables or ipsec.
Can anyone explain why that is?

s = socket.socket(s ocket.AF_INET, socket.SOCK_STR EAM)
s.bind((ip_para m, port_param))
while 1:
s.listen(5)

I can connect to the socket server and even transmit data so I know it's
there.

Thanks,
rbt
Jul 19 '05 #1
2 1563
Are you explicitly referencing the port for nmap, or is it a general
port scan?

The version of nmap I run only checks common ports unless a port range
is specified.

rbt wrote:
I don't fully understand sockets, I just know enough to be dangerous.
The below is not detected by nmap, but is affected by iptables or ipsec.
Can anyone explain why that is?

s = socket.socket(s ocket.AF_INET, socket.SOCK_STR EAM)
s.bind((ip_para m, port_param))
while 1:
s.listen(5)

I can connect to the socket server and even transmit data so I know it's
there.

Thanks,
rbt

Jul 19 '05 #2
rbt wrote:
I don't fully understand sockets, I just know enough to be dangerous.
The below is not detected by nmap, but is affected by iptables or ipsec.
Can anyone explain why that is?

s = socket.socket(s ocket.AF_INET, socket.SOCK_STR EAM)
s.bind((ip_para m, port_param))
while 1:
s.listen(5)


This, by the way, is wrong. s.listen(5) just tells the stack that you
would like to allow a backlog of up to 5 waiting-to-be-connected
connection attempts while you are accepting another. The call doesn't
block and needn't be called repeatedly. You could just as well do the
call to listen first, then have an empty "while 1: pass" loop (but note
that in either case it is a "busy wait", consuming 100% CPU while it runs).

What you are looking for is more like this:

s.listen(5)
while 1:
s.accept() # wait for connection, and ignore it
If you want to simulate a little server to allow multiple connections,
you would of course need to use the value returned by accept() and
probably call close() on the client socket right away.

-Peter
Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3081
by: Rolln_Thndr | last post by:
I'm vey new to network programing and have a few rather fundemental questions. I'm creating a very basic UDP proxy server and having a few issues regarding the sockets. Is it possible to change the properties of a socket WITHOUT closing it and creating a new one? Basically, I need to change the port of a bound socket, but the only way I have found to do this so far is to close the exisitng socket and create a new one. This in itself...
5
3687
by: John Sheppard | last post by:
Hi all, I am not sure that I am posting this in the right group but here it goes anyway. I am new to socket programming and I have been searching on the internet to the questions I am about to pose but have been unsuccessful in finding the answers so far. Either because my understanding of sockets isn't where it needs to be or my questions are too basic. My programming environment is Windows XP, Visual Studio .NET 2003 and C#. So here it...
1
3398
by: John Sheppard | last post by:
Thanks to everyone that responded to my previous Socket Programming question. Now I have run into some behavior that I don't quite understand. Programming environment. VS.NET 2003, C#, Windows XP. About the architecture: I have a socket server dll that contains a class that handles connections for a given local ipaddress and port. This class(server) can be started or stopped by calls to the appropriate functions. The server class has...
5
4734
by: AtherMurtuzapurwala | last post by:
Hi All, I am doing socket programming. Client is in C#.Net 2003 and Server is in VC++ 6.0 When Server uses csoc class than it connect & communicate to client without any problem.... while it uses api on server side so it is not able to connect it throws an
2
2879
by: Rene Sørensen | last post by:
We are 4 students working on a assignment, that our teacher gave use, normally we do this is C++, but the 4 of us, use C# more often that C++ so… We made a small games called reversi, now our job is to make a server, none of us know nothing about socket programming in C#, but we founds some guides for this, and now ,got a server running, but we have some problems though. We have 2 scenario, one where we use a telnet connection and one...
10
4043
by: Uma - Chellasoft | last post by:
Hai, I am new to VB.Net programming, directly doing socket programming. In C, I will be able to map the message arrived in a socket directly to a structure. Is this possible in VB.Net. Can anyone please help me with some sample codings and guidance? Can you also suggest some other news group available for socket programming in VB.Net?
3
2770
by: Stuart | last post by:
I am in the process of teaching myself socket programming. I am "playing around" with some simple echo server-client programs for m the book TCP/IP Sockets in C. The Server program is: #include "TCPEchoServer.h" /* TCP echo server includes */ #include <pthread.h /* for POSIX threads */
6
3676
by: ahlongxp | last post by:
socket.makefile() may lose data when "connection reset by peer". and socket.recv() will never lose the data. change the "1" to "0" in the client code to see the difference. confirmed on both windows and linux. so I guess there is a problem with makefile(). # Echo server program
2
3674
by: manasap | last post by:
Hi all! I've written a server and a client application using asynchronous sockets.The client sends data packets for every 7 seconds.The server receives the packets. This process proceeds smoothly without any errors but,sometimes I get the following error. "An existing connection was forcibly closed by the remote host." Why is this happening when i am not closing the client program? Could someone guide me in this issue
0
9656
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9498
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10172
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10110
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9967
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5398
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5536
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4069
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3670
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.