blechschmidt / massdns

A high-performance DNS stub resolver for bulk lookups and reconnaissance (subdomain enumeration)
GNU General Public License v3.0
3.08k stars 460 forks source link

Cannot Compile The Program In Windows! #86

Closed Xeek3y closed 2 years ago

Xeek3y commented 3 years ago

I'm using Windows 7x64 Ultimate and whenever i'm trying to compile this program with Mingw or Git Bash i'm getting this following error:

MyPC@MyPC MINGW64 /d/Recon Tools/Subdomain Enumeration/Resolver/massdns (master)
$ make
mkdir -p bin
cc  -O3 -std=c11 -DHAVE_EPOLL -DHAVE_SYSINFO -Wall -fstack-protector-strong src/main.c -o bin/massdns
Makefile:4: recipe for target 'all' failed
process_begin: CreateProcess(NULL, cc -O3 -std=c11 -DHAVE_EPOLL -DHAVE_SYSINFO -Wall -fstack-protector-strong src/main.c -o bin/massdns, ...) failed.
make (e=2): The system cannot find the file specified.
mingw32-make: *** [all] Error 2
MyPC@MyPC MINGW64 /d/Recon Tools/Subdomain Enumeration/Resolver/massdns (master)
$ make nolinux
mkdir -p bin
cc  -O3 -std=c11 -Wall -fstack-protector-strong src/main.c -o bin/massdns
Makefile:10: recipe for target 'nolinux' failed
process_begin: CreateProcess(NULL, cc -O3 -std=c11 -Wall -fstack-protector-strong src/main.c -o bin/massdns, ...) failed.
make (e=2): The system cannot find the file specified.
mingw32-make: *** [nolinux] Error 2

Tried with both command make and make nolinux but both aren't working for me and have no idea what's wrong going on?

blechschmidt commented 3 years ago

I currently have no Windows machine with development environment configured but https://stackoverflow.com/a/4447561/778421 suggests that it might be an issue with the environment variables.

Does replacing $(CC) $(CFLAGS) -O3 -std=c11 -Wall -fstack-protector-strong src/main.c -o bin/massdns with gcc $(CFLAGS) -O3 -std=c11 -Wall -fstack-protector-strong src/main.c -o bin/massdns in the Makefile help?

What happens if you run cc or gcc?

gptshubham595 commented 3 years ago

I'm in win10 x64 I tried with git bash, cygwin , cmd

changing to gcc it gives this err in windows, it is because socket.h is not present in windows I think

gcc gives this output in windows

image

image

after checking in StackOverflow, I tried replacing socket.h with winsock2.h but still that doesn't help

can you have a release for windows like amass, subfinder, shuffledns, assetfinder

like below

image

Even I tried to build this using kali linux VMware and downloaded that bin folder but still I cannot run that

image

image

blechschmidt commented 2 years ago

The compilation has to take place inside the Cygwin Terminal. The installation process on Windows works as follows:

  1. Download and install Cygwin from https://cygwin.com.
  2. During the installation process, when you are prompted to select the packages to be installed, select the latest versions of gcc-core, git and make. To this end, enter the package names into the search bar and instead of Skip, select the appropriate version in the New column for each required package. For example, for git this might look like this: cygwin
  3. After the installation has completed, open the Cygwin Terminal, clone the repository there, cd into massdns and run make nolinux. Afterwards, massdns can be run using ./bin/massdns.exe. This does not work with the cmd.exe.

As I do not want to deal with architecture specifics and do not like the idea of distributing or installing binary blobs which require quite an effort to be audited, I currently do not plan to distribute executables myself.