Skip to content
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

docker command issues #39

Closed
Anutrix opened this issue Mar 5, 2023 · 7 comments
Closed

docker command issues #39

Anutrix opened this issue Mar 5, 2023 · 7 comments
Assignees
Labels
question Further information is requested

Comments

@Anutrix
Copy link

Anutrix commented Mar 5, 2023

docker run -t enum4linux-ng -As <IP> gives no output. I suspect it just runs the command inside the container, outputs it there and stops the container when done.

So I tried docker run -it enum4linux-ng -As IP which works correctly but expectedly doesn't work with -oY, -oA, etc.

Are these issues known? Is there any workaround to get yaml output via docker run command?

@cddmp
Copy link
Owner

cddmp commented Mar 7, 2023

It works fine for me, when you run docker run -t enum4linux-ng -h, do you see the help?
And how did you build the container?

grafik

@cddmp cddmp self-assigned this Mar 7, 2023
@cddmp
Copy link
Owner

cddmp commented Mar 13, 2023

Did it work for you? Do you still have any questions?

@Anutrix
Copy link
Author

Anutrix commented Mar 13, 2023

Those commands without -it flag don't work. -t is not enough. Extra -i flag is needed.

image

This is my workaround that doesn't work with doesn't work with -oY, -oA, etc:

❯ docker run -it enum4linux-ng -A localhost | tee enum4linux-ng-results.txt
ENUM4LINUX - next generation (v1.3.1)

 ==========================
|    Target Information    |
 ==========================
[*] Target ........... localhost
[*] Username ......... ''
[*] Random Username .. 'cphnqbss'
[*] Password ......... ''
[*] Timeout .......... 5 second(s)

 ==================================
|    Listener Scan on localhost    |
 ==================================
[*] Checking LDAP
[-] Could not connect to LDAP on 389/tcp: connection refused
[*] Checking LDAPS
[-] Could not connect to LDAPS on 636/tcp: connection refused
[*] Checking SMB
[-] Could not connect to SMB on 445/tcp: connection refused
[*] Checking SMB over NetBIOS
[-] Could not connect to SMB over NetBIOS on 139/tcp: connection refused

 ========================================================
|    NetBIOS Names and Workgroup/Domain for localhost    |
 ========================================================
[-] Could not get NetBIOS names information via 'nmblookup': timed out

[!] Aborting remainder of tests since neither SMB nor LDAP are accessible

Completed after 5.01 seconds

@Anutrix
Copy link
Author

Anutrix commented Mar 13, 2023

As for how I built it? Via the commands in README.md of this repo:

$ git clone https://github.com/cddmp/enum4linux-ng
$ docker build enum4linux-ng --tag enum4linux-ng

which worked without issues afaik.

@cddmp
Copy link
Owner

cddmp commented Mar 15, 2023

Normally stdout and stderr should be connected with your terminal when using the -t parameter which does not seem to be true in your case. Regarding writing the output to your host, you could do something like that:

docker run -v $(pwd):/e4l -it enum4linux-ng 127.0.0.1 -oY /e4l/out

This would write a file "out.yaml" to your current working directory. It temporarily mounts your current working directory to /e4l inside the docker container. enum4linux-ng then writes the output yaml file to this folder. Due to the mount it ends up on your host too. Please note, that since the enum4linux-ng is running as user root inside the container, this will create a file owned by user root. This can be a security issue if you are not careful, as it would overwrite any file on your host system with the name "out.yaml" in your current working directory without asking for permission.

Btw. the easier option would be to run the tool directly from your system. You do not need a docker container for that. The docker option is just for people having issues running the tool on their system. Since Linux Mint is based on Ubuntu, it should be enough to install the following packages:

apt install smbclient python3-ldap3 python3-yaml python3-impacket

Then you can just clone the repo and run the tool directly.

Let me know if this works for you!

@cddmp cddmp added help wanted Extra attention is needed question Further information is requested and removed help wanted Extra attention is needed labels Mar 15, 2023
@Anutrix
Copy link
Author

Anutrix commented Mar 16, 2023

docker run -v $(pwd):/e4l -it enum4linux-ng 127.0.0.1 -oY /e4l/out

That works as expected but like you said it poses a risk so I didn't use it that way.

Then you can just clone the repo and run the tool directly.

I am trying avoid doing that as that would need me to run source venv/bin/activate everytime I spawn a new shell. I like venv but it doesn't mean its a bit less productive. It would also make it hard to run enum4linux-ng anywhere-anytime without having to cleanup venv folder later.

Looks like outputting docker response to local is generic problem. Maybe one day we will find solutions to docker issues blockers(xD).

Anyways, Thx for the response.

@cddmp
Copy link
Owner

cddmp commented Mar 17, 2023

Then you can just clone the repo and run the tool directly.

I am trying avoid doing that as that would need me to run source venv/bin/activate everytime I spawn a new shell. I like venv but it doesn't mean its a bit less productive. It would also make it hard to run enum4linux-ng anywhere-anytime without having to cleanup venv folder later.

No, you do not need a virtual environment in that case and therefore you also do not need to source. You just install the necessary python modules directly from the official Linux Mint repositories and then you can run the tool directly. No pip, no virutal environment. :)

@cddmp cddmp closed this as completed Mar 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants