| 1 | == Перехват SIP-трафика на плате VE-01 == |
| 2 | |
| 3 | [[span(style=color: #FF0000, ''Внимание! Данное руководство предназначено для опытных пользователей. Выполнение некорректных команд на плате может привести к потере работоспособности платы. '')]] |
| 4 | |
| 5 | |
| 6 | === 1. Скопировать файлы === |
| 7 | libpcap_1.0.0-1_c300evm.ipk и tcpdump_4.0.0-1_c300evm.ipk в каталог {{{/tmp}}} на плате VE-01 (Сделать это можно, например с помощью программы !WinScp) |
| 8 | |
| 9 | === 2. Подключиться к SSH консоли === |
| 10 | Например, программой putty, перед подключением нужно установить большее количество строк в выводе консоли {{{Настройки->Window->Lines of scrollback}}}, по умолчанию там значение 2000, для нашего эксперимента это маловато, можно увеличить раз в 10. |
| 11 | |
| 12 | === 3.Выполнить следующие команды === |
| 13 | 3.1. Перейти в каталог /tmp |
| 14 | {{{cd /tmp}}} |
| 15 | 3.2. Установить пакеты из каталога /tmp |
| 16 | {{{opkg install libpcap_1.0.0-1_c300evm.ipk tcpdump_4.0.0-1_c300evm.ipk}}} |
| 17 | |
| 18 | Вот пример успешного выполнения команд: |
| 19 | {{{ |
| 20 | root@comcerto:~# cd /tmp |
| 21 | root@comcerto:/tmp# opkg install libpcap_1.0.0-1_c300evm.ipk tcpdump_4.0.0-1_c300evm.ipk |
| 22 | Installing libpcap (1.0.0-1) to root... |
| 23 | Installing tcpdump (4.0.0-1) to root... |
| 24 | Configuring tcpdump |
| 25 | Configuring libpcap |
| 26 | }}} |
| 27 | |
| 28 | === 4. Запустить tcpdump === |
| 29 | Выполнить команду типа: |
| 30 | {{{ |
| 31 | tcpdump -v -s1514 port 5060 and host 192.168.0.105 |
| 32 | }}} |
| 33 | здесь после host нужно указать IP адрес дальней стороны (устройства которое пытается связаться с платой VE-01) |
| 34 | |
| 35 | - Провести эксперимент и наблюдать вывод пакетов SIP в консоль. |
| 36 | - По окончанию эксперимента прервать выполнение команды (нажать CTRL+C), затем выделить весь текст начиная с запуска команды tcpdump и до конца вывода и скопировать его в буфер (в putty копирование производится нажатием левой кнопки мыши на выделенный текст). |
| 37 | - Вставить текст из буфера в текстовый файл. |
| 38 | |
| 39 | Должно получиться что-то подобное: |
| 40 | {{{ |
| 41 | root@comcerto:/tmp# tcpdump -v -s1514 port 5060 and host 192.168.0.105 |
| 42 | tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 1514 bytes |
| 43 | 06:16:04.512319 IP (tos 0x68, ttl 64, id 0, offset 0, flags [DF], proto UDP (17), length 32) |
| 44 | 192.168.0.105.5060 > 192.168.0.147.5060: SIP, length: 4 |
| 45 | |
| 46 | |
| 47 | |
| 48 | 06:16:04.853344 IP (tos 0x68, ttl 64, id 0, offset 0, flags [DF], proto UDP (17), length 1004) |
| 49 | 192.168.0.105.5060 > 192.168.0.147.5060: SIP, length: 976 |
| 50 | INVITE sip:100@192.168.0.147:5060 SIP/2.0 |
| 51 | Via: SIP/2.0/UDP 192.168.0.105:5060;branch=z9hG4bK4227904688 |
| 52 | From: "123" <sip:123@192.168.0.147:5060>;tag=4009663443 |
| 53 | To: <sip:100@192.168.0.147:5060> |
| 54 | Call-ID: 1_3246133754@192.168.0.105 |
| 55 | CSeq: 1 INVITE |
| 56 | Contact: <sip:123@192.168.0.105:5060> |
| 57 | Content-Type: application/sdp |
| 58 | Allow: INVITE, INFO, PRACK, ACK, BYE, CANCEL, OPTIONS, NOTIFY, REGISTER, SUBSCRIBE, REFER, PUBLISH, UPDATE, MESSAGE |
| 59 | Max-Forwards: 70 |
| 60 | User-Agent: Yealink SIP-T21P_E2 52.80.14.2 |
| 61 | Supported: timer |
| 62 | Session-Expires: 180;refresher=uac |
| 63 | Min-SE: 90 |
| 64 | Allow-Events: talk,hold,conference,refer,check-sync |
| 65 | Supported: replaces |
| 66 | Content-Length: 315 |
| 67 | |
| 68 | v=0 |
| 69 | o=- 20167 20167 IN IP4 192.168.0.105 |
| 70 | s=SDP data |
| 71 | c=IN IP4 192.168.0.105 |
| 72 | t=0 0 |
| 73 | m=audio 11926 RTP/AVP 8 0 102 18 101 |
| 74 | a=rtpmap:8 PCMA/8000 |
| 75 | a=rtpmap:0 PCMU/8000 |
| 76 | a=rtpmap:102 G726-32/8000 |
| 77 | a=rtpmap:18 G729/8000 |
| 78 | a=fmtp:18 annexb=no |
| 79 | a=ptime:30 |
| 80 | a=sendrecv |
| 81 | a=rtpmap:101 telephone-event/8000 |
| 82 | a=fmtp:101 0-15 |
| 83 | |
| 84 | 06:16:04.865300 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto UDP (17), length 468) |
| 85 | 192.168.0.147.5060 > 192.168.0.105.5060: SIP, length: 440 |
| 86 | SIP/2.0 407 Proxy Authentication Required |
| 87 | Via: SIP/2.0/UDP 192.168.0.105:5060;branch=z9hG4bK4227904688 |
| 88 | Proxy-Authenticate: Digest nonce="1560492964:155384d9f42e21d611ff2f4a6548f523",algorithm=MD5,realm="192.168.0.147",qop="auth,auth-int" |
| 89 | To: <sip:100@192.168.0.147:5060>;tag=a5126e6b |
| 90 | From: "123"<sip:123@192.168.0.147:5060>;tag=4009663443 |
| 91 | Call-ID: 1_3246133754@192.168.0.105 |
| 92 | CSeq: 1 INVITE |
| 93 | Server: repro 1.10.2 |
| 94 | Content-Length: 0 |
| 95 | |
| 96 | |
| 97 | 06:16:04.870323 IP (tos 0x68, ttl 64, id 0, offset 0, flags [DF], proto UDP (17), length 305) |
| 98 | 192.168.0.105.5060 > 192.168.0.147.5060: SIP, length: 277 |
| 99 | ACK sip:100@192.168.0.147:5060 SIP/2.0 |
| 100 | Via: SIP/2.0/UDP 192.168.0.105:5060;branch=z9hG4bK4227904688 |
| 101 | From: "123" <sip:123@192.168.0.147:5060>;tag=4009663443 |
| 102 | To: <sip:100@192.168.0.147:5060>;tag=a5126e6b |
| 103 | Call-ID: 1_3246133754@192.168.0.105 |
| 104 | CSeq: 1 ACK |
| 105 | Content-Length: 0 |
| 106 | |
| 107 | |
| 108 | 06:16:04.882345 IP (tos 0x68, ttl 64, id 0, offset 0, flags [DF], proto UDP (17), length 1260) |
| 109 | 192.168.0.105.5060 > 192.168.0.147.5060: SIP, length: 1232 |
| 110 | INVITE sip:100@192.168.0.147:5060 SIP/2.0 |
| 111 | Via: SIP/2.0/UDP 192.168.0.105:5060;branch=z9hG4bK3315518714 |
| 112 | From: "123" <sip:123@192.168.0.147:5060>;tag=4009663443 |
| 113 | To: <sip:100@192.168.0.147:5060> |
| 114 | Call-ID: 1_3246133754@192.168.0.105 |
| 115 | CSeq: 2 INVITE |
| 116 | Contact: <sip:123@192.168.0.105:5060> |
| 117 | Proxy-Authorization: Digest username="123", realm="192.168.0.147", nonce="1560492964:155384d9f42e21d611ff2f4a6548f523", uri="sip:100@192.168.0.147:5060", response="ede18207ecfb6d870a9e4acb97174604", algorithm=MD5, cnonce="0a4f113b", qop=auth, nc=00000001 |
| 118 | Content-Type: application/sdp |
| 119 | Allow: INVITE, INFO, PRACK, ACK, BYE, CANCEL, OPTIONS, NOTIFY, REGISTER, SUBSCRIBE, REFER, PUBLISH, UPDATE, MESSAGE |
| 120 | Max-Forwards: 70 |
| 121 | User-Agent: Yealink SIP-T21P_E2 52.80.14.2 |
| 122 | Supported: timer |
| 123 | Session-Expires: 180;refresher=uac |
| 124 | Min-SE: 90 |
| 125 | Allow-Events: talk,hold,conference,refer,check-sync |
| 126 | Supported: replaces |
| 127 | Content-Length: 315 |
| 128 | |
| 129 | v=0 |
| 130 | o=- 20167 20167 IN IP4 192.168.0.105 |
| 131 | s=SDP data |
| 132 | c=IN IP4 192.168.0.105 |
| 133 | t=0 0 |
| 134 | m=audio 11926 RTP/AVP 8 0 102 18 101 |
| 135 | a=rtpmap:8 PCMA/8000 |
| 136 | a=rtpmap:0 PCMU/8000 |
| 137 | a=rtpmap:102 G726-32/8000 |
| 138 | a=rtpmap:18 G729/8000 |
| 139 | a=fmtp:18 annexb=no |
| 140 | a=ptime:30 |
| 141 | a=sendrecv |
| 142 | a=rtpmap:101 telephone-event/8000 |
| 143 | a=fmtp:101 0-15 |
| 144 | |
| 145 | 06:16:04.956783 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto UDP (17), length 591) |
| 146 | 192.168.0.147.5060 > 192.168.0.105.5060: SIP, length: 563 |
| 147 | SIP/2.0 180 Ringing |
| 148 | Via: SIP/2.0/UDP 192.168.0.105:5060;branch=z9hG4bK3315518714 |
| 149 | Record-Route: <sip:192.168.0.147:5060;transport=udp;lr> |
| 150 | Contact: <sip:100@127.0.0.1:6060> |
| 151 | To: <sip:100@192.168.0.147:5060>;tag=1425527049 |
| 152 | From: "123" <sip:123@192.168.0.147:5060>;tag=4009663443 |
| 153 | Call-ID: 1_3246133754@192.168.0.105 |
| 154 | CSeq: 2 INVITE |
| 155 | Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, REFER, NOTIFY, INFO, UPDATE, PRACK |
| 156 | Server: repro 1.10.2 |
| 157 | Supported: replaces, timer, 100rel |
| 158 | User-Agent: eXosip/4.1.0 |
| 159 | P-Asserted-Identity: <sip:100@192.168.0.147> |
| 160 | Content-Length: 0 |
| 161 | |
| 162 | |
| 163 | 06:16:10.526388 IP (tos 0x68, ttl 64, id 0, offset 0, flags [DF], proto UDP (17), length 360) |
| 164 | 192.168.0.105.5060 > 192.168.0.147.5060: SIP, length: 332 |
| 165 | CANCEL sip:100@192.168.0.147:5060 SIP/2.0 |
| 166 | Via: SIP/2.0/UDP 192.168.0.105:5060;branch=z9hG4bK3315518714 |
| 167 | From: "123" <sip:123@192.168.0.147:5060>;tag=4009663443 |
| 168 | To: <sip:100@192.168.0.147:5060> |
| 169 | Call-ID: 1_3246133754@192.168.0.105 |
| 170 | CSeq: 2 CANCEL |
| 171 | Max-Forwards: 70 |
| 172 | User-Agent: Yealink SIP-T21P_E2 52.80.14.2 |
| 173 | Content-Length: 0 |
| 174 | |
| 175 | |
| 176 | 06:16:10.539300 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto UDP (17), length 306) |
| 177 | 192.168.0.147.5060 > 192.168.0.105.5060: SIP, length: 278 |
| 178 | SIP/2.0 200 OK |
| 179 | Via: SIP/2.0/UDP 192.168.0.105:5060;branch=z9hG4bK3315518714 |
| 180 | To: <sip:100@192.168.0.147:5060>;tag=24766014 |
| 181 | From: "123" <sip:123@192.168.0.147:5060>;tag=4009663443 |
| 182 | Call-ID: 1_3246133754@192.168.0.105 |
| 183 | CSeq: 2 CANCEL |
| 184 | Server: repro 1.10.2 |
| 185 | Content-Length: 0 |
| 186 | |
| 187 | |
| 188 | 06:16:10.572847 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto UDP (17), length 349) |
| 189 | 192.168.0.147.5060 > 192.168.0.105.5060: SIP, length: 321 |
| 190 | SIP/2.0 487 Request Cancelled |
| 191 | Via: SIP/2.0/UDP 192.168.0.105:5060;branch=z9hG4bK3315518714 |
| 192 | To: <sip:100@192.168.0.147:5060>;tag=1425527049 |
| 193 | From: "123" <sip:123@192.168.0.147:5060>;tag=4009663443 |
| 194 | Call-ID: 1_3246133754@192.168.0.105 |
| 195 | CSeq: 2 INVITE |
| 196 | Server: repro 1.10.2 |
| 197 | User-Agent: eXosip/4.1.0 |
| 198 | Content-Length: 0 |
| 199 | |
| 200 | |
| 201 | 06:16:10.577410 IP (tos 0x68, ttl 64, id 0, offset 0, flags [DF], proto UDP (17), length 307) |
| 202 | 192.168.0.105.5060 > 192.168.0.147.5060: SIP, length: 279 |
| 203 | ACK sip:100@192.168.0.147:5060 SIP/2.0 |
| 204 | Via: SIP/2.0/UDP 192.168.0.105:5060;branch=z9hG4bK3315518714 |
| 205 | From: "123" <sip:123@192.168.0.147:5060>;tag=4009663443 |
| 206 | To: <sip:100@192.168.0.147:5060>;tag=1425527049 |
| 207 | Call-ID: 1_3246133754@192.168.0.105 |
| 208 | CSeq: 2 ACK |
| 209 | Content-Length: 0 |
| 210 | |
| 211 | |
| 212 | |
| 213 | 10 packets captured |
| 214 | 11 packets received by filter |
| 215 | 0 packets dropped by kernel |
| 216 | }}} |