-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pass a directory as an argument #1042
Comments
I'm not sure I understand: does We check every file passed into us, so a normal glob should work just fine. Could you make sure that you're running the latest release (3.0.2)? |
Nop, that doesn't work.
Actually tried it different ways in both MacOS/Windows/Linux but same results. Edit: Yes I'm on latest release.
|
Could you make sure you ran the right glob? It needs to be I'll test locally in a moment, but I just visually confirmed from the source code that we do indeed check every file passed to us: for (auto path = std::next(cmdl.begin()); path != cmdl.end(); ++path) {
try {
checksec::Checksec csec(*path);
if (json) {
results.push_back(csec);
} else {
std::cout << "Results for: " << *path << '\n';
std::cout << csec << '\n';
}
} catch (checksec::ChecksecError& error) {
std::cerr << error.what() << '\n';
usage(argv);
return 2;
} catch (...) {
std::cerr << "General error" << '\n';
usage(argv);
return 3;
}
} |
Sorry for that typo. Still the same tho.
So I thought it must be zsh quirk? But then with sh:
And bourne shell as well:
Tested on latest MacOS. |
@woodruffw could you replicate? |
Windows hotfix for now:
|
Sorry, this fell of my radar completely. Trying now... |
I can't reproduce this locally:
...audits all of the EXEs under that directory. Example output: Results for: ../test/assets/32/pegoat-authenticode.exe
Dynamic Base : "Present"
ASLR : "Present"
High Entropy VA : "NotPresent"
Force Integrity : "NotPresent"
Isolation : "Present"
NX : "Present"
SEH : "Present"
CFG : "NotPresent"
RFG : "NotPresent"
SafeSEH : "NotPresent"
GS : "Present"
Authenticode : "Present"
.NET : "NotPresent"
Results for: ../test/assets/32/pegoat-ineffective-cfg-no-dynamicbase.exe
Dynamic Base : "NotPresent"
ASLR : "NotPresent"
High Entropy VA : "NotPresent"
Force Integrity : "NotPresent"
Isolation : "Present"
NX : "Present"
SEH : "Present"
CFG : "NotPresent"
RFG : "NotPresent"
SafeSEH : "NotPresent"
GS : "Present"
Authenticode : "NotPresent"
.NET : "NotPresent"
Results for: ../test/assets/32/pegoat-no-cetcompat.exe
Dynamic Base : "Present"
ASLR : "Present"
High Entropy VA : "NotPresent"
Force Integrity : "NotPresent"
Isolation : "Present"
NX : "Present"
SEH : "Present"
CFG : "NotPresent"
RFG : "NotPresent"
SafeSEH : "NotPresent"
GS : "Present"
Authenticode : "NotPresent"
.NET : "NotPresent"
Results for: ../test/assets/32/pegoat-no-cfg.exe
Dynamic Base : "Present"
ASLR : "Present"
High Entropy VA : "NotPresent"
Force Integrity : "NotPresent"
Isolation : "Present"
NX : "Present"
SEH : "Present"
CFG : "NotPresent"
RFG : "NotPresent"
SafeSEH : "NotPresent"
GS : "Present"
Authenticode : "NotPresent"
.NET : "NotPresent"
Results for: ../test/assets/32/pegoat-no-dynamicbase.exe
Dynamic Base : "NotPresent"
ASLR : "NotPresent"
High Entropy VA : "NotPresent"
Force Integrity : "NotPresent"
Isolation : "Present"
NX : "Present"
SEH : "Present"
CFG : "NotPresent"
RFG : "NotPresent"
SafeSEH : "NotPresent"
GS : "Present"
Authenticode : "NotPresent"
.NET : "NotPresent"
Results for: ../test/assets/32/pegoat-no-gs.exe
Dynamic Base : "Present"
ASLR : "Present"
High Entropy VA : "NotPresent"
Force Integrity : "NotPresent"
Isolation : "Present"
NX : "Present"
SEH : "Present"
CFG : "NotPresent"
RFG : "NotPresent"
SafeSEH : "NotPresent"
GS : "Present"
Authenticode : "NotPresent"
.NET : "NotPresent"
Results for: ../test/assets/32/pegoat-no-integritycheck.exe
Dynamic Base : "Present"
ASLR : "Present"
High Entropy VA : "NotPresent"
Force Integrity : "NotPresent"
Isolation : "Present"
NX : "Present"
SEH : "Present"
CFG : "NotPresent"
RFG : "NotPresent"
SafeSEH : "NotPresent"
GS : "Present"
Authenticode : "NotPresent"
.NET : "NotPresent"
Results for: ../test/assets/32/pegoat-no-nxcompat.exe
Dynamic Base : "Present"
ASLR : "Present"
High Entropy VA : "NotPresent"
Force Integrity : "NotPresent"
Isolation : "Present"
NX : "NotPresent"
SEH : "Present"
CFG : "NotPresent"
RFG : "NotPresent"
SafeSEH : "NotPresent"
GS : "Present"
Authenticode : "NotPresent"
.NET : "NotPresent"
Results for: ../test/assets/32/pegoat-no-safeseh.exe
Dynamic Base : "Present"
ASLR : "Present"
High Entropy VA : "NotPresent"
Force Integrity : "NotPresent"
Isolation : "Present"
NX : "Present"
SEH : "Present"
CFG : "NotPresent"
RFG : "NotPresent"
SafeSEH : "NotPresent"
GS : "Present"
Authenticode : "NotPresent"
.NET : "NotPresent"
Results for: ../test/assets/32/pegoat-yes-cfg.exe
Dynamic Base : "Present"
ASLR : "Present"
High Entropy VA : "NotPresent"
Force Integrity : "NotPresent"
Isolation : "Present"
NX : "Present"
SEH : "Present"
CFG : "Present"
RFG : "NotPresent"
SafeSEH : "NotPresent"
GS : "Present"
Authenticode : "NotPresent"
.NET : "NotPresent"
Results for: ../test/assets/32/pegoat.exe
Dynamic Base : "Present"
ASLR : "Present"
High Entropy VA : "NotPresent"
Force Integrity : "NotPresent"
Isolation : "Present"
NX : "Present"
SEH : "Present"
CFG : "NotPresent"
RFG : "NotPresent"
SafeSEH : "NotPresent"
GS : "Present"
Authenticode : "NotPresent"
.NET : "NotPresent" |
Looking at your globs: I'm not sure if you were running in a directory that had any executables or other auditable files in it. The ZSH error is the one ZSH gives you when a glob expands to nothing; Bash and the standard |
Ping: were you able to resolve this? I can confirm that globs work correctly for me locally, on all of Winchecksec's supported hosts. |
...except for Windows of course, since Windows doesn't have shell-native globbing. Looks like I misread this a little: if you're still seeing the problem on Windows, it's because the Windows basic shell ( |
Yeah I meant for WinNT. I think the first post shows a viable option. Just scan for globs through the app interface and voila :) |
Hi! It would be nice if we could pass directory as an
<file> / <dir>
argument. A lot of times when we are looking for a potential target in exploitable binary, we look in all external PE inside the target installation and the dependencies.Right now, we have to check each PE separately for our $TARGET (manually through cli or via bash script). A more natively supported way would be awesome, something like:
Searched the repo but couldn't find this option.
Hotfix for now:
The text was updated successfully, but these errors were encountered: