1 00:00:17,660 --> 00:00:26,260 Hello, DEF CON. Nice to meet you. Let me introduce myself. My name is Sergey Puzankov. 2 00:00:26,260 --> 00:00:34,660 I work at Positive Technologies Company as a telecom security expert. A couple of words 3 00:00:34,660 --> 00:00:45,520 about my experience. I have been working for telecom industry for more than 18 years. During 4 00:00:45,520 --> 00:00:54,000 this period, I worked in telecom equipment vendor as a support engineer. I worked in 5 00:00:54,000 --> 00:01:02,560 a huge multinational mobile operator as a quality engineer, and now my current position 6 00:01:02,560 --> 00:01:11,360 is telecom security expert where I perform security research and perform penetration 7 00:01:11,360 --> 00:01:20,860 tests or security assessments of mobile networks. All our findings we contribute to non-commercial 8 00:01:21,200 --> 00:01:23,980 organizations such as ITS and ITM. 9 00:01:24,000 --> 00:01:36,100 and GSMA and also we share this information at security conferences and now I'm going to share 10 00:01:36,100 --> 00:01:50,320 my recent research with you the subject of this presentation is ss7 but what the ss7 is ss7 is a 11 00:01:50,320 --> 00:01:57,680 control plane of protocols this is not one protocols but a set of protocols that is 12 00:01:57,680 --> 00:02:10,020 primarily intended to set up and release telephony calls when mobile telephony appeared ss7 started 13 00:02:10,020 --> 00:02:17,280 processing SMS messages subscriber mobilities and some other services 14 00:02:17,280 --> 00:02:17,880 you 15 00:02:20,980 --> 00:02:32,180 ss7 works between network elements only not on the user side the elementary portion of 16 00:02:32,180 --> 00:02:40,560 the ss7 signaling calls message I will use this term throughout the presentation just 17 00:02:40,560 --> 00:02:49,880 remember message is similar to a packet in IP networks nowadays ss7 18 00:02:50,320 --> 00:03:05,280 is used in fixed telephony in mobile networks of 2G and 3G standards like GSMA and UMTS and for 19 00:03:05,800 --> 00:03:12,180 interconnection with next generation networks like LTE and 5G in the future 20 00:03:14,500 --> 00:03:19,220 there is an opinion that ss7 is an absolute 21 00:03:20,320 --> 00:03:31,160 technology and tomorrow or the day after tomorrow all we will use only 4G and 5G mobile 22 00:03:31,160 --> 00:03:41,100 devices but if we look at the official statistics from GSMA GSMA this is a session of all mobile 23 00:03:41,100 --> 00:03:50,100 operators mobile operators of all standards we could see we are somewhere here now 24 00:03:50,100 --> 00:03:50,300 we could see we are somewhere here now 25 00:03:50,300 --> 00:03:56,460 we could see we are somewhere here now on at this point and the number of 2g and 26 00:03:56,460 --> 00:03:56,580 on at this point and the number of 2g and 27 00:03:56,580 --> 00:04:01,760 on at this point and the number of 2g and 3g users is about five billions so each of 28 00:04:01,760 --> 00:04:05,380 3g users is about five billions so each of five billion subscribers could be a target 29 00:04:05,380 --> 00:04:05,640 five billion subscribers could be a target 30 00:04:05,640 --> 00:04:12,680 five billion subscribers could be a target of the ss7 hacker once the hacker got 31 00:04:12,680 --> 00:04:16,220 of the ss7 hacker once the hacker got access to the ss7 they are able to 32 00:04:16,220 --> 00:04:16,420 access to the ss7 they are able to 33 00:04:16,420 --> 00:04:20,040 access to the ss7 they are able to intercept all subscribers died 34 00:04:20,040 --> 00:04:20,280 intercept all subscribers died 35 00:04:20,300 --> 00:04:28,080 data like SMS and voice calls they can receive confidential information 36 00:04:28,080 --> 00:04:34,380 including information about subscriber location and I could perform those 37 00:04:34,380 --> 00:04:45,700 attacks on single subscribers or the whole networks also these hackers are 38 00:04:45,700 --> 00:04:52,700 able to take control over the digital identity including emails social 39 00:04:52,700 --> 00:05:01,060 networks application messages like whatsapp telegram and so on and also 40 00:05:01,060 --> 00:05:09,240 hackers in signal networks are able to steal money for example from balances of 41 00:05:09,240 --> 00:05:15,380 subscribers or using some fraudulent activity against the operator at all 42 00:05:15,380 --> 00:05:15,680 you 43 00:05:17,360 --> 00:05:30,300 why ss7 is insecure to answer these questions we need to look at history of 44 00:05:30,300 --> 00:05:39,740 ss7 development when ss7 has been developed it was the era of trusted 45 00:05:39,740 --> 00:05:44,140 networks because there were only a few 46 00:05:44,140 --> 00:05:55,660 Telephone operators who were connected to ss7 but later in early such an 47 00:05:56,260 --> 00:06:02,900 administration was introduced it calls seek Trump this person 48 00:06:02,900 --> 00:06:03,260 ED 49 00:06:06,220 --> 00:06:07,620 network 50 00:06:11,960 --> 00:06:12,660 ... 51 00:06:12,660 --> 00:06:13,360 ... 52 00:06:14,140 --> 00:06:21,400 SS7 was isolated network, but from this point SS7 stopped being isolated. 53 00:06:23,980 --> 00:06:36,260 In 80s mobile operators got widespread, so there are a lot of subscribers, a lot of new 54 00:06:36,260 --> 00:06:39,740 players in this market, a lot of traffic. 55 00:06:41,400 --> 00:06:46,820 And nowardays trusted area is over because 56 00:06:46,820 --> 00:06:53,200 more and more operators are connected to the SS7. 57 00:06:55,680 --> 00:07:04,160 Mobile operators are aware of this problem and they protect their networks. 58 00:07:04,380 --> 00:07:08,320 They use a lot of 59 00:07:08,320 --> 00:07:09,720 neural networks to send news . 60 00:07:09,740 --> 00:07:20,900 tools security tools such as SSN firewalls SMS home routing signaling ideas and also they can 61 00:07:20,900 --> 00:07:31,400 configure equipment in comply with compliance of security and one one thing mobile operators 62 00:07:31,400 --> 00:07:38,080 orders external penetration testing of their signal networks in order to understand how the 63 00:07:38,080 --> 00:07:49,680 networks look like from external hacker hackers point of view so I will speak about mobile 64 00:07:49,680 --> 00:07:59,700 networks and I need to describe some terms some identities and node elements of these networks 65 00:07:59,700 --> 00:08:07,960 first identity is MSI is then identity with this loan abbreviation is just a telephone number 66 00:08:08,080 --> 00:08:19,340 all we use the next term is GT or global title this is address of a core node element and the 67 00:08:19,340 --> 00:08:28,820 global title has the structure similar to a message then similar to telephone numbers the 68 00:08:28,820 --> 00:08:36,520 third identity is EMSI EMSI international mobile subscriber identity this is identifier of a SIM 69 00:08:38,080 --> 00:08:46,520 and nodes STP signal transfer point this is a router of signal and traffic of signal messages 70 00:08:46,520 --> 00:08:56,780 between core network elements HLR home location register this is a database of all home subscribers 71 00:08:56,780 --> 00:09:07,810 of the operator this database contains information of subscriber profiles which contain information 72 00:09:08,080 --> 00:09:17,880 subscriber identifiers EMSI and MSISDNS list of allowed and prohibited services and so on some 73 00:09:17,880 --> 00:09:27,820 technical information the next element is MSC and VLR this node the performs two functions first of 74 00:09:27,820 --> 00:09:38,060 them is MSC mobile switching Center this node is responsible for voice call routing and VLR are the 75 00:09:38,080 --> 00:09:47,400 visit location register this is one more database the database contains information about active 76 00:09:47,400 --> 00:09:58,760 subscribers who are under the coverage area of this note the alarms receives copies of subscriber 77 00:09:58,760 --> 00:10:09,140 profiles from HLR and and reach them with some information of radio access part for example 78 00:10:09,140 --> 00:10:20,700 cell identity and the last one the last node is SMS see or SMS Center this node is responsible 79 00:10:20,700 --> 00:10:28,740 for SMS processing since the subscriber profile of the subscriber is registered with the same 80 00:10:28,740 --> 00:10:37,480 is SSL I need to describe structure of this protocol I omit some low layers of 81 00:10:37,480 --> 00:10:44,220 this as of this protocol stack because they're responsible for neighboring 82 00:10:44,220 --> 00:10:50,800 communication the lowest layer protocol it is that is used on the international 83 00:10:50,800 --> 00:10:58,220 communication is sccp or signal connection control part this layer is 84 00:10:58,220 --> 00:11:06,340 responsible for the routing of signal messages it contains such information as 85 00:11:06,340 --> 00:11:14,580 source address destination address and some payload that is tick up protocol 86 00:11:14,580 --> 00:11:21,680 next protocol tick up transaction capabilities application part is 87 00:11:21,680 --> 00:11:27,060 responsible for transactions and dialogues this 88 00:11:27,060 --> 00:11:27,760 protocol 89 00:11:27,760 --> 00:11:35,780 ties single requests and response in responses into one transaction or one 90 00:11:35,780 --> 00:11:44,740 dialogue and the top layer protocol map mobile application part this protocol is 91 00:11:44,740 --> 00:11:50,900 a payload of signal and message it contains operation itself and all the 92 00:11:50,900 --> 00:11:53,060 parameters of each operation 93 00:11:57,760 --> 00:11:59,660 signal networks signal transfer points signal network Cortland® is the 94 00:11:59,660 --> 00:12:05,800 the Communal Minbooks has their own unique Hinds security tools they are signal 95 00:12:05,800 --> 00:12:15,080 transfer point i have all dimension thesepelled as rotor of signal traffic but 96 00:12:15,080 --> 00:12:23,240 But also, this node is able to block some illegitimate traffic. 97 00:12:23,800 --> 00:12:25,080 SMS home routing. 98 00:12:25,280 --> 00:12:35,220 This solution is intended to prevent SMS fraud and SMS spam and also hide IMSI identifiers. 99 00:12:35,840 --> 00:12:40,820 And one more security tool is SSL firewall. 100 00:12:40,820 --> 00:12:53,900 This is the most sophisticated tool that could protect signal networks against the most of signal attack. 101 00:12:54,200 --> 00:12:59,160 Such as IMSI disclosure, location tracking, voice contraception and so on. 102 00:13:02,660 --> 00:13:07,740 Some details about each of signal security tool. 103 00:13:08,540 --> 00:13:10,220 Signal transfer point. 104 00:13:10,820 --> 00:13:13,700 I have already mentioned twice. 105 00:13:14,400 --> 00:13:17,900 This is router of signal messages. 106 00:13:18,480 --> 00:13:24,060 This node is usually installed on the border of the network. 107 00:13:24,260 --> 00:13:33,620 And this network element receives all the external signal traffic. 108 00:13:34,020 --> 00:13:40,320 So, it is reasonable to bring in some security mechanisms into this network element. 109 00:13:40,820 --> 00:13:52,380 But STP is able to block signal traffic only by some simple rules. 110 00:13:52,660 --> 00:13:58,620 For example, block particular operation code. 111 00:13:58,820 --> 00:14:03,500 Block some source of the traffic. 112 00:14:03,740 --> 00:14:08,640 And maybe in some cases combinations of these. 113 00:14:10,820 --> 00:14:11,960 So, you see simple rules. 114 00:14:14,320 --> 00:14:19,580 The next protection tool is SMS home routing. 115 00:14:19,840 --> 00:14:30,940 But before I explain how it works, I'd like to describe how SMS delivery process works in mobile networks. 116 00:14:31,940 --> 00:14:38,320 We have SMS center that should deliver SMS to the subscriber. 117 00:14:39,040 --> 00:14:40,800 Normally SMS center should be like this. 118 00:14:40,800 --> 00:14:47,480 does not know where subscriber is located because all subscribers are mobile and this subscriber 119 00:14:47,480 --> 00:14:57,180 could be anywhere around the world SMS Center first of all should request some routing information to 120 00:14:57,180 --> 00:15:06,400 deliver this message it sends send routing info for SM signal message to the home network of 121 00:15:06,400 --> 00:15:15,980 subscriber this single message comes to to the HL on to the database HLR always knows where 122 00:15:15,980 --> 00:15:27,420 subscriber is located HL our replies with to data they are MC identity and address of the current 123 00:15:27,420 --> 00:15:36,240 MSC after that SMS enter knows address where to deliver the right 124 00:15:36,400 --> 00:15:47,840 And it does it. It delivers SMS to the appropriate MSC, and MSC after that delivers this SMS to the radio access system and finally to the subscriber. 125 00:15:50,160 --> 00:16:05,080 When intruders appear in the SSL network, they are able to use this dialog to retrieve IMS identity and identity of the current MSC. 126 00:16:05,080 --> 00:16:13,020 This is a confidential information that may be used for other sophisticated attacks. 127 00:16:14,960 --> 00:16:23,260 To protect network, SMS router was introduced in the network as a new network element. 128 00:16:24,440 --> 00:16:32,460 And now, when the border STP receives, send routing info for SM signal message. 129 00:16:32,740 --> 00:16:34,620 It should deliver this message. 130 00:16:34,660 --> 00:16:35,060 Not too late. 131 00:16:35,080 --> 00:16:36,900 Not to the HLR, but to the SMS router. 132 00:16:37,780 --> 00:16:45,980 SMS router generates some random IMSI, fake IMSI, and sends this in the response. 133 00:16:46,720 --> 00:16:52,940 And also, it uses its own address instead of MSC's one. 134 00:16:53,360 --> 00:16:57,900 After that, SMS comes to the SMS router. 135 00:16:58,240 --> 00:17:05,060 SMS router correlates this fake IMSI with MSSDN number and initiates... 136 00:17:05,080 --> 00:17:11,100 One new SMS delivery process inside the network. 137 00:17:11,280 --> 00:17:17,520 It sends the same send routing info for SMS to the HLR internally in the home network. 138 00:17:17,720 --> 00:17:20,800 HLR replies with correct data. 139 00:17:20,980 --> 00:17:26,340 After that, SMS is delivered to the right MSC and addressing right subscriber. 140 00:17:27,520 --> 00:17:31,120 Here we see two SMS delivery processes. 141 00:17:31,540 --> 00:17:33,660 First one is external. 142 00:17:33,860 --> 00:17:34,920 And the second one. 143 00:17:35,080 --> 00:17:45,580 is fully internal and what what we see that no confidential information goes abroad only fake data 144 00:17:47,480 --> 00:17:57,140 now if intruder appears in the ss7 network this intruder can send send routine info for sm 145 00:17:57,640 --> 00:18:03,940 signal message this message is delivered to the sms router and sms router replies with fake data 146 00:18:03,940 --> 00:18:16,960 so the network is protected and the third the third security tool ss7 firewall sm firewall 147 00:18:16,960 --> 00:18:26,680 usually implemented not in line but in loop mode it looks like this when ss7 message comes to the 148 00:18:26,680 --> 00:18:33,460 stp stp routes it to the ss7 firewall ss7 firewall has a lot of rules 149 00:18:34,100 --> 00:18:44,720 uh smart rules to define if this signal message is illegitimate or not if the message is illegitimate 150 00:18:44,720 --> 00:18:54,500 or malformed not malformed but hostile ss7 firewall just blocks it otherwise it sends it back 151 00:18:54,500 --> 00:19:02,020 to the stp and stp delivers message into the network into the home network and it delivers to 152 00:19:02,020 --> 00:19:03,340 the destination node 153 00:19:05,340 --> 00:19:19,840 all the ss7 firewalls relies on jsma rules jsm actually has done the great great work they 154 00:19:19,840 --> 00:19:28,160 classified all potentially hazard signal messages into three categories the first category contains 155 00:19:28,160 --> 00:19:33,920 list of operations that may be used only for the ss7 firewalls 156 00:19:33,940 --> 00:19:41,740 for internal signal and exchange if this traffic comes from external connections these signal 157 00:19:41,740 --> 00:19:51,040 messages this all signal traffic should be blocked category 2 consists list of signaling messages 158 00:19:51,580 --> 00:20:02,020 that should be related to inbound roamers for example i am an inbound roamer he in china i came 159 00:20:02,020 --> 00:20:03,920 from russia i am an inbound roamer he in china i came from russia i am an inbound roamer he in china i came from russia 160 00:20:03,940 --> 00:20:08,980 my russian operator can send some signaling traffic to chinese operator 161 00:20:09,300 --> 00:20:17,880 and this signal traffic should be related on my identity if the same russian operator sends 162 00:20:17,880 --> 00:20:24,680 the same signal traffic to the chinese operator that is related to chinese subscribers this 163 00:20:24,680 --> 00:20:32,860 traffic is illegitimate and category three the list of operations 164 00:20:33,940 --> 00:20:37,420 of category 3 is also available on the 165 00:20:37,420 --> 00:20:37,780 of category 3 is also available on the 166 00:20:37,780 --> 00:20:38,160 of category 3 is also available on the interconnection 167 00:20:38,160 --> 00:20:38,420 interconnection 168 00:20:38,420 --> 00:20:42,160 interconnection but category 3 is opposite to category 169 00:20:42,160 --> 00:20:42,940 but category 3 is opposite to category 2. 170 00:20:45,760 --> 00:20:48,200 all the operations from category 3 are 171 00:20:48,200 --> 00:20:48,400 all the operations from category 3 are 172 00:20:48,400 --> 00:20:49,100 all the operations from category 3 are related to 173 00:20:49,100 --> 00:20:52,020 related to outbound subscribers for example 174 00:20:52,580 --> 00:20:53,000 outbound subscribers for example 175 00:20:53,000 --> 00:20:55,000 outbound subscribers for example um i am outbound subscribers 176 00:20:55,000 --> 00:20:55,860 um i am outbound subscribers 177 00:20:55,860 --> 00:20:58,140 um i am outbound subscribers outbound subscriber from 178 00:20:58,140 --> 00:20:58,660 outbound subscriber from 179 00:20:58,660 --> 00:21:02,240 outbound subscriber from my home network point of view and if 180 00:21:02,240 --> 00:21:02,380 my home network point of view and if 181 00:21:02,380 --> 00:21:03,680 my home network point of view and if i 182 00:21:03,680 --> 00:21:03,820 i 183 00:21:03,820 --> 00:21:12,500 perform some operations here Chinese operator sends some signal traffic to my home to Russian 184 00:21:12,500 --> 00:21:21,480 operator and this traffic should be related to my subscriber identity if Chinese operator sends the 185 00:21:21,480 --> 00:21:32,680 same signal traffic to the Russian operator that is related to other subscribers who are home this 186 00:21:32,680 --> 00:21:46,500 traffic is illegitimate and now I will describe several attacks several vulnerabilities and to 187 00:21:46,500 --> 00:21:54,760 make this story more interesting I'll imagine some intruder who will perform illegitimate 188 00:21:54,760 --> 00:22:01,700 activity step by step receiving some information from the network and on each 189 00:22:02,680 --> 00:22:10,840 turn on each step this intruder will use different vulnerability will exploit different vulnerabilities 190 00:22:10,840 --> 00:22:22,100 of the mobile networks first what intruder needs this is MC identity and to receive this identifier 191 00:22:22,100 --> 00:22:32,280 our intruder will use will exploit vulnerability of malformed application context name to 192 00:22:32,680 --> 00:22:42,140 explain what the application contact is I need to explain some details about tcap protocol tcap protocol 193 00:22:42,140 --> 00:22:50,120 consists of several fields the first one is tcap message type this is mandatory field the second 194 00:22:50,120 --> 00:23:00,700 one is transaction identity 1 or 2 this is also mandatory field the next block not field but huge 195 00:23:00,700 --> 00:23:02,660 block is a dialogue portion the next block not field but huge block is a dialogue portion the next block not field but huge block is a dialogue portion 196 00:23:02,680 --> 00:23:10,580 this portion contains application context name application context name and defines the 197 00:23:10,580 --> 00:23:24,580 operation that is coded on the upper layer on the map layer and map layer itself is is laid inside 198 00:23:24,580 --> 00:23:32,500 the component portion two latest components dialogue portion a company portion are optional 199 00:23:32,680 --> 00:23:46,760 parameters in tcap protocol let's look in some details of the application context name this is a 200 00:23:46,760 --> 00:23:59,920 set of numbers each number has its own definition but in all the map operations first six numbers 201 00:24:03,940 --> 00:24:04,900 set of numbers each number has its own definition but in all the map operations first six numbers 202 00:24:04,900 --> 00:24:13,560 and let's see what happens if our intruder changes one of these content constant values to some value 203 00:24:13,560 --> 00:24:13,800 and let's see what happens if our intruder changes one of these content constant values to some value 204 00:24:13,800 --> 00:24:25,240 that is not supported that is out of range for example into the change zero that means ETSI as 205 00:24:25,240 --> 00:24:32,140 identified the organization to number four that is unknown value for the 206 00:24:32,140 --> 00:24:32,400 identified the organization to number four that is unknown value for the standard 207 00:24:33,700 --> 00:24:36,540 that is out of range for example into the person lessERSEON sends sociiell-конcake 208 00:24:36,540 --> 00:24:37,720 ssense pane blind two good person des a sssone and sends centered out person sssone and sends send 209 00:24:37,720 --> 00:24:42,860 rootin info for same signaling message with more form querer application context 210 00:24:43,700 --> 00:24:51,200 this single message comes to the stp and stp starts inspecting these mission error by 211 00:25:02,680 --> 00:25:10,400 player and here STP faces with malformed application context STP considers that 212 00:25:10,960 --> 00:25:20,900 all the message is also malformed and what the decision of course pass this 213 00:25:20,900 --> 00:25:28,640 message into the network the destination node is known this is HLR STP does not 214 00:25:28,640 --> 00:25:35,480 look inside does not inspect other protocols that is map and on the map 215 00:25:35,480 --> 00:25:43,680 protocol STP could find operation code send root info for SAM that means message 216 00:25:43,680 --> 00:25:48,580 should be routed not to the HLR but to the SMS router to implement SMS home 217 00:25:48,580 --> 00:25:56,540 routing procedure STP sends this message to the HLR it considers destination 218 00:25:56,540 --> 00:25:58,520 node should decide if 219 00:25:58,520 --> 00:26:04,840 this message malformed or not this destination node should decide should it 220 00:26:04,840 --> 00:26:12,600 reply on this message with error or with normal signal message and what happens 221 00:26:12,600 --> 00:26:18,700 HLR ignores malformed application context and replies with correct data 222 00:26:18,700 --> 00:26:26,460 with correct IMSI and correct MSC address but this is not all in this attack 223 00:26:27,020 --> 00:26:27,860 normally 224 00:26:27,860 --> 00:26:36,940 HLR doesn't know this data is correct or not because if SMS home routing 225 00:26:36,940 --> 00:26:44,000 procedure is implemented HLR receives the same structure of data to be 226 00:26:44,000 --> 00:26:50,960 sure that the SMS home routing is bypassed HLR needs to send the same 227 00:26:50,960 --> 00:26:57,840 absolutely the same signal of request and compare IMSI identity in the next optimizercomfry multiple attempt 228 00:26:57,840 --> 00:27:06,100 response if SMS home wrote and procedure works intruder receives two different 229 00:27:07,180 --> 00:27:15,400 random MC in two responses but if intruder sees equal MCS that means SMS 230 00:27:15,400 --> 00:27:27,540 home home wrote and solution is bypassed so now our intruder receives some 231 00:27:27,540 --> 00:27:33,880 technical some confidential technical data about target subscriber but this is 232 00:27:33,880 --> 00:27:41,240 not valuable for our intruder and they want to find where this subscriber is 233 00:27:41,240 --> 00:27:45,100 located and now intruder will perform 234 00:27:45,100 --> 00:27:50,880 one more attack location tracking and will exploit another vulnerability that 235 00:27:50,880 --> 00:28:00,320 is substitution of operation code tech but before I explain attack mechanic I 236 00:28:00,320 --> 00:28:07,360 need to describe some technical information about signal networks I have 237 00:28:07,360 --> 00:28:13,300 mentioned mentioned that MSSDN and global titles have the same structure 238 00:28:13,300 --> 00:28:13,820 I 239 00:28:15,100 --> 00:28:22,060 they consist of a group of digits the first group defines country this is a 240 00:28:22,060 --> 00:28:30,720 country code in this case this is China the second group defines mobile or fix it 241 00:28:30,720 --> 00:28:36,960 operator this is network destination code I took these digits eight five four 242 00:28:37,840 --> 00:28:45,080 randomly so I don't know if there is operator with this code in China and 243 00:28:45,100 --> 00:28:51,840 the third group of digits defines subscriber or a node if this is a globe to 244 00:28:51,840 --> 00:29:00,300 global title the next identity type is MCM you see is also consists also consists 245 00:29:00,300 --> 00:29:06,620 of three groups of digits the first group defines mobile country this is 246 00:29:06,620 --> 00:29:12,740 mobile country code the second group defines network or mobile network code 247 00:29:12,740 --> 00:29:20,480 and the third group of digits defines particular subscriber pay your attention 248 00:29:20,480 --> 00:29:27,520 these codes might belong to the same operator and if we speak about 249 00:29:28,280 --> 00:29:34,880 correlation of operator or comparison of operator we do not compare digits of 250 00:29:34,880 --> 00:29:41,220 global title and MC digit by digit but first we need to define operator by 251 00:29:41,220 --> 00:29:48,100 global title prefix and operator by into predict after that to do the 252 00:29:48,100 --> 00:29:59,160 compression how it works in SSN firewalls in this example as a firewall 253 00:29:59,160 --> 00:30:07,940 receives some single message this is provide subscriber info and it inspects 254 00:30:07,940 --> 00:30:10,940 its layer by layer it defines 255 00:30:10,940 --> 00:30:17,000 defines operation. Provide subscriber info belongs to the category 2 regarding GMA classification. 256 00:30:17,600 --> 00:30:27,460 That means that SN firewall needs to define source operator from this part, from the sccp 257 00:30:27,460 --> 00:30:35,040 layer and target subscriber operator from the map layer. What we see? Source operator 258 00:30:35,040 --> 00:30:41,260 somewhere in Switzerland, this is a Swiss operator and subscriber is from 259 00:30:41,260 --> 00:30:50,120 China, from Chinese operator. These two operators are not equal, so the decision 260 00:30:50,120 --> 00:31:03,800 is block this incoming message. Let's look in some details more. This is 261 00:31:03,800 --> 00:31:04,880 IT 262 00:31:04,880 --> 00:31:14,040 recommendation that describes tick up protocol and here we see interesting thing tick up operation 263 00:31:14,040 --> 00:31:26,620 code tag might be local or global value and they have different values 2 & 6 normally in all the 264 00:31:26,620 --> 00:31:36,680 map messages is used local operation code for both local signal traffic and the international 265 00:31:36,680 --> 00:31:47,320 signal traffic on the traffic dump it looks like this o2 this is local operation to take 266 00:31:47,320 --> 00:31:55,640 then o1 this is the length of the code itself of the operation code and for six this is hex 267 00:31:55,640 --> 00:31:56,200 decimal 268 00:31:57,780 --> 00:32:08,040 code of this operation of the provide subscriber info request let's see what happens if our 269 00:32:08,040 --> 00:32:19,920 intruder substitute tag of the operation code into the sense provide subscriber info signal 270 00:32:19,920 --> 00:32:31,180 message but they use they use o6 instead of or two instead of normal value what cannot 271 00:32:33,440 --> 00:32:41,380 cannot encode this message at all and what happens then STP sends this message to the 272 00:32:41,380 --> 00:32:48,920 SSN firewall but as a second firewall expect only local values and it ignores all global 273 00:32:48,920 --> 00:32:49,900 all the global values of the SSN firewall and it ignores all global all the global values of the 274 00:32:49,900 --> 00:32:57,100 values it sends this message to the STP and STP delivers it to the destination 275 00:32:57,100 --> 00:33:04,820 node that is MSC and VLR and one more surprise MSC and VLR replies with normal 276 00:33:05,340 --> 00:33:14,700 message and it codes operation with normal with local operation operation 277 00:33:14,700 --> 00:33:26,220 code tag here in this message we can see identity of the sale that process target 278 00:33:26,220 --> 00:33:34,200 subscriber so the location tracking attack is done a 7 firewall bypassed 279 00:33:35,200 --> 00:33:44,580 during this research we sent this kind of malicious traffic on equipment of 280 00:33:44,700 --> 00:33:52,200 four different vendors and all nodes replied with normal requests normal 281 00:33:52,760 --> 00:34:04,780 responses sorry that were coded in local operation code tags so our intruder knows 282 00:34:04,780 --> 00:34:12,100 location of the target subscriber but it's enough not all intruder wants to 283 00:34:12,100 --> 00:34:13,920 intercept voice call 284 00:34:14,700 --> 00:34:22,960 or a lot of voice calls of this subscriber and now intruder will use will 285 00:34:22,960 --> 00:34:30,080 exploit one more vulnerability that that is connected with double map or double 286 00:34:30,080 --> 00:34:37,580 component encoding first of all let's look how classical voice call or man in 287 00:34:37,580 --> 00:34:43,640 the middle attack works in mobile networks in signal networks that are not 288 00:34:43,640 --> 00:34:44,000 protected 289 00:34:44,700 --> 00:34:52,140 first of all intruder sends insert subscriber data this signal message 290 00:34:52,140 --> 00:35:03,940 contains EMC and some information that is intended to change billing system of 291 00:35:03,940 --> 00:35:10,240 this subscriber in the profile this one this message is delivered to the MSC and 292 00:35:10,240 --> 00:35:14,680 VLR this node sends okay an IP address is in the message of the target subscriber and this node sends insert subscriber data this 293 00:35:14,680 --> 00:35:21,760 profile is updated after that intruder just finalizes the transaction and now 294 00:35:21,760 --> 00:35:28,960 intruder should wait for subscriber to call when this target subscriber who is 295 00:35:28,960 --> 00:35:35,660 read on the picture when subscriber calls information comes to the MSC and 296 00:35:35,660 --> 00:35:42,260 MSC should perform billing process it sends initial DP signal and message to 297 00:35:42,260 --> 00:35:46,600 the billing platform to this spoof to the fake billing platform that is under 298 00:35:46,600 --> 00:35:53,760 the hackers control after that hacker is able to send connect message with 299 00:35:53,760 --> 00:36:01,760 private branch exchange number and this is direction to redirect to forward call 300 00:36:01,760 --> 00:36:12,040 to this number to this new number MSC just redirect this call to the PBX after 301 00:36:12,040 --> 00:36:12,240 that it sends a message to the konsumer which is your business address and I also 302 00:36:12,240 --> 00:36:23,300 that hacker is able to initiate one more new call to the target operator and use 303 00:36:23,300 --> 00:36:27,900 this number information because initial DP signal the message contains 304 00:36:27,900 --> 00:36:33,520 information about a and B subscriber about calling and cold subscribers in 305 00:36:33,520 --> 00:36:41,080 this case of intruder just make a call to correct be subscriber and spoofs 306 00:36:41,080 --> 00:36:50,700 address of a subscriber this call comes to the operator two subscribers are able 307 00:36:50,700 --> 00:36:56,820 to communicate each other but all the voice traffic goes through the subscriber 308 00:36:56,820 --> 00:37:08,040 hackers controlled equipment SSL firewalls of course is able to block 309 00:37:08,040 --> 00:37:09,000 this attack 310 00:37:11,080 --> 00:37:14,660 insert subscriber data signal the message from the hacker comes to the 311 00:37:14,660 --> 00:37:21,600 network STP sends this signal message to the SM firewall and SSN firewall starts 312 00:37:21,600 --> 00:37:27,080 inspecting this message it finds that the operation code is insert subscriber 313 00:37:27,080 --> 00:37:35,800 data this operation code belongs to category 2 that means SM firewall should 314 00:37:35,800 --> 00:37:40,540 compare source and target subscriber 315 00:37:41,080 --> 00:37:47,220 operators of source and target subscriber and we know switzerland is 316 00:37:47,220 --> 00:37:56,300 not China so this message should be blocked attack is impossible one more 317 00:37:56,300 --> 00:38:03,480 interesting thing about teacup protocol when I was speaking about this protocol 318 00:38:03,480 --> 00:38:10,180 I mentioned a component portion and I said this component portion includes 319 00:38:10,180 --> 00:38:11,000 much more than one component portion and I said this component portion includes much more than one component portion and I said this component portion includes much 320 00:38:11,000 --> 00:38:11,580 much more than one component portion and I said this component portion and I said this component portion and I said this component跟 321 00:38:11,580 --> 00:38:15,380 map operation itself but standard suggested suggests 322 00:38:15,700 --> 00:38:20,080 that it could be more than one component 323 00:38:20,080 --> 00:38:30,520 within one teacup teacup primitive each component should have its own operation 324 00:38:30,520 --> 00:38:31,460 and 325 00:38:31,460 --> 00:38:40,180 they might might to have different subscriber identities when SSL Firewalls 326 00:38:40,180 --> 00:38:40,840 face 327 00:38:41,000 --> 00:38:50,700 with this kind of signal messages this is a really unexpected message as some 328 00:38:50,700 --> 00:38:59,280 firewalls usually inspects only first part for first component and it 329 00:38:59,280 --> 00:39:05,220 considers that the second component this is just a long tail of the first 330 00:39:05,220 --> 00:39:18,280 component it does not look at this let's look how intruder can use this 331 00:39:18,280 --> 00:39:26,540 feature of the signal protocol intruder sends signal message that contains two 332 00:39:26,540 --> 00:39:32,980 operations in two components first one is insert subscribe insert subscriber 333 00:39:32,980 --> 00:39:35,100 data and the second one is delete subscriber 334 00:39:35,100 --> 00:39:35,200 data and the second one is delete subscriber data and the second one is delete 335 00:39:35,200 --> 00:39:37,400 subscriber data and the second one is delete subscriber data and the second one is delete 336 00:39:37,400 --> 00:39:40,360 subscriber data and the second one is delete subscriber data and the second one is delete 337 00:39:40,360 --> 00:39:45,360 subscriber data and the second one is delete subscriber data and the second one is delete 338 00:39:46,220 --> 00:39:48,520 subscriber data and the second one is delete subscriber data and the second one is delete 339 00:39:48,520 --> 00:39:48,540 subscriber data and the second one is delete subscriber data and the second one is delete 340 00:39:48,540 --> 00:39:50,380 subscriber data and the second one is delete subscriber data and the second one is delete 341 00:39:50,380 --> 00:39:51,820 subscriber data and the second one is delete subscriber data and the second one is delete 342 00:39:51,820 --> 00:39:53,080 subscriber data and the second one is delete subscriber data and the second one is delete 343 00:39:53,080 --> 00:39:57,500 subscriber data and the second one is delete subscriber data and the second one is delete 344 00:39:58,340 --> 00:40:05,180 subscriber data and the second one is delete subscriber data and the second one is delete 345 00:40:05,180 --> 00:40:14,340 From the point of view, this combination, simultaneously insert and delete, this is something wrong and unknown. 346 00:40:14,740 --> 00:40:16,500 This is impossible combination. 347 00:40:17,820 --> 00:40:22,880 That's why MSC sends some errorless message, return error. 348 00:40:23,920 --> 00:40:28,020 It looks normal from the first point of view, 349 00:40:28,020 --> 00:40:35,040 but this signal message with error goes into cap continue signal message. 350 00:40:35,300 --> 00:40:40,940 That means that MSC says something like this, 351 00:40:41,100 --> 00:40:46,560 I don't understand you, please repeat your request within the same transaction. 352 00:40:47,800 --> 00:40:50,120 And intruder does. 353 00:40:50,780 --> 00:40:54,520 Intruder sends one more signal message within this transaction 354 00:40:54,520 --> 00:40:57,580 that consists of two errors. 355 00:40:58,020 --> 00:40:59,380 Again, of two components. 356 00:40:59,700 --> 00:41:03,420 Both of them are insert subscriber data operations. 357 00:41:04,040 --> 00:41:07,200 The first component is without subscriber identity, 358 00:41:07,460 --> 00:41:12,060 and the second one contains identity of the target subscriber. 359 00:41:14,980 --> 00:41:20,580 SN firewall again inspects only the first component. 360 00:41:21,100 --> 00:41:25,140 It sees that the first component is absolutely normal 361 00:41:25,140 --> 00:41:27,340 and pass this message to the network. 362 00:41:28,020 --> 00:41:38,020 Now MSC has two insert subscriber data requests within one tickup message. 363 00:41:39,100 --> 00:41:43,860 MSC sends OK for the first component and OK for the second one. 364 00:41:43,920 --> 00:41:48,000 So the subscriber profile is updated. 365 00:41:48,220 --> 00:41:53,020 After that, intruder finalizes the transaction. 366 00:41:53,100 --> 00:41:56,820 And now they are waiting for a call. 367 00:41:58,080 --> 00:42:00,140 Subscriber, target subscriber calls. 368 00:42:00,980 --> 00:42:06,360 MSC sends initial DP signal message to the intruder's equipment. 369 00:42:06,960 --> 00:42:10,540 Intruder replies with connect to the PBX. 370 00:42:11,340 --> 00:42:14,540 Call goes to the hacker's PBX. 371 00:42:14,640 --> 00:42:17,900 After that, hacker redirects one more. 372 00:42:18,040 --> 00:42:20,020 This call to the B subscriber. 373 00:42:20,680 --> 00:42:23,660 Subscribers are able to talk to each other, 374 00:42:23,740 --> 00:42:26,200 but all the traffic goes through the 375 00:42:26,200 --> 00:42:28,500 hacker's PBX. 376 00:42:28,920 --> 00:42:31,360 And this attack is successful, 377 00:42:31,540 --> 00:42:34,240 and the S7 firewall is bypassed. 378 00:42:36,140 --> 00:42:39,480 And what I can say as a conclusion. 379 00:42:40,740 --> 00:42:47,500 Really, the stack of S7 protocols has some problems. 380 00:42:47,780 --> 00:42:51,580 First of them is architectural flaws. 381 00:42:53,100 --> 00:42:54,480 The second one, 382 00:42:54,480 --> 00:43:01,060 operators usually make a lot of mistakes in the configuration. 383 00:43:01,120 --> 00:43:03,500 First of all, in SDP configuration. 384 00:43:04,460 --> 00:43:10,140 Some of described attacks could be impossible 385 00:43:10,140 --> 00:43:12,620 if SDP configuration is correct. 386 00:43:13,500 --> 00:43:18,920 And of course, now we see a lot of software bugs of telecom equipment. 387 00:43:19,420 --> 00:43:22,800 For example, at the last case, 388 00:43:24,480 --> 00:43:28,020 we saw that MSC said, 389 00:43:29,000 --> 00:43:31,040 I don't understand, please continue, 390 00:43:31,280 --> 00:43:32,400 repeat your request. 391 00:43:32,780 --> 00:43:39,100 But insert and simultaneous delete should be rejected at all. 392 00:43:41,180 --> 00:43:43,660 Just on the first request. 393 00:43:47,020 --> 00:43:50,460 Message to mobile operators. 394 00:43:50,460 --> 00:43:55,240 Please check your security tools 395 00:43:55,240 --> 00:43:59,220 as soon as new vulnerability is reported. 396 00:44:00,400 --> 00:44:06,020 You also should use intrusion detection systems 397 00:44:06,020 --> 00:44:10,160 together with S7 firewalls. 398 00:44:10,160 --> 00:44:15,360 Because some of attacks could not be blocked on the S7 firewalls, 399 00:44:15,360 --> 00:44:19,080 but IDS are able to detect them. 400 00:44:20,860 --> 00:44:27,420 Block almost all double map messages. 401 00:44:28,200 --> 00:44:33,860 During our research and during our monitoring of signaling, 402 00:44:34,120 --> 00:44:41,720 we saw only one legal pair with double map components. 403 00:44:41,880 --> 00:44:45,060 This is begin subscriber activity and process unstructured data. 404 00:44:45,820 --> 00:44:46,840 And of course, 405 00:44:46,840 --> 00:44:49,760 configure SDP and firewalls carefully. 406 00:44:50,180 --> 00:44:53,760 And don't forget about application context names, 407 00:44:54,840 --> 00:44:56,320 malformed application context names, 408 00:44:56,540 --> 00:45:00,900 and operation codes, locals, and global. 409 00:45:01,700 --> 00:45:02,740 Thank you for your attention. 410 00:45:08,900 --> 00:45:10,040 Please, questions. 411 00:45:21,700 --> 00:45:22,060 Thank you.