b'\n_START_ARTICLE_\nFTP\n_START_SECTION_\nDatu savienojuma atv\xc4\x93r\xc5\xa1anas metodes\n_START_PARAGRAPH_\nFTP par transporta sl\xc4\x81\xc5\x86a protokolu lieto tikai TCP. Ien\xc4\x81ko\xc5\xa1ajiem savienojumiem FTP serveri p\xc4\x93c noklus\xc4\x93juma lieto 21 portu. Klienta savienojums uz \xc5\xa1o portu ir vad\xc4\xabbas savienojums (control connection). Caur \xc5\xa1o savienojumu klients s\xc5\xabta komandas serverim un serveris s\xc5\xabta atbildes, bet \xc5\xa1o savienojumu nelieto pa\xc5\xa1u failu p\xc4\x81rs\xc5\xabt\xc4\xab\xc5\xa1anai. Failu p\xc4\x81rs\xc5\xabt\xc4\xab\xc5\xa1anai FTP lieto datu savienojumus, kurus var izveidot da\xc5\xbe\xc4\x81dos veidos._NEWLINE_Active mode (akt\xc4\xabvais re\xc5\xbe\xc4\xabms) - klients sav\xc4\x81 gal\xc4\x81 atver nejau\xc5\xa1i izv\xc4\x93l\xc4\x93tu portu (porta numurs virs 1024) un serverim nos\xc5\xabta \xc5\xa1o porta numuru. FTP serveris p\xc4\x93c tam izveido savienojumu ar \xc5\xa1o portu un var s\xc5\xabt\xc4\xabt vai sa\xc5\x86emt datus._NEWLINE_Lai \xc5\xa1aj\xc4\x81 re\xc5\xbe\xc4\xabm\xc4\x81 atv\xc4\x93rtu datu savienojumu, klients nos\xc5\xabta komandu PORT, kuras argumenti ir klienta IP adrese un atv\xc4\x93rtais ports. adrese:ports te ir k\xc4\x81 6 skait\xc4\xbcu virkne. "h1,h2,h3,h4,p1,p2", pirmie 4 skait\xc4\xbci atbilst IP adresei, atliku\xc5\xa1ie divi - portam. Piem. ja IP adrese ir 192.168.0.2 un atv\xc4\x93rtais ports ir 1025, tad klients nos\xc5\xabta komandu "PORT 192,168,0,1,4,1". ports ir h1*256+h2, \xc5\xa1aj\xc4\x81 gad\xc4\xabjum\xc4\x81 4*256+1._NEWLINE_Passive mode (pas\xc4\xabvais re\xc5\xbe\xc4\xabms) - serveris sav\xc4\x81 gal\xc4\x81 atver nejau\xc5\xa1i izv\xc4\x93l\xc4\x93tu portu (porta numurs virs 1024) un pazi\xc5\x86o to klientam, kur\xc5\xa1 uz turieni veido savienojumu._NEWLINE_Lai \xc5\xa1aj\xc4\x81 re\xc5\xbe\xc4\xabm\xc4\x81 izveidotu datu savienojumu, klients nos\xc5\xabta komandu PASV, uz kuru serveris atbild apm\xc4\x93ram \xc5\xa1\xc4\x81di: "227 Entering Passive Mode (127,0,0,1,78,52)", kur \xc5\xa1ie se\xc5\xa1i skait\xc4\xbci ir ar apm\xc4\x93ram t\xc4\x81du pa\xc5\xa1u noz\xc4\xabmi k\xc4\x81 PORT komandas argumenti akt\xc4\xabvaj\xc4\x81 re\xc5\xbe\xc4\xabm\xc4\x81._NEWLINE_Eksist\xc4\x93 ar\xc4\xab extended passive mode, kas ir l\xc4\xabdz\xc4\xabga pas\xc4\xabvajam re\xc5\xbe\xc4\xabm\xc4\x81m, tikai lieto cit\xc4\x81d\xc4\x81ku argumentu form\xc4\x81tu._NEWLINE_Taj\xc4\x81 laik\xc4\x81, kad notiek datu p\xc4\x81rraide caur datu savienojumu, vad\xc4\xabbas savienojum\xc4\x81 nekas nenotiek. Tas da\xc5\xbereiz rada probl\xc4\x93mas ar lielu failu p\xc4\x81rs\xc5\xabt\xc4\xab\xc5\xa1anu, ja pa vidu ir ugunsm\xc5\xabri, kas vardarb\xc4\xabgi p\xc4\x81rtrauc vad\xc4\xabbas savienojumu._NEWLINE_FTP protokols nodro\xc5\xa1ina iesp\xc4\x93ju ats\xc4\x81kt norautas lejupel\xc4\x81des izmantojot REST komandu. \xc5\xa0\xc4\xabs komandas arguments ir faila lejupl\xc4\x81d\xc4\x93t\xc4\x81s da\xc4\xbcas izm\xc4\x93rs baitos. Aug\xc5\xa1upl\xc4\x81\xc5\xbeu ats\xc4\x81k\xc5\xa1ana ir problem\xc4\x81tisk\xc4\x81ka, jo nav prec\xc4\xabzi zin\xc4\x81ms, kur\xc4\x81 viet\xc4\x81 p\xc4\x81rs\xc5\xabt\xc4\xab\xc5\xa1ana p\xc4\x81rtr\xc5\xabka, lai ar\xc4\xab eksist\xc4\x93 REST analoga APPE komanda. Failu izm\xc4\x93ru var noteikt no direktoriju saraksta vai ar SIZE komandu.\n_START_SECTION_\nNAT\xe2\x80\x93PT\n_START_PARAGRAPH_\n\xc4\xaapa\xc5\xa1i priek\xc5\xa1 FTP protokola darb\xc4\xabbas caur ugunsm\xc5\xabri tika izveidots NAT papla\xc5\xa1in\xc4\x81jums, kuru nosauca par NAT-PT (rfc2766), kur\xc5\xa1 \xc4\xbcauj veidot ien\xc4\x81ko\xc5\xa1os savienojumus no servera uz klientu caur NAT. Izveidojot \xc5\xa1\xc4\x81du savienojumu NAT maina s\xc5\xabt\xc4\x81mos datus, kas tiek p\xc4\x81rs\xc5\xabt\xc4\xabti no klienta, nor\xc4\x81dot serverim patieso adresi un portu, ar kuru serveris var izveidot savienojumu un p\xc4\x93c tam p\xc4\x81rraida savienojumu no servera no \xc5\xa1\xc4\xabs adreses uz klienta adresi. Neskatoties uz visiem pas\xc4\x81kumiem un jaunin\xc4\x81jumiem, kas likti liet\xc4\x81, lai atbalst\xc4\xabtu FTP protokolu, praks\xc4\x93, NAT-PT funkcija visos mar\xc5\xa1rut\xc4\x93t\xc4\x81jos tiek atsl\xc4\x93gta, lai sniegtu papildus dro\xc5\xa1\xc4\xabbu pret v\xc4\xabrusu draudiem.\n_START_SECTION_\nFXP\n_START_PARAGRAPH_\nFXP (angliski File eXchange Protocol \xe2\x80\x93 Failu apmai\xc5\x86as protokols) - veids, k\xc4\x81 p\xc4\x81rs\xc5\xabt\xc4\xabt failus starp diviem FTP serveriem pa tie\xc5\xa1o, neiel\xc4\x81d\xc4\x93jot datus sav\xc4\x81 dator\xc4\x81. Izveidojot FXP sesiju klients atver divus FTP savienojumus uz diviem da\xc5\xbe\xc4\x81diem serveriem, pieprasot failu no pirm\xc4\x81 servera nor\xc4\x81da komand\xc4\x81 PORT otra servera IP adresi._NEWLINE_Par viennoz\xc4\xabm\xc4\xabgu priek\xc5\xa1roc\xc4\xabbu FXP standarta atbalst\xc4\x81 ir tas, ka gala lietot\xc4\x81jus, kuri v\xc4\x93las kop\xc4\x93t failus no viena FTP servera uz citu, vairs neietekm\xc4\x93 vi\xc5\x86u interneta piesl\xc4\x93guma \xc4\x81truma ierobe\xc5\xbeojumi. Nav nepiecie\xc5\xa1am\xc4\xabbas sev lejupiel\xc4\x81d\xc4\x93t failu, lai p\xc4\x93c tam aug\xc5\xa1upiel\xc4\x81d\xc4\x93tu to uz citu FTP serveri. T\xc4\x81tad, failu p\xc4\x81rs\xc5\xabt\xc4\xab\xc5\xa1anas \xc4\x81trums b\xc5\xabs atkar\xc4\xabgs tikai no interneta savienojuma \xc4\x81truma starp diviem att\xc4\x81lin\xc4\x81tajiem FTP serveriem, kas liel\xc4\x81kaj\xc4\x81 da\xc4\xbc\xc4\x81 gad\xc4\xabjumu ir krietni \xc4\x81tr\xc4\x81ks par lietot\xc4\x81ju interneta piesl\xc4\x93gumiem._NEWLINE_FXP tagad s\xc4\x81ku\xc5\xa1i izmantot hakeri, lai uzbruktu citiem serveriem; komand\xc4\x81 PORT tiek nor\xc4\x81d\xc4\xabta IP adrese un ports, kuru izmanto serviss, kuram tiek veikts uzbrukums, un ar komand\xc4\x81m RETR / STOR tiek veikts piepras\xc4\xabjums uz \xc5\xa1o portu k\xc4\x81 no FTP servera, nevis no uzbr\xc5\xabko\xc5\xa1\xc4\x81 datora, kas \xc4\xbcauj veikt liela m\xc4\x93roga DDoS uzbrukumus izmantojot uzreiz vair\xc4\x81kus FTP serverus, vai apiet upura datora dro\xc5\xa1\xc4\xabbas sist\xc4\x93mu, ja tas p\xc4\x81rbauda tikai klienta IP adreses, kas nor\xc4\x81d\xc4\xabta komand\xc4\x81 PORT, atbilst\xc4\xabbu FTP klienta IP adresei un p\xc4\x93c noklus\xc4\x93juma aizliedz izmantot tre\xc5\xa1o pu\xc5\xa1u IP adreses. T\xc4\x81d\xc4\x93j\xc4\x81di FXP nav iesp\xc4\x93jams izmantot str\xc4\x81d\xc4\x81jot ar publiskajiem FTP serveriem.'