<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    學海拾遺

    生活、技術、思想無處不在學習
    posts - 52, comments - 23, trackbacks - 0, articles - 3
      BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理

    [轉]Understanding The FTP PORT Command

    Posted on 2008-07-16 11:41 tanzek 閱讀(1142) 評論(0)  編輯  收藏
    You may already know that when FTP (File Transfer Protocol) commands cross the wire, they use port 21 by default. You may also know that port 20 is assigned to FTP data. Unfortunately, most FTP data sessions do not actually use port 20.

    So you have just taken a trace of an FTP session and noticed that a PORT command crossed the wire. When you looked at the decode, you saw the strangest command sequence:

    PORT 10,2,0,2,4,31

    [We have several FTP trace files online at
    http://www.packet-level.com/traceFiles.htm.]

    What does this mean? First let us take a look at the purpose of the PORT command. Then we will decipher the numbers following the command.

    THE PORT COMMAND
    FTP communications use two port number values - one for commands (port 21 by default) and one for data transfer (this is where the PORT command comes into play).

    The PORT command is sent by an FTP client to establish a secondary connection (address and port) for data to travel over. In some FTP implementations port 20 is used for data, but that is the exception rather than the rules. Typically in a trace you will see data crossing over a dynamic port number (IANA states that this range should be between 49152 through 65535, but most likely you'll see your application using something just above 1024 - the area that used to be the dynamic port number area).

    Figure 1 shows the summary of an FTP communication. Packet 16 contains the PORT command. [This trace file is online at http://www.packet-level.com/traceFiles.htm.]


    Figure 1: The PORT command and parameters are visible in Sniffer's summary column.


    An FTP client issues a PORT to the FTP server and defines what port the client will be listening on for the data channel connection. Upon receipt of the PORT command, the server establishes a new TCP connection to the client using that TCP port value.

    You may see numerous PORT commands issued during a single FTP session - a new data channel must be established to transfer directory listings and perform file GET and PUT operations.

    The Freaky Numbers

    After the PORT command, you will see a series of six numbers - these numbers indicate the IP address and port number to use in establishing a data transfer connection. The first four numbers (10,2,0,2 in our example above) indicate the client IP address. The second numbers, 4,15 indicate the client port number.

    4,15? Strange. When you look at your trace, you would notice that the server establishes a connection on the client port 1039 (D=1039 in packet 19 in Figure 1). How did we get from 4,15 to 1039? Here we go. To interpret and translate the value 4,15 into a port number the receiver must do some decimal to hex translations - here is an example:

    first number (4) translate to hex (0x04)
    second number (15) translate to hex (0x0F)

    Now take the entire set of hex bytes (0x040F) and translate the bytes from hex to decimal (1055). Figure 2 displays the conversion value in Hex Workshop's Base Converter applet. (Hex Workshop and Base Converter are available online at www.bpsoft.com.) Voila!


    Figure 2: Hex value 040F is equivalent to decimal value 1039.


    Most folks get snagged when they try to translate both decimal values as a single set (415 = 0x019F) - that just will not work. You must split the values and convert individually to hex before combining and converting to decimal.

    Now you know - when you see another PORT command on the wire, you should be able to guess what port the data transfer process will use.

    View All Articles by Laura Chappell


    About the Author:
    Laura Chappell is the Sr. Protocol Analyst for the Protocol Analysis Institute. Laura focuses on researching, writing and lecturing on network analysis and security. In 2003, over 60 of Laura's courses become available via internet/CD and a series of "White Hat Toolbox: Security Tools, Tricks and Traces" are releasing at http://www.packet-level.com. Laura can be reached at lchappell@packet-level.com.

    More it_network_systems Articles


    Traceback: http://www.securitypronews.com/it/networksystems/spn-21-20030917UnderstandingtheFTPPORTCommand.html


    只有注冊用戶登錄后才能發表評論。


    網站導航:
     
    主站蜘蛛池模板: 久久精品无码专区免费| 老司机午夜免费视频| 久久免费精彩视频| 亚洲线精品一区二区三区影音先锋 | 可以免费观看的毛片| a级亚洲片精品久久久久久久| 免费国产a理论片| 亚洲国产电影av在线网址| 水蜜桃视频在线观看免费| 区三区激情福利综合中文字幕在线一区亚洲视频1 | 久久久久国色AV免费看图片| 亚洲精品乱码久久久久久下载 | 青青草国产免费国产是公开 | 亚洲成人激情在线| 青青草无码免费一二三区| 亚洲综合色一区二区三区小说| 91免费国产精品| 精品亚洲成A人无码成A在线观看| 久久久久免费看黄A片APP| 国产亚洲午夜精品| 亚洲国产精品成人精品无码区 | 国产高潮久久免费观看| 国产亚洲精品自在久久| 亚洲免费视频播放| 亚洲精品乱码久久久久久V | 99久久国产热无码精品免费| 亚洲小说图区综合在线| 亚洲?V乱码久久精品蜜桃| 两个人看的www视频免费完整版| 亚洲av日韩av无码黑人| 免费看国产成年无码AV片| 男人扒开添女人下部免费视频| 激情97综合亚洲色婷婷五| 曰批全过程免费视频网址 | 国产精品免费久久久久影院| 国产亚洲精品久久久久秋霞 | 免费高清小黄站在线观看| 免费看黄网站在线看| 亚洲视频国产精品| 九月婷婷亚洲综合在线| 足恋玩丝袜脚视频免费网站|