ashenchowthee / zaproxy

Automatically exported from code.google.com/p/zaproxy
0 stars 0 forks source link

owasp-zap does not launch on Kali 1.1.0a VMWare VM due to architecture detection logic #1595

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Download http://images.offensive-security.com/kali-linux-1.1.0a-vm-486.7z
2. Do all apt-get update, upgrade, dist-upgrades
3. Upon completion of all upgrades run 'uname -r'
4. Note result '3.18.0-kali3-586'
5. Try to launch owasp-zap from Kali menu
(Applications -> Kali Linux -> Web Applications -> Web Application Proxies -> 
owasp-zap)
6. Note failure to launch application
7. Open terminal
8. Type 'owasp-zap' to launch application.
9. Note output of '/usr/bin/env: bash: No such file or directory'

What is the expected output? What do you see instead?

Owasp Zap should launch from both the GUI and the terminal.  Instead the 
application silently fails from the GUI and gives the following error on the 
terminal

'/usr/bin/env: bash: No such file or directory'

What version of the product are you using? On what operating system?

Kali Linux
Downloaded 32 bit VMWare image here:
http://images.offensive-security.com/kali-linux-1.1.0a-vm-486.7z
Created VM in Virtualbox.  Updated to latest.

uname -a
inux kali 3.18.0-kali3-586 #1 Debian 3.18.6-1~kali2 (2015-03-02) i686 GNU/Linux

Hardware is an Acer C7 Chromebook. Processor is 64bit however I'm running 32bit 
Kali VM as recommended in OSCP course manual.

Please provide any additional information below.

The issue in question seems to be in the owasp-zap shell script's ARCH 
detection.  It detects arch using uname -r and has logic branches for 686, 486, 
amd64 and a general case for none of the above.

Based on the arch string it will export a JDK path to the shell environment.

Since my arch is 586, I hit the general, catch all, else clause that exports a 
directory path for the ARM JDK, which is not present on my machine.

As a result ZAP fails to start.

Original issue reported on code.google.com by phil.gr...@gmail.com on 11 Apr 2015 at 4:18

GoogleCodeExporter commented 9 years ago
My VM has the i386 JVM at path
/usr/lib/jvm/java-7-openjdk-i386

To resolve this I simply copied the elif block for ARCH=486, pasted it in as 
another elif block and modified the check to be for ARCH=586.

Both the 686 and 486 branches export the i386 JDK directory path so either of 
those should work fine I believe.

Honestly not sure if this is a bug for you guys or for Kali and their kernel / 
arch naming convention.  Either way, pretty simple fix but thought you should 
know.

Cheers.

Original comment by phil.gr...@gmail.com on 11 Apr 2015 at 4:26

GoogleCodeExporter commented 9 years ago
Attached is my updated owasp-zap script file

Original comment by phil.gr...@gmail.com on 11 Apr 2015 at 4:35

Attachments:

GoogleCodeExporter commented 9 years ago
The owasp-zap script is maintained by kali and not us.
Please raise on their tracker: https://bugs.kali.org/

Cheers

Original comment by psii...@gmail.com on 13 Apr 2015 at 9:01