dnsdiag icon indicating copy to clipboard operation
dnsdiag copied to clipboard

Python 2 Support

Open exploitprotocol opened this issue 8 years ago • 21 comments

Hi,

Awesome Tool!

I would like to include this in PentestBox, so could you please provide support for python 2.x ?

Thanks Aditya Agrawal

exploitprotocol avatar May 01 '16 23:05 exploitprotocol

It is a bit complicated given that I am using some python3 specific stuff (such as concurrent.futures and ipaddress modules). Isn't there any chance that you can bundle python3 in your package?

farrokhi avatar May 02 '16 12:05 farrokhi

Yes. I can do that. But still a large user base uses python 2.x, so it could be easy for them.

Also there is port of ipaddress module to 2.7 https://pypi.python.org/pypi/ipaddress

I am sure with some changes it can done. If not, then i will try to provide compiled binaries using py2exe.

exploitprotocol avatar May 02 '16 13:05 exploitprotocol

If you are providing the exe file at the end, PyInstaller is able to turn this code into .exe. Did you try it?

farrokhi avatar May 04 '16 09:05 farrokhi

I just tried compiling using pyinstaller, and the compiled binaries are not working fine.

exploitprotocol avatar May 04 '16 12:05 exploitprotocol

PyIntsaller should produce working exe for windows with latest commits. Please also make sure you update submodules as well and provide feedback so that I can close this issue.

farrokhi avatar May 09 '16 09:05 farrokhi

dnsping-windows

farrokhi avatar May 09 '16 09:05 farrokhi

No exe file is created in dist folder after installing dnsdiag. Also when i tried to run run file installed in scripts folder of python directly, there is error.

exploitprotocol avatar May 09 '16 09:05 exploitprotocol

Could you please upload your own created .exe files ?

exploitprotocol avatar May 09 '16 09:05 exploitprotocol

Here is how I create exe file on a Windows 10 machine (officia python 3.4 installed):

python -m PyInstaller dnseval.py --clean
python -m PyInstaller traceroute.py --clean
python -m PyInstaller ping.py --clean

resulting exe files (zipped full directory for each binary) are attached. dnsping.zip dnseval.zip dnstraceroute.zip

farrokhi avatar May 09 '16 10:05 farrokhi

Even after creating exe file, it is not working properly.

exploitprotocol avatar May 09 '16 10:05 exploitprotocol

Also the exe file provided in zip format do not work because it required an installation of python 3.4 on same system.

exploitprotocol avatar May 09 '16 10:05 exploitprotocol

clone a fresh copy. I made some changed in dnspython. dns subdirectory is a symlink to dnspython\dns subdirectory. But once you check it out on windows, it is created as a normal subdirectory. So you need to remove it and update the submodule. Once you clone a fresh copy of repo, it would be created again.

farrokhi avatar May 09 '16 10:05 farrokhi

I did that. I think because i am using python 3.5, that is why it is not working. I though this would work on python 3.x

exploitprotocol avatar May 09 '16 10:05 exploitprotocol

my bad. I zipped the wrong directory. here is a fresh one. dist.zip

farrokhi avatar May 09 '16 10:05 farrokhi

It is working now. Awesome!

Could you please now generate those files using pyinstaller with --onefile switch and upload it to releases. https://github.com/farrokhi/dnsdiag/releases

exploitprotocol avatar May 09 '16 10:05 exploitprotocol

Here you are. I will create these exe files manually until I come up with an automated per-release procedure. dist.zip

farrokhi avatar May 09 '16 10:05 farrokhi

https://github.com/farrokhi/dnsdiag/releases/tag/v2.0.0 has been released, yet it has no *.exe files, alas.

sergeevabc avatar Apr 03 '21 20:04 sergeevabc

binary packages are available now

farrokhi avatar Apr 03 '21 21:04 farrokhi

@farrokhi, it does not work on my end as follows

But your earlier package of year 2016 still works.

sergeevabc avatar Apr 04 '21 02:04 sergeevabc

Err… Hello?

sergeevabc avatar Apr 13 '21 02:04 sergeevabc

There seems to be some recent changes in PyInstaller (the tool I use to build these binaries). I found a thread here discussing this in more details: https://github.com/pyinstaller/pyinstaller/issues/1588 Bottom line is, you will probably need to manually install VC 2015 Redistributable. Please let me know if it worked.

farrokhi avatar Apr 13 '21 11:04 farrokhi