ארגון תוכנית של portscanner

dedtheded

New member
ארגון תוכנית של portscanner

אני מנסה לממש תוכנית portscanner בסביבה מונחית אירועים (Assmebler and API). איך אני יכול לבצע את הסריקה של הפורטים ? האם אפשר לכתוב לולאה: עבור i מ1 עד 100 נסה להתחבר אל הכתובת בפורט i. ופרוצדורה לטפל באירוע התחברות: בעת התחברות: כתוב את הפורט של ההתחברות. זו הדרך היחידה שחשבתי עליה. האם יש דרך אחרת מזו , שאינה משתמשת ב blocking sockets? התוכנית לסביבת windows. בר.
 

Edo Reshef

New member
TCP/IP hell

There are two modes of working with sockets, Blocking or NoneBlocking mode. Those modes applies (if I remember correct) to the sockets read/write functions and less to the connection establishing. I don't know if your scanner maybe wants to send and receive data after connection has been made and if you want to communicate with more then one socket at a time (most advance scanners do that). Anyway, if your interested in multi-scans you should use one of the following options: 1. None-Blocked sockets 2. Blocked sockets and Threads Personally I like the second method, but since you use assembler first option maybe be batter for you. And again, I hardly see the point of doing this in assembler, but that's something else! Regards, Edo​
 

אמיר ט

New member
Non blocking Sockets

Windows's implementation ok non blocking sockets has support for all socket operations, for tcp as well as udp. including accepting connections. try to search in MSDN about WSAEventSelect() and FD_ACCEPT -> the options that turns on the nonblocking accept. i belive you will have to use some kind of "WaitForSingleObject()" in order to check if the connection event is turned on. not to long ago i built a whole class in cpp that Encapsulated non-blocking sockets, not that hard to work with them under win32 api.​
 
למעלה