Difference between revisions of "JQuery Upgrade"

From Notes_Wiki
(Blanked the page)
Tag: Blanking
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
[[Main_Page|Home]] > [[TheHive]]


= jQuery Version Upgrade =
We can check the jQuery version by accessing the following URI:
<code>http://&lt;THEHIVE_SERVER-IP&gt;:9000/static/bootstrap/jquery.min.js</code>
=== Locate "jquery.min.js" in TheHive ===
By default, TheHive is installed in the directory <code>/opt/thehive/</code> and all files are packaged in <code>.jar</code> format.
To find the <code>jquery.min.js</code> file within the <code>.jar</code> files, run the following commands:
<pre>
cd /opt/thehive/lib/
for jar in *.jar; do
  unzip -l "$jar" | grep -i jquery.min.js && echo "Found in $jar"
done
</pre>
After executing the above command, you should find that <code>jquery.min.js</code> is located inside the <code>org.thp.thehive-frontend-5.4.10-1.jar</code> file.
=== Replace the jQuery File ===
To safely replace the <code>jquery.min.js</code> file, follow these steps:
'''Step 1:''' Create a working directory:
<pre>
mkdir /opt/thehive/tmpjar
cd /opt/thehive/tmpjar
</pre>
'''Step 2:''' Extract the JAR file:
<pre>
unzip /opt/thehive/lib/org.thp.thehive-frontend-5.4.10-1.jar
</pre>
'''Step 3:''' Replace the existing jQuery file with a secure version: 
''Note: At the time of writing, the jQuery version used is 3.7.1''
<pre>
wget https://code.jquery.com/jquery-3.7.1.min.js -O frontend/static/bootstrap/jquery.min.js
</pre>
'''Step 4:''' Rebuild the JAR file:
<pre>
zip -r org.thp.thehive-frontend-5.4.10-1.jar *
</pre>
'''Step 5:''' Replace the old JAR file (make a backup first):
<pre>
mv /opt/thehive/lib/org.thp.thehive-frontend-5.4.10-1.jar /opt/thehive/lib/org.thp.thehive-frontend-5.4.10-1.jar.bak
mv org.thp.thehive-frontend-5.4.10-1.jar /opt/thehive/lib/
</pre>
'''Step 6:''' Restart TheHive service:
<pre>
sudo systemctl restart thehive
</pre>
=== Verify the jQuery Version ===
After restarting the service, verify the jQuery version by visiting the following URL in a web browser:
<code>http://&lt;THEHIVE_SERVER-IP&gt;:9000/static/bootstrap/jquery.min.js</code>

Latest revision as of 12:45, 21 May 2025