Difference between revisions of "TruxtonChildFileIO tag"
Jump to navigation
Jump to search
(→Sample) |
|||
| Line 3: | Line 3: | ||
=Syntax= | =Syntax= | ||
<syntaxhighlight lang="Python"> | <syntaxhighlight lang="Python"> | ||
| − | bool tag(tag, reason); | + | bool tag(tag: str, reason: str); |
</syntaxhighlight> | </syntaxhighlight> | ||
| Line 10: | Line 10: | ||
=Sample= | =Sample= | ||
| − | |||
<syntaxhighlight lang="Python" highlight="20"> | <syntaxhighlight lang="Python" highlight="20"> | ||
import truxton | import truxton | ||
Revision as of 06:58, 1 October 2022
This creates a tag associated with this file in Truxton.
Syntax
bool tag(tag: str, reason: str);
Return value
True if the tag was associated with the file, False on failure.
Sample
import truxton
import shutil
from pathlib import Path
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 main():
t = truxton.create()
file = t.getfileid("5ec2a123-74d6-5da7-0653-4e6800000000")
child = add_child( file, "C:/Manual Exploitation/Clients.csv")
child.tag("Leads", "Manual recovery of client list")
return None
if __name__ == "__main__":
main()