start	end	text
8030	11110	All right, so my name is Ken Pyle.
11130	15190	I am a partner and exploit developer at a firm named Cyber.
15330	20510	I do exploit development, offensive work.
20710	24630	I'm a really prolific zero-day hunter.
25270	26770	So this is, we do managed services,
26770	30690	we do managed services, data security, breach response, digital forensics.
30810	34990	I'm primarily, as I tell people, I live on the very red side of purple.
35190	36750	Like, very red side of purple.
36750	38630	I get called in and it's like, has anybody ever seen this?
38630	41130	Have you ever given your view on it?
41610	45150	I'm also a graduate professor of cyber security at Chestnut Hill College.
45150	49430	I teach applied cryptography, advanced exploit development, cyber warfare stuff,
49430	51730	refinement of exploits, what have you.
51910	53750	I have to give you the plug because I'm here, whatever.
53910	55730	But I'm going to be very clear about this.
56010	58350	None of the opinions I'm expressing in this presentation
58350	60890	are representative of either of those institutions.
61330	63110	So you know where this is going.
63150	65850	All right, this is actually my academic research
65850	68130	I've been working on for a really, really long time.
68570	71890	And I'm going to, as I put this presentation together,
71890	76450	it looks very small, but I'm building up from the bottom to something really big.
76450	78750	And it all starts with some very basic concepts.
78750	81190	One of the things I try to tell people is,
82410	87110	I am a really, really prolific exploiter of critical infrastructure.
87430	88470	If you don't know who I am, I'm the person,
88470	91310	if anybody heard about the emergency alert system getting hacked last year,
91310	92250	that was me.
93370	96390	The ruckus Andoriu botnet that got started earlier this year
96390	99210	caused a big problem on the KEV, that's me.
100150	101490	Some other stuff.
101490	104870	And I always tell people this, I love my job, I am super passionate,
104870	107650	I love this, I've been doing this since I was six years old.
107650	109970	I was on a 2400 baud modem doing this.
110350	113750	I do some really serious work, we all do some really serious work,
113750	116890	but it is really important to not take yourself too seriously.
117430	119990	So when I popped the emergency alert system,
119990	122230	and my picture was getting broadcast all over the world,
122230	125470	I made sure to troll goth fans with my favorite New Order CD.
125590	128870	The keys to set off emergency system alerts across the United States
128870	130790	are actually hidden behind that CD.
131670	134870	But the whole point of it is, we do really serious work,
134870	136930	and we get really tied up into it,
136930	139430	and there's this problem we have in the industry
139430	141530	of everybody aiming guns at each other.
141550	143670	I'm an exploiter, I'm a hacker,
143670	146590	and I have to talk to appsec people constantly.
146590	148510	And it's always adversarial.
148510	150330	And it doesn't need to be.
150850	152690	It's also not very difficult.
152690	153770	All the things I'm going to show you here
153770	156330	are literally basic concept things
156330	158630	that I'm sure you read in the first five pages
158630	160230	of anything you ever read.
161170	162890	So if you ask yourself a couple questions
162890	165010	of how do I know some of these things,
165010	167450	or how did I figure some of this out,
167450	169090	my full confession is this,
169090	170730	I used to be an MSP engineer,
170730	173070	I used to be a security and network engineer,
173070	175450	and I know because I'm sitting in a room of appsec people,
175450	178590	I will tell you flat out, it's not always the network.
179270	181490	But this time it kind of is.
182450	185070	But it's your fundamental lack of understanding
185070	186330	of how the network works
186330	189230	that makes what I'm going to show you happen.
189610	192810	And I want the light bulbs to start going off.
192990	195670	So people ask me this, how do you find zero days?
196970	198690	Break out the crayons.
199170	201890	On the engineering side, we hate doing this.
202090	204790	I hate having to explain myself to people.
205190	206410	You have to.
207090	210010	You guys got to be a little bit more cool with us on our side,
210010	211670	and we'll be a little bit better on your side,
211670	213150	but that's causing these problems.
213250	214710	How do you find zero days?
214710	216850	It's as simple as reading the effing manual.
217050	219450	I tell people this all the time.
220250	222610	Understand what you are actually working at.
222610	224750	If you're an appsec person,
224750	226330	your application is transmitted
226330	228370	in some way over a network, correct?
228730	231530	You should probably learn how that road works,
231970	234490	and all the off-ramps and ways to hijack it
234490	236870	through application security.
237430	240570	I always tell people to be eternally cynical, skeptical.
242350	244510	If somebody tells you they did something,
245070	246350	double-check anyway.
246670	249330	The big problem we have with supply chain management software,
249330	250730	stuff like this, is we're all depending
250730	252430	on the person behind us or next to us
252430	255310	to have done their job and actually read the manual.
255850	257990	Turns out, it's the complete opposite.
258510	259490	Don't give up.
259490	260530	If you find something new,
260530	262350	and I'm going to show you something that's brand new,
262470	264970	a new type of HTTP exploit I came up with,
264970	267090	and I knew what I had,
267090	269170	but I had to protect it because people were trying
269170	271430	to actively not let me talk about it.
271850	274490	Not just this situation, it's a bunch of...
274490	277250	And sometimes you just have to, as an engineer,
277250	279590	lower yourself to the pity of explaining
279590	282110	the network to plebs who don't know anything.
282110	283570	That's BS, man.
284270	286710	As a very good friend of mine, an amazing hacker,
286710	288350	John Vandiver, said,
288350	291370	great hacking is just great system administration.
291890	293790	That's living off the land, right?
293990	296350	Living off the land is taking what the defense gives you
296870	299190	to accomplish something you want to do.
299710	300990	So I did it.
301410	303110	So I'm going to break out the crayons a little bit.
303110	304770	Like I said, I'm going to explain through this,
304770	306070	and it's going to look weirdly weird.
306070	307350	I'm going to snap something else on,
307350	308690	and it's all going to click together.
309510	312510	Breaking out the crayons, living off the land,
312510	316090	finding new exploits, is all about one thing.
316450	319450	What is the difference between the way you intended
319450	324070	this application to be working and how it's actually designed?
324750	325610	Right?
325610	330170	I intended for this application to provide a login.
330390	332810	As designed, it allows you to inject things
332810	335210	into the login page and obtain access, right?
335210	336790	That's how it works.
337770	339990	Going back to that, sanitization of input,
339990	343190	if I can tell one other thing to application developers,
343190	347850	is that sanitization of input needs to happen on both sides,
347850	351530	and any time information comes in and leaves.
351850	353610	And there is more implication from that
353610	357230	other than an API call or an HTTP request.
358090	359510	And now this is what I'm saying,
359510	360850	it's kind of about the network,
360850	362910	but it's a fundamental lack of understanding.
363030	365870	The lack of understanding of the OSI model.
366770	369810	And trust me, there is no greater abuse in technology
369810	371930	than the first hundred pages of every book you've ever read
371930	374670	that explains the OSI model for the 900th time.
374850	375530	Right?
375630	377130	But it's actually important,
377130	378490	and you should actually learn it,
378490	380450	because I'm old.
380450	382250	I feel like I'm coming back from the future
382250	384590	to warn everybody about something that happened.
384950	387430	I'm old, and some of the tricks I'm using
387430	390410	are things that I've been using for 30 years.
391450	392730	Because what happened?
392730	395510	They were known about, nobody fixed them,
395510	397750	it's like the last person standing in the room
397750	399430	and everybody forgot that old knowledge,
399430	400330	and when I wonder why that,
400330	402790	it's just forgotten, it goes into the ether.
403310	404510	And the last thing I tell people is
404510	406570	sometimes you actually need to write the manual
406570	408270	to explain it to people.
409230	411410	So, here's the story.
411410	412430	I'll give you the background story,
412430	414390	how it got to this, and how it snaps together.
414790	417190	So, ConnectWise Control and their applications
417190	419630	are set for MSPs and large organizations
419630	421130	to do endpoint management.
421790	422190	Right?
422330	425070	You've had some version, Kaseya, ConnectWise,
425070	426070	there's all these different things
426070	427670	that allow MSPs or large corporations
427670	430190	to manage all their endpoints, jump in, yada, yada, yada.
430670	434610	I began disclosing my work in October 22 to them.
435850	438150	After disclosing it and being responsible,
438150	440430	they started saying it was minimally impactful,
440430	442350	but they still patched it.
443850	445410	In addition to that, several IR firms,
445410	447110	because a lot of people in that side of the world
447110	448270	know me and came out to me and said,
448270	450510	I heard you're on some hot stuff, can you tell me?
450890	452350	I shared it and I always said, like,
452350	453990	as I always say, I'll share what I know,
453990	455610	just do me a favor, don't share it with anybody,
456230	458750	keep it quiet until I talk about it.
458770	460630	Because it's not a fame thing,
460630	462430	this is actually a pretty big deal.
463530	467570	After attempting this and being called overblown,
467570	469390	ridiculous, whatever else, it's not a big deal,
469390	471810	and after all the patching, I finally just said,
471810	472930	I'm done with this.
473150	476310	I'm going to MITRE and I'm just gonna ask for the CVEs.
476490	479770	So after being called overblown, this wasn't a big deal,
479770	482430	my CVEs were classified as a 9.8.
484250	487930	Not only that, on December 1st,
487930	489750	Krebs posted an article about it,
489750	491930	how I publish a blog post around my findings,
491930	495010	and coincidentally, ConnectWise released an advisory
495010	498990	warning about phishing campaigns, client-side exploitation,
498990	501690	and all these other things that bear a lot of similarities
501690	502750	to what I did.
505450	507490	I'm not here to talk about that, but I'll say this,
507490	509150	all you really needed to do all of this
509150	510490	is sitting there on the right-hand corner,
510490	512070	I just never explained it to anybody.
512550	514670	Because it was like, if this is the game
514670	516650	that's gonna get played, I'm just gonna go talk about it
516650	517730	and that's the end of it.
518310	520170	Going a little further, a third-party company
520170	522410	who did some analysis of this,
522410	525550	posted a public analysis and comment on my work
525550	527110	stating it wasn't a big deal.
527150	528650	And I'm not here to talk about them,
528650	530930	it's not the story about them, but I will say,
530930	532930	there are a number of potential emissions and issues
532930	534110	in this analysis.
534770	537050	So instead of going in a fight with them,
537050	538450	I checked their homework.
539710	542190	So, there's your CVEs.
542190	543610	One of the things I'll tell you is that analysis
543610	545390	does not ever mention that those things are actually
546430	547330	a little ridiculous.
547330	549630	But, let's talk with it.
549630	551730	How does living off the land start?
551810	554070	It starts with understanding how things work.
554590	557130	In the top left corner is basically your average,
557130	560190	hey, this is a switching network with a router and firewall,
560190	561990	bottom's the OSI model, the top right,
561990	563450	I'm gonna explain it to you in a minute.
564650	568150	But, living off the land is basically this.
568470	569390	And you can read it.
569390	571490	Taking advantage of things like,
571490	573990	abusing PowerShell, Visual Basic, WMI,
573990	576570	PS Exec, Mimikatz,
576570	578230	all of these things that are allowed,
578230	580610	exploits the functionality of a system
580610	583930	to hijack it for nefarious purposes.
584310	586130	That's living off the land.
586610	588910	Abusing something you're given to do it.
589570	591790	It may include tactics like DLL hijacking,
591790	594550	hiding payloads, process dumping, downloading files,
594550	595830	all these other things.
595830	598470	Code execution, persistence, log evasion.
599530	604410	These are all hallmarks of mega super APT groups, right?
604750	606250	Like, oh, they do live off the land,
606250	607350	they're gonna be detected.
607350	608950	No, it's just knowing how a computer works.
608950	610670	Nobody on my side of the house wants to tell you
610670	613590	it's really as simple as knowing how to launch a command shell.
614550	617290	So, after all of this and everything else,
617290	618870	my work was repeatedly acknowledged
618870	621490	as defeating controls, internally reproducible,
621870	624130	sharing traits with APT groups,
624130	628450	I directly disclosed it prior to any public notification by them,
628450	630390	and it's being actively exploited.
631890	633270	Keep that in mind.
633750	635090	So why don't you ask yourself this,
635090	636910	if I'm gonna build a botnet,
636910	639670	what are the things that I really want?
640270	642310	So, on the left-hand side, I want a port scanner,
642310	645410	C2 beaconing, tunneling, arbitrary request handler,
645410	647950	amazing hosting that doesn't go down,
647950	649650	code signing, trusted execution,
649650	652450	exfiltration, implantation, client-side exploitation.
652610	654750	For me, that's a fully functioning botnet
654750	656230	with all the tooling I need.
656710	658750	On the right-hand side, what would I love to have?
658750	661210	I'd love to be able to bypass everybody's firewall rules,
661210	663870	something has no monitoring, poor user habits.
663870	665910	I would love to get access to somebody else's
665910	667990	trusted SSL and code signing certificates
667990	669770	to sign my malware with.
670390	672470	I want to drop catch domains,
672470	675050	so I can catch people when their instances expire
675050	676310	and I can phish them.
676550	678570	I want to be able to send my phishing emails
678570	681190	to a trusted SMTP source,
681190	682670	like their hosted cloud instance
682670	685850	that enables you to do all of that through a hosted solution.
686950	688410	And this is the thing to think about,
689070	691290	HTTP API protocol fuzzing.
691470	693330	I'll show you how that works,
693330	696670	but think about this in the context of your applications.
697450	699270	With abusing a little trick
699270	701770	with server-side request forgery,
701770	704890	I have a really amazing little thing to show you.
704890	706690	I want to bypass eight controls.
706690	709470	This bypasses AV and EDR controls.
709470	710670	I know it does.
711390	713930	Even better, if all of this can be free to you,
713930	716330	instead of spending thousands of dollars on hosting,
717610	721390	and I really am after is getting code past everything.
721390	724290	There's all those controls in place that make things stop happening.
724510	726810	Now, what's perfect for that?
726950	728250	RMM software.
728670	730630	And I'm not picking on ConnectWise,
730630	732890	because you can go look at my critical CVEs
732890	735010	on all kinds of MSP software.
735190	737170	Because say it happened in 2020, right?
737590	740190	2019, I alerted them to a very similar kind of issue
740190	741970	and said, you've got to fix this.
742150	744710	Why? Why do I go after this piece of software?
744710	746050	It's poorly managed.
746330	749270	People disable controls to make this work.
749270	750930	And I'm going to show you a specific example
750930	752430	for every one of these points.
752570	755110	It provides system access in Windows.
755550	756810	So I'm the colonel, right?
756890	757790	Normal looking.
757790	759110	So if I want to phish people,
759110	761930	and I figure out who your MSP is,
761930	763290	or your company is,
763290	766050	I can just make it look like it came from them.
766430	767510	Gives me access to everything.
767510	768850	And here's the important part.
769010	771890	I can either maintain persistence,
771890	773310	or I can make it temporary
773310	776250	and leave very few, if any, forensic IOCs.
776490	777730	That's what I go after.
777730	779250	I want to be not detected.
779250	782730	And again, all of this is free.
783330	785990	You don't need a dollar to your name
785990	788070	to set all of this up.
789750	792470	Now, let's talk about this.
793550	794510	Many people...
794510	795770	and this is...
795770	796550	I'm talking about specific...
796550	797150	but you've got to think about this
797150	798450	in the context of your application,
798450	799670	how you're designing things.
799810	801470	People disable security controls
801470	805150	because software is either over-designed,
805150	807650	or there's deployment complexities.
807650	808890	And what people try to do,
808890	809670	which we all do,
809670	812050	is design so it works absolutely everywhere,
812050	813490	no matter the infrastructure.
813970	814990	What you're looking at here
814990	816630	is on the left-hand side,
816630	817930	and I'll read it so you can't see it.
817930	820890	It's a posting from a Zscaler forum,
820890	822090	the support forum.
822830	824510	I'm having problem with connectwise
824510	826250	connecting to a direct IP.
826250	828230	At the bottom there it says,
828230	829510	oh, the way we fixed this
829510	831690	was on our SSL inspection.
831970	833690	We accepted and allowed
833690	836150	asterisk.screenconnect.com
836150	837550	but we should have used
837550	839530	screenconnect.com.
840070	841650	So,
841650	842890	think about it this way.
842890	845430	If you asterisk the domain name
845430	848770	for disabling security controls,
848770	850330	as long as I have
850570	852010	a subdomain existing
852010	853190	in there and resolving
853190	855850	what has just happened,
855850	857090	you have disabled
857250	859590	all inspection of SSL
859590	862130	for anything coming from there.
862590	864190	That's really important.
864330	866570	On the right-hand side, you have another one where it says,
866570	868150	I'm having an oddball issue with screenconnect
868150	870110	where the agent can't connect back to screenconnect
870110	871650	so it just keeps retrying.
871870	873830	If I disable, decrypt, and scan,
873830	875550	it'll just work fine.
875670	877670	I've whitelisted screenconnect.com
877670	879390	including all domain names.
879570	881410	And the bottom one is a moderator saying,
881410	883830	please show a picture of the edit of this configuration.
886720	888180	Starting to get it now?
889060	889840	So,
889840	891860	even further,
891860	893500	there is really poor management
893500	895760	of their cloud instances of
895760	897940	registering FQDNs.
897940	899520	What you're looking at is
899520	901880	some company that I dug out of security trails
901880	903880	that has a screenconnect.com
903880	905560	subdomain for their old instance
905560	907680	except it was retired
907680	909160	for a year.
910020	912060	I did some OSINT, I went out,
912060	913440	I registered their domain
913440	916020	to me, started a connectwise
916020	918320	instance, and I now own their FQDN
918320	919340	for it.
919340	921120	So if you didn't go back
921120	923200	and disable all of those changes
923200	925180	that you made to your security
925180	927660	controls for any of this,
927660	929340	what have I just done?
930440	931600	Right through.
932140	933600	And I prove it.
933900	935260	Further complicating
935260	937720	this fact is that every single cloud instance,
937720	939400	even trials, that you
939400	941340	get, issues the
941340	943260	same wildcard SSL
943260	945280	certificate to absolutely every
945280	946380	instance.
947500	948540	Anybody do
948540	949800	cryptography like me?
950300	952240	What is the first rule of public-key
952240	954220	cryptography? Control
954220	956320	of the key and registration
956320	958520	and knowing it. So this is a
958520	961140	really good cert. It's a high-grade cert.
961140	962820	So anybody, whether you're
962820	964740	a corporate customer paying millions of dollars
964740	967140	or whatever, or some idiot like me
967140	969300	with some free time in a basement,
969300	970840	I can go get the same SSL
970840	972600	certificate for you. And remember,
972600	973900	everybody's keying on the wildcard.
975880	976640	And they
976640	978540	don't inspect SSL either, do they?
979060	980340	Awesome.
980740	982220	So, there's another
982220	984500	certificate that exists in all of this.
984500	986220	A code-signing certificate. When you
986220	988280	download their agent for installing
988280	990420	these things, it's
990420	992440	signed. But it's a
992440	994640	click-once installer.
994640	996520	And there is a small little space
996520	998900	in here in which
998900	1000580	the code-signing certificate
1000580	1001900	doesn't apply. It's
1001900	1003680	an unregulated space
1003680	1006700	in a signed executable.
1006700	1008040	You're all AppSec people.
1008040	1010180	Is that something you're supposed to do?
1010900	1012000	How much is
1012000	1013820	that cert now worth?
1013960	1015520	Zero dollars.
1016300	1018660	It's worth it. It doesn't do anything.
1018720	1020020	I can go in there and edit
1020020	1022040	that space and
1022040	1023660	it won't break the certificate.
1023660	1026740	So how are the two ways that EDR and AV work?
1027560	1028420	Hash-banning
1028420	1030680	and code-signing.
1030680	1032640	By changing this space and
1032640	1034640	injecting whatever I want in here, it changes the
1034640	1036620	hash of the file. And that changes every
1036620	1038180	time you start a session.
1038180	1040080	So you can't hash-ban it.
1040080	1042640	The only other trust control you can anchor this on,
1042640	1044860	other than watching behavior, is a
1044860	1046840	code-signing certificate that
1046840	1050420	doesn't actually do anything.
1050420	1050880	See how this
1050880	1054620	is all starting to snowball a little bit?
1054620	1056240	To make matters
1056240	1057160	worse, the
1057160	1058300	download of that signed executable
1058300	1060480	that gives you system
1060480	1062800	access, all these other things, or whatever,
1062800	1065340	is transmitted via HTTP,
1065340	1066440	which
1066440	1069100	is plain text.
1069480	1070400	So, by
1070400	1072620	transmitting a
1072620	1075380	weakly-signed, can't-hash-ban
1076080	1077240	it executable
1077240	1079580	over a network via plain text,
1079580	1081220	I can essentially, without any
1081220	1083020	social engineering or interaction, back
1083020	1089250	door that thing when people are downloading.
1089250	1089590	Not only that, you can
1089590	1091290	man-in-the-middle-it, proxy it, or just
1091290	1093550	directly edit the file and download
1093550	1095810	it from anybody's public instance.
1096110	1097610	Top right, left corner.
1097610	1099510	This thing executed that malformed
1099510	1101650	HTTP request to that IP address
1101650	1103490	via that signed client that
1103490	1105610	I manually edited and man-in-the-middle-ed
1105610	1108310	and it worked.
1108450	1109630	It executed
1109630	1111610	an arbitrary HTTP
1111610	1113510	request to a host
1113510	1115330	of my designation inside
1115330	1117290	of a signed executable.
1117910	1118970	Checkmate, right?
1120070	1121350	That's the first 10
1121350	1123370	seconds of this. Because
1123370	1125690	all of these things violate the CIA triad.
1126290	1127530	There's no integrity.
1127870	1129190	You can use this to do some availability
1129190	1131270	problems. It's in the CV, and it's
1131270	1133130	definitely not maintaining cryptographic controls.
1133130	1135290	So, I'm going to rewind a little
1135290	1137610	bit and go back to third-party analysis.
1138090	1139490	And I want to read this to you.
1139870	1141350	Third-party companies are giving out some
1141350	1143210	pretty flawed advice, and I don't think maybe they
1143210	1145770	understand exactly how the AppSec or product works.
1145770	1147630	I'm going to read you an analysis they had on
1147630	1149810	another case to you,
1149810	1151730	and I want you to put this together in your head.
1152050	1153870	This simply means that hackers could register
1153870	1155790	for trials of control and potentially
1155790	1157570	serve malicious JavaScript from an
1157570	1160210	asterisk.screenconnect.com domain.
1160550	1161970	Theoretically, this could be a
1161970	1164010	building block for other attack chains,
1164010	1167930	but it's not worth losing sleep over.
1167930	1168390	Because
1168390	1169990	this happens,
1169990	1171910	and they're wild-carding,
1172370	1173690	control of any server in their
1173690	1175450	cloud domain FQDN
1175450	1177390	DNS zone, whether
1177390	1179450	inflected or injected,
1179450	1181410	will allow you to perform client-side
1181410	1183270	exploitation and bypass
1183270	1185810	browser controls. Why?
1185810	1187410	We are allowing
1187410	1189250	script access from
1189250	1192090	asterisk.screenconnect.com.
1192090	1193430	Right?
1193610	1195650	It's not a theory. In fact,
1195650	1197770	I'm giving you only one weaponized
1197770	1199650	example of this. As long
1199650	1201650	as you can figure out how to get something on
1201650	1203850	that, it goes nuclear.
1204110	1205670	Now, think about this in an AppSec
1205670	1208650	perspective. I'm downloading an executable file,
1208650	1209390	an agent,
1209390	1211510	that doesn't have any effective
1211510	1213230	framing mitigations.
1213450	1215350	Does anybody know what that does?
1215470	1217590	Download a file via a frame, and it's
1218170	1220070	a no-click downloader.
1220070	1221650	It will just download it
1221650	1223710	because it's injected in a frame.
1223730	1225430	So, if I can come up with a malicious
1225430	1227630	agent, put it
1227630	1229530	in another instance, and find
1229670	1231470	a web page that I can inject content
1231470	1233570	into, I can now
1233570	1235670	install without a click
1236430	1237590	an agent on
1237590	1239050	anybody's computer.
1239930	1241650	Which gives you access
1241650	1242690	to everything.
1244070	1245510	Now that you have this,
1245510	1247610	you're probably asking yourself, how do I weaponize this?
1247610	1248950	How do you live off the land?
1249370	1251630	Well, living off the land is understanding how things work,
1251630	1253550	right? So, why not
1253550	1255350	just make it an unauthenticated, signed
1255350	1257950	exploit factory and delivery method?
1257950	1259790	It's a signed Windows executable
1259790	1262030	that you can't hashband,
1262030	1264010	that's always excluded, but not
1264010	1265890	only that, it works across
1265890	1267950	multiple operating systems, signed
1267950	1270250	or unsigned. It executes
1270250	1272010	arbitrary requests and other things
1272010	1274230	that I'm not talking about to targeted endpoints.
1274890	1276150	Because it's a network
1276150	1278030	thing that goes back to a DNS
1278030	1279990	name or an IP address, it
1279990	1281970	resolves it and creates requests
1281970	1283890	from it. It's an
1283890	1285630	arbitrary HTTP
1285630	1287530	or command
1287530	1289610	executing application that's
1289610	1291270	signed with somebody's legitimate
1291270	1293550	sign, sir. Now, here's where it gets
1293550	1295630	crazy. You already know about
1295630	1297970	this, but look at the top right corner.
1297970	1299910	As long as I have a
1299910	1301810	cloud instance, an
1301810	1303810	on-premise instance, I can
1303810	1305710	sign executables with their
1305710	1308110	code signing certificate.
1308110	1309730	Even an unlicensed
1309730	1311610	on-premise version of it that
1312170	1313930	has a trial that was never licensed.
1313930	1315490	Hint, hint.
1316950	1318210	It works.
1318610	1320530	So here's a signed exploit factory.
1320530	1321430	I'm the guy who came up with the
1321430	1323890	Endorubot one. I'm the one who came up with the Cisco Dell
1323890	1325990	one that became a big problem. Why do
1325990	1327950	I make every one of my exploits
1327950	1329830	that are web-based, I try to get them to get
1329830	1331910	requests. Because they're client
1331910	1334450	deliverable. They're not posts.
1334450	1335690	I just have to craft
1336030	1337090	a good URL.
1337910	1339930	So what you can do is
1339930	1341790	embed my exploits, which give you
1341790	1343990	remote code execution, complete control
1343990	1345750	of network infrastructure,
1345750	1347010	by bouncing it out of an
1347610	1348510	executable,
1350330	1351910	somebody downloads it, and because
1351910	1353850	they're inside somebody's firewall, it
1353850	1356050	will execute that to wherever I want.
1356050	1358130	That's how you bypass a firewall.
1358790	1359910	If you don't believe
1359910	1361970	me and you want to test this out for yourselves,
1362350	1364030	and that you can actually inject this,
1364310	1365590	here's the exploit.
1365650	1368090	This will compromise
1368090	1370310	Cisco, Dell, Netgear,
1370310	1372510	D-Link, Linksys, there's a whole slew
1372510	1374690	of switches that have this.
1374930	1376290	And it really is as simple as
1376290	1378370	pointing to the right IP address, feeding it
1378370	1380690	about 1,200 characters,
1380690	1382610	and then putting a
1382610	1384490	certain character in there, and it reboots
1384490	1386590	the switch. Which
1386590	1389030	stops all of your applications from working.
1389030	1391690	But why would I give you that exploit
1391690	1393390	as part of that?
1393390	1394530	Because remember how I said you can
1394530	1396690	man in the middle of the download?
1396690	1397990	What do you need to do that?
1397990	1399910	To roomful AppSec people,
1399910	1401650	and they don't know this, this is important.
1401650	1404490	What happens in the first 15 seconds you reboot a switch?
1405910	1407710	ARP table flushes.
1408350	1410530	What do you need to do man in the middle?
1410590	1412430	Control of ARP and Mac.
1412750	1413970	So if you want to test
1413970	1416350	out man in the middle in the download,
1416350	1418210	get a switch, send it that exploit,
1418210	1419750	and do this, and you can completely
1419750	1421790	recreate my work in about
1421790	1424010	10 seconds. Don't believe me?
1424010	1426490	That's the default IP address for those switches.
1426490	1428570	So what I do is I control external
1428570	1430470	domains with internally resolvable IP
1430470	1432770	addresses, like the default IP addresses for everybody's
1432770	1434410	switch, or most of them.
1434730	1436770	Spray them out, and eventually
1436770	1437970	you're going to get a hit.
1439510	1440630	Even more to the point,
1440630	1442630	I'm not just talking about Windows executables,
1442630	1444550	and this is important. I did a lot of work on this, nobody
1444550	1446530	read it. I'm one of the leading exploiters
1446530	1448550	of a format called JNLP, Java Network Launch
1448550	1450710	Protocol. It actually launches Java
1450710	1452610	and works across any operating system
1452610	1454830	that has Java in it. So this injection
1454830	1456910	problem doesn't just exist in the Windows
1456910	1459090	executable. Every kind
1459090	1461250	of agent, EXE,
1461250	1462990	DBN, Windows,
1463670	1465030	Linux, they all
1465030	1467170	suffer from this problem where you can inject
1467170	1468590	into space like this
1468590	1471030	to get it to do these things.
1471030	1473930	All this is, is a downloader.
1474010	1475130	Like a click once
1475130	1477150	installer. It just goes out and retrieves
1477150	1479070	something, but I have control
1479070	1481090	of what it retrieves.
1481450	1482950	So, now that you have
1482950	1485030	all that, how do you
1485030	1487030	actually exploit this in a meaningful way?
1488370	1489030	What if I
1489030	1490850	did have a way to theoretically inject
1490850	1492890	things into ScreenConnect.com's domain without
1492890	1493990	them ever knowing?
1496150	1496890	So put that
1496890	1498750	aside for a second and look at this.
1499270	1501370	You have this malicious code factory,
1501370	1503050	how do I start delivering it? And remember
1503050	1504870	all those tools I told you I built out? How
1504870	1507330	do I do it? So here's my moment.
1508070	1508890	For the past
1508890	1511150	year, I have been routing,
1511150	1513510	abusing, using the ConnectWise
1513510	1514430	cloud service
1515150	1516490	under their noses.
1516910	1519390	After informing them of this,
1519390	1520990	and I've been collecting POC for
1520990	1523130	C2 beaconing, bypassing firewall
1523130	1525370	rules, tunneling malicious files,
1525370	1527510	creating a giant DDOS cannon,
1527510	1528890	botnet creation, client-side
1528890	1531050	exploitation, port scanning and API access
1531050	1533250	to external and internal
1533250	1535270	hosts at ConnectWise.
1536070	1536690	Arbitrary
1536690	1539310	HTTP requests on arbitrary ports
1539310	1541490	and exfiltration and implantation of malicious
1541490	1543790	code. How did I do it?
1544030	1545730	Because of one web page
1546450	1547630	and how that software
1547630	1549370	works. Why?
1549570	1551570	Because software developers don't know
1551570	1553010	how a network works.
1553310	1555450	I'm going to explain it, it's going to look all complex
1555450	1558070	but I did it a really simple way here.
1558130	1559350	All you really need
1559350	1561470	are three GET requests.
1561930	1563490	If you look at this, the top
1563490	1565250	one is how I made it into a port scanner
1565250	1567210	and an arbitrary HTTP
1567210	1568870	and API fuzzer.
1568870	1570890	The second one is a content brooder
1570890	1572790	you can use like Durabuster
1572790	1574850	to scan people's things.
1574970	1577090	And the last one is a client-side exploitation
1577090	1578990	method of something I'm going to show you that I've never
1578990	1580370	showed anybody before.
1580890	1582930	Or you can just go to my
1583670	1585090	GitHub and I'll give you the Python
1585090	1587130	scripts. As you'll see, none of this
1587130	1589130	requires anything other than a knowledge of the things on the
1589130	1591170	left-hand side. Doesn't require a credit
1591170	1593170	card. Actually, I host all
1593170	1595510	of my stuff in ScreenConnect's own cloud.
1595510	1597970	I registered for a trial instance anonymously
1598670	1599570	and I've been hosting
1599570	1601970	it for a long time.
1603090	1603710	I'm hosting
1603710	1605290	everything out of Amazon EC2
1605290	1606750	for free.
1607550	1609270	And I'm going to give you the free Python scripts.
1609270	1611330	In fact, if you take pictures, I have them all up here for you.
1611690	1613430	So it starts with this web page.
1615430	1616090	Oh.
1618470	1619870	My battery's getting cut out.
1619870	1620570	Hold on.
1627560	1629200	Ah, there we go. Okay, sorry.
1629200	1630760	My battery was going out.
1630960	1632420	This page.
1632680	1634960	How do you live off the land with ScreenConnect?
1635060	1637360	If you go to that web page right now,
1637360	1639760	I'm pretty sure it's still up.
1640980	1643020	What is this page? Remember the difference between
1643020	1645840	intended and as designed?
1646420	1647480	So this is the intended design.
1647480	1649320	Use our port test tool to determine the external
1649320	1651500	accessibility of your ScreenConnect instance.
1651500	1653020	If you have changed ports or are hosting
1653020	1655080	at a different IP or host name, you'll need
1655080	1656720	to change those values accordingly.
1656720	1659080	So ask yourself this.
1659280	1660740	What happens when I submit this
1660740	1661860	post request?
1662320	1665360	I control the DNS record, I control the port.
1665880	1667700	The answer is this.
1667800	1669100	I can control the port
1669100	1670800	the request goes to,
1670800	1672740	the host it goes to,
1672740	1674800	and it's not coming
1674800	1676560	from my IP address.
1677040	1679460	It's a server-side request forgery.
1679460	1680880	If you look it up, it's coming
1680880	1682820	from their IP address.
1683680	1684740	And I'm doing this over
1684740	1687440	an anonymous VPN.
1687600	1688840	So think about what's
1688840	1689520	happening.
1689900	1692620	When I submit this request,
1692620	1694720	the server receives this request from me,
1694720	1695760	get or post.
1695760	1698700	The server at 52.202.11.141
1698700	1699820	processes that record
1699820	1703540	and performs three to five DNS requests.
1704400	1706460	It then creates a new HTTP
1706460	1707220	request
1708000	1709920	to the user control port
1709920	1713460	and it's coming from the targeted IP address.
1713460	1715280	So if you have a firewall
1715280	1719080	that says asterisk.screenconnect.com
1719080	1721500	you have whitelisted everything
1721500	1722840	coming out of this.
1723780	1725720	Make sense? Follow me so far?
1725720	1726420	Alright.
1726800	1729080	The page then returns a status of this.
1729080	1731200	So the web server one, it just says succeeded.
1731640	1733560	So if it connected, it got a 200 code
1733560	1734800	it says succeeded.
1735100	1737180	It's a blind SSRF, right?
1738620	1739420	Okay.
1740000	1741140	As intended,
1741140	1743120	this is designed to let users of the software
1743120	1744860	test ports and HTTP access
1744860	1747420	no matter where they are. It's a diagnostic tool.
1747600	1749320	Because people change ports
1749320	1751140	in DNS or they use dynamic DNS
1751140	1752560	for this, they change it.
1752560	1755340	So the diagnostic tool has to be able to do that.
1755700	1756940	It's unauthenticated
1756940	1759220	and totally public because an MSP
1759220	1761740	or a large corporate customer might need to test this.
1762080	1763860	Now put this together in your head.
1763860	1765060	What do you think the egress
1765060	1767220	firewall rules on that host are?
1767980	1769260	If you can scan on
1769260	1771300	any port going
1771300	1773320	out, what are
1773320	1775160	the firewall rules going out?
1776120	1777180	Okay.
1777660	1779480	All ports are open.
1779720	1780420	Got it?
1780420	1783240	So what's happening is it's creating
1783380	1785280	a DNS request. Going deep
1785280	1787420	into this, I don't want to go too deep into it,
1787420	1789320	but just understand it's three to five
1789320	1791860	DNS requests and then the HTTP request.
1792280	1793140	It's also
1793140	1795340	effectively operating as a proxy
1795340	1797180	for me. Every server side
1797180	1799100	request forgery is a proxy.
1799120	1801060	It's a limited proxy,
1801060	1803820	but it is indeed proxying traffic.
1805000	1806940	So working as designed,
1806940	1809300	this is a port scanner,
1809580	1812120	a proxy, a firewall bypass,
1812120	1813160	backdoor access to
1813160	1815280	people's HTTP and API.
1815760	1817140	Remember how it's generating five
1817140	1819040	to seven requests every time and it doesn't
1819040	1821040	do any sort of rate limiting?
1821220	1823060	That's a DDoS attack. Just
1823060	1825260	flood it. Trust me.
1825260	1827160	You can do C2 beaconing.
1827160	1828700	You can enumerate content.
1828840	1831240	You can fish from it. It bypasses AV
1831240	1833160	because everybody's disabling this stuff.
1833440	1835160	I have the malicious code signing thing
1835160	1836700	and I now have access
1837260	1839360	to ConnectWise's internal network.
1840660	1841280	Who wants
1841280	1842580	to call me on that one?
1843620	1845200	I will explain why in a minute,
1845200	1847060	but look on the bottom right hand corner.
1847100	1848860	That's a port scan script I wrote,
1848860	1850260	abusing that function.
1850780	1853220	Do you see that lb.corp.xyz?
1853220	1855760	Here's one of my nefarious things that I never tell developers.
1855880	1857200	None of you actually likes to go
1857200	1859080	look at DNS requests, especially externally
1859080	1861120	injected ones, so I maintain
1861260	1862660	a bunch of really funny zones.
1862900	1865260	Corp.xyz is one that a lot of corporations
1865260	1867160	used to use, but if you query
1867600	1869260	lb.corp.xyz
1869260	1873260	it resolves to 127.0.0.1.
1875460	1876920	Making sense now?
1877480	1878860	But I'm not going to get there yet.
1878860	1880300	What I want to get there is this.
1880300	1882740	Two one-way communication channels
1882740	1884360	equal one two-way
1884360	1885860	communication channel.
1886500	1888540	I got this way, this way,
1888540	1890520	all I'm really doing is three lights
1890520	1891840	make a left turn.
1892420	1894460	I turned this into
1894460	1896240	an effective C2 exfiltration
1896240	1898300	DNS and HTTP beacon, similar
1898300	1900320	to HTTP exfiltration
1900320	1902180	like staging, or Iodine
1902180	1904100	C2, which is DNS based.
1904620	1906400	How did I do it?
1906400	1907920	I just encoded
1907920	1909840	in that HTTP
1909840	1912100	request that gets generated, I added
1912300	1914660	a base64 payload to the end of it.
1914940	1915820	Sent it
1915820	1917580	to an external host
1919140	1920040	and if you
1920040	1922600	decrypt it, it says cyber POC.
1922660	1924120	That's a message encoded
1924120	1926120	over base64, exfiltrated
1926120	1927500	through a trusted host
1927500	1930080	and signaling something to me
1930080	1931760	in a way they've never found.
1932380	1933940	Instant win.
1934020	1936580	What happens when you're requesting that?
1936580	1938560	It sends that request via user
1938560	1940740	control port as their IP address.
1940740	1942340	This is going to get very important.
1942400	1944420	Not my IP address.
1944580	1946940	Good luck doing forensics on that.
1946940	1949240	Good luck doing IR on that.
1949480	1950480	How I'm creating
1950480	1952820	an arbitrary HTTP generator
1952820	1954620	is, at the end
1954620	1956540	of that web server box, you
1956540	1958680	can actually put slashes and restful
1958680	1960520	stuff, but as long as you
1960520	1962740	put the anchor tag at the end of it,
1962740	1964580	it snips off all the other
1964580	1966700	stuff at the end that they add on,
1966700	1968700	making it a completely arbitrary
1968700	1970860	HTTP request generator.
1971540	1972980	Why the anchor tag?
1973360	1974860	What does it do in a browser?
1974860	1976660	You guys disregard it because it's an anchor tag
1976660	1978200	for the browser. Not for that.
1978200	1979640	They're snipping it off.
1979680	1982380	So all you need to do is put in that web server host,
1982380	1984820	the FQDN, whatever the URL is,
1984820	1985320	and put an
1986260	1988280	anchor tag at the end, and it's going to forward out
1988280	1989540	that exact thing.
1990040	1992900	I told them about this in December of 2022,
1992900	1994820	and as of July
1994820	1996960	15th, the day I got the acceptance from
1996960	1999000	the CFP, I immediately generated
1999000	2000880	this to prove it was still possible.
2002100	2002720	AppSecVillage,
2003040	2005120	a-v-s-v-d-c-31,
2005120	2006940	and if you decrypt the base64 value
2006940	2008920	in there, it has a funny little message for you.
2009280	2011000	Proof of concept. I get the F
2011000	2012980	out. There it is. I'm
2012980	2014520	not even done. This is the beginning.
2014780	2016820	If you see this right here, it says succeeded, right?
2016820	2019200	It's giving me a message. It definitely connected, right?
2019780	2020900	So what happens if
2020900	2023200	I start feeding that form malicious input?
2024980	2027260	Like the loopback interface.
2028280	2029040	This is
2029040	2030780	an external and internal port scanner
2030780	2032960	because it's
2032960	2034920	coming from that host.
2034960	2036860	All you need to do, and there's the Python script
2036860	2039000	for doing it, is to basically
2039000	2041040	iterate through every port
2041040	2043780	for your target host,
2043780	2045040	parse the return message
2045040	2046740	it gives you in that page,
2046740	2048460	and that's a port scanner.
2049200	2050540	If you have gone
2050540	2051600	out to your firewall
2052360	2054500	and disabled controls
2054500	2056400	or allowed firewall
2056400	2059520	rules from asterisk.screenconnect.com,
2059520	2060700	what have you done?
2060700	2062500	You've given me backdoor
2062500	2064560	access because it's
2064560	2066540	coming from somebody else's IP.
2066760	2068520	Don't believe I'm scanning the inside
2068520	2070600	of their network? Here you go.
2070600	2071980	Here's the URL.
2071980	2074760	If you use lb.corp.xyz
2074760	2076480	on the relay one, put in
2076480	2078280	the port box 3389
2078280	2080600	and click test.
2080640	2082800	Whatever you put in that teleprompter,
2082800	2084580	Ron Burgundy is going to read.
2084660	2086080	It resolves to
2086080	2088340	127.0.0.1
2088340	2090260	and it performs a TCP
2090260	2092540	connection to 3389.
2093880	2094760	Is that
2094760	2096560	externally accessible? No, it is
2096560	2097520	not.
2097780	2099320	I win.
2100500	2102260	And it all comes because
2102260	2104580	nobody understands the OSI
2104580	2106360	model. This is an
2106360	2108460	application using the network, but nobody
2108460	2110400	really thinks of what the network's doing.
2110520	2113180	Web applications are layer 7.
2113580	2114820	Network security
2114820	2116400	and that kind of stuff is
2116400	2117860	layer 2 and 3.
2118540	2120420	All of the things that I'm bypassing are
2120420	2122500	not anything web application developers tend to
2122500	2124480	think about. So, how
2124480	2126540	did I do this? How am I scanning behind
2126540	2129280	people's firewalls, beyond VLANs?
2129480	2130520	The only connectivity
2130520	2132880	between those two,
2132880	2134940	their internal network, me,
2134940	2137100	other ones, is a layer 7
2137100	2138060	traffic crafter
2138760	2140940	that is available on multiple
2140940	2142280	subnets.
2143300	2144040	Right?
2144620	2146880	It's weakly controlled and because I
2146880	2148940	can inject external IP
2148940	2150800	addresses in, or internal IP
2150800	2152800	addresses to external DNS,
2152800	2154720	if I feed it one of their internal
2154720	2157120	IP addresses for their cloud instance,
2157120	2158900	I am now tunneling HTTP
2158900	2160640	traffic or regular traffic
2160640	2163360	to stuff inside their firewall.
2164220	2164900	Does that make
2164900	2167100	sense? Not difficult, right?
2167200	2168440	Am I overblown?
2168440	2170200	I don't think so, right?
2170380	2172520	I should not be able to do this under
2172520	2175320	any circumstances. Ever.
2175380	2176180	Period.
2177800	2178840	So, there's your Python
2178840	2180660	script for doing it and that's how I scanned
2180660	2182220	their internal network with it.
2182960	2184760	So, you're probably at this point, great, you got a couple tools,
2184760	2185720	what's the big deal?
2186180	2188820	This is a blind server side request forgery, right?
2188820	2190340	Incorrect.
2190340	2193280	Everything is a proxy if you try hard enough.
2193440	2194580	Exactly.
2194680	2195740	Okay.
2195980	2198540	Well, when the content on the other side isn't
2198540	2200620	available, it actually
2200620	2202220	returns the HTTP
2202700	2204660	status code to you of
2204660	2206320	what just happened.
2206500	2208260	So, my arbitrary HTTP
2208660	2210380	request is now
2210380	2212380	getting back HTTP
2212380	2214620	status codes telling me what
2214620	2216460	happened. Isn't that
2216460	2218540	Durabuster? Isn't that
2218640	2220300	a brute force content enumerator?
2221060	2222460	So, if you want to enumerate
2222460	2224460	the content of anything,
2225040	2226480	there's my Python script. If you look
2226480	2228520	at the bottom, you just need a file with all your
2228520	2230600	directory names called content.txt
2231480	2232680	and it'll go through
2232680	2234580	and you'll get reliable return
2234580	2236680	codes out of all that. So, it's not so blind anymore,
2236680	2237440	is it?
2238760	2240440	Okay, here's the new thing that I
2240440	2242380	invented. I'm pretty sure I invented it.
2242380	2244740	Nobody knows. I've looked around about it.
2244740	2246720	Here's the crazy part, and this is one
2246720	2248460	of the things I know from 1980-something
2248460	2250900	or 90-something, sorry, more accurate.
2251500	2252780	Nobody actually
2252780	2254640	cares about the content of
2254640	2256820	HTTP status codes.
2257220	2258660	Right? How many
2258660	2260820	of you are actually saving anything
2260820	2263200	other than the three-digit numerical?
2264100	2265060	Right?
2266140	2266820	That's
2266820	2269100	IIS. That's Apache.
2269100	2270500	All they ever keep
2270500	2272580	are the three-digit status
2272580	2275140	codes. Now, here's the secret.
2276240	2276760	They
2276760	2277660	are entirely
2278680	2280240	attacker controllable.
2281560	2282720	I saw you look.
2282720	2284440	I'm going to prove it. Hold on.
2284980	2286800	Those status codes, the text
2286800	2288480	200, okay,
2288480	2290520	400, all those, the text that
2290520	2291420	appears after it
2292420	2294500	is not saved. Nobody looks
2294500	2296640	at it. Nobody wants to keep it.
2296680	2298580	So, what you can actually do
2299260	2300300	is inject
2300300	2302180	payloads into that
2302180	2304440	message, and if something
2304440	2306460	returns the text of that message
2306460	2308300	to you via server-side request
2308300	2310240	forgery, what have I just
2310240	2312040	done? I am now
2312040	2314340	directly injecting into
2314340	2315660	their web pages
2316300	2318360	my content hosted somewhere
2318360	2320420	else. Remember
2320420	2322620	that agent download? Going to become important.
2323360	2324260	It leaves
2324260	2326400	very few IOCs because nobody actually has
2326400	2328280	that, but think about it this way.
2328280	2330220	The IOCs that could tell you where that
2330220	2332240	is are on a third-party
2332240	2334380	server, and it...
2334380	2335920	I'm not going to speak...
2335920	2338120	It doesn't appear that they're monitoring this
2338120	2340300	because I've been doing it for a year,
2340300	2342300	and I've never been stopped.
2343560	2344460	That code,
2344460	2346020	right? So, I invented my own
2346020	2347580	HTTP status code called
2348280	2349140	666.
2353040	2354160	HTTP status
2354160	2356140	code 666 did not exist before
2356140	2357680	this moment, but
2357680	2360160	I am injecting into, as part
2360160	2361960	of that code, my
2361960	2364480	malicious page, or my malicious content.
2364600	2366160	All the controls that are supposed
2366160	2368040	to keep you from cross-site scripting and all those
2368040	2370420	other things immediately disappear. What?
2370420	2372200	Because this is directly integrated
2372200	2374520	into that web page's content.
2374900	2375600	It's not...
2375960	2378120	It's proxying it, but it's not like sending it directly
2378120	2380280	through. It's taking it, integrating it into that page
2380280	2382320	as its own web page code
2382320	2384000	and going.
2385200	2386000	Right?
2386640	2388000	Now, look at the thing at the bottom.
2388000	2390300	We used asterisk.screenconnect.com,
2390300	2392440	but we should have used screenconnect.com.
2392700	2394200	So, all of this is hosted,
2394200	2395220	or you can inject it through
2395220	2398880	www.screenconnect.com.
2399680	2400080	So, is
2400080	2402200	it a theory that I have a way of injecting malicious
2402200	2404080	code into anything on their pages?
2404680	2405880	Absolutely not.
2406080	2408100	So, all you really need to do is serve
2408560	2410440	666 as your error code,
2410440	2412800	put in a cross-site scripting payload,
2412800	2415260	and that is the world's simplest XSS.
2415500	2416800	What you need is the
2416800	2418820	Python listener to do this.
2419180	2421440	And it's on the left-hand side. That's the code.
2421820	2423020	So, all I did,
2423020	2424800	because their post requests can also
2424800	2426760	be submitted as GET requests,
2426760	2428640	I now have a client-deliverable
2429200	2430140	single URL
2430760	2433020	that will trigger all of this reliably.
2433960	2434720	Oh, wow, Ken,
2434720	2435880	you popped a one.
2436400	2437880	Get a lot more than that.
2438860	2440480	You can do all of this
2441420	2442420	just by doing that.
2442420	2443720	And that's the web page code.
2443720	2446400	I'm returning 666 via
2446400	2448180	that code, but if you see here in the input
2448180	2450220	field at the bottom where I highlighted it,
2450220	2452300	it's directly integrated into
2452300	2453720	the web page code.
2454840	2456220	Your browser thinks
2456220	2458320	this is legitimate content coming from
2458460	2459640	a trusted source.
2461240	2462520	So, how do you enumerate this?
2462520	2464300	How do you find this cool new way
2464300	2465180	of doing it?
2466220	2468260	I'm a big proponent of none of our information
2468260	2470300	or knowledge should be secret or esoteric
2470920	2472440	and this isn't all that hard to do
2472440	2474120	all this stuff, it's a matter of logic.
2474300	2476100	So, I like using free tools instead of
2476100	2478320	telling you to pay $15,000 for something.
2478320	2480120	It's very simple. There is a diagnostic
2480120	2481360	web page on the internet called
2482440	2483640	httpstat.us.
2483780	2486480	Whatever you put in the URL, it will return the error code
2486480	2488160	for whatever you put in there.
2488160	2490740	So, if you put 418 at the end of that,
2490740	2492300	it'll return a 418 code.
2492300	2494200	How many people know what a 418 code is?
2494200	2496920	How many people have actually ever used that in the real world?
2496920	2499380	Okay, you're like the three people I've ever met
2499380	2501480	that have ever actually used this for anything.
2501820	2503460	You're not a teapot.
2503460	2504780	You're a proxy.
2505620	2506880	Because if your
2506880	2508780	blind server-side request forgery
2508780	2510660	returns 418,
2510660	2512580	that's not something anybody uses.
2512580	2515660	That immediately tells you they're not sanitizing.
2516400	2517100	So, if you've got
2517200	2519180	a blind server-side request forgery like I do,
2519180	2521000	that's how I do it in Burp. That's exactly how
2521000	2523080	I do this. Run every status
2523080	2524660	code from 1 to 699
2524660	2526780	and if you get any sort
2526780	2528620	of code that means
2528620	2530840	anything, it's any kind of HTTP status code,
2530840	2532780	you're in. Now, here's
2532780	2534240	where it gets silly.
2535140	2536700	You have to understand what
2536700	2539200	this is happening. I call it sanitization depth.
2539280	2540560	On the right-hand side, you just have
2540560	2542520	my custom error. But,
2542520	2544600	the application completely
2544600	2546940	fails to actually sanitize
2546940	2548860	any of the data that I'm injecting
2548860	2550500	via that status code.
2551000	2553020	Character markup, anything.
2553020	2554820	So, if you remember my talk from last year,
2554820	2556720	I talked about how I figured out a way to do DNS
2556720	2558900	and HTTP exfiltration via this.
2559660	2560860	Malicious payloads that I want to
2560860	2563020	transmit over this, because it's a proxy,
2563820	2565140	I have all these characters
2565140	2567040	available, so now I can use Base64
2567620	2568760	and you can encode
2568760	2571260	anything as a Base64 payload.
2572280	2572820	So,
2573640	2574760	what do you do?
2575100	2577060	Well, if you want to tunnel live HTTP
2577060	2579420	traffic to bypass a content filter,
2579900	2581140	or you just want to traffic
2581140	2583540	files through connectwise port test,
2583540	2585140	aka proxy chains,
2585680	2587100	two one-way communication channels
2587100	2588780	equal one communicate, right?
2588780	2591320	So, all I'm doing, this Python script,
2591320	2594140	I inject an arbitrary
2594140	2595120	URL
2595120	2596880	in the web server thing,
2596880	2599040	and then what I'm actually putting at the end
2599040	2601060	is a Base64 encoded
2601060	2602400	URL.
2602720	2605020	My proxy hosted in Amazon
2605020	2607200	parses that,
2607200	2609040	goes out and retrieves
2609040	2610840	the web page I asked for,
2610840	2612240	and then returns it
2612840	2614840	inside that status code,
2614840	2617000	and I wrote a shim on the other side
2617000	2619420	that picks it up and parses it all.
2620460	2620980	In
2620980	2623120	23 lines of Python code.
2624300	2625200	It's really
2625200	2626920	that easy.
2626940	2629140	Now, think about this. I am inheriting
2629140	2630780	all the firewall rules.
2630820	2632900	How do I prove that at the only place on
2632900	2635680	Earth this could have come from was their server?
2636640	2636920	Well,
2636920	2638740	you can add to your Amazon EC2 rules
2638740	2641060	that the only IP address on the entire world
2641060	2642980	that can connect to that server that I'm serving
2642980	2645300	is their IP address.
2645520	2647020	Why did I do that?
2647040	2649060	Because if you've got third-party IR companies
2649060	2650960	trying to sniff around your stuff and you don't want them
2650960	2652880	finding it, putting up firewall
2652880	2654940	rules that prevent them from ever looking at what your
2654940	2656980	payloads look like is a pretty good idea.
2659360	2660740	So, again, I've
2660740	2662920	whitelisted ScreenConnect.com including domain
2662920	2664920	names. So now
2664920	2667080	it's basically an open network
2667080	2667920	tunnel.
2668800	2671020	So if you want to build a content filter bypass
2671020	2673080	or just run a proxy, you can do
2673080	2675020	the same exact thing. Now, here's
2675020	2677020	why it's important to inherit
2677020	2679200	all these firewall rules. If you're in a
2679200	2681860	highly secure critical infrastructure environment,
2681860	2683240	many times the only
2683240	2685200	IP address or network traffic you are allowed to
2685200	2687220	pass outside the house is to the
2687220	2689820	remote management software.
2689820	2691180	Anything else gets dropped. Anybody else run
2691180	2692940	their stuff like that? A lot of people run that, especially in
2692940	2694360	high availability environments.
2694840	2696940	So now that I have this available, I
2696940	2699020	can now tunnel out to the internet and hence
2699020	2700960	the world via that status
2700960	2703060	code. It's the only
2703060	2705160	IP it can go, so I put something up in my Amazon
2705160	2706940	instance that picks up the request and does
2706940	2708600	all the HTTP stuff.
2709460	2711020	Right? Not a bit
2711020	2712520	of social engineering so far,
2712520	2715000	which was their big concern. Oh, you need
2715000	2717160	social engineering for all of this. No.
2717580	2718980	So all you really need to do is start
2719080	2720560	a free EC2 server. I
2720560	2722300	prefer elastic ones because
2722300	2724920	they are anywhere and you can sign up anonymously
2724920	2726280	and don't cost you a dollar.
2726280	2728100	You just host this scripting
2728100	2730540	out there, make a firewall rule that says
2730540	2732580	the only thing it can attach via HTTP
2733540	2734500	on port 80
2734500	2736080	is this. Serve that code
2736080	2738020	and you win.
2739280	2740440	So I've been serving
2740440	2742660	malicious POC and assigned executables
2742660	2744300	to their cloud instance since January
2744300	2746480	2023. My warning
2746480	2748600	to you is this. Whatever you do,
2748600	2750500	and I seriously mean this because I'm not that guy.
2750500	2752760	I'm an ethical go-by-the-books person.
2752920	2754220	Do not click that URL
2754220	2756500	or put it in while you put
2756500	2758540	the Xs in because if you do, it will install
2758540	2760540	without clicking a remote install agent
2760540	2762460	on your computer. And
2762460	2764480	it's a frame, right? I can inject that via frame
2764480	2766040	without ever downloading, right?
2766600	2768660	So let's talk about social engineering. What is social
2768660	2770620	engineering? Tactic of manipulating,
2770620	2773280	influencing, deceiving a victim in order to gain control,
2773280	2775380	steal personal financial information,
2775380	2776300	it uses psychological
2776300	2778340	manipulation to trick users into making
2778340	2779840	security mistakes, right?
2780340	2782380	So if I can register your old
2782380	2783380	domain,
2784620	2786280	send somebody that cross-site
2786280	2788320	scripting payload, and load it off
2788320	2791480	of what used to be your FQDN,
2791480	2792080	that's barely
2792080	2793520	social engineering.
2793960	2796320	The agent doesn't have any framing invitations,
2796320	2798360	right? So why not
2798360	2800520	start injecting a frame instead?
2801200	2802200	So my
2802200	2803640	payload is actually
2804240	2806200	serving an iframe.
2806900	2807720	But I use
2807720	2810220	the hidden tag, right?
2810600	2811760	You inject the frame,
2811760	2813760	it automatically downloads, all
2813760	2815740	of that gets bypassed. That's
2815740	2817840	literally how you do it. It's barely social engineering
2817840	2819060	at this point, right?
2819580	2821680	So what if you have some company sniffing around your
2821680	2823440	work and you don't want them finding it?
2823440	2825620	Well, the simple elaboration for Tradecraft is
2825620	2827640	just to use the hidden tag. So if anybody
2827640	2829920	actually finds that page, they won't actually see it.
2829920	2831740	And the psychological trick of all of this
2831740	2833660	is what? I have total
2833660	2836080	control of the HTML content in there.
2836080	2837700	It doesn't check CSRF
2837700	2839320	any of that to get requests.
2839320	2842020	So I simply just started rewriting the web page.
2843140	2843760	At the
2843760	2845720	bottom of that it says, please wait
2845720	2847480	while the PortConnect client is downloaded
2847480	2849860	to your computer. So my trick is
2849860	2851580	I send it to a port test page and say it's
2851580	2853620	an installable port testing module.
2853920	2855580	They download the agent and
2855580	2857520	it loads on my machine, gives me full system
2857520	2858840	access to the endpoint.
2860020	2861280	Don't believe me?
2863700	2865580	Give this video a watch.
2866800	2867680	So this
2867680	2868840	is me grabbing
2869540	2872120	the URL as if I would send it to somebody,
2872120	2873420	putting it in here
2873420	2875880	and literally it's the same thing you're seeing.
2876120	2877520	See how it says 666? I'm
2877520	2879380	just showing you what the URL is. There's no tricks up
2879380	2881460	my sleeve. I'm not playing any games.
2882120	2883100	Hit enter.
2886000	2887660	And I'm showing you this.
2887660	2889300	All of the antivirus is turned
2889300	2891360	on on this computer. All of the
2891360	2892680	controls are there.
2894060	2895660	It just downloaded.
2897180	2899480	Open it up. I'll refresh
2899480	2901220	it here just to show you that's how it
2901220	2903660	downloads. Open it up.
2903900	2905340	That's the HTTP request
2905340	2907540	executing. I'm
2907540	2909140	going to show you the details and you're going to see
2909140	2911020	that's all the content I put in there. I
2911020	2912560	injected from my server.
2913520	2915280	Watch it one more time. Here's the
2915280	2917400	important part. See this
2917400	2919860	right here? You'll see it in a second.
2922590	2923390	I need to
2923390	2925330	hurry up about six months ago on this.
2925330	2927250	That's signed by their
2927250	2929410	controlled thing. Running that
2929410	2931090	it looks fine.
2931270	2932830	And now what am I doing?
2933450	2935170	I'm waiting for my attacker
2935170	2936950	to connect to the machine.
2937070	2939050	Because it's calling back to my rogue connect
2939050	2941210	wise instance in their cloud that I signed up
2941210	2943230	for anonymously and it's loading
2943230	2945070	up stuff on their computer.
2945470	2947150	As system.
2949770	2950950	That's how it's done.
2951250	2952130	Like I said,
2952770	2953850	thank you.
2955410	2956450	There it is.
2956450	2958590	And literally from this you now have access to everything.
2958590	2960170	You load everything up and if you go back and read
2960170	2962730	the Iranian APTs this is exactly their trampoline
2962730	2963930	and everything else.
2964330	2966410	It will either stay once or if on my end I just
2966410	2967810	click persist.
2967910	2969810	Maintain a shell. It will do it.
2971210	2972610	Cool. Thank you for the applause.
2972610	2974970	That was a moment for me because I worked
2974970	2977130	really hard on this and it was a really rough time.
2977770	2979830	I successfully exploited it.
2979830	2981330	But there's more.
2982230	2983190	I'm not telling
2983190	2985970	everything. I'm just going to show you some stuff.
2987510	2987930	Connect wise
2987930	2989550	applications even beyond this use
2989810	2990830	a client application
2991810	2993510	that is really just a
2993510	2997130	wrapped web browser.
2997130	2997610	You can figure
2997610	2999590	this out by looking at their web page and they
2999590	3003830	parse what the user agent tags are.
3003830	3005170	That client is absolutely
3005170	3007310	exploitable because it's an old browser
3007790	3009490	but nobody realizes
3009490	3011310	it's a browser so
3011310	3013230	there are tons of ways of going
3013230	3015450	through connect wise, not this, the other parts
3015450	3017390	of the system to deliver
3018050	3019330	client side exploits
3020170	3021970	without user interaction.
3023090	3023990	That's one thing.
3023990	3025430	I'm not sharing that yet because it's
3025430	3027890	cool and it's another cool thing that nobody's ever done before.
3028090	3029350	Now I want you to think, and this is the
3029350	3031370	important part, I want you to think about this
3031370	3032870	as application developers.
3036430	3037470	Who leaves
3037470	3040130	debugging symbols on when you compile code?
3042530	3043490	So the
3043490	3045030	click once installer that they provided
3045030	3046890	if you carve through the metadata
3047750	3049490	software bill of materials, software
3049490	3051250	supply chain attacks, all that stuff I do
3052050	3053570	what they've left in here
3053570	3055290	was the absolute drive path
3055290	3056990	including username for the profile
3056990	3059590	source, stream connect work
3059590	3061410	misc, bootstrapper,
3061410	3063310	release, click once runner.
3064270	3065370	The source is where
3065370	3067050	the source code is stored.
3067050	3069250	Right? I have
3069430	3071170	a username of somebody who can
3071170	3073270	actually get to that and compiles
3073270	3075250	it. I know what
3075250	3077270	they're doing and I'm going
3077270	3079270	to mic drop after the next slide
3079270	3081290	on this. There is
3081470	3083130	a lot of metadata embedded
3083130	3084830	in their software and applications
3084830	3087430	that will allow you to map their internal
3087430	3088370	network.
3092270	3093690	This is the thing I'll come out is
3093690	3095730	I love attacking developers and I love
3095730	3097770	exploiting developer weaknesses because
3097770	3099630	you all have something like this.
3100290	3101970	So, wrapping up.
3102650	3103750	Should companies, and this is where
3103750	3105690	it comes down to, this is all cool, this is new stuff, whatever
3105690	3107710	it's like, one, should
3107710	3109670	companies be responsible, and that's the question I get,
3109670	3111490	responsible for their own disclosure analysis of
3111490	3113630	vulnerabilities? I don't know.
3114430	3115670	I can tell you that I shouldn't
3115670	3117750	have been the person that registered the CVEs and it certainly
3117750	3119450	wasn't overblown in my eyes.
3119730	3121730	So here's my trick I'm going to tell you. Learn how
3121730	3123710	the CVE system reporting works.
3124210	3126570	So if a company is a
3126990	3127950	CNA and they won't
3127950	3130030	give you your CVE, what you can do is
3130030	3132490	go to MITRE, who's a CNA of last resort,
3132490	3134890	and they'll issue it to you if you're correct.
3134890	3137090	Which is why I went to MITRE.
3137230	3138490	So if you're a bug hunter
3138490	3140190	or somebody who's doing this and the program
3140190	3142870	won't give it to you, you can just go to MITRE and say
3142870	3146270	rectify this for me.
3146270	3146810	Yes,
3146810	3148890	you were just certified, yes.
3147730	3149730	Follow that.
3148890	3150930	A magic bullet
3150930	3153110	of this isn't a big deal won't fix anything.
3153750	3154910	All of you need to start
3154910	3157350	thinking holistically how the system gets put together.
3157350	3158930	Because like I said, it's an application
3158930	3160890	problem, it's the network problem,
3160890	3162690	but it's really a lack of understanding.
3163270	3164890	Two last things, I'll get off, give me two
3164890	3166830	seconds. Bug bounty programs
3166830	3168970	and responsible disclosure are totally killing employment
3168970	3170890	in the industry because why would anybody hire
3170890	3173030	you full time when they can get the milk for free?
3173170	3175330	Or for a t-shirt and 500 bucks?
3175590	3177010	If you want more jobs in this
3177010	3179430	industry, stop taking the quick payday.
3179430	3181190	Put your CVEs that you register
3181190	3183010	on your resume and that is money that will
3183010	3185270	pay off on your salary for the rest of your life.
3185930	3186970	Trust me,
3186970	3189010	I've got hundreds. Last thing, I'll
3189010	3191210	say this, ask yourself
3191210	3193070	this, I'm not a bad person, I don't turn bad,
3193070	3195310	but think about it this way as all of you.
3195470	3197310	If I have to stare these people down,
3197310	3198990	fly out to Las Vegas, do a press
3198990	3201130	whatever, just for a few
3201130	3203030	words of acknowledgement on a website, why
3203030	3204350	would I ever help them again?
3205270	3207470	Think about that as an application designer.
3208070	3209030	Be more open.
3209210	3211430	Thank you very much guys, that puts everybody else at risk.
3211430	3212590	Thank you very much, I appreciate it.
