Skip to content

Commit cf641b7

Browse files
committed
Merge branch 'main' into release/10.2.x
2 parents 4c0db0f + 0799c04 commit cf641b7

22 files changed

+510
-112
lines changed

CHANGELOG.md

+15
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
# ChangeLog
22

3+
## [10.2.2] - 2023-09-20
4+
### Added
5+
- Allow user to specify any 'key' from 'ORC_Offline' special command set
6+
- NTFSInfo: add columns to volstats.csv for output file name
7+
- WolfLauncher: remove working directory on exit when it was created and empty
8+
9+
### Changed
10+
- Yara: update to 4.3.2
11+
12+
### Fixed
13+
- Yara: possible execution loop issue depending on the rule
14+
- FastFind: in the XML results file the 'Type' values for a registry match was always set to 'Type'
15+
- FastFind: XML output style
16+
- NTFSInfo/FATInfo: unexpected FirstBytes column zero padding
17+
318
## [10.2.1] - 2023-06-20
419
### Changed
520
- Configuration: accept wildcard as exclusion path

src/OrcCommand/Command/FastFind/FastFind_Run.cpp

+30-7
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,10 @@ HRESULT Main::RunFileSystem()
249249
HRESULT hr = E_FAIL;
250250

251251
if (pStructuredOutput)
252+
{
252253
pStructuredOutput->BeginCollection(L"filesystem");
254+
pStructuredOutput->BeginElement(nullptr);
255+
}
253256

254257
hr = config.FileSystem.Files.Find(
255258
config.FileSystem.Locations,
@@ -267,7 +270,11 @@ HRESULT Main::RunFileSystem()
267270
if (pFileSystemTableOutput)
268271
aMatch->Write(*pFileSystemTableOutput);
269272
if (pStructuredOutput)
273+
{
274+
pStructuredOutput->BeginCollection(L"filefind_match");
270275
aMatch->Write(*pStructuredOutput, nullptr);
276+
pStructuredOutput->EndCollection(L"filefind_match");
277+
}
271278

272279
return;
273280
},
@@ -281,7 +288,10 @@ HRESULT Main::RunFileSystem()
281288
}
282289

283290
if (pStructuredOutput)
291+
{
292+
pStructuredOutput->EndElement(nullptr);
284293
pStructuredOutput->EndCollection(L"filesystem");
294+
}
285295

286296
m_console.PrintNewLine();
287297
::PrintStatistics(m_console.OutputTree(), config.FileSystem.Files.AllSearchTerms());
@@ -311,7 +321,6 @@ HRESULT Main::RunRegistry()
311321
},
312322
false,
313323
ResurrectRecordsMode::kNo);
314-
315324
if (FAILED(hr))
316325
{
317326
Log::Error(L"Failed to parse location while searching for registry hives");
@@ -320,6 +329,7 @@ HRESULT Main::RunRegistry()
320329
if (pStructuredOutput)
321330
{
322331
pStructuredOutput->BeginCollection(L"registry");
332+
pStructuredOutput->BeginElement(nullptr);
323333
}
324334

325335
for (const auto& aFileMatch : config.Registry.Files.Matches())
@@ -328,6 +338,7 @@ HRESULT Main::RunRegistry()
328338

329339
if (pStructuredOutput)
330340
{
341+
pStructuredOutput->BeginCollection(L"hive");
331342
pStructuredOutput->BeginElement(nullptr);
332343
pStructuredOutput->WriteNamed(L"volume_id", aFileMatch->VolumeReader->VolumeSerialNumber(), true);
333344

@@ -385,11 +396,15 @@ HRESULT Main::RunRegistry()
385396
}
386397

387398
if (pStructuredOutput)
399+
{
388400
pStructuredOutput->EndElement(nullptr);
401+
pStructuredOutput->EndCollection(L"hive");
402+
}
389403
}
390404

391405
if (pStructuredOutput)
392406
{
407+
pStructuredOutput->EndElement(nullptr);
393408
pStructuredOutput->EndCollection(L"registry");
394409
}
395410

