question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Not capturing STDOUT/STDERR

See original GitHub issue

When running certain PE files, the STDOUT/STDERR is not be captured approximately.

RunPE Version: Latest
OS: Windows 10
Build: OS Version: 10.0.19045 N/A Build 19045

Example running Mimikatz (latest):

image

[…snippet…]

image

As you can see, the execution of the PE works, however no output is pushed to the redirection pipe handlers.

I am using our C2 to wrap this functionality and when I try to get the output, there is nothing that is returned (https://github.com/nettitude/RunPE/blob/main/RunPE/Program.cs#L107)

I have also tried the CheekyBlinders (https://github.com/br-sn/CheekyBlinder) PE file, which results in the same issue of no output being collected.

Issue Analytics

  • State:closed
  • Created 9 months ago
  • Reactions:1
  • Comments:17 (9 by maintainers)

github_iconTop GitHub Comments

3reactions
benpturnercommented, Jan 24, 2023

Nice find, we’ve definitely seen some of this in the past, e.g. static vs dynamic linking when running in memory. Must have had this configuration our side, i’ll check and confirm as well 🙌

2reactions
aconite33commented, Jan 24, 2023

Anndddd boom goes the dynamite.

image

Any program you want to run within RunPE needs this changed when compiling with Visual Studio:

Project -> Properties -> C/C++ -> Code Generation -> RunTime Library -> Multi-Threaded Debug

Thanks to @kerrymilan for debugging it.

Here is CheekyBlinders running:

image

Reason for the fix might be due to static compilation?

https://learn.microsoft.com/en-us/cpp/build/reference/md-mt-ld-use-run-time-library?view=msvc-170

Read more comments on GitHub >

github_iconTop Results From Across the Web

Capturing stderr, but not stdout [duplicate]
I want to be able to run the line, capture the STDERR as a variable, and prevent either the STDOUT or STDERR from...
Read more >
How to capture output that is going neither to stdout nor ...
I think the answer to the question is "No" for the following reason: You can only redirect output that existed before the command...
Read more >
Don't include any captured stdout/stderr/log output to the ...
Hi, To reduce report file size, I'm trying to exclude any captured stdout/stderr/log output. I'm running tests with the following command: ...
Read more >
Capturing stdout and stderr from %run seems not to work
When trying to capture stdout out from %run when using %%capture cell magic, the output of %run is still streamed to the cell....
Read more >
How to capture stdout/stderr output
By default capturing is done by intercepting writes to low level file descriptors. This allows to capture output from simple print statements as...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found