如何掃瞄埠

2022-02-21 07:48:29 字數 1260 閱讀 5354

using system;
using system.drawing;
using system.collections;
using system.componentmodel;
using system.windows.forms;
using system.data;
using system.net.sockets;
按鈕事件

private

void button1_click(object sender, system.eventargs e)

catch
}
this.richtextbox1.text+="掃瞄埠結束!\n";
}
catch(exception err)
}

public

class tcpclient : system.object

system.net.sockets 的成員
摘要:
為 tcp 網路服務提供客戶端連線。

public tcpclient ( system.string hostname , system.int32 port )
system.net.sockets.tcpclient 的成員
摘要:
初始化 system.net.sockets.tcpclient 類的新例項並連線到指定主機上的指定埠。
引數:
hostname: 要連線到的遠端主機的 dns 名。
port: 要連線到的遠端主機的埠號。
異常:
system.argumentnullexception: hostname 為 null。
system.argumentoutofrangeexception: port 不在 system.net.ipendpoint.minport 和 system.net.ipendpoint.maxport 之間。
system.net.sockets.socketexception: 訪問套接字時出錯。有關更多資訊,請參見備註部分。

如何對udp埠進行掃瞄

由於udp協議是非面向連線的,對udp埠的探測也就不可能像tcp埠的探測那樣依賴於連線建立過程 不能使用telnet這種tcp協議型別命令 這也使得udp埠掃瞄的可靠性不高。所以雖然udp協議較之tcp協議顯得簡單,但是對udp埠的掃瞄卻是相當困難的。下面具體介紹一下udp掃瞄方案 方案1 利用ic...

python掃瞄埠指令碼 python掃瞄埠指令碼

usr bin python coding utf 8 一 socket模組的類方法 socket.socket family,type 建立並返回乙個新的socket物件 socket.getfqdn name 將使用點好分割的ip位址字串轉換成乙個完整的網域名稱 socket.gethostby...

python掃瞄埠指令碼 python掃瞄埠指令碼

usr bin python coding utf 8 一 socket模組的類方法 socket.socket family,type 建立並返回乙個新的socket物件 socket.getfqdn name 將使用點好分割的ip位址字串轉換成乙個完整的網域名稱 socket.gethostby...