p0dalirius / Coercer

A python script to automatically coerce a Windows server to authenticate on an arbitrary machine through 12 methods.
https://podalirius.net/
GNU General Public License v2.0
1.76k stars 180 forks source link

[bug] Is the Coercer application platform dependent? #47

Closed fabelx closed 1 year ago

fabelx commented 1 year ago

I'm trying to run Coercer on Windows but I'm facing with an error:

ModuleNotFoundError: No module named 'fcntl'

Found this question rror-no-module-named-fcntl.

Python 3.9.11 (tags/v3.9.11:2de452f, Mar 16 2022, 14:33:45) [MSC v.1929 64 bit (AMD64)] on win32

> pip list
Package            Version
------------------ -------
cffi               1.15.1
chardet            5.1.0
click              8.1.3
coercer            2.4
colorama           0.4.6
cryptography       39.0.0
dnspython          2.2.1
Flask              2.2.2
future             0.18.2
impacket           0.10.0
importlib-metadata 6.0.0
itsdangerous       2.1.2
Jinja2             3.1.2
ldap3              2.9.1
ldapdomaindump     0.9.4
MarkupSafe         2.1.1
pip                22.3.1
pyasn1             0.4.8
pycparser          2.21
pycryptodomex      3.16.0
pyOpenSSL          23.0.0
setuptools         65.6.3
six                1.16.0
Werkzeug           2.2.2
wheel              0.38.4
XlsxWriter         3.0.6
zipp               3.11.0
nodauf commented 1 year ago

I encounter a similar issue. I was able to use Coercer v1.6 where the fcntl module is not used.

p0dalirius commented 1 year ago

Hi,

The source of the problem was in the function get_ip_address_of_interface here: https://github.com/p0dalirius/Coercer/blob/a76c9b433a533ea6d7bf49cf9957d6d1659dd622/coercer/network/utils.py#L12-L25

The problem is, I do not find a simple way to get the ip address from the interface name under windows. I wanted to check on which platform Coercer is running through if sys.platform == "win32": but the fun thing about this is that under WSL, we get sys.platform = "linux", but no fcntl module since we're still on windows.

I'm still looking into this.

Best regards,

fabelx commented 1 year ago

Thanks for answering my question.