meta data for this page
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| soc:irt:playbooks:windows_disk [2026/06/16 14:45] – titannet | soc:irt:playbooks:windows_disk [2026/06/18 16:51] (current) – [Prefetch on Linux] titannet | ||
|---|---|---|---|
| Line 30: | Line 30: | ||
| <code bash> | <code bash> | ||
| mmls -r $E | mmls -r $E | ||
| - | sudo -E ~/ | + | sudo -E ~/ |
| # -p has ' | # -p has ' | ||
| # new tab or crtl-z | # new tab or crtl-z | ||
| Line 36: | Line 36: | ||
| </ | </ | ||
| - | ==== Start with plaso ==== | + | ==== Hayabusa ==== |
| + | |||
| + | <code bash> | ||
| + | target-fs " | ||
| + | docker run -it --rm -v " | ||
| + | docker run -it --rm -v " | ||
| + | </ | ||
| + | |||
| + | |||
| + | ==== Plaso ==== | ||
| <code bash> | <code bash> | ||
| Line 55: | Line 64: | ||
| docker compose up -d | docker compose up -d | ||
| # -> localhost: | # -> localhost: | ||
| + | |||
| + | </ | ||
| + | |||
| + | |||
| + | ==== Splunk ==== | ||
| + | |||
| + | <code bash> | ||
| + | mkdir -p etc/ | ||
| + | vim props.conf | ||
| + | cp props.conf etc/ | ||
| + | |||
| + | </ | ||
| + | |||
| + | |||
| + | ==== Browser ==== | ||
| + | |||
| + | |||
| + | <code bash> | ||
| + | Users\...\AppData\Local\Google\Chrome\User Data\Default\History | ||
| + | Users\...\AppData\Local\Microsoft\Edge\User Data\Default\History | ||
| + | Users\...\AppData\Roaming\Mozilla\Firefox\Profiles\< | ||
| + | |||
| + | |||
| + | C_DR= | ||
| + | EUSER= | ||
| + | mkdir -p evidence/ | ||
| + | mkdir evidence/ | ||
| + | mkdir evidence/ | ||
| + | cp -r $C_DR/ | ||
| + | cp -r $C_DR/ | ||
| + | cp -r $C_DR/ | ||
| + | |||
| + | sqlitebrowser evidence/ | ||
| + | sqlitebrowser evidence/ | ||
| + | |||
| + | </ | ||
| + | |||
| + | |||
| + | ==== PE ==== | ||
| + | |||
| + | <code bash> | ||
| + | https:// | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | </ | ||
| + | |||
| + | ==== Prefetch on Linux ==== | ||
| + | |||
| + | <code bash> | ||
| + | |||
| + | curl --proto ' | ||
| + | source ~/ | ||
| + | rustup toolchain install 1.85.0 | ||
| + | rustup default 1.85.0 | ||
| + | </ | ||
| + | |||
| + | <code rust> | ||
| + | use chrono:: | ||
| + | use std::{env, fs}; | ||
| + | |||
| + | fn filetime_to_datetime(ft: | ||
| + | // FILETIME epoch (1601-01-01) -> Unix epoch (1970-01-01) | ||
| + | const EPOCH_DIFF_100NS: | ||
| + | |||
| + | let unix_100ns = ft - EPOCH_DIFF_100NS; | ||
| + | let secs = unix_100ns / 10_000_000; | ||
| + | let nanos = ((unix_100ns % 10_000_000) * 100) as u32; | ||
| + | |||
| + | DateTime:: | ||
| + | .expect(" | ||
| + | } | ||
| + | |||
| + | fn main() { | ||
| + | let path = env::args() | ||
| + | .nth(1) | ||
| + | .expect(" | ||
| + | |||
| + | let raw = fs:: | ||
| + | |||
| + | let info = prefetch_core:: | ||
| + | .unwrap_or_else(|e| panic!(" | ||
| + | |||
| + | println!(" | ||
| + | println!(" | ||
| + | |||
| + | println!(" | ||
| + | for ft in & | ||
| + | println!( | ||
| + | " | ||
| + | filetime_to_datetime(*ft).to_rfc3339(), | ||
| + | ft | ||
| + | ); | ||
| + | } | ||
| + | |||
| + | println!(" | ||
| + | for v in & | ||
| + | println!(" | ||
| + | |||
| + | let created = filetime_to_datetime(v.creation_time); | ||
| + | println!(" | ||
| + | |||
| + | println!(" | ||
| + | println!(); | ||
| + | } | ||
| + | } | ||
| + | |||
| + | </ | ||
| + | |||
| + | |||
| + | <code rust> | ||
| + | # | ||
| + | use std:: | ||
| + | use std::fs; | ||
| + | use std:: | ||
| + | use chrono:: | ||
| + | |||
| + | /// based on https:// | ||
| + | |||
| + | |||
| + | fn filetime_to_datetime(ft: | ||
| + | // FILETIME epoch (1601-01-01) -> Unix epoch (1970-01-01) | ||
| + | const EPOCH_DIFF_100NS: | ||
| + | |||
| + | let unix_100ns = ft - EPOCH_DIFF_100NS; | ||
| + | let secs = unix_100ns / 10_000_000; | ||
| + | let nanos = ((unix_100ns % 10_000_000) * 100) as u32; | ||
| + | |||
| + | DateTime:: | ||
| + | .expect(" | ||
| + | } | ||
| + | |||
| + | fn csv_escape(s: | ||
| + | let mut out = String:: | ||
| + | out.push('"' | ||
| + | for c in s.chars() { | ||
| + | match c { | ||
| + | '"' | ||
| + | _ => out.push(c), | ||
| + | } | ||
| + | } | ||
| + | out.push('"' | ||
| + | out | ||
| + | } | ||
| + | |||
| + | fn main() { | ||
| + | let mut root = PathBuf:: | ||
| + | root.pop(); | ||
| + | let out_dir = std:: | ||
| + | .nth(1) | ||
| + | .unwrap_or_else(|| "/ | ||
| + | std:: | ||
| + | |||
| + | let dir = Path:: | ||
| + | | ||
| + | let files: Vec< | ||
| + | .unwrap() | ||
| + | .filter_map(Result:: | ||
| + | .map(|e| e.path()) | ||
| + | .filter(|p| { | ||
| + | p.extension() | ||
| + | .and_then(|ext| ext.to_str()) | ||
| + | .map(|ext| ext == " | ||
| + | .unwrap_or(false) | ||
| + | }) | ||
| + | .map(|p| p.to_string_lossy().to_string()) | ||
| + | .collect(); | ||
| + | |||
| + | // | ||
| + | println!( | ||
| + | " | ||
| + | ); | ||
| + | for name in files { | ||
| + | let p = PathBuf:: | ||
| + | |||
| + | let raw = std:: | ||
| + | let scca = prefetch_core:: | ||
| + | |||
| + | std:: | ||
| + | .expect(" | ||
| + | |||
| + | let info = prefetch_core:: | ||
| + | |||
| + | let filenames = info | ||
| + | .filenames | ||
| + | .iter() | ||
| + | .map(|f| escape(f)) | ||
| + | .collect::< | ||
| + | .join(";" | ||
| + | |||
| + | let volumes = info | ||
| + | .volumes | ||
| + | .iter() | ||
| + | .map(|v| { | ||
| + | format!( | ||
| + | " | ||
| + | v.serial, | ||
| + | escape(& | ||
| + | filetime_to_datetime(v.creation_time) | ||
| + | ) | ||
| + | }) | ||
| + | .collect::< | ||
| + | .join(";" | ||
| + | |||
| + | let last_runs = info | ||
| + | .last_run_times | ||
| + | .iter() | ||
| + | .map(|t| filetime_to_datetime(*t).to_string()) | ||
| + | .collect::< | ||
| + | .join(";" | ||
| + | |||
| + | println!( | ||
| + | " | ||
| + | csv_escape(& | ||
| + | scca.len(), | ||
| + | info.version, | ||
| + | csv_escape(& | ||
| + | info.run_count, | ||
| + | csv_escape(& | ||
| + | info.filenames.len(), | ||
| + | csv_escape(& | ||
| + | csv_escape(& | ||
| + | ); | ||
| + | } | ||
| + | } | ||
| + | |||
| + | fn escape(s: &str) -> String { | ||
| + | s.replace(' | ||
| + | } | ||
| </ | </ | ||