new module: smb > presence#561
Conversation
high privilege smb module that traces domain level admin presences in target
|
Quite a nice module, thanks for the contribution! Gonna take a closer look at it when i got the time |
|
added legacy windows support, changed logging style and tried to group hosts in latest update. |
NeffIsBack
left a comment
There was a problem hiding this comment.
Really like the idea of the module, but i think we should try to accomplish it without command execution if possible. That way AVs will not detect/stop the execution that easy. Especially task listing is often kinda risky.
If you need help feel free to dm me or someone else on discord/twitter or reach out on here.
|
updated module with every request resolved. also, thank you for the help! |
NeffIsBack
left a comment
There was a problem hiding this comment.
When you finished please check if your code matches the formatting/style guidelines: poetry run ruff check . --preview
|
done. |
…numerate domain groups on the DC
|
Fyi, also fixed a minor logging bug in the change-password module |
|
looks good, i will def need to try on a real world pentest. i hold the original in my arsenal. :)) thank you for your extended support on this. really appreciated. |
|
Thanks for the work! |
|
hello again alex! i finally got the opportunity to test it in a real world pentest. problems: 1- it doesn't get administrator.domain domain admins. |
|
Hi :) regarding your points:
|
3- no, i meant, automatic process injection if there is domain user task/s in pwn3d machine to enunerate domain related things on behalf of injected domain user. or even better adding a module option that we can use our domain user for enumerating domain related things. for example, in whitebox tests (mostly i do) i always get a domain user from client. or we can obtain from somewhere or creating ourselves if maq is positive. so i think it's a good opportunity to augment the module with this possibility. i.e: netexec smb 10.20.30.40 -u administrator -H 8020b81d23caa5ab922096948d7c192d --local-auth -M presence -o ALTUSER=pentestuser ALTPASS=Aa123456 ALTDOMAIN=zurrak.local just like impacket's old smbpasswd.py. |
|
There is the |
|
hello again alex, i'd like to explain with code. you can see at: explanation: goal is getting domain admins and enterprise admins users locally by using our domain user. and with my proposal it's possible. here is poc:
things i couldn't do (due to lack of my python knowledge): proposal: |
|
Hmm okay understood, might be worth to add it 👍 |





Description
during my engagements, i hunt a lot of local administrators. both local administrator and local administrator privileged domain user. before seeking tokens, lsass dump or process injection; i always do "-x 'dir c:\users'" and "-x tasklist /v" for getting first level user information. if there is a domain admin user then the scenario is completed. but if not, there is a lot of work. grepping "-x tasklist /v" is time consuming and not a meta.
this module first executes 'net group "domain admins" /domain' and 'net group "enterprise admins" /domain'. then seeks domain level admin users in c:\users and tasklist /v command output. also:
-it seeks only dotted administrator folders in c:\users. ie. domainname.administrator (built in administrator will be not shown on dc -- we don't need it tho..)
-it seeks both dotted and non dotted domain level admin users in c:\users. ie. domainname.emreadmin and emreadmin.
-it seeks only domain named tasks in tasklist for administrator. ie. domainname\administrator is shown, localmachinename\administrator is not shown.
please note that i need help to improve this module. this is as far as i could get with my current knowledge.
Type of change
How Has This Been Tested?
tested on a dummy domain, a domain controller and a domain client machine.
Screenshots (if appropriate):
domain admin and enterprise admin users:

check on client with local admin creds:

opening a cmd as domain admin:

check again:

check after creating folder with admin name:

check on dc with domain admin creds:

Checklist:
poetry run python -m ruff check . --preview, use--fixto automatically fix what it can)