..-----------------------------..
..      Phoenix net proto      ..
.._____________________________..


  1.1  wtf?
  1.2    about warez

  2.1  protocol overview
  2.2    transport level
  2.3    how it works?
  2.4    features

  3.1  bugz and sux


 __     __
 __ 1.1 __   wtf?


     ,      ds   
           icw5   .       
    SP0ofed LAN utility (spolan.sourceforge.com) by DarkK.  
     ,        
    ip-  icmp  udp .   
   MTU (Maximal Transmission Unit)   .    
       ,      isp
   MTU-intel.        ,      
    .


 __     __
 __ 1.2 __   about warez


         (./include/freewaybbs_1.4/)    
            little endian      bsd-
    .    ,   -  )).


 __     __
 __ 2.1 __   protocol overview


         ,         
   :

       -    .

       -   , ..     -  10 . 
                 .

       -    - ,     -  
          .

       -         linux  *BSD.


 __     __
 __ 2.2 __   transport level


            icmp-tunnel,
   .. dns-    =)  ,  ,
     . ,      icmp-     
      192.168.10.x     :

            .=---> GATE (i.e. 195.34.32.26) --->=.
           ./"                                  "\.
          ./"                                    "\.
         ./" 192.168.10.1                         "\. 192.168.10.7

  out packet:                                    in packet:

  ip_src: 192.168.10.7                          ip_src: 195.34.32.26
  ip_dst: 195.34.32.26                          ip_dst: 192.168.10.7
  ip_proto: icmp                                ip_proto: icmp
  ...data....                                   ...data...


            
     icmp ( , oxid   " 
    icmp",   ).     phoenix_net.
     :

  // phoenix_net header (based on icmp):


  0           8          16                   32
  +-----------+-----------+---------------------+       ICMP header
  i icmp_type i icmp_code i        chksum       i
  +-----------+-----------+----------+----------+
  i    src    i    uid    i    cmd   i   arg    i
  +-----------+-----------+----------+----------+

   ,    :

     // to use via ICMP_ECHO
    struct phoenix_proto {

      char type[1];  // icmp_type
      char code[1];  // icmp_code
      short  chksum;
      char  src[1];  // source addr
      char  uid[1];  // user id
      char  cmd[1];  // command
      char  arg[1];  // argument

    };


  // phoenix_net header vol.2 (based on udp+dns):

  0         8        16              32
  +---------+---------+-------+--------+       UDP header
  i   cmd   i   arg   i    dst_port    i
  +---------+---------+----------------+
  i      length       i    check sum   i
  +-------------------+----------------+

  +---------+---------+----------------+       DNS header
  i   src   i   uid   i      zeroed    i
  +---------+---------+----------------+
  i      htons(1)     i      zeroed    i
  +-------------------+----------------+
  i     zeroed        i      zeroed    i
  +---------+---------+----------------+
  i datalen i our MAD DATA!! ......... i
  +---------+-----------------+--------+
  i ......................... i  zero  i
  +-------------------+-------+--------+
  i     htons(1)      i   htons(1)     i
  +-------------------+----------------+

     // to use via DNS
    struct phoenix_proto {

      char cmd[1];    // 0x00 udp_src
      char arg[1];    // 0x01 udp_src
      short dst_port; // 53
      short len;
      short chksum;
      char src[1];    // 0x00 dns_id
      char uid[1];    // 0x01 dns_id
      short junk;   // this flags must be 0 in requests
      short qd_cnt; // == 1
      short an_cnt; // == 0
      short ns_cnt; // == 0
      short ar_cnt; // == 0
      char datalen[1];  // datalen
    };

     dns-:

     char[1];   // == 0
     short a1;  // htons(1)
     short a2;  // htons(1)


       phoenix-:

  src (8 bits)  -    ip  -
  uid (8 bits)  -  uid 
  cmd (8 bits)  -   
  arg (8 bits)  -    ( )

     :

  // server-side cmdz

  #define   SERV_MESG     0
  #define   SERV_PING     1
  #define   SERV_CON      2
  #define   SERV_FUCK     3
  #define   SERV_WHOZ     4
  #define   SERV_DATA     5
  #define   SERV_FILE     6

  // client-side cmdz

  #define   SERV_JOIN    16
  #define   SERV_PART    17
  #define   SERV_ERR     20
  #define   SERV_OK      21
  #define   SERV_BAK     22
  #define   SERV_PRP     23

  // SERV_ERR argz:

  #define   UPLOAD_DENY   1
  #define   UPLOAD_BUSY   2
  #define   UPLOAD_FLER   3
  #define   UPLOAD_DONE   4


 __     __
 __ 2.3 __   how it works?


   ,    ..

*            ip-
 , ..       .

   1.               freeway. 
          SERV_CON.

   2. ..   ,      ( 
        peer-2-peer  -  ).

   3. ,      .    freeway.

   4.       SERV_CON   ,   
       .    .    
       SERV_BAK  ,    ph->src    
      .     ph->src    usr_list     
      ph->uid (look users_tab.h).

   5.      SERV_BAK        
      .            
           .

   6.       -.    
      SERV_CON'.

   7.  ,      uid   usr_list.  
      ,    SERV_ERR.     uid    
          SERV_OK  ,   
       .       
         SERV_JOIN  ,  ph->uid.

   8.  -    ,     
      SERV_MESG     .          
             .
           -  SERV_OK.

   9.  ,    SERV_MESG        
      .

  10.   -      SERV_WHOZ,    
             :

      0        8       16  bits
      +--------+--------+
      i  uid1  i  src1  i
      +--------+--------+
      i  uid2  i  src2  i
      +--------+--------+
      i  uid3  i  src3  i
      +--------+--------+
      ...


  11.   -       SERV_PING    
         SERV_OK.

  12.  -    ( /quit),  
       SERV_FUCK.   ,     src
      addr   usr_list    ph->uid'.     
       SERV_PART  ,  uid'  .



      :

   1.  ,  SERV_MESG   SERV_PING     
                 
      SERV_PRP (aka server_prepare)    .

   2. ,  ,    SERV_PRP 
         .  
       1-12,  .



       :

   1.              
        SERV_WHOZ.

   2. ,       SERV_FILE.

   3. ,      ,     
      ,    ,  SERV_FILE  SERV_ERR  arg =
      UPLOAD_DENY .

   4. ,  SERV_FILE,    
           MAX_FILE_SEGMENT     
           SERV_DATA.         
       .

   5. ,           
           .

   6.      ,      
      SERV_ERR   UPLOAD_DONE,       
         SERV_DATA   .


 __     __
 __ 2.4 __   features


   -     ,      
   .   ,    .  icw5 
    ,         ;P   
     dns-   freeway_bbs   icw5, rol, comstar
    ..     icw5-community =)


 __     __
 __ 3.1 __   bugz and sux


   -            
   ,              .

