2011年1月18日 星期二

tftp 介紹與套用

TFTP簡介
TFTP(Trivial File Transfer Protocol,簡單文件傳輸傳輸協定)是TCP/IP傳輸協定族中的一個用來在客戶端機與伺服器之間進行簡單文件傳輸的傳輸協定,提供不複雜、預先配置不大的文件傳輸服務。TFTP承載在UDP上,提供不可靠的資料流傳輸服務,不提供存取授權與認證機制,使用超時重傳方式來保證資料的到達。與FTP相比,TFTP的大小要小的多。現在最普遍使用的是第二版TFTP(TFTP Version 2,RFC 1350).

使用UDP 67連接埠!下面是fport.exe的結果
2000 tftpd -> 69 UDP c:\winnt\system32\tftpd.exe

2. 尋找tftp程序
C:\WINNT\system32>dir %windir%\tftp* /s
dir %windir%\tftp* /s //表示在%windir%目錄所有子目錄搜尋tftp前綴程序
驅動器 C 中的磁碟區沒有標籤。
磁碟區的序列號是 D428-6BB5
C:\WINNT\system32 的目錄
2000-01-10 12:00 17,168 tftp.exe //客戶端 微軟自帶
2000-01-09 00:00 11,264 tftpd.exe //服務端 server版本以上才有
2 個文件 28,432 字元 pro沒有
C:\WINNT\system32\dllcache 的目錄
2000-01-10 12:00 17,168 tftp.exe
1 個文件 17,168 字元

3. 安裝為服務 (需要instsrv.exe程序)

a.安裝
C:\WINNT\system32>instsrv system %windir%\system32\tftpd.exe
instsrv system %windir%\system32\tftpd.exe

The service was successfuly added!
Make sure that you go into the Control Panel and use
the Services applet to change the Account Name and
Password that this newly installed service will use

b.查詢
C:\WINNT\system32>sc qc system
sc qc system
[SC] GetServiceConfig SUCCESS
SERVICE_NAME: system
TYPE : 10 WIN32_OWN_PROCESS
START_TYPE : 2 AUTO_START
ERROR_CONTROL : 1 NORMAL
BINARY_PATH_NAME : C:\WINNT\system32\tftpd.exe
LOAD_ORDER_GROUP :
TAG : 0
DISPLAY_NAME : system
DEPENDENCIES :
SERVICE_START_NAME : LocalSystem

c.啟動
C:\WINNT\system32>net start system
net start system
system 服務正在啟動 .
system 服務已經啟動成功。

C:\WINNT\system32>sc query system
sc query system
SERVICE_NAME: system
TYPE : 10 WIN32_OWN_PROCESS
STATE : 4 RUNNING
(STOPPABLE,PAUSABLE,ACCEPTS_SHUTDOWN)
WIN32_EXIT_CODE : 0 (0x0)
SERVICE_EXIT_CODE : 0 (0x0)
CHECKPOINT : 0x0
WAIT_HINT : 0x0

d.檢視連接埠是否開放!
C:\WINNT\system32>fp |find "tftp"
fp |find "tftp"
2000 tftpd -> 69 UDP c:\winnt\system32\tftpd.exe
C:\WINNT\system32>netstat -an |find "69"
netstat -an |find "69"
UDP 192.168.0.1:69 *:*
UDP 218.11.x.67:69 *:*

e.預設檔案名稱
當前驅動器的根目錄
C:\WINNT\system32>dir %windir%\..\tftp* /ad //看見了嗎?
dir %windir%\..\tftp* /ad
驅動器 C 中的磁碟區沒有標籤。
磁碟區的序列號是 D428-6BB5
C:\ 的目錄
2002-12-19 09:27 <DIR> tftpdroot
0 個文件 0 字元
1 個目錄 3,560,779,776 可用字元
C:\WINNT\system32>dir %windir%\..\tftpdroot
dir %windir%\..\tftpdroot
驅動器 C 中的磁碟區沒有標籤。
磁碟區的序列號是 D428-6BB5
C:\tftpdroot 的目錄
2002-12-19 09:27 <DIR> .
2002-12-19 09:27 <DIR> ..
2002-11-30 14:12 941 slimftpd.conf
2002-10-22 11:00 1,642 settings.ini
2001-05-04 13:58 52,736 fp.exe

f.使用客戶端程序
因為put就是預設到伺服器的這個目錄。 上傳
get就是到當前執行的目錄裡面 下載
C:\WINNT\system32>tftp -i 218.11.x.67 get fp.exe
tftp -i 218.11.140.67 get fp.exe
Transfer successful: 52736 bytes in 1 second, 52736 bytes/s

C:\WINNT\system32>tftp -i 218.11.x.67 put fp.exe
tftp -i 218.11.140.67 put fp.exe
Transfer successful: 52736 bytes in 1 second, 52736 bytes/s
//上面是上傳到伺服器。

總結來說, 目前還是有資訊設備利用 tftp 的方式來更新韌體。
如果略嫌步驟麻煩,也可以利用windows下的軟體來使用喔!!
http://www.solarwinds.com/products/freetools/free_tftp_server.aspx
TFTP Server

沒有留言:

張貼留言