Latest / CyberCode Academy / Course 12 - Maltego Advanced Course | Episode 4: Custom Entity Design and Implementation in Maltego
Transcript
- 0:00Speaker 1: Welcome to the deep dive, the shortcut to being well informed. Today,
- 0:04Speaker 1: we are getting into the architecture of information itself.
- 0:07Speaker 2: We are.
- 0:08Speaker 1: I mean, if you're in complex investigations, cybersecurity, even data science,
- 0:12Speaker 1: you know that the standard software labels things like IP
- 0:16Speaker 1: address or email, they just don't always cut it right.
- 0:20Speaker 2: You run into these unique, specialized bits of data and
- 0:23Speaker 2: you need a way to integrate them properly into your
- 0:25Speaker 2: analysis platform.
- 0:26Speaker 1: So that's the challenge we're tackling.
- 0:28Speaker 2: That is the essential challenge. Yeah, when you're tracking, say
- 0:31Speaker 2: a fraud ring or a specific piece of malware, you
- 0:33Speaker 2: might find some kind of proprietary ID or a custom
- 0:37Speaker 2: role that your software just sees as generic text.
- 0:41Speaker 1: And it has no idea what to do with it exactly.
- 0:43Speaker 2: So our mission today is to wank you through the
- 0:45Speaker 2: methodical process of creating what we call a custom entity,
- 0:50Speaker 2: a specialized piece of information within one of these major
- 0:53Speaker 2: analysis platforms.
- 0:55Speaker 1: And this isn't just about making it look different, right.
- 0:57Speaker 1: This process actually defines its functionality.
- 1:00Speaker 2: It absolutely does.
- 1:01Speaker 1: We're talking about designing a data type that's smart enough
- 1:03Speaker 1: to know what analysis actions or transforms it can even perform.
- 1:08Speaker 2: Precisely. We're going to uncover the systematic steps, from crucial
- 1:13Speaker 2: naming conventions all the way to advance features like dynamic visuals.
- 1:18Speaker 2: The goal is an entity that's both informative and really
- 1:21Speaker 2: efficient for the investigator.
- 1:23Speaker 1: If you can master this, you move from just being
- 1:25Speaker 1: a user of the tools to being a creator of
- 1:28Speaker 1: intelligence assets.
- 1:29Speaker 2: That's a great way to put it. So let's start
- 1:31Speaker 2: with the foundation. What exactly is an entity in this context?
- 1:35Speaker 1: It's essentially a set of rules. You can think of
- 1:37Speaker 1: it as a specification that lives on the client's machine.
- 1:40Speaker 1: It tells the software two main things. Okay, first how
- 1:43Speaker 1: this piece of information should look to the user it's
- 1:45Speaker 1: visual representation, and second what it can do, meaning which
- 1:50Speaker 1: transforms or analysis actions are available for it.
- 1:53Speaker 2: And every single entity has to have at least one
- 1:55Speaker 2: property we're not to called the main property.
- 1:57Speaker 1: That's the core value.
- 1:58Speaker 2: That's the core value, and you'll interact with the most
- 2:01Speaker 2: Any other information you want to add, like a status
- 2:04Speaker 2: or a location, you can display right on the graph
- 2:07Speaker 2: using these things called overlays.
- 2:08Speaker 1: Now, before we even start building, the one thing I
- 2:11Speaker 1: saw stressed over and over was naming convention. It's absolutely critical.
- 2:15Speaker 1: Why is that technical id so important.
- 2:17Speaker 2: It's all about preventing conflicts, especially if you ever plan
- 2:20Speaker 2: to share your work or your transforms with anyone else.
- 2:24Speaker 2: Every entity needs a completely unique type.
- 2:26Speaker 1: ID, and the standard ones have their own prefix.
- 2:29Speaker 2: Yes, the platform standard entities, they always start with multig
- 2:33Speaker 2: that's multigo dot. It works like a name space, you know,
- 2:36Speaker 2: to keep things separate.
- 2:37Speaker 1: So for our custom entities, we need our own distinct
- 2:41Speaker 1: name space exactly.
- 2:43Speaker 2: The recommended way to do it is to start with
- 2:45Speaker 2: a unique identifier for your organization, maybe followed by a
- 2:48Speaker 2: category and then a short name.
- 2:50Speaker 1: Can you give an example.
- 2:51Speaker 2: Sure, Let's say you work for an organization called in
- 2:53Speaker 2: vecta Tech. You might create an entity ID like investitech,
- 2:57Speaker 2: dot gov, dot customer. That unique ID prevents so many
- 3:00Speaker 2: headaches down the road.
- 3:01Speaker 1: Walk us through what happens if you ignore that. Let's
- 3:04Speaker 1: say two different teams in my company both decide to
- 3:07Speaker 1: create a new entity and they just call it customer.
- 3:09Speaker 2: Oh, that's a recipe for disaster. Yeah. I mean if
- 3:12Speaker 2: one team's customer expects a Social Security number and the
- 3:15Speaker 2: other expects a customer ID. What happens when you try
- 3:18Speaker 2: to merge your data?
- 3:19Speaker 1: The software has no idea which one is which it is?
- 3:21Speaker 2: No idea, you get entity collisions, data gets lost, transforms
- 3:25Speaker 2: start failing because they're looking for properties that just aren't there.
- 3:29Speaker 2: It's a mess.
- 3:29Speaker 1: So even for personal use, you should use a prefix always.
- 3:33Speaker 2: Even something simple like my do worker is enough to
- 3:36Speaker 2: keep things clean.
- 3:37Speaker 1: Okay, that makes the risk very clear. Let's actually create
- 3:40Speaker 1: that basic worker entity. Now we're modeling an employee. What's
- 3:44Speaker 1: step one?
- 3:45Speaker 2: First we need to give it a human readable name
- 3:47Speaker 2: and some context. So step one identification, you set the
- 3:51Speaker 2: display name what the user actually sees like worker and
- 3:55Speaker 2: a short description, maybe a person working at a job.
- 3:58Speaker 1: And that description shows up in the endity palette.
- 4:00Speaker 2: It does. It's the first piece of guidance for any
- 4:02Speaker 2: analyst using it.
- 4:03Speaker 1: Okay, So then step two classification. This is where that
- 4:08Speaker 1: unique name space comes in.
- 4:09Speaker 2: Right, that's it. You enter the unique type name, our
- 4:12Speaker 2: secure ID, my dot worker. Then, just to keep things
- 4:17Speaker 2: organized in the tool, you pick a category something like personal.
- 4:20Speaker 1: And finally step three visuals, Right.
- 4:24Speaker 2: You pick an icon that will show up on the graph.
- 4:26Speaker 2: We could use a standard person icon, maybe find one
- 4:29Speaker 2: with a little gear on it to show they're a worker.
- 4:31Speaker 1: All right, Now for the most important part defining the
- 4:34Speaker 1: main property.
- 4:35Speaker 2: This is the critical field absolutely for our worker, we'll
- 4:38Speaker 2: give it a display name of worker name and a
- 4:41Speaker 2: unique name of just name. Then we have to pick
- 4:44Speaker 2: a data type like string integer exactly, string date integer
- 4:48Speaker 2: double for a name, string is almost always the right choice.
- 4:51Speaker 1: Now, you mentioned the sample value, like putting John Doe
- 4:54Speaker 1: in there. Why is that so important? It feels like
- 4:57Speaker 1: just a placeholder.
- 4:57Speaker 2: It's much more than that. It's really an enforce hint.
- 5:00Speaker 2: When an analyst drags that new worker entity onto the graph,
- 5:03Speaker 2: it comes pre filled with John Doe.
- 5:05Speaker 1: Ah, so it shows them the form out of the
- 5:07Speaker 1: data you're expecting.
- 5:08Speaker 2: Precisely. If your entity needs a complex sixteen digit alphanumeric key,
- 5:14Speaker 2: putting a valid example in the sample value shows the
- 5:17Speaker 2: user exactly what to type. It drives consistency from the
- 5:21Speaker 2: very first click.
- 5:22Speaker 1: That's a great little detail for ensuring data quality. Okay,
- 5:24Speaker 1: let's talk about a huge efficiency booster. Inheritance. This is
- 5:28Speaker 1: where we stop building from scratch.
- 5:30Speaker 2: Inheritance is just a foundational concept in good software design,
- 5:34Speaker 2: and it's invaluable here. It lets your new specialized entity
- 5:37Speaker 2: just absorb all the properties and most importantly, all the
- 5:41Speaker 2: transforms from an existing base entity.
- 5:43Speaker 1: Can you give us a classic network example?
- 5:45Speaker 2: Of course, think about a standard DNS name entity. It
- 5:48Speaker 2: already knows how to run transforms like find the IP
- 5:51Speaker 2: address or look up the registrar. Okay, Now, if you
- 5:54Speaker 2: create a more specific website entity and you tell it
- 5:57Speaker 2: to inherit from DNS name your website entity, he automatically
- 6:00Speaker 2: gets all those lookups. You don't have to write a
- 6:02Speaker 2: single line of new code.
- 6:04Speaker 1: So I'm saved from rewriting an IP lookup transform for
- 6:07Speaker 1: every new kind of website or domain data I create.
- 6:10Speaker 2: You are, But here's where the specialization comes in. Because
- 6:13Speaker 2: a website is more specific than a DNS name, you
- 6:16Speaker 2: could add transforms to it that wouldn't make sense on
- 6:19Speaker 2: the generic one, Like what well, a website entity could
- 6:22Speaker 2: have a transform like find email addresses on the homepage
- 6:26Speaker 2: that requires scanning web page content, which is something a
- 6:30Speaker 2: generic DNS name entity just shouldn't be doing.
- 6:33Speaker 1: That sounds incredibly powerful, But what's the biggest trap here?
- 6:37Speaker 1: Is there a risk of doing it wrong?
- 6:38Speaker 2: The trap is the main property. It's a huge one.
- 6:41Speaker 2: Let's say we want our worker entity to be compatible
- 6:44Speaker 2: with all the standard person related transform.
- 6:47Speaker 1: By public record lookups exactly.
- 6:49Speaker 2: So we should inherit from the built in multi got
- 6:52Speaker 2: person entity. But here's the crucial limitation. When you do that,
- 6:56Speaker 2: you have to decide right then and there if you
- 6:59Speaker 2: want to reuse the person entity's main property, which is
- 7:02Speaker 2: probably full name.
- 7:03Speaker 1: And what if I get it wrong. Say I decide
- 7:05Speaker 1: later that I actually needed the worker's I D number
- 7:07Speaker 1: as the main property, not their name.
- 7:09Speaker 2: You cannot change it. The main property cannot be changed
- 7:12Speaker 2: after the entity is created. You have to delete the
- 7:15Speaker 2: entire entity definition and start over from scratch.
- 7:17Speaker 1: Wow, so all the other properties I might have added,
- 7:20Speaker 1: they're gone.
- 7:20Speaker 2: Too, all gone. That choice is set in stone the
- 7:23Speaker 2: second you click create. It really underlines why that upfront
- 7:27Speaker 2: design and systematic approach is so non negotiable.
- 7:31Speaker 1: Okay, that is a high stakes moment to remember. So
- 7:34Speaker 1: now that we have foundations and inheritance, let's talk about
- 7:37Speaker 1: maximizing the data's utility and reliability.
- 7:40Speaker 2: Reliability really comes down to how you define your properties. See,
- 7:44Speaker 2: transforms can often return extra bits of information, which we
- 7:46Speaker 2: call dynamic properties, and those are useful, but but you
- 7:49Speaker 2: should never rely on them as input for your next
- 7:52Speaker 2: analysis step. If you need a piece of data to
- 7:55Speaker 2: be reliably present For another transform to work, you absolutely
- 7:58Speaker 2: must define it in the entity specification itself.
- 8:01Speaker 1: And what kind of specialized property types can we use
- 8:04Speaker 1: beyond just strings and numbers?
- 8:06Speaker 2: Well, there are some really useful ones like boolean, color,
- 8:08Speaker 2: and ur. And the type isn't just a label, It
- 8:12Speaker 2: actually changes the user interface. How so a date type
- 8:15Speaker 2: gives you a calendar picker, a color type gives you
- 8:18Speaker 2: a color wheel that spits out an HTML code. A
- 8:21Speaker 2: boolean is just a simple checkbox. They enforce correct data entry.
- 8:25Speaker 1: That's smart. Now, to really maximize utility, we have to
- 8:29Speaker 1: talk about calculated properties. How do we make one property
- 8:33Speaker 1: get its value automatically from other properties?
- 8:36Speaker 2: This is how you ensure data cleanliness without any manual work.
- 8:40Speaker 2: Calculated properties use special functions, usually in the property's default
- 8:44Speaker 2: value field. Imagine you have separate fields for first name
- 8:47Speaker 2: and last.
- 8:47Speaker 1: Name, but you need a single clean full name field
- 8:50Speaker 1: for a report.
- 8:51Speaker 2: Exactly, so we use special annotations to stick them together.
- 8:54Speaker 2: We'd use property to grab the value from the first
- 8:57Speaker 2: name field, add a space, then use property again for
- 9:00Speaker 2: the last name.
- 9:00Speaker 1: But what if one of those fields is empty? You
- 9:02Speaker 1: could end up with a stray space.
- 9:04Speaker 2: And that's where the other critical annotation, TRIM comes in.
- 9:07Speaker 2: You wrap the entire calculation in TRIM and it automatically
- 9:10Speaker 2: removes any leading or trailing white space. It guarantees clean
- 9:13Speaker 2: display ready data every single time.
- 9:16Speaker 1: Excellent clean data is actionable data. Let's move on to
- 9:20Speaker 1: the visuals. I love this idea that an entity's icon
- 9:24Speaker 1: can literally change based on its data.
- 9:26Speaker 2: It's a huge workflow accelerator. You can set the large
- 9:29Speaker 2: image on the graph to dynamically pull from the value
- 9:32Speaker 2: of one of its properties.
- 9:33Speaker 1: So if a property's value is say danger, and I
- 9:37Speaker 1: have an iconfile named danger dot png.
- 9:40Speaker 2: The platform will instantly display that icon on the graph.
- 9:44Speaker 2: It's incredibly powerful for at a glance analysis.
- 9:46Speaker 1: And what about the overlays you mentioned? How do we
- 9:48Speaker 1: use those without making the graph unreadable?
- 9:52Speaker 2: That is the key question. Overlays are small visual cues
- 9:56Speaker 2: you can place in five spots around the entity. They
- 9:59Speaker 2: can show text, color dot, or even a small image.
- 10:02Speaker 2: But you have to beware the Christmas tree effect.
- 10:04Speaker 1: The Christmas tree effect, too many lights, too much noise.
- 10:07Speaker 2: Exactly that. I've seen graphs where every entity has four
- 10:10Speaker 2: different color dots and you need a legend to figure
- 10:13Speaker 2: out what you're even looking at.
- 10:14Speaker 1: So the rule is only use an overlay if it
- 10:16Speaker 1: provides genuinely critical information for an instant decision.
- 10:20Speaker 2: That's the rule. A single red dot for critical status perfect,
- 10:24Speaker 2: A rainbow of colors for different data sources. Probably not helping.
- 10:28Speaker 1: Okay, there's one more advanced concept we need for making
- 10:31Speaker 1: sure our data is reliable from the moment it's entered.
- 10:34Speaker 1: Regular expressions ah rej as.
- 10:38Speaker 2: It plays a massive role in validating data. It has
- 10:40Speaker 2: two main jobs here, matching and extraction.
- 10:44Speaker 1: Matching seems straightforward. It's how the platform recognizes an email
- 10:47Speaker 1: address when I paste it in right.
- 10:49Speaker 2: That's it. You paste a random string and the platform
- 10:52Speaker 2: runs it against the library of ridgix patterns to see
- 10:55Speaker 2: if it matches the format of an email or a
- 10:57Speaker 2: phone number or an IP address, and then it creates
- 10:59Speaker 2: the right entity automatically.
- 11:01Speaker 1: An extraction that sounds more involved.
- 11:03Speaker 2: It is. Using rejx groups, you can match a complex
- 11:06Speaker 2: piece of data like a GPS coordinate in a single
- 11:09Speaker 2: string and parse it on the fly. You capture the
- 11:12Speaker 2: latitude part in one group and the longitude in another,
- 11:14Speaker 2: and route those values into separate properties on.
- 11:17Speaker 1: Your entity, so it validates and organizes the data in one.
- 11:20Speaker 2: Shot, exactly ready for analysis right away.
- 11:23Speaker 1: Okay, let's bring all this home. Let's build our advanced
- 11:25Speaker 1: worker entity inheriting from that Multigo Dot person entity and
- 11:30Speaker 1: using all these cool dynamic features.
- 11:32Speaker 2: Right. So, first we define three extra properties to describe
- 11:35Speaker 2: our worker, gender, skin, tone, and job. We're going to
- 11:40Speaker 2: mark them as required to force the analysts to fill
- 11:43Speaker 2: them in, and we'll give them good defaults like unknown.
- 11:46Speaker 1: Now for the magic, the part that drives that dynamic icon,
- 11:51Speaker 1: we need to create a pointer that combines those three
- 11:53Speaker 1: variables into one string.
- 11:55Speaker 2: Yes, we add a fourth property, let's call it combined,
- 11:58Speaker 2: and this is key. We mark this property is hidden
- 12:00Speaker 2: and read only. The analyst should never see it or touch.
- 12:03Speaker 1: It, and its default value is a calculated property.
- 12:06Speaker 2: Correct. We said it's default value to a function that
- 12:08Speaker 2: concatenates the others with underscores. So property gender, property, skin, done, property.
- 12:13Speaker 1: Job, and that resulting string like female medium programmer is
- 12:16Speaker 1: designed to perfectly match the file name of a custom
- 12:19Speaker 1: icon we've loaded.
- 12:20Speaker 2: That's the connection. That calculated string becomes the direct pointer
- 12:24Speaker 2: to the visual element. We then go into the entity's
- 12:27Speaker 2: display settings and tell a large image to use the
- 12:31Speaker 2: value of our combined property.
- 12:32Speaker 1: So the system handles the visual taxonomy automatically based on
- 12:36Speaker 1: the data. A huge efficiency game.
- 12:38Speaker 2: It's massive. And to finish it off, we can display
- 12:41Speaker 2: the job titled directly on the entity using an overlay.
- 12:44Speaker 1: Okay, how do we set that up?
- 12:45Speaker 2: We set the north overlay location to display the job property.
- 12:49Speaker 2: But here's the crucial setting. You have to make sure
- 12:52Speaker 2: the overlays type is set to text.
- 12:54Speaker 1: Ah, because if you leave it as the default, which
- 12:57Speaker 1: is image, it'll look for an icon file name programmer
- 13:00Speaker 1: and find nothing.
- 13:01Speaker 2: And display nothing. You set it to text and it
- 13:04Speaker 2: displays the actual job title clear as day.
- 13:06Speaker 1: So what we have now is an advanced worker entity.
- 13:09Speaker 1: It inherits all the standard person functions, but it has
- 13:12Speaker 1: its own specialized dynamic personality, all driven by structured and
- 13:16Speaker 1: calculated properties.
- 13:18Speaker 2: It's a perfect blueprint for building reliable, intelligent data types.
- 13:21Speaker 2: And you know, one last pro tip. You could even
- 13:24Speaker 2: hide this entity from the main palette if you want.
- 13:26Speaker 1: Why would you do that?
- 13:27Speaker 2: You do it if the entity is very complex and need,
- 13:30Speaker 2: say a database key to be valid, you force it
- 13:33Speaker 2: to be created only by a specific transform, which guarantees
- 13:36Speaker 2: its structural integrity from the start.
- 13:39Speaker 1: So designing these custom entities, it's really a structured exercise
- 13:42Speaker 1: and reliability and clear communication. It's about turning messy specialized
- 13:47Speaker 1: data into a real asset.
- 13:49Speaker 2: Indeed, we saw how a specialized website entity can just
- 13:53Speaker 2: automatically use transforms made for a generic DNS name just
- 13:57Speaker 2: by inheriting from it. So here's something for you to
- 14:00Speaker 2: think about. If you were designing a new entity for
- 14:03Speaker 2: a very specific type of malware and you wanted it
- 14:06Speaker 2: to automatically use analysis tools that were designed for generic
- 14:09Speaker 2: software files, what would you need to do to its
- 14:12Speaker 2: entity definition to make sure you get that essential cross compatibility.
- 14:15Speaker 1: We hope this deep dive helps you structure your own
- 14:18Speaker 1: custom data for better, faster analysis. Until next time,