Difference between revisions of "TruxtonObject"
| (28 intermediate revisions by the same user not shown) | |||
| Line 5: | Line 5: | ||
Creates a record in the <code>[DatabaseTableName]</code> table to help [[Identifying Databases|identify a database file]]. | Creates a record in the <code>[DatabaseTableName]</code> table to help [[Identifying Databases|identify a database file]]. | ||
| − | ==<code>carvefile(file_id: | + | ==<code>addtriagefile(type: int, name: str, description: str, why: str) -> boolean</code>== |
| + | Creates a record in the <code><nowiki>[</nowiki>[[TriageFile Table|TriageFile]]<nowiki>]</nowiki></code> table to specify the files and folders used in a [[Triage]] load. | ||
| + | You supply the name of the file or folder, which can be a [https://en.wikipedia.org/wiki/Regular_expression regular expression], a description of the file and a reason why it should be part of the Triage. | ||
| + | [[Python_Sample_Triage_File|Here's]] and example of how to use it. | ||
| + | |||
| + | The values for <code>type</code> can be: | ||
| + | {| class="wikitable" | ||
| + | ! Value | ||
| + | ! Meaning | ||
| + | |- | ||
| + | | style="text-align:center;" | 1 | ||
| + | | The <code>name</code> is the name of a file | ||
| + | |- | ||
| + | | style="text-align:center;" | 2 | ||
| + | | The <code>name</code> is the name of a folder | ||
| + | |- | ||
| + | | style="text-align:center;" | 5 | ||
| + | | The <code>name</code> is [https://en.wikipedia.org/wiki/Regular_expression regular expression] pattern for a file | ||
| + | |- | ||
| + | | style="text-align:center;" | 6 | ||
| + | | The <code>name</code> is [https://en.wikipedia.org/wiki/Regular_expression regular expression] pattern for a folder | ||
| + | |} | ||
| + | |||
| + | ==<code>carvefile(file_id: str | UUID) -> boolean</code>== | ||
Will tell the carver to carve the contents of the given file identifier. | Will tell the carver to carve the contents of the given file identifier. | ||
Carved files will be added as child files. | Carved files will be added as child files. | ||
| Line 28: | Line 51: | ||
Creates a [[Hash Set|hash set]] file from the unique hashes in Truxton. | Creates a [[Hash Set|hash set]] file from the unique hashes in Truxton. | ||
| − | ==<code>createinvestigationhashset(investigation_id: | + | ==<code>createinvestigationhashset(investigation_id: str | UUID, output_filename: str) -> boolean</code>== |
Creates a [[Hash Set|hash set]] file from the unique hashes in the given investigation. | Creates a [[Hash Set|hash set]] file from the unique hashes in the given investigation. | ||
| − | ==<code>createmediahashset(media_id: | + | ==<code>createmediahashset(media_id: str | UUID, output_filename: str) -> boolean</code>== |
Creates a [[Hash Set|hash set]] file from the unique hashes in the given media. | Creates a [[Hash Set|hash set]] file from the unique hashes in the given media. | ||
| Line 41: | Line 64: | ||
This will return a [http://en.wikipedia.org/wiki/JSON JSON] string integer strings mapped to the names of the [[DATA_TYPE|data types]]. | This will return a [http://en.wikipedia.org/wiki/JSON JSON] string integer strings mapped to the names of the [[DATA_TYPE|data types]]. | ||
The name corresponds to the <code><nowiki>[</nowiki>Name<nowiki>]</nowiki></code> column of the <code><nowiki>[</nowiki>DataType<nowiki>]</nowiki></code> table in the database. | The name corresponds to the <code><nowiki>[</nowiki>Name<nowiki>]</nowiki></code> column of the <code><nowiki>[</nowiki>DataType<nowiki>]</nowiki></code> table in the database. | ||
| + | |||
| + | ==<code>deleteartifacttype(typeid: int) -> boolean</code>== | ||
| + | This will delete an artifact type from Truxton. | ||
| + | It will return [https://docs.python.org/3/library/constants.html#True True] on success, [https://docs.python.org/3/library/constants.html#False False] otherwise. | ||
==<code>deletedepots() -> boolean</code>== | ==<code>deletedepots() -> boolean</code>== | ||
| Line 46: | Line 73: | ||
It will return [https://docs.python.org/3/library/constants.html#True True] if the message was sent, [https://docs.python.org/3/library/constants.html#False False] otherwise. | It will return [https://docs.python.org/3/library/constants.html#True True] if the message was sent, [https://docs.python.org/3/library/constants.html#False False] otherwise. | ||
| − | ==<code>deletemedia(media_id: | + | ==<code>deleteeventtype(typeid: int) -> boolean</code>== |
| + | This will delete an event type from Truxton. | ||
| + | It will return [https://docs.python.org/3/library/constants.html#True True] on success, [https://docs.python.org/3/library/constants.html#False False] otherwise. | ||
| + | |||
| + | ==<code>deleteinvestigationbyname(name: str) -> boolean</code>== | ||
| + | This will delete an investigation from Truxton knowing only the name. | ||
| + | It will return [https://docs.python.org/3/library/constants.html#True True] on success, [https://docs.python.org/3/library/constants.html#False False] otherwise. | ||
| + | |||
| + | ==<code>deletemedia(media_id: str | UUID) -> boolean</code>== | ||
| + | This will delete a piece of media from Truxton given its identifier. | ||
| + | It will return [https://docs.python.org/3/library/constants.html#True True] on success, [https://docs.python.org/3/library/constants.html#False False] on failure. | ||
| + | |||
| + | ==<code>deletemediabyname(name: str) -> boolean</code>== | ||
| + | This will delete a piece of media from Truxton knowing only the name. | ||
| + | It will return [https://docs.python.org/3/library/constants.html#True True] on success, [https://docs.python.org/3/library/constants.html#False False] otherwise. | ||
| + | |||
| + | ==<code>deletemedia(media_id: str | UUID) -> boolean</code>== | ||
This will delete a piece of media from Truxton given its identifier. | This will delete a piece of media from Truxton given its identifier. | ||
It will return [https://docs.python.org/3/library/constants.html#True True] on success, [https://docs.python.org/3/library/constants.html#False False] on failure. | It will return [https://docs.python.org/3/library/constants.html#True True] on success, [https://docs.python.org/3/library/constants.html#False False] on failure. | ||
| + | |||
| + | ==<code>deletesubject(subject_id: str | UUID) -> boolean</code>== | ||
| + | This will delete a subject from Truxton given its identifier. | ||
| + | It will return [https://docs.python.org/3/library/constants.html#True True] on success, [https://docs.python.org/3/library/constants.html#False False] on failure. | ||
| + | |||
| + | ==<code>deletetag(tagname: str) -> boolean</code>== | ||
| + | This will delete tag from Truxton. | ||
| + | It will return [https://docs.python.org/3/library/constants.html#True True] on success, [https://docs.python.org/3/library/constants.html#False False] otherwise. | ||
==<code>depotstatusnames() -> str</code>== | ==<code>depotstatusnames() -> str</code>== | ||
This will return a [http://en.wikipedia.org/wiki/JSON JSON] string of integer strings mapped to the names of the depot status. | This will return a [http://en.wikipedia.org/wiki/JSON JSON] string of integer strings mapped to the names of the depot status. | ||
The name corresponds to the <code><nowiki>[</nowiki>ShortName<nowiki>]</nowiki></code> column of the <code><nowiki>[</nowiki>DepotStatus<nowiki>]</nowiki></code> table in the database. | The name corresponds to the <code><nowiki>[</nowiki>ShortName<nowiki>]</nowiki></code> column of the <code><nowiki>[</nowiki>DepotStatus<nowiki>]</nowiki></code> table in the database. | ||
| − | |||
| − | |||
| − | |||
| − | |||
==<code>disablerouteupdate() -> boolean</code>== | ==<code>disablerouteupdate() -> boolean</code>== | ||
| Line 75: | Line 122: | ||
Returns the [https://en.wikipedia.org/wiki/Universally_unique_identifier GUID] of the ETL as a string if it is running. | Returns the [https://en.wikipedia.org/wiki/Universally_unique_identifier GUID] of the ETL as a string if it is running. | ||
| − | ==<code>fileexists(file_id: str) -> boolean</code>== | + | ==<code>fileexists(file_id: str | UUID) -> boolean</code>== |
This looks in the <code><nowiki>[</nowiki>[[File Table|File]]<nowiki>]</nowiki></code> for a record with the given <code>file_id</code>. | This looks in the <code><nowiki>[</nowiki>[[File Table|File]]<nowiki>]</nowiki></code> for a record with the given <code>file_id</code>. | ||
If a record is found with that globally unique identifier, [https://docs.python.org/3/library/constants.html#True True] is returned. | If a record is found with that globally unique identifier, [https://docs.python.org/3/library/constants.html#True True] is returned. | ||
| Line 81: | Line 128: | ||
==<code>filemimetypes() -> str</code>== | ==<code>filemimetypes() -> str</code>== | ||
This will return a [http://en.wikipedia.org/wiki/JSON JSON] string of integer strings mapped to the MIME types of the [[File_Types_Supported|file types]]. | This will return a [http://en.wikipedia.org/wiki/JSON JSON] string of integer strings mapped to the MIME types of the [[File_Types_Supported|file types]]. | ||
| − | The name corresponds to the <code><nowiki>[</nowiki>MIME<nowiki>]</nowiki></code> column of the <code><nowiki>[</nowiki>FileType<nowiki>]</nowiki></code> table in the database. | + | The name corresponds to the <code><nowiki>[</nowiki>MIME<nowiki>]</nowiki></code> column of the <code><nowiki>[</nowiki>[[FileType Table|FileType]]<nowiki>]</nowiki></code> table in the database. |
| + | Please see the [[Python Sample List File Types|sample code]] for how to use it. | ||
==<code>filetypenames() -> str</code>== | ==<code>filetypenames() -> str</code>== | ||
This will return a [http://en.wikipedia.org/wiki/JSON JSON] string of integer strings mapped to the names of the [[File_Types_Supported|file types]]. | This will return a [http://en.wikipedia.org/wiki/JSON JSON] string of integer strings mapped to the names of the [[File_Types_Supported|file types]]. | ||
| − | The name corresponds to the <code><nowiki>[</nowiki>ShortName<nowiki>]</nowiki></code> column of the <code><nowiki>[</nowiki>FileType<nowiki>]</nowiki></code> table in the database. | + | The name corresponds to the <code><nowiki>[</nowiki>ShortName<nowiki>]</nowiki></code> column of the <code><nowiki>[</nowiki>[[FileType Table|FileType]]<nowiki>]</nowiki></code> table in the database. |
| + | Please see the [[Python Sample List File Types|sample code]] for how to use it. | ||
==<code>getfilehash(hash: str) -> [[TruxtonFileIO]]</code>== | ==<code>getfilehash(hash: str) -> [[TruxtonFileIO]]</code>== | ||
This will retrieve a [[TruxtonFileIO|file]] from Truxton based on its [https://en.wikipedia.org/wiki/MD5 MD5] hash. | This will retrieve a [[TruxtonFileIO|file]] from Truxton based on its [https://en.wikipedia.org/wiki/MD5 MD5] hash. | ||
| − | ==<code>getfileid(file_id: str) -> [[TruxtonFileIO]]</code>== | + | ==<code>getfileid(file_id: str | UUID) -> [[TruxtonFileIO]]</code>== |
This will retrieve a [[TruxtonFileIO|file]] from Truxton based on its [https://en.wikipedia.org/wiki/Universally_unique_identifier GUID.] | This will retrieve a [[TruxtonFileIO|file]] from Truxton based on its [https://en.wikipedia.org/wiki/Universally_unique_identifier GUID.] | ||
| − | ==<code>getinvestigationid(id: str) -> [[TruxtonInvestigation]]</code>== | + | ==<code>getinvestigationid(id: str | UUID) -> [[TruxtonInvestigation]]</code>== |
This will retrieve an [[TruxtonInvestigation|investigation]] from Truxton based on its [https://en.wikipedia.org/wiki/Universally_unique_identifier GUID.] | This will retrieve an [[TruxtonInvestigation|investigation]] from Truxton based on its [https://en.wikipedia.org/wiki/Universally_unique_identifier GUID.] | ||
| − | ==<code>getmediaid(media_id: str) -> [[TruxtonMedia]]</code>== | + | ==<code>getmediaid(media_id: str | UUID) -> [[TruxtonMedia]]</code>== |
This will retrieve a [[TruxtonMedia|media]] from Truxton based on its [https://en.wikipedia.org/wiki/Universally_unique_identifier GUID.] | This will retrieve a [[TruxtonMedia|media]] from Truxton based on its [https://en.wikipedia.org/wiki/Universally_unique_identifier GUID.] | ||
| Line 162: | Line 211: | ||
==<code>newfiletype() -> [[TruxtonFileType]]</code>== | ==<code>newfiletype() -> [[TruxtonFileType]]</code>== | ||
| − | This will create | + | This will create a [[TruxtonFileType|file type]] object. |
==<code>newinvestigation() -> [[TruxtonInvestigation]]</code>== | ==<code>newinvestigation() -> [[TruxtonInvestigation]]</code>== | ||
| Line 188: | Line 237: | ||
This will return a [http://en.wikipedia.org/wiki/JSON JSON] string of integer strings mapped to the names of the [[Object_Types|object types]]. | This will return a [http://en.wikipedia.org/wiki/JSON JSON] string of integer strings mapped to the names of the [[Object_Types|object types]]. | ||
The name corresponds to the <code><nowiki>[</nowiki>Name<nowiki>]</nowiki></code> column of the <code><nowiki>[</nowiki>ObjectType<nowiki>]</nowiki></code> table in the database. | The name corresponds to the <code><nowiki>[</nowiki>Name<nowiki>]</nowiki></code> column of the <code><nowiki>[</nowiki>ObjectType<nowiki>]</nowiki></code> table in the database. | ||
| + | |||
| + | ==<code>openfiletype(file_type: int) -> [[TruxtonFileType]]</code>== | ||
| + | This will open an existing [[TruxtonFileType|file type]] object given the [[File Types Supported|file type identifier]]. | ||
==<code>optimizedatabase() -> boolean</code>== | ==<code>optimizedatabase() -> boolean</code>== | ||
| Line 196: | Line 248: | ||
The name corresponds to the <code><nowiki>[</nowiki>Name<nowiki>]</nowiki></code> column of the <code><nowiki>[</nowiki>Origin<nowiki>]</nowiki></code> table in the database. | The name corresponds to the <code><nowiki>[</nowiki>Name<nowiki>]</nowiki></code> column of the <code><nowiki>[</nowiki>Origin<nowiki>]</nowiki></code> table in the database. | ||
| − | ==<code>reindexmedia(media_id: | + | ==<code>reindexmedia(media_id: str | UUID) -> boolean</code>== |
This will send all of the files in a piece of media to the indexer. | This will send all of the files in a piece of media to the indexer. | ||
| Line 205: | Line 257: | ||
==<code>removedatabaseid(file_type_id: int, table_and_column: str) -> boolean</code>== | ==<code>removedatabaseid(file_type_id: int, table_and_column: str) -> boolean</code>== | ||
Removes a record in the <code>[DatabaseTableName]</code> table used to [[Identifying Databases|identify a database file]]. | Removes a record in the <code>[DatabaseTableName]</code> table used to [[Identifying Databases|identify a database file]]. | ||
| + | |||
| + | ==<code>removetriagefile(type: int, name: str) -> boolean</code>== | ||
| + | Removes a record from the <code><nowiki>[</nowiki>[[TriageFile Table|TriageFile]]<nowiki>]</nowiki></code> table. | ||
| + | |||
| + | ==<code>setartifacttypecolor(type_id: int, foreground_rgb_color: int, background_rgb_color: int) -> None</code>== | ||
| + | Sets the color of an artifact when displayed in the GUI. | ||
| + | This is a per user setting. | ||
| + | |||
| + | ==<code>seteventtypecolor(type_id: int, foreground_rgb_color: int, background_rgb_color: int) -> None</code>== | ||
| + | Sets the color of an event type when displayed in the GUI. | ||
| + | This is a per user setting. | ||
| + | |||
| + | ==<code>setfiletypecolor(type_id: int, foreground_rgb_color: int, background_rgb_color: int) -> None</code>== | ||
| + | Sets the color of a file type when displayed in the GUI. | ||
| + | This is a per user setting. | ||
| + | |||
| + | ==<code>setinvestigationstatuscolor(type_id: int, foreground_rgb_color: int, background_rgb_color: int) -> None</code>== | ||
| + | Sets the color of an investigation status when displayed in the GUI. | ||
| + | This is a per user setting. | ||
| + | |||
| + | ==<code>setinvestigationtypecolor(type_id: int, foreground_rgb_color: int, background_rgb_color: int) -> None</code>== | ||
| + | Sets the color of an investigation type when displayed in the GUI. | ||
| + | This is a per user setting. | ||
| + | |||
| + | ==<code>setlocationtypecolor(type_id: int, foreground_rgb_color: int, background_rgb_color: int) -> None</code>== | ||
| + | Sets the color of a location type when displayed in the GUI. | ||
| + | This is a per user setting. | ||
| + | |||
| + | ==<code>setmessagetypecolor(type_id: int, foreground_rgb_color: int, background_rgb_color: int) -> None</code>== | ||
| + | Sets the color of a message type when displayed in the GUI. | ||
| + | This is a per user setting. | ||
| + | |||
| + | ==<code>setreviewstatuscolor(type_id: int, foreground_rgb_color: int, background_rgb_color: int) -> None</code>== | ||
| + | Sets the color of a review status when displayed in the GUI. | ||
| + | This is a per user setting. | ||
| + | |||
| + | ==<code>setreviewtypecolor(type_id: int, foreground_rgb_color: int, background_rgb_color: int) -> None</code>== | ||
| + | Sets the color of a review type when displayed in the GUI. | ||
| + | This is a per user setting. | ||
| + | |||
| + | ==<code>seturltypecolor(type_id: int, foreground_rgb_color: int, background_rgb_color: int) -> None</code>== | ||
| + | Sets the color of a URL type when displayed in the GUI. | ||
| + | This is a per user setting. | ||
==<code>taghash(hash: object, tag: str, description: str) -> boolean</code>== | ==<code>taghash(hash: object, tag: str, description: str) -> boolean</code>== | ||
| Line 212: | Line 307: | ||
This will add a tag to all files that have contents matching the given hash. | This will add a tag to all files that have contents matching the given hash. | ||
| − | ==<code>updatemediatype(media_id: | + | ==<code>updatemediatype(media_id: str | UUID, type: int) -> boolean</code>== |
Sets the [[Media Types|type]] of the media. | Sets the [[Media Types|type]] of the media. | ||
| − | This | + | This updates the <code>[MediaTypeID]</code> column of the <code><nowiki>[</nowiki>[[Media Table|Media]]<nowiki>]</nowiki></code> table. |
It can be one of the [[Media Types|defined constants]] but it must be one of the values in the <code>[ID]</code> column of the <code>[MediaType]</code> table. | It can be one of the [[Media Types|defined constants]] but it must be one of the values in the <code>[ID]</code> column of the <code>[MediaType]</code> table. | ||
It will return [https://docs.python.org/3/library/constants.html#True True] if the update succeeded, [https://docs.python.org/3/library/constants.html#False False] otherwise. | It will return [https://docs.python.org/3/library/constants.html#True True] if the update succeeded, [https://docs.python.org/3/library/constants.html#False False] otherwise. | ||
| Line 226: | Line 321: | ||
==<code>version: str</code>== | ==<code>version: str</code>== | ||
| − | Returns the version string. | + | Returns the version of Truxton as a string. |
==<code>websitevisitmethodnames() -> str</code>== | ==<code>websitevisitmethodnames() -> str</code>== | ||
| Line 314: | Line 409: | ||
if __name__ == "__main__": | if __name__ == "__main__": | ||
| − | main() | + | sys.exit(main()) |
</source> | </source> | ||
Latest revision as of 05:40, 9 February 2026
This class gives you access to Truxton at a global level.
Contents
- 1 Attributes and Methods
- 1.1 adddatabaseid(file_type_id: int, table_and_column: str) -> boolean
- 1.2 addtriagefile(type: int, name: str, description: str, why: str) -> boolean
- 1.3 carvefile(file_id: str | UUID) -> boolean
- 1.4 cleandatabase() -> boolean
- 1.5 closed: boolean
- 1.6 connnectionstring: str
- 1.7 consolidatedepots() -> boolean
- 1.8 createeverythinghashset(output_filename: str) -> boolean
- 1.9 createinvestigationhashset(investigation_id: str | UUID, output_filename: str) -> boolean
- 1.10 createmediahashset(media_id: str | UUID, output_filename: str) -> boolean
- 1.11 createtag(name: str, description: str) -> None
- 1.12 datatypenames() -> str
- 1.13 deleteartifacttype(typeid: int) -> boolean
- 1.14 deletedepots() -> boolean
- 1.15 deleteeventtype(typeid: int) -> boolean
- 1.16 deleteinvestigationbyname(name: str) -> boolean
- 1.17 deletemedia(media_id: str | UUID) -> boolean
- 1.18 deletemediabyname(name: str) -> boolean
- 1.19 deletemedia(media_id: str | UUID) -> boolean
- 1.20 deletesubject(subject_id: str | UUID) -> boolean
- 1.21 deletetag(tagname: str) -> boolean
- 1.22 depotstatusnames() -> str
- 1.23 disablerouteupdate() -> boolean
- 1.24 enablerouteupdate() -> boolean
- 1.25 entitytypenames() -> str
- 1.26 eventtypenames() -> str
- 1.27 etlid: str
- 1.28 fileexists(file_id: str | UUID) -> boolean
- 1.29 filemimetypes() -> str
- 1.30 filetypenames() -> str
- 1.31 getfilehash(hash: str) -> TruxtonFileIO
- 1.32 getfileid(file_id: str | UUID) -> TruxtonFileIO
- 1.33 getinvestigationid(id: str | UUID) -> TruxtonInvestigation
- 1.34 getmediaid(media_id: str | UUID) -> TruxtonMedia
- 1.35 getsensitivesitelistid(list_id: object) -> TruxtonSensitiveSiteList
- 1.36 groupentrytypenames() -> str
- 1.37 groupstatusnames() -> str
- 1.38 grouptypenames() -> str
- 1.39 investigationstatusnames() -> str
- 1.40 investigationtypenames() -> str
- 1.41 locationtypenames() -> str
- 1.42 machineid: str
- 1.43 mediastatusnames() -> str
- 1.44 mediatypenames() -> str
- 1.45 messageaddresstypenames() -> str
- 1.46 messagetypenames() -> str
- 1.47 newartifact() -> TruxtonArtifact
- 1.48 newartifacttype() -> TruxtonArtifactType
- 1.49 newbolo() -> TruxtonBolo
- 1.50 neweventtype() -> TruxtonEventType
- 1.51 newexporter() -> TruxtonExporter
- 1.52 newfiletype() -> TruxtonFileType
- 1.53 newinvestigation() -> TruxtonInvestigation
- 1.54 newjurisdiction() -> TruxtonJurisdiction
- 1.55 newmedia() -> TruxtonMedia
- 1.56 newmessageaddress() -> TruxtonMessageAddress
- 1.57 newrelation() -> TruxtonRelation
- 1.58 newsensitivesitelist() -> TruxtonSensitiveSiteList
- 1.59 newsubject() -> TruxtonSubject
- 1.60 objecttypenames() -> str
- 1.61 openfiletype(file_type: int) -> TruxtonFileType
- 1.62 optimizedatabase() -> boolean
- 1.63 originnames() -> str
- 1.64 reindexmedia(media_id: str | UUID) -> boolean
- 1.65 relationtypenames() -> str
- 1.66 removedatabaseid(file_type_id: int, table_and_column: str) -> boolean
- 1.67 removetriagefile(type: int, name: str) -> boolean
- 1.68 setartifacttypecolor(type_id: int, foreground_rgb_color: int, background_rgb_color: int) -> None
- 1.69 seteventtypecolor(type_id: int, foreground_rgb_color: int, background_rgb_color: int) -> None
- 1.70 setfiletypecolor(type_id: int, foreground_rgb_color: int, background_rgb_color: int) -> None
- 1.71 setinvestigationstatuscolor(type_id: int, foreground_rgb_color: int, background_rgb_color: int) -> None
- 1.72 setinvestigationtypecolor(type_id: int, foreground_rgb_color: int, background_rgb_color: int) -> None
- 1.73 setlocationtypecolor(type_id: int, foreground_rgb_color: int, background_rgb_color: int) -> None
- 1.74 setmessagetypecolor(type_id: int, foreground_rgb_color: int, background_rgb_color: int) -> None
- 1.75 setreviewstatuscolor(type_id: int, foreground_rgb_color: int, background_rgb_color: int) -> None
- 1.76 setreviewtypecolor(type_id: int, foreground_rgb_color: int, background_rgb_color: int) -> None
- 1.77 seturltypecolor(type_id: int, foreground_rgb_color: int, background_rgb_color: int) -> None
- 1.78 taghash(hash: object, tag: str, description: str) -> boolean
- 1.79 updateinvestigationtype(investigation_id: str | UUID, type: int) -> boolean
- 1.80 updatemediatype(media_id: str | UUID, type: int) -> boolean
- 1.81 updatemediaphotohash(media_id: str | UUID, hash: object) -> boolean
- 1.82 urltypenames() -> str
- 1.83 version: str
- 1.84 websitevisitmethodnames() -> str
- 2 Sample
Attributes and Methods
adddatabaseid(file_type_id: int, table_and_column: str) -> boolean
Creates a record in the [DatabaseTableName] table to help identify a database file.
addtriagefile(type: int, name: str, description: str, why: str) -> boolean
Creates a record in the [TriageFile] table to specify the files and folders used in a Triage load.
You supply the name of the file or folder, which can be a regular expression, a description of the file and a reason why it should be part of the Triage.
Here's and example of how to use it.
The values for type can be:
| Value | Meaning |
|---|---|
| 1 | The name is the name of a file
|
| 2 | The name is the name of a folder
|
| 5 | The name is regular expression pattern for a file
|
| 6 | The name is regular expression pattern for a folder
|
carvefile(file_id: str | UUID) -> boolean
Will tell the carver to carve the contents of the given file identifier. Carved files will be added as child files. It will return True if the message was sent, False otherwise.
cleandatabase() -> boolean
This send a message to the maintenance ETL to go through the tables looking for unreferenced (orphaned) records and delete them. It will return True if the message was sent, False otherwise.
closed: boolean
It will be True if the connection to Truxton is closed, False otherwise.
connnectionstring: str
This will return the database connection string. Use this if you want to query the database directly.
consolidatedepots() -> boolean
This send a message to the maintenance ETL to go through closed depots and merge the smaller ones into the larger ones. What you will be left with is few very large depot files instead of many smaller ones. It will return True if the message was sent, False otherwise.
createeverythinghashset(output_filename: str) -> boolean
Creates a hash set file from the unique hashes in Truxton.
createinvestigationhashset(investigation_id: str | UUID, output_filename: str) -> boolean
Creates a hash set file from the unique hashes in the given investigation.
createmediahashset(media_id: str | UUID, output_filename: str) -> boolean
Creates a hash set file from the unique hashes in the given media.
createtag(name: str, description: str) -> None
This will create a new tag in Truxton.
After calling this method, you can tag other items using only the name.
datatypenames() -> str
This will return a JSON string integer strings mapped to the names of the data types.
The name corresponds to the [Name] column of the [DataType] table in the database.
deleteartifacttype(typeid: int) -> boolean
This will delete an artifact type from Truxton. It will return True on success, False otherwise.
deletedepots() -> boolean
This will send a message to the maintenance ETL to delete any depot files that have been marked as ToBeDeleted.
It will return True if the message was sent, False otherwise.
deleteeventtype(typeid: int) -> boolean
This will delete an event type from Truxton. It will return True on success, False otherwise.
deleteinvestigationbyname(name: str) -> boolean
This will delete an investigation from Truxton knowing only the name. It will return True on success, False otherwise.
deletemedia(media_id: str | UUID) -> boolean
This will delete a piece of media from Truxton given its identifier. It will return True on success, False on failure.
deletemediabyname(name: str) -> boolean
This will delete a piece of media from Truxton knowing only the name. It will return True on success, False otherwise.
deletemedia(media_id: str | UUID) -> boolean
This will delete a piece of media from Truxton given its identifier. It will return True on success, False on failure.
deletesubject(subject_id: str | UUID) -> boolean
This will delete a subject from Truxton given its identifier. It will return True on success, False on failure.
deletetag(tagname: str) -> boolean
This will delete tag from Truxton. It will return True on success, False otherwise.
depotstatusnames() -> str
This will return a JSON string of integer strings mapped to the names of the depot status.
The name corresponds to the [ShortName] column of the [DepotStatus] table in the database.
disablerouteupdate() -> boolean
Disable the automatic update of the [ETLRoute] table during software updates
enablerouteupdate() -> boolean
Enable the automatic update of the [ETLRoute] table during software updates
entitytypenames() -> str
This will return a JSON string of integer strings mapped to the names of the artifact types.
The name corresponds to the [ShortName] column of the [EntityType] table in the database.
eventtypenames() -> str
This will return a JSON string of integer string mapped to the names of the artifact types.
The name corresponds to the [Name] column of the [EventType] table in the database.
etlid: str
Returns the GUID of the ETL as a string if it is running.
fileexists(file_id: str | UUID) -> boolean
This looks in the [File] for a record with the given file_id.
If a record is found with that globally unique identifier, True is returned.
filemimetypes() -> str
This will return a JSON string of integer strings mapped to the MIME types of the file types.
The name corresponds to the [MIME] column of the [FileType] table in the database.
Please see the sample code for how to use it.
filetypenames() -> str
This will return a JSON string of integer strings mapped to the names of the file types.
The name corresponds to the [ShortName] column of the [FileType] table in the database.
Please see the sample code for how to use it.
getfilehash(hash: str) -> TruxtonFileIO
This will retrieve a file from Truxton based on its MD5 hash.
getfileid(file_id: str | UUID) -> TruxtonFileIO
This will retrieve a file from Truxton based on its GUID.
getinvestigationid(id: str | UUID) -> TruxtonInvestigation
This will retrieve an investigation from Truxton based on its GUID.
getmediaid(media_id: str | UUID) -> TruxtonMedia
This will retrieve a media from Truxton based on its GUID.
getsensitivesitelistid(list_id: object) -> TruxtonSensitiveSiteList
This will retrieve a sensitive site list from Truxton based on its GUID.
groupentrytypenames() -> str
This will return a JSON string of integer strings mapped to the names of the group entry types.
The name corresponds to the [Name] column of the [GroupEntryType] table in the database.
groupstatusnames() -> str
This will return a JSON string of integer strings mapped to the names of the group status.
The name corresponds to the [Name] column of the [GroupStatus] table in the database.
grouptypenames() -> str
This will return a JSON string of integer strings mapped to the names of the group types.
The name corresponds to the [Name] column of the [GroupType] table in the database.
investigationstatusnames() -> str
This will return a JSON string of integer strings mapped to the names of the investigation types.
The name corresponds to the [Name] column of the [InvestigationStatus] table in the database.
investigationtypenames() -> str
This will return a JSON string of integer strings mapped to the names of the investigation types.
The name corresponds to the [Name] column of the [InvestigationType] table in the database.
locationtypenames() -> str
This will return a JSON string of integer strings mapped to the names of the geographic location types.
The name corresponds to the [Name] column of the [LocationType] table in the database.
machineid: str
Returns the GUID of the machine. When Truxton is installed, this identifier is generated with the most significant 64-bits being a Windows FILETIME and the lower 64-bits being random.
mediastatusnames() -> str
This will return a JSON string of integer strings mapped to the names of the media status.
The name corresponds to the [Name] column of the [MediaStatus] table in the database.
mediatypenames() -> str
This will return a JSON string of integer strings mapped to the names of the media types.
The name corresponds to the [ShortName] column of the [MediaType] table in the database.
messageaddresstypenames() -> str
This will return a JSON string of integer strings mapped to the names of the message address types.
The name corresponds to the [Name] column of the [MessageAddressType] table in the database.
messagetypenames() -> str
This will return a JSON string of integer strings mapped to the names of the message types.
The name corresponds to the [ShortName] column of the [MessageType] table in the database.
newartifact() -> TruxtonArtifact
This will create an artifact object.
newartifacttype() -> TruxtonArtifactType
This will create an artifact type object.
newbolo() -> TruxtonBolo
This will create a BOLO object.
neweventtype() -> TruxtonEventType
This will create an event type object.
newexporter() -> TruxtonExporter
This will create an exporter object.
newfiletype() -> TruxtonFileType
This will create a file type object.
newinvestigation() -> TruxtonInvestigation
This will create an investigation object.
newjurisdiction() -> TruxtonJurisdiction
This will create a jurisdiction object.
newmedia() -> TruxtonMedia
This will create a media object.
newmessageaddress() -> TruxtonMessageAddress
This will create a message address object.
newrelation() -> TruxtonRelation
This will create a relation object.
newsensitivesitelist() -> TruxtonSensitiveSiteList
This will create a sensitive site list object.
newsubject() -> TruxtonSubject
This will create a subject object.
objecttypenames() -> str
This will return a JSON string of integer strings mapped to the names of the object types.
The name corresponds to the [Name] column of the [ObjectType] table in the database.
openfiletype(file_type: int) -> TruxtonFileType
This will open an existing file type object given the file type identifier.
optimizedatabase() -> boolean
This update the query statistics in the database.
originnames() -> str
This will return a JSON string of integer strings mapped to the names of the file origins.
The name corresponds to the [Name] column of the [Origin] table in the database.
reindexmedia(media_id: str | UUID) -> boolean
This will send all of the files in a piece of media to the indexer.
relationtypenames() -> str
This will return a JSON string of integer strings mapped to the names of the relation types.
The name corresponds to the [Name] column of the [RelationType] table in the database.
removedatabaseid(file_type_id: int, table_and_column: str) -> boolean
Removes a record in the [DatabaseTableName] table used to identify a database file.
removetriagefile(type: int, name: str) -> boolean
Removes a record from the [TriageFile] table.
setartifacttypecolor(type_id: int, foreground_rgb_color: int, background_rgb_color: int) -> None
Sets the color of an artifact when displayed in the GUI. This is a per user setting.
seteventtypecolor(type_id: int, foreground_rgb_color: int, background_rgb_color: int) -> None
Sets the color of an event type when displayed in the GUI. This is a per user setting.
setfiletypecolor(type_id: int, foreground_rgb_color: int, background_rgb_color: int) -> None
Sets the color of a file type when displayed in the GUI. This is a per user setting.
setinvestigationstatuscolor(type_id: int, foreground_rgb_color: int, background_rgb_color: int) -> None
Sets the color of an investigation status when displayed in the GUI. This is a per user setting.
setinvestigationtypecolor(type_id: int, foreground_rgb_color: int, background_rgb_color: int) -> None
Sets the color of an investigation type when displayed in the GUI. This is a per user setting.
setlocationtypecolor(type_id: int, foreground_rgb_color: int, background_rgb_color: int) -> None
Sets the color of a location type when displayed in the GUI. This is a per user setting.
setmessagetypecolor(type_id: int, foreground_rgb_color: int, background_rgb_color: int) -> None
Sets the color of a message type when displayed in the GUI. This is a per user setting.
setreviewstatuscolor(type_id: int, foreground_rgb_color: int, background_rgb_color: int) -> None
Sets the color of a review status when displayed in the GUI. This is a per user setting.
setreviewtypecolor(type_id: int, foreground_rgb_color: int, background_rgb_color: int) -> None
Sets the color of a review type when displayed in the GUI. This is a per user setting.
seturltypecolor(type_id: int, foreground_rgb_color: int, background_rgb_color: int) -> None
Sets the color of a URL type when displayed in the GUI. This is a per user setting.
taghash(hash: object, tag: str, description: str) -> boolean
This will add a tag to all files that have contents matching the given hash.
updateinvestigationtype(investigation_id: str | UUID, type: int) -> boolean
This will add a tag to all files that have contents matching the given hash.
updatemediatype(media_id: str | UUID, type: int) -> boolean
Sets the type of the media.
This updates the [MediaTypeID] column of the [Media] table.
It can be one of the defined constants but it must be one of the values in the [ID] column of the [MediaType] table.
It will return True if the update succeeded, False otherwise.
updatemediaphotohash(media_id: str | UUID, hash: object) -> boolean
Associates the photo with the given MD5 hash with the Media.
urltypenames() -> str
This will return a JSON string of integer strings mapped to the names of the URL types.
The name corresponds to the [ShortName] column of the [URLType] table in the database.
version: str
Returns the version of Truxton as a string.
websitevisitmethodnames() -> str
This will return a JSON string of mapped integer strings to the names of the URL methods.
The name corresponds to the [ShortName] column of the [WebsiteMethod] table in the database.
Sample
import sys
sys.path.append('C:/Program Files/Truxton/SDK')
import truxton
import shutil
from datetime import datetime
from calendar import timegm
from pathlib import Path
def create_event_type(t, id, name):
event_type = t.neweventtype()
event_type.id = id
event_type.name = name
event_type.save()
def add_file(parent_truxton_file, filename):
source_file = open(filename, "rb")
child = parent_truxton_file.newchild()
child.name = Path(filename).name
shutil.copyfileobj(source_file, child)
source_file.close()
child.save()
return child
def add_media(t):
media = t.newmedia()
media.name = "Public Documents"
media.description = "Publicly available documents"
media.case = "DC-SNAFU-2016.2020"
media.evidencebag = "EV-0937459386623-a"
media.originator = "Jeffrey Jensen"
media.latitude = 38.897661
media.longitude = -77.036458
media.type = truxton.MEDIA_TYPE_LOGICAL_FILES
media.save()
return media
def add_ec(parent_file ):
child_file = add_file(parent_file, "JW-v-DOJ-reply-02743.pdf")
a = child_file.newartifact()
a.type = truxton.ENTITY_TYPE_ACCOUNT
a.value = "r0cker"
a.datatype = truxton.DATA_TYPE_ASCII
a.length = 6
a.save()
b = child_file.newartifact()
b.type = truxton.ENTITY_TYPE_PERSON
b.value = "Bob Smith"
b.datatype = truxton.DATA_TYPE_ASCII
b.length = 9
b.save()
relation = child_file.newrelation()
relation.a = a.id
relation.atype = truxton.OBJECT_TYPE_ENTITY
relation.b = b.id
relation.btype = truxton.OBJECT_TYPE_ENTITY
relation.relation = truxton.RELATION_LOGON_ACCOUNT
relation.save()
def main():
t = truxton.create()
print(t.version + '\n' );
print("Truxton will write to depot files in: " + t.getstring("datadir") + '\n');
print("The database port is: " + str(t.getint("dbport")) + '\n');
print("Database was created: " + str(t.getbool("CreateTheDatabase")) + '\n');
media = add_media(t)
root_file = media.addroot()
root_file.save()
add_ec(root_file)
if __name__ == "__main__":
sys.exit(main())