start	end	text
0	2380	We have no time to waste and a lot of ground to cover.
2380	4680	This is Journey to the Center of the PSTN.
4720	8000	I'm Enzo D'Amato and first a little bit about me.
8200	18900	So I got into computing when I was very young, got a bunch of servers, turned them into this, then got one of these, one of these, and put my servers in a professional data center.
19100	22360	After doing that, I started looking for the next big challenge.
22360	25380	I mean, after getting an ASN, you got to find something new to do.
25640	28160	And for me, the answer was telephones.
28280	37020	I wanted to figure out how the phone network worked, how I could become a part of it, and some interesting and unique exploits that you could do from the inside of the phone network.
37020	38740	And this talk will take you through all of that.
38740	40780	How you can become your own mob L.
41060	43640	This talk, however, is not legal advice.
43640	46740	It is not a comprehensive course on voice network design.
46840	49740	It is not a guide to the regulations in your state.
49740	51940	We're going to be covering licensing later on.
51960	58120	And just remember to always check everything with what the actual rules are for your state, not just the generic nationwide rules.
59140	61320	And this is also not going to be PBX hacking.
61320	63960	A lot of people have done that, and that's sort of overplayed.
63960	66560	We're going to be doing everything from the carrier side.
66820	70780	So with that in mind, what is the publicly switched telephone network?
70780	75620	The PSTN is essentially any phone that allows you to call another phone using a standard U.S.
75620	76400	phone number.
76400	87140	Some people define the PSTN as only phones that are connected over the traditional TDM network rather than phones that are connected over VoIP.
87420	91760	However, in my opinion, there's no difference as long as the number is accessible from a standard telephone.
91880	94100	So we're just going to say the PSTN is everything.
94620	97220	And with that in mind, what is a phone company?
97380	111020	In this case, a phone company, and when I say I started a phone company and I run a phone company, I mean a real phone company that owns its own numbering resources in the same way an ISP that has its own ASN owns its own IPV4 resources.
111020	116840	You're not just reselling, you're not just buying from a generic sub-trunk provider and slapping a PBX on top of it.
116840	118580	You're actually the carrier of record.
118580	120380	You're managing the routing for those entities.
120480	128600	A real phone company also files its own FCC 499, so it files federal taxes for phone companies, and it's interconnected with other carriers.
128600	129920	Again, manages its own routing.
129920	133000	It doesn't just send everything through whatever its upstream is.
133440	135360	And why should you care about this?
135360	140360	Well, the answer is that we, you know, in the hacker community, used to love phones.
140360	142040	This was how the community started.
142040	145740	Defcon groups are still labeled by area code and freaking was everything.
145740	149640	But then everyone sort of lost interest right as the network started to get interesting.
149640	158660	Because in 1996, you, for the first time, were allowed to become a competitor to Ma Bell for local exchange service, which means you could become a legit freak.
158660	161420	You didn't have to do it in secret anymore.
161420	168080	And with that, the amount of stuff on the network and therefore the interesting bits of the network got way larger and way more interesting.
168120	174140	So we're going to be looking at all of those new interesting bits of the network.
174740	181480	Unfortunately, we do have to cover first a bit of history and a bit of terminology for those who are new to freaking and new to phones.
181620	183420	In the beginning, there was AT&T.
183420	190440	AT&T was an amalgam of one major long distance company and then a local Bell operating company in each region.
190440	196160	The long distance company did long distance and the local companies provided dial tone and local calls.
196160	213280	However, this would break apart in 1984, which created nine separate RBOCs or regional Bell operating companies in each region of the United States and one IXC or inter exchange carrier that was the AT&T long distance entity that was subject to competition for the first time.
213440	217540	MCI, Sprint, the other long distance carriers, if you remember dial around codes.
218540	222340	And this is sort of a graph of how things broke apart and then merged back together.
222340	231600	As you can see, there are three major phone companies, all of which own their own long distance branch and all of which also own a significant chunk of the U.S.
231600	232980	geography for phones.
232980	241140	The only difference now is that Quest is now level three, but these companies are the RBOC successors, what happened after the RBOC got broken up.
241320	245940	And an interesting note here is looking at what an actual local call is.
245940	250860	Because when we say we have local exchange carriers and inter exchange carriers, what is what?
250860	257780	And this up on the screen here is a map of all of the LATAs or local access and transport areas in the United States.
257780	264700	Each LATA is the specific territory of one of the RBOCs and any calls within the LATA are handled by that RBOC.
264700	268020	Any calls external to the LATA are handled by an IXC.
269080	275860	And within a specific LATA, we also have a number of numbering plan areas or area codes and rate centers.
276140	279580	With calls within a rate center are always truly local.
279580	284920	So always truly local meaning that they are not billed per minute.
284920	288000	They are either billed not at all or per call.
288100	296960	And usually there will be an arbitrary boundary between that rate center and a couple of the other adjoining rate centers that will be included in that local calling scope.
296960	301420	This is defined in the state tariff for the RBOC and it is highly arbitrary.
301460	309780	Unlike the LATAs, there is no federal standard for how big a rate center is supposed to be, what it includes and sort of what the rules are for those.
309780	314460	So you are going to have to check for your specific rate center to see what counts as local for it.
314900	318360	And therefore, we can sort of put together a taxonomy.
318360	326900	We've got local calls that are always handled by the local exchange carrier and therefore governed by the state public utilities commission as a local utility.
327840	330280	And they are usually unmetered.
330460	337100	And then we've got true long distance calls, which are governed by the FCC under the Braille system break up and handled by an IXC.
337100	340280	However, then you've got a bunch of weird niche categories.
340360	349520	So intra LATA and intrastate calls are what are known as local long distance or long distance calls handled by the local exchange carrier or the baby bell.
349520	367620	And then you also have inter LATA and intrastate calls, which are counterintuitively more expensive than interstate long distance calls because they are governed by the state public utilities commission and therefore, since the state public utilities commission is a less strong regulator,
367620	371020	those calls are more expensive because they can get away with charging more.
371020	385960	And finally, you have a very weird category that usually only exists in the large flat plain states of interstate intra LATA, interstate inter LATA calls that are governed by the FCC, I think, and handled by the local exchange carrier.
385960	396140	These basically only exist on paper, but this just goes to show you the weirdness and the state of the number of exceptions and oddities that exist in the phone network.
396140	405200	You know, when you have a bunch of categories that are created by successive regulations being layered on top of each other, you get these sort of weird categories.
405200	409240	And this only is going to expand and create a bunch of interesting opportunities for us later.
409500	415320	However, the real big change wouldn't come with the bell break up, but rather with the telecom act of 1996.
415440	423740	This enabled competition for the local exchange carriers, these new entities known as CLECs, or any local exchange carriers certified after 1996.
423820	437020	It normalized wireless regulation and created the modern cell phone industry by allowing cell carriers to be treated as co-equal carriers to the LECs instead of just as basically almost as resellers that subtended off of them.
437020	457800	And it also critically required the incumbent LECs, meaning the R box, to interconnect their networks at any technically feasible point, offer services for resale, and to do all of this on nondiscriminatory terms expressed in a publicly filed interconnection agreement.
457800	462660	These responsibilities are known collectively as 251, 252 interconnection.
462660	471180	Together with the provision allowing for CLECs, that has been what has allowed the telephone network to really transform itself over the past couple of years.
471180	478420	It's how we got VoIP, it's how we got new carriers, and it's how I was able to become a phone company at the age of 19.
478800	485960	Later on, we would see a new category of sort of a half CLEC certification created for VoIP only carriers.
485960	500300	This, known as an IPES, allowed those VoIP carriers to get numbering resources issued directly to them, but still required them to go through an IPES entity, sorry, go through a CLEC entity as their sort of parent company.
500760	505500	The ILEC entity would manage the routing on their behalf.
505560	508340	So sort of a half CLEC that doesn't have interconnection.
508340	513000	So now let's get into how the PSTN actually works and how those calls are going to flow through the network.
513100	518480	So here we can see an example of a modern LATA ecosystem as it exists currently.
518480	521660	Each different company is represented by a different colored box.
521660	535200	And as you can see, a call from an ILEC to a CLEC is going to go through, obviously, the ILEC's network, but it's also going to go through a very special box that exists in every LATA, the ILEC's feature group D tandem.
535200	540000	The feature group D tandem acts almost like the default route for everything within that LATA.
540000	555320	If two carriers don't have a connection to each other, they're supposed to always have an interconnection with that ILEC's feature group D tandem as part of their interconnection agreement with that ILEC, which means that those calls can flow through that feature group D tandem to sort of reach where they need to go.
555580	559420	Either on the ILEC or on another carrier that subtends that ILEC.
559420	563660	They can use that sort of as an almost like a tandem that they can both reach.
564500	573420	If a call is long distance, however, it's going to get piped out over the long distance network and then all the way back into the feature group D tandem in the new LATA.
573420	576000	As an example, this is an ILEC to ILEC call.
576020	583040	Critically, the ILECs, because of the regulations, are not allowed to carry their own long distance traffic between LATAs.
583040	585480	They have to send that traffic over an IXC.
585480	589340	However, CLECs are not subject to the same restriction.
589460	594280	So in this example, two CLECs in different LATAs are able to send traffic directly to each other.
594280	596940	In this case, over an IP trunk that they have.
596940	599100	So CLECs can actually use IP trunks.
599100	602280	They can use VOIP to send calls between each other.
602280	611100	So the internal routings on CLEC to CLEC or CLEC to mobile calls can actually be IP in some cases.
611360	621140	Finally, you also have an example of a CLEC that connects directly to the inter-exchange carriers, receiving calls from them directly instead of sending them over the feature group D tandem.
621140	627540	In this case, the CLEC basically acts as its own feature group D or acts as tandem for the numbers that it has.
627720	630980	Hanging off of an IXC is one directly.
631500	639560	This allows us to put together some general rules for routing with the caveat that voice routing is very ad hoc.
639560	648460	It's not particularly well defined like BGP routing is where like a BGP router will always be able to use BGP to pick the best route to a given point.
648720	656880	An ILEC will not be able to do this because an ILEC routing will not be able to see the entire picture of the network at one time.
656880	658900	It won't be able to calculate a best path.
658900	664440	So it has to go through basically a series of rules defined by the regulations and the information that it does have.
664440	666180	These rules generally are as follows.
666180	671240	If two carriers have a private IP interconnection between each other, that will be used by default.
671240	675420	It's much cheaper and everyone prefers to keep things on IP as much as possible.
675460	679720	If the call is local, however, it will be sent over the local interconnection.
679720	683020	Local calls have to go over the local interconnection.
683020	685420	If you send them over a long distance, they won't route properly.
685420	700060	However, if a call is intra ladder, it can either go over the future group D tandem for that ladder or it can go through an IXC who they can then be responsible for basically delivering it back onto the future group D tandem through their internal network.
700120	703260	However, if a call is inter ladder, it has to go over an IXC.
703260	709280	It can't get sent through the future group D tandem unless that future group D tandem is basically being used just as a bridge to reach an IXC.
709860	711740	We can now look at phone numbers.
712680	716640	Everyone's familiar with the basic parts of a phone number, but there's a bit more to it.
716860	721020	So obviously an area code, one or multiple will be assigned to a single numbering plan area.
721020	723840	And when there are multiple assigned, that's called an overlay complex.
723900	733020	However, we also have the next three digits, the CO code, are the most important for actually routing the call within the numbering plan area to the carrier that it's going to.
733020	739500	So this was the original basic unit of phone number routing from the original days of direct dialing.
739500	745320	And these were originally assigned to a single end office, like a single building back when it was the Bell system.
745320	749040	After the break up, these started just being assigned to a single entity.
749060	752540	So it's like a single, you know, licensed local exchange carrier.
753180	755860	However, this, even this was too inefficient.
755980	770900	They were noticing that especially in metropolitan, that especially with the rise of smaller CLECs, you'd have CLECs that were getting a CO code in every rate center and only using about a thousand of those numbers, meaning that all of those blocks, potentially hundreds of thousands if not millions of phone numbers,
770900	773220	would only be ten percent utilized or less.
773220	778520	This was extremely inefficient and therefore they created the number block pooling system.
778980	792260	Instead of assigning people CO codes directly, instead a CO code would be broken up into its constituent thousands blocks and these would be assigned to carriers and we would route on these thousands blocks instead of routing on the full CO code.
792300	798040	This made, allowed us to make much more efficient uses of our routing, but it wasn't adopted everywhere.
798200	811280	It was required in major urban and metropolitan areas by the FCC, however in more rural areas it's optional and again you'll have to check with your state public utilities commission to see what rate centers in your area are pooled.
812180	816900	Most of you will know that if you change carriers, you'll be able to take your number with you.
816900	818940	However, you may not know how this is implemented.
818940	825700	The routing that I just displayed is fairly static, you know, it's based on block, so if you move your number, how is that number going to be able to move with you?
825700	828840	The answer to this is number portability, uh, or porting.
829120	837780	The porting allows you to take the number with you by adding a routing overlay, a query layer on top of that existing base, you know, routing structure.
837780	843080	And the way this works is that each number gets an LRN in addition to its, you know, normal appearance.
843220	849280	And when that number is called, we hit a database for that outgoing call and we get back the LRN.
849280	857660	We are guaranteed to know that the LRN will be a phone number, um, will be a phone number in a CO code owned by the destination carrier.
857680	873280	So the destination carrier's CO code will point to that switch and then we can route to that CO code and we know that routing to the LRN's CO code rather than the original dialed number will get that call to the switch where it actually lives rather than the one,
873280	875260	the carrier that initially owned that number.
875620	879300	And then we can put all this together and actually figure out how routes are built.
879300	883380	So an AOCN loads routes into BIRDS.
883520	886740	BIRDS then feeds a database called the LURG.
886740	892440	The LURG is a pile of CSV files, like several gigabytes worth of CSV files.
892440	896700	And those CSV files form the routing information for the entire network.
897100	902300	These CSV files are sent weekly to individual, to all of the carriers that are subscribed to the LURG.
902300	909860	And then they use these CSV files to manually build routing entries on their switches, sometimes using scripts, especially if they're a larger carrier.
910260	914960	And within these, the LURG entries, there will be a bunch of codes known as Silly Codes.
914960	919120	The Silly Codes identify each individual switch or routing entity on the network.
919120	933780	And then these codes are then manually associated to either SS7 point codes, in the case of SS7 signaling, which is the most common, especially for legacy networks, or sometimes for VoIP signaling in the case that the two carriers have implemented VoIP between each other.
934580	945680	This is a very manual process, obviously, and it takes, on average, 30 to 60 days for the network to update with a new full CO code, and about 14 days for a new thousands block.
945760	947960	It's slow, very, very slow.
948080	951740	And the reason for this is, again, it's a very manual process.
951740	955740	Those switches do not have the capability to communicate routing information to each other.
955740	958240	So we have to maintain the routing information centrally.
959200	965040	All of these different parts of the network are governed by separate regulatory bodies that you're going to have to interface with.
965040	969220	So phone numbers are governed by NANPA, or the North American Numbering Plan Authority.
969400	972480	Portability and number porting is governed by NPAC.
972920	981220	Operating company numbers, or OCNs, which identify individual telcos, and individual telcos in a state, are governed by NECA.
981220	996760	And then silly codes, the SS7 point codes themselves, the LURG, and IAC codes, and basically any other code that you'll need, is controlled by a company called iConnective, which is basically allowed by the FCC to have a monopoly on routing information for the entire network.
997700	1001280	Billing is another interesting topic.
1001460	1003980	In almost all cases, the calling party pays.
1003980	1015260	It's not billed 95.5 like internet traffic is, it's strictly billed per minute based on the calling party paying, with each call counting as an additional billing counter.
1015540	1026020	The calling customer pays the calling local exchange carrier, the calling local exchange carrier pays the IXC that they're using to route that call, the calling IXC pays the receiving IXC.
1026020	1029520	The money flows along the call path from entity to entity.
1029520	1031740	It's not end to end, it's hop by hop.
1031740	1039440	And there are also a few special cases, the most prominent is 800 numbers, where the money basically flows in reverse.
1039440	1050460	There are entities known as RESP orgs, or responsible organizations, which handle the toll free routing, and they handle billing for that routing, and the billing passes from the called party back to the caller.
1050620	1056860	900 numbers and 500 numbers used to be special cases, because they were premium numbers that were up charged.
1056860	1060140	However, these numbers don't exist anymore.
1060160	1064760	The software to bill them no longer exists, so they're not routable on the current phone network.
1064760	1074080	Local calls are almost always unmetered, or if they are metered, they are paid per call, not paid per minute.
1075140	1083180	So now, with all of that information, all of that details about the phone network, let's actually get to doing something interesting and useful with it.
1083180	1085360	We'll start with access stimulation.
1085420	1093260	So if you were listening during the segment where I was talking about phone number billing, you may have noticed that the calling party always pays.
1093360	1100260	And since most people nowadays have an unlimited minutes plan on their phone, can you make money off of this?
1100260	1103440	You know, having people just call you and collecting the money?
1103440	1104960	And the answer is yes.
1105080	1113860	Access stimulation has been one of the longest running legalized abuses of the process since the very early days of competitive local exchange carriers.
1113860	1116300	And the process goes about like this.
1116300	1128380	We have, you know, so all we have to do in order for this to work is to get people to call us.
1128380	1129460	It is that simple.
1129460	1132900	Because the money will always flow along the calling path and our carrier will pay us.
1132900	1135120	So we just have to generate a volume of calls.
1135120	1142600	So imagine it's 1996 and you need people to call you and sit on the line with you for a long period of time so you can make money.
1142660	1143800	How are you going to do this?
1144000	1145200	And the answer is dial up.
1145860	1149760	Dial up in 96 was the golden ticket for this.
1149760	1157040	There were many, many, many, many companies.
1157040	1165880	Dial up calls were 100% inbound and people sat on the line for hours so they could just rack up the billing.
1165880	1170180	They would sit on the line and the dial up ISP would, you know, become a SELEC.
1170180	1175340	Since they weren't serving real customers, they didn't have to run lines, you know, they didn't have to get a fancy switch.
1175340	1177060	They had almost no costs.
1177060	1185640	They just had to connect their dial up modems into the interconnection trunks that they were getting from the RBOC and they could collect those inbound minutes and profit off of this.
1185660	1190420	However, the FCC would kill it in 2001 with the ISP remand order.
1190440	1202100	They would rule, and I still do not understand where they got this from, but they ruled that internet traffic is considered interstate because it's going to the internet rather than another person at a fixed location.
1202100	1213380	I still don't know how the FCC came up with this ruling, but they basically did it so that they could seize control over the reciprocal compensation for those ISP calls which had previously been a state issue.
1213480	1217660	And then the FCC basically said, since this is interstate, we can set the rates for it.
1217660	1219280	We say you get nothing.
1219320	1220300	You know, this doesn't count.
1220300	1221380	ISP calls don't count.
1221380	1223160	You can't get compensation for them.
1223160	1228900	Later on, much later on, they would kill local compensation for local calls altogether.
1229040	1232240	However, there was still another plan.
1232240	1233900	All we have to do is get people to call us.
1233900	1236100	So if dial up isn't working, what are we going to do now?
1236580	1238480	We're going to give people free stuff.
1239200	1244500	Freeconferencecall.com is one of the original people who pioneered this space, but there were a lot more.
1244500	1253240	Basically, any music, chat line, conference site, anything that people would call into and use for long periods of time.
1253240	1267060	And critically, during the period between 96 and when dial up died, when the dial up loophole died, people got unlimited long distance packages where they could talk long distance for a long time or almost unlimited amount of time.
1267060	1274320	We combined the free stuff with locating our numbers in the middle of nowhere so we can harvest higher per minute rates from them.
1274320	1279200	We combine that with our unlimited plans and we get a pile of money.
1279200	1283060	We're talking millions upon millions of dollars back when this was running out of its head.
1283060	1285980	And we make AT&T extremely mad.
1286320	1294420	This likely cost AT&T more in a month than all of the freaks of the 60s and 70s did the entire time they were operating.
1294420	1296860	The scale of this was really astronomical.
1296960	1301740	And it hit its peak during COVID, back when everyone was calling into conference call sites.
1301740	1303960	However, this too would die.
1305240	1321240	In 2011, the FCC finally closed the loophole and said that if you're doing a revenue share agreement with the person who's driving your inbound traffic and you either have an over 3 to 1 in out ratio or 100% year on year increase in inbound calls, you don't get access revenue.
1321500	1324220	Unfortunately, there was still another loophole.
1324660	1335940	In certain rural areas, there were specialized collector IXCs that basically pooled access to a bunch of rural co-ops and collected that long distance traffic and they could bill for that.
1335940	1342640	So we would put our access stimulation behind like 20 of these that still existed and have them bill it.
1342760	1344080	Because that was a loophole .
1344080	1345940	The FCC would close that loophole.
1346100	1347800	We would try again.
1347800	1355740	And we would add an IPES company between the LEC and the high volume to end point and now the LEC would bill the access minutes.
1355740	1357000	And this was also a loophole.
1357000	1358920	They only closed this one last year.
1359260	1361720	And, of course, people have moved on to something else.
1361820	1366980	This, like I said, it's the longest running basically free money glitch in the phone network.
1366980	1368440	People have been using this for years.
1368440	1374920	I'm sure people still continue to use it until they get rid of per minute charging for long distance calls.
1375860	1378200	And you may be wondering why do you care about this?
1378200	1386160	And if you looked at your PBX logs, if you have SIP exposed, you may have noticed that there are a lot of people attempting to brute force your box.
1386260	1386960	Why?
1387040	1389740	Why are people trying to brute force PBXs on the internet?
1389740	1391640	How is that a profitable activity for them?
1391680	1399380	And the answer is that this same principle that works for domestic calls also works for international calls where the rates aren't, you know, half a cent per minute.
1399380	1400760	They're 50 cents a minute.
1401000	1414060	And if someone is actually able to get in your PBX and you've got international dialing enabled, or hell, even if you've got domestic dialing enabled, they will run up a tremendous bill on your PBX until you figure out that you've been hacked and you close the loophole.
1414320	1421180	It is a pretty big money attack and it's the reason why everyone is always trying to brute force into your SIP servers.
1422660	1424560	Now let's get on to another attack.
1424560	1426360	Something more traditionally freaky.
1426360	1431180	Let's say we want to make robocalls and we don't want people to be able to identify that we're making them.
1434980	1442040	In the FCC quite recently added a new SIP header that mandated that all telecoms use it.
1442040	1444380	This SIP header was the stir shaken header.
1444380	1451380	The stir shaken header added a cryptographic signature to every call that contained certain critical details about the call and an attestation level.
1451380	1454960	A, for a fully verified caller ID where you assign the number to the user.
1455020	1461040	B, for a verified customer where you knew the customer but you didn't know that the number they were using was legit.
1461040	1464100	And C, if you were just a gateway passing on a call to someone else.
1464300	1468180	Passing on a call you got from another carrier on to someone else with no real information.
1469360	1474240	But you may have noticed that if you have a phone you've still been getting robocalls.
1475080	1479320	This hasn't fixed anything and the robocalls you're getting are still spoofed.
1479320	1480640	This has fixed nothing.
1480880	1483800	So how are the robocalls getting away from this?
1483800	1488560	If you think about it, if you have a stir shaken certificate for them the police should just be able to roll up and arrest you.
1488560	1489700	But this hasn't worked.
1489700	1493100	And the answer to this is something that I'm calling the TDM shuffle.
1493580	1501300	In a normal telephone arrangement everyone will generally prefer IP trunks because they're faster, they're easier, they're cheaper.
1501300	1512020	And most major carriers, especially people doing real volume and the major cell companies have IP trunks between each other because they want to take advantage of those discounts.
1512020	1520940	However, if we choose a provider that's, let's say, spammer friendly, that provider can choose where and how they're going to send out those calls.
1520940	1527780	So they can choose to force those calls over the old school TDM network instead of the newer IP trunks.
1527840	1534480	This means that those calls will lose their stir shaken header once they go over TDM because TDM doesn't support stir shaken.
1534520	1544460	So that header gets stripped out and then eventually once the call reenters the IP network a gateway node is going to see that it doesn't have a signature on it and is going to slap a C attestation on it.
1544460	1549500	If you're really lucky you'll hit a misconfigured PSTN gateway that puts A attestation on everything.
1549540	1562140	But either way you've now gotten your spoofed caller ID to have a legitimate stir shaken certificate on it and the original destination of that call has been completely muggled and no one knows where it came from.
1562980	1566900	There are a bunch of approaches to this and ways that this can happen.
1566900	1570240	The spammer can directly run TDM trunks into their boxes.
1570300	1574680	More likely the spammer will use a carrier that they know will support TDM.
1574680	1586460	Sometimes the spammer can try and force the routings to force a call over a legacy pathway by calling between two providers that they know don't have trunks, that they know don't have IP trunks even if both of the providers are legitimate.
1586940	1589340	This can sometimes just be coincidental.
1589340	1595380	A lot of phone companies especially in rural areas or just for whatever reason are still TDM only.
1595380	1600880	A large part of the network, I'd say about 40 percent of calls today are still hitting TDM at some point in the call chain.
1601180	1613640	So, you know, a lot of times that this stir shaken header gets popped out and with the weird routings, this can be very hard to diagnose and much harder to actually definitively prove to be malicious.
1614940	1618020	There is a standard for TDM shaken.
1618140	1622740	However, there is no yet, there is no date yet on a forced implementation.
1622740	1625180	There is no agreement on how the implementation would work.
1625180	1627380	The FCC is working on it but they are not done yet.
1627380	1637140	And I'm sure the fact that the robocall carriers are harvesting millions of dollars in revenue for carrying these robocalls has absolutely nothing to do with the fact that we haven't gotten a fix for this yet.
1638180	1642800	Now, let's say we want to do something a bit less technical.
1642800	1647320	We're not a carrier, we're just a jerk and we want to blast people with spam.
1648180	1652800	We can harvest a technique that will be familiar to anyone from the old days of email spamming.
1652800	1654620	I call it snowshoe.
1654620	1671400	But essentially what we do is we get 20 shell companies and each shell company signs up with 20 mom and pop or super tiny VoIP providers that aren't doing good KYC, that aren't doing proper attestation, they're not doing caller ID filtering on their outbound calls.
1671400	1677460	And all of these companies are going to get like 5% of the overall spam volume.
1677460	1683800	So the spammer might be having a tremendous spam pipe cranking out tens of thousands of calls a day.
1683800	1687840	Remember the car warranty robocall thing was one guy.
1687840	1689920	That was one spam operation.
1690240	1698240	That was one guy and he had all of these accounts with a bunch of other people and he was blasting these calls out and basically spreading them out.
1698240	1707500	So even if any one of these entities would get zapped by the government, there would be no way to really get the root guy because it was all shell companies.
1708340	1712720	This was combined with the fact that a lot of these small carriers aren't doing KYC properly.
1712720	1714380	They don't know who their end customer is.
1714380	1719620	They're not stopping that customer from sending out stupid amounts of traffic for their profile size.
1719620	1726700	They'd let a residential customer have 100,000 lines active and that can become a real powerful attack vector.
1726700	1730460	This is made even better by the fact that numbers are so cheap now.
1730460	1735740	If numbers are one cent each, we're going to buy one per day per company and just switch them out.
1735800	1741920	And major, like the state attorney's general robocall report has noted that this is one of the big issues they're seeing.
1741920	1748420	That caller ID filtering has become almost useless because spammers will never use the same caller ID for more than a couple of calls.
1749320	1767260	And we can, of course, mix and match both of these techniques for maximum damage, spreading calls across piles of tiny middle of nowhere in the country, TDM carriers, all of which aren't doing KYC, all of which are muddling the call flow and all of which can never be tracked back to us,
1767260	1777280	especially when you consider that a lot of these carriers have three or more resellers and other entities in the chain between customer and the actual entity in the LERP responsible for routing.
1777280	1785460	And since only inbound carriers require licenses, none of these high volume VoIP carriers are regulated, so you can't take away their license.
1785460	1786960	You can't kick them off the network.
1786960	1790700	You've got a recipe for infinite robocalls with almost no mitigation.
1791140	1795000	And this is just scratching the surface of carrier side VoIP abuse.
1795000	1798300	Again, once you get your certification, the doors are open to you.
1798300	1801100	You can do everything that you want pretty much legally.
1801100	1803560	You've got local number portability abuse.
1803680	1805660	You don't need a pin for wireline ports.
1805660	1808100	You can just make a fake LOA and steal someone's number.
1808460	1811920	SS7 devices haven't been pen tested in, I think, ever.
1812000	1820340	And that's not even considering just plain freaking, sending out calls with no ANI, sending out calls with a charge number set to someone you don't like because they get billed for it.
1820760	1827000	Sending out, using your access as an AOCN to hijack number blocks and numbering resources.
1828400	1839880	Vulnerabilities on 20‑plus‑year‑old hardware like 5Es and DMS100s that have never been pen tested but have a bunch of interfaces that may not be accessible to the public but are certainly accessible to other telcos.
1839880	1843260	You're basically only limited by your time and the imagination you're willing to put into this.
1843260	1844860	It's like a new Internet to play with.
1844860	1845760	It's wonderful.
1845940	1854180	Now, finally, hopefully you're all interested enough that we can discuss CLEC formation, the actual process to become a phone company.
1854700	1855700	So let's do this.
1855700	1856700	And let's do this quickly.
1856900	1860900	So, you know, first thing you're going to do is you're going to need to get certification.
1861100	1864800	So then establish interconnection with another phone company so your calls will route.
1864820	1867560	Set up a switch, get your numbers and then handle taxes.
1868400	1870760	So there are a bunch of different types of certification.
1870840	1872080	I'll let you read this slide later.
1872080	1872940	It's on the server.
1873000	1877560	But the key ones you need to understand, the ILEX are existing phone companies before 96.
1877720	1878540	There are no new ones.
1878540	1880420	You either have to buy one or merge into it.
1880520	1887080	CLECs are new wireline companies and cell companies are wireless companies and IPEZ are IP only.
1887080	1895920	In terms of picking which one you want to get, if you can afford it and you don't plan to be doing wholesale minutes because wireless carriers have to sell wireless, wireless is by far the easiest type.
1895920	1898340	It's included with your wireless certification.
1898340	1902580	So if you can track down any common carrier wireless certification, you're basically good to go.
1902720	1906380	If you don't need interconnection agreements, you can get an IPEZ.
1906380	1907840	However, it's nationwide.
1907840	1909660	It has minimal ongoing paperwork.
1909700	1914120	However, the FCC is slow and expensive to deal with and, again, you don't get to do interconnection agreements.
1914120	1916140	So you're basically completely shut out of TDM.
1916420	1923020	If you want maximum power, like you want the full set of certifications, you want to be as mobile as you can be.
1923020	1924860	You want to get a CLEC certification.
1924900	1927500	However, the downside is that these are a lot of paperwork.
1927500	1930840	You have to get one for each state you want to operate in.
1930840	1935180	So you have to file paperwork in each state and you need to file ongoing reports in each state.
1935180	1938340	It's also a tax headache because, again, you have to pay taxes in each state.
1938620	1943460	However, the application process for all of these, again, except mobile, is fairly simple.
1943600	1946180	You file with the State Public Utilities Commission.
1946240	1959440	You need, in general, some financial information, balance sheets and income statements, resume for your key executives and key personnel, descriptions of the service area that you want to serve and the services to be offered.
1959440	1961820	This can be the whole state and everything.
1961820	1968740	Just write something that sounds good for, you know, those categories and a brief description of what equipment you want to put together.
1968740	1971960	Again, the people at the POC aren't really tech experts.
1971960	1974480	They just want to have some idea of what you're going to be setting up.
1974500	1977020	Then be prepared to wait about 30 to 90 days.
1977620	1983400	In terms of getting approved, the best advice I can give you is to read the Public Utilities Commission docket.
1983440	1986680	Every application that has ever been filed is public and it's in there.
1986680	1991180	You can read the applications that got approved and, more importantly, you can read the ones that didn't.
1991180	1992640	You do what's in the good ones.
1992640	1994260	You don't do what's in the not good ones.
1994260	1998360	Download one that got approved quickly by a major carrier and modify it to suit your needs.
1998940	2001000	Generally, however, having a team is better.
2001000	2003720	Hacking is a social activity, especially phone hacking.
2003740	2007660	The more people you have on it, the more years of experience you're able to show, the better.
2008140	2012680	This goes doubly well if you have actual telecom experience, but this isn't a necessity.
2012680	2014560	Just have some idea of what you're doing.
2015060	2022500	The biggest and most important thing is you can't have a criminal record or judgments, especially for fraud or consumer abuses.
2022500	2029400	I don't know about other stuff, but I know that, basically, if you got convicted for defrauding people, they're never going to give you a license for obvious reasons.
2029400	2031440	You also need some amount of money.
2031620	2047180	The actual amount varies from zero in liberal states, not liberal as in politically liberal, liberal as in giving out licenses, to a fairly decent chunk in other states that require you to have a specific amount of equity or a specific balance.
2047180	2051020	Again, check your state's website and read your state's laws.
2051260	2052240	Read the laws.
2052240	2054140	It will tell you what needs to be in the application.
2054140	2055560	Make sure you put that stuff in there.
2055740	2057040	And don't be afraid to call.
2057040	2060920	Generally, the public utilities commissions are more friendly than you might think.
2061040	2066560	You'll have to shop around a bit to get to the right person, but generally, once you get to the right guy, they'll be able to help.
2066700	2068440	It's not as hard as it used to be.
2068440	2070780	In the 90s, it was very difficult to get approved.
2070840	2074700	Now, it's almost deregulated, so you just have to do a box ticking exercise almost.
2075560	2078020	Once you've got your certification, you need to get interconnection.
2078020	2078940	There are two kinds.
2078940	2082740	Local, for where your numbers live, and long distance or feature group D for everything else.
2082860	2084360	Inbound calls are hard.
2084360	2089080	Outbound calls are fairly easy, because for outbound, you just use a normal SIP trunk for everything that's not local.
2089300	2094040	The first step is to pick a ladder and a rate center that you're going to be getting numbering resources in.
2094040	2099640	You have to pick the geographic location in the rate center in order to figure out what kind of interconnection you need and where you're going to grab it from.
2099800	2102480	Local interconnection is the harder of the two.
2102880	2110220	You need to find, you're going to need to get an ICA in the area where you want to get numbers, in the rate center where your numbers are going to live.
2110340	2112880	For RBOX, this process is fairly standardized.
2112880	2115160	If inflexible, you're going to send them an email.
2115160	2121600	They're going to send you an information request form and credit application, and then a draft interconnection agreement that's part of their standardized template.
2121600	2125820	You're going to fill out the draft ICA and send it back to them, and you're done in about a month.
2125880	2131300	For a smaller ILAC, the process is a lot more variable, because they almost certainly won't know you're talking about.
2131300	2139920	You're going to have to go through multiple rounds of people until you either get their regulatory guy or their, you know, whoever's responsible for that at their company.
2139920	2144240	And you might have to send them a draft ICA, because they might not have one on file.
2144240	2150220	But the upshot to this is that even though it's harder to deal with them, they are more willing to negotiate and more flexible.
2150220	2154520	So if you need something that the RBOX doesn't want to give you, they'll be more helpful.
2154800	2159360	If you want to deal with TDM, you've got a few difficulties.
2159460	2162160	So firstly, the actual media part of TDM is pretty easy.
2162160	2164080	Cheap T1 media gateways are everywhere.
2164400	2166180	However, SS7 is a real killer.
2166180	2170980	If you have to deal with it, you're basically going to have to develop a custom platform , because it's not supported on anything.
2172980	2178360	However, you can order MF trunks still in a lot of parts of the country, so you can use MF to avoid this.
2179060	2182360	There are also interconnect companies that make the process easier.
2183800	2185800	However, there are a lot more.
2185800	2190200	These companies basically provide you a TDM IP translation service.
2190280	2196460	However convenient this may be, it also is an added cost per minute and sometimes per number.
2196460	2198980	You know, check with whatever provider you're going to deal with.
2198980	2207360	But this avoids having to pay for either a fiber mid‑point splice or leased facilities from the ILAC.
2207840	2214640	This isn't that bad in terms of actually ordering real TDM from the ILAC if you're close to them, if you're in the same ladder, if you're in their service territory.
2214720	2220880	However, if you're outside of their service territory, those rates are no longer regulated and therefore are obscenely expensive.
2220880	2225700	We're talking tens of thousands of dollars for a single T1 if you need to run it between states or something.
2226060	2227780	So again, your mileage may vary.
2227780	2230480	If you're staying local, you might be able to just deal with the RBOC directly.
2230480	2232480	If you're not, you might have to do something different.
2233800	2236680	Long distance interconnection, thankfully, is a hell of a lot easier.
2236880	2239360	You can just get an ICA with your RBOC.
2240200	2244900	If you have an ICA with your RBOC and you're doing TDM, you can just do long distance through them.
2244900	2248420	Otherwise, you're going to want to look for an access homing tandem service.
2248420	2250460	This is either cheap or free.
2250460	2251960	Again, depending on who you deal with.
2251960	2257340	If you're doing decent volume, you can even get some of that access revenue that we were talking about before.
2258080	2266820	In either way, this is easier to get because, you know, there's no incentive for long distance companies to protect their brand or their territory.
2266820	2271820	It's a profit center for them to be selling interconnection because they're getting a fraction of that permanent revenue.
2272020	2275340	Switch building is where you really get to exercise your creativity.
2275380	2281440	A couple of the major SIP platforms, I have their logos up, but you're going to pick one or multiple of these and put something together.
2281440	2288380	Generally, you're going to need a session border controller or a gateway signaling element to deal with SIP and load balancing and that sort of thing.
2288380	2293840	And then some sort of media element to do codec translation, to do NAT traversal, that sort of thing.
2293840	2297800	This is where you can really show your creativity and make your voice service unique.
2297820	2303220	There's a ton of flexibility you can show here, but it is a bit of a larger project because you're going to have to develop something.
2303420	2305240	Again, this is also sort of what you want to do.
2305240	2311300	You can get away with a single asterisk box if you just want to be tiny and serve yourself, but if you want something production ready, you're going to need to do more.
2311540	2314760	A couple key notes here, IMS is the standard for LTE.
2314920	2323600	It's confusing, difficult and generally a nightmare to work with, but you do need it if you want to deal with phones or if you want to follow the technical standard for residential VoIP services.
2323760	2325760	But no one really uses it if they don't have to.
2326040	2336980	And finally, commercial switches, your old stuff, your 5Es, your DMS100s or your meta switches and ribbons if you want to buy modern stuff are very expensive and less customizable, but rock solid reliability.
2336980	2340960	We're talking five nines for a single box and have everything you're going to need out of the box.
2340960	2345700	So if you want to, if you're willing to pay out of pocket for them, you know, they might be worth it.
2345800	2347820	There are a couple pitfalls with switches.
2348320	2350220	Biggest one is Lex style routing.
2350340	2354660	So local and interlattic calls, you're going to have to pick those out and make sure they go over the correct trunks.
2354900	2360240	You may have to support equal access depending on whether someone asks you to and the regulations in your state.
2360240	2361600	Again, check your local laws.
2361660	2365080	And you may have to deal with TDM and SS7 as we were talking about before.
2365080	2366620	So you may need media gateways.
2366620	2369340	You may need other, you know, gateway type elements.
2369340	2371200	You may need an SS7 signaling gateway.
2371420	2380420	Billing can be a real nightmare if you want to do proper, you know, telco style billing where you're billing local calls separately, you're billing per minute, you're billing cabs or access revenue for inbound.
2381120	2389920	You're also going to have to deal with high availability and failover if you want to meet certain state standards for, you know, time, for uptime.
2389920	2393600	A lot of states have a standard of four nines of uptime for your switches.
2393600	2398240	So you may have to, you know, make sure you're suitably reliable and not just running on one box.
2398360	2402940	You may also want to go multi‑site, especially if you're going to be pumping a lot of traffic through one central instance.
2403320	2406700	There are issues for how to do this, you know, clustering and that sort of thing.
2406700	2410240	VoIP is not particularly easy to cluster like, you know, websites.
2411420	2414300	Once you've got your switch set up, you're on the home stretch.
2414300	2416880	Now all you need to do is follow for your numbering resources.
2416880	2425680	You're going to go to NAMPA or the North American Numbering Plan Authority, you're going to send them your OCN, you're going to send them your long distance interconnection details and you're going to send them your silly code for your switch.
2425680	2431820	Then you're going to wait 45 to 90 days to get your central office code or a bit less if you're just getting a thousands block.
2432000	2437620	Once you're approved by NAMPA, you're going to get an AOCN to put the numbers into birds and set up the routing records.
2437620	2443080	You're going to talk to them about how you want to get your routing set up and then you're going to input your numbers into NPAC so people can port them.
2443180	2454820	After you're all set up and all fully online, you're going to submit part four with NAMPA and if your numbers are pooled, you'll also have to send in a PSTN confirmation to say basically a test that you've fully built out the block.
2455220	2456020	And then you're done.
2456020	2462540	You are now an official phone company with your own numbering resources built out and with your own interconnection set up and routed.
2463020	2467300	We're going to finally have a few concluding notes and hopefully get that done before we run out of time.
2467900	2477380	So firstly, if you're a phone company or hell, even if you have an internet connected PBX, monitor your call and SIP logs, set alerts for unexpected usage, especially for weird international destinations.
2477460	2479620	Lock down those weird international destinations.
2479720	2482520	If you're a normal company, why are your employees calling Uganda?
2482520	2483740	They probably shouldn't.
2483740	2487520	Nothing wrong with Uganda, just they charge like 50 cents a minute for a call.
2487620	2490780	So you want to make sure that's not happening if it doesn't have to be.
2490780	2502000	Did rotation or people swapping out phone numbers, if you're a carrier, is not normal and is almost a certain sign that that person is using your service to send spam calls, you're going to want to monitor your customers too.
2502000	2507820	Know the real person behind every company, know who's making your calls, know who you're dealing with and set limits on your switches to match that.
2507820	2511840	If a customer says they're a home, they don't need to be making 40 calls at the same time.
2512600	2519600	If a customer says they're a large business, you should expect them to not be switching out their numbers every two days because that's not normal for anyone.
2519600	2526960	And never give out people the ability to swap out their caller ID and basically supply what the caller ID is going to be, unless you absolutely have to.
2526960	2529980	It's the number one way that spammers are able to abuse phone services.
2530140	2535540	In terms of public policy, if we have any feds in the room, require ILEX to support IP interconnection.
2535540	2541720	This would solve a huge chunk of our issues for the TDM shuffle, the evasion of Starshaken.
2541920	2547800	And it would also, at the very least, get the FCC moving on mandating out of band Starshaken support.
2547800	2551880	This would be a big thing for fixing a lot of those problems.
2552000	2554140	End user shaking might also be a good idea.
2554140	2566200	If you force the end user PBX to sign the call, rather than the calling carrier, this would allow us to set a proper black hole list for PBX for people whose calls are frequently associated with spam.
2566320	2569900	And it would allow us to track the call directly back to the originator rather than their carrier.
2570040	2572660	And we also need better enforcement against criminal telcos.
2572720	2579960	I have no proof of this, but I would estimate that 50 plus percent of all robocalls right now come from less than 10 carriers who make this a market for them.
2579960	2583980	These guys need to be kicked off the network, because they're the source of all the spam, basically.
2584660	2601360	Finally, I will ask you nicely, if any of you have equipment that you don't need, please, like, if you have 5Es, if you have old step by step stuff, you know, even if you have, like, mainframe gear, I've also got the Z14, if you have anything, or if you just are an ISP,
2601360	2607920	an IXE, a WEC, an ASN, you want to peer with me, I'll connect with anyone and I will give any unloved equipment a new home.
2608720	2613220	Finally, I'd like to give a thanks, first, to DEF CON for inviting me here to speak.
2613300	2620720	Second, to LiveWire Telecom and my friend Dylan Cruz, who knows far more about TDM and the old phone network than I ever will and has been a tremendous help in this.
2620840	2626480	Wide Voice, who is my future group D carrier, and I have nothing but good things to say about their service.
2626500	2638800	And finally, YKC Communications in Ganado, Texas, who did not have a choice when I sent them an interconnection request, but was still a good sport about cooperating, so thanks for following the law and being a good sport, I guess.
2639080	2640620	And finally, call me.
2640620	2641980	This is my information.
2642100	2646000	I love talking about phone stuff with people, and I have no one to talk about it with.
2646000	2646980	Please reach out.
2646980	2649320	I will talk your ear off about any of this stuff.
2649320	2651940	I love to talk to you, but I love to talk about phones.
2651940	2653680	And I think we're done with one minute to spare.