@@ -403,10 +418,11 @@ Main::LogObjectMatch(const ObjectSpec::ObjectItem& spec, const ObjectDirectory::
403418

404419
if (pStructuredOutput)
405420
{
406-
pStructuredOutput->BeginElement(szElement);
421+
pStructuredOutput->BeginElement(L"object_match");
422+
407423
pStructuredOutput->WriteNamed(L"description", spec.Description().c_str());
408424
obj.Write(*pStructuredOutput);
409-
pStructuredOutput->EndElement(szElement);
425+
pStructuredOutput->EndElement(L"object_match");
410426
}
411427
if (pObjectTableOutput)
412428
{
@@ -423,10 +439,11 @@ Main::LogObjectMatch(const ObjectSpec::ObjectItem& spec, const FileDirectory::Fi
423439

424440
if (pStructuredOutput)
425441
{
426-
pStructuredOutput->BeginElement(szElement);
442+
pStructuredOutput->BeginElement(L"object_match");
443+
427444
pStructuredOutput->WriteNamed(L"description", spec.Description().c_str());
428445
file.Write(*pStructuredOutput);
429-
pStructuredOutput->EndElement(szElement);
446+
pStructuredOutput->EndElement(L"object_match");
430447
}
431448

432449
if (pObjectTableOutput)
@@ -442,7 +459,10 @@ HRESULT Main::RunObject()
442459
HRESULT hr = E_FAIL;
443460

444461
if (pStructuredOutput)
445-
pStructuredOutput->BeginCollection(L"object_directory");
462+
{
463+
pStructuredOutput->BeginCollection(L"object");
464+
pStructuredOutput->BeginElement(nullptr);
465+
}
446466

447467
for (const auto& objdir : ObjectDirs)
448468
{
@@ -600,7 +620,10 @@ HRESULT Main::RunObject()
600620
}
601621

602622
if (pStructuredOutput)
603-
pStructuredOutput->EndCollection(L"object_directory");
623+
{
624+
pStructuredOutput->EndElement(nullptr);
625+
pStructuredOutput->EndCollection(L"object");
626+
}
604627

605628
return S_OK;
606629
}

src/OrcCommand/Command/FatInfo/FatInfo_Run.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ HRESULT Main::Run()
6262
return loc->GetParse() && (loc->IsFAT12() || loc->IsFAT16() || loc->IsFAT32());
6363
});
6464

65-
hr = m_FileInfoOutput.GetWriters(m_Config.output, L"FatInfo", locations);
65+
hr = m_FileInfoOutput.GetWriters(m_Config.output, L"FatInfo", locations, OutputInfo::DataType::kFatInfo);
6666
if (FAILED(hr))
6767
{
6868
Log::Error(L"Failed to create file information writers [{}]", SystemError(hr));
@@ -91,7 +91,8 @@ HRESULT Main::Run()
9191
fileEntry,
9292
m_CodeVerifier);
9393

94-
HRESULT hr = fi.WriteFileInformation(FatFileInfo::g_FatColumnNames, *dir.second, m_Config.Filters);
94+
HRESULT hr =
95+
fi.WriteFileInformation(FatFileInfo::g_FatColumnNames, *dir.second.Writer(), m_Config.Filters);
9596
if (FAILED(hr))
9697
{
9798
Log::Error(L"Could not WriteFileInformation for '{}' [{}]", szFullName, SystemError(hr));

src/OrcCommand/Command/NTFSInfo/NTFSInfo.h

+19
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,15 @@ enum KindOfTime : DWORD
4848
class ORCUTILS_API Main : public UtilitiesMain
4949
{
5050
public:
51+
struct OutputPaths
52+
{
53+
std::optional<std::wstring> fileInfo;
54+
std::optional<std::wstring> i30Info;
55+
std::optional<std::wstring> attrInfo;
56+
std::optional<std::wstring> ntfsTimeline;
57+
std::optional<std::wstring> secDescr;
58+
};
59+
5160
class Configuration : public UtilitiesMain::Configuration
5261
{
5362
public:
@@ -123,6 +132,16 @@ class ORCUTILS_API Main : public UtilitiesMain
123132

124133
HRESULT Prepare();
125134
HRESULT GetWriters(std::vector<std::shared_ptr<Location>>& locs);
135+
136+
void GetOutputPathsByLocation(
137+
const std::vector<std::shared_ptr<Location>>& locations,
138+
std::unordered_map<std::wstring, OutputPaths>& outputPathsByLocation) const;
139+
140+
HRESULT WriteVolStats(
141+
const OutputSpec& volStatsSpec,
142+
const std::vector<std::shared_ptr<Location>>& locations,
143+
std::shared_ptr<TableOutput::IWriter>& newWriter);
144+
126145
HRESULT WriteTimeLineEntry(
127146
ITableOutput& pTimelineOutput,
128147
const std::shared_ptr<VolumeReader>& volreader,

src/OrcCommand/Command/NTFSInfo/NTFSInfoSqlSchema.xml

+5
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,11 @@
203203
<bool name="Parse" />
204204
<utf16 name="MountPoint" maxlen="256" />
205205
<utf16 name="ShadowCopyId" maxlen="256" />
206+
<utf16 name="FileInfo" maxlen="256" />
207+
<utf16 name="i30Info" maxlen="256" />
208+
<utf16 name="AttrInfo" maxlen="256" />
209+
<utf16 name="Timeline" maxlen="256" />
210+
<utf16 name="SecDescr" maxlen="256" />
206211
</table>
207212
</sqlschema>
208213

0 commit comments

Comments
 (0)