View Issue Details

IDProjectCategoryView StatusLast Update
0000984Kali LinuxFeature Requestspublic2014-10-13 07:43
Reporteraltjx Assigned Tomuts  
PrioritynormalSeverityfeatureReproducibilityalways
Status closedResolutionno change required 
Summary0000984: Kali Linux Java Auto Updater
Description

Last night, I wrote a script to automatically update Java within Kali Linux 32-bit and 64-bit images. A few times I've been on an internal pentest and couldn't access an application because Java was significantly outdated. In some cases I couldn't even ignore this warning.

This usually caused me to go to Google, searching how to update it in Kali. I always ran across the same thread by purehate (https://forums.kali.org/showthread.php?41-Installing-Java-on-Kali-Linux). I figured I'd tweak around with this and see if I could automate it, and I did.

I have a few friends try it out on both 32-bit and 64-bit versions, and it worked flawless for them. For one person, it updated them from 6.27 to 7.51, another person from 7.17 to 7.51, and another person from 7.25 to 7.51 etc.

It simply does this:

  1. Check /opt folder for the jdk folder.
  2. Strips out the jdk folder to grab its build number.
  3. Goes to http://www.oracle.com/technetwork/java/javase/downloads/index.html and checks for any jdk versions (it'll work even when there's version 8 eventually).
  4. Follows the jdk links to the actual downloads pages.
  5. Checks the version of Kali Linux to see if it's 32-bit or 64-bit.
  6. Downloads the appropriate jdk version
  7. Extracts this file when it's finished downloading
  8. Moves it to /opt, and runs all the update-alternatives commands (also taking into perspective either 32-bit or 64-bit folders).
  9. Checks to see if Google Chrome exists. If it does, it creates a symbolic link in /opt/google/chrome/plugins to get Java to work with it.
  10. Done

If there's a request to add/remove anything to it to make it more compatible or easier, I'm game for making those changes any day.

Downloadable from my github repository: https://github.com/altjx/ipwn/blob/master/java-update.py

Additional Information

Example of its output on an up-to-date Java instance:

Updating Java.
[] Current version: 7.51
[
] Latest version: 7.51
[] Already up-to-date.
[
] Checking if Google Chrome Exists.
[*] Java already configured to work with Google Chrome.

Example of its output on an out-of-date Java instance:

Updating Java.
[] Current version: 7.25
[
] Latest version: 7.51
[] Old version detected. Performing Java update.
[
] Downloading Java update: jdk-7u51-linux-i586.tar.gz [size: 132.98 MB]
[] Download complete.
[
] Extracting archive.
[] Extraction complete.
[
] Updating alternatives.
[] Alternatives updated.
[
] Checking if Google Chrome Exists.
[] Java already configured to work with Google Chrome.
[
] Java update complete. Verify with java -version.

Activities

altjx

altjx

2014-02-21 08:52

reporter   ~0001553

Not quite sure this is something worth trying to get added. I'm guessing it'll be more appropriate to keep it as a personal script instead.

Not sure how to close this request, but it'd be great if someone could close this for me.

Thanks.

muts

muts

2014-10-13 07:43

reporter   ~0002572

Thanks, but as a policy we must keep all our files and packages in Kali under the close eyes of apt.

Issue History

Date Modified Username Field Change
2014-01-23 17:50 altjx New Issue
2014-02-21 08:52 altjx Note Added: 0001553
2014-10-13 07:43 muts Note Added: 0002572
2014-10-13 07:43 muts Status new => closed
2014-10-13 07:43 muts Assigned To => muts
2014-10-13 07:43 muts Resolution open => no change required