2.3.1 Deploying AspectJWeaver into your web application
To download and deploy AspectJWeaver, run the following commands:
wget -c https://repo1.maven.org/maven2/org/aspectj/aspectjweaver/1.9.5/aspectjweaver-1.9.5.jar sudo mv aspectjweaver-1.9.5.jar /opt/tomcat9/lib sudo ln -s /opt/tomcat9/lib/aspectjweaver-1.9.5.jar /opt/tomcat9/lib/aspectjweaver.jar 2.3.2 Deploying AcuSensor into your web application
Download the Acunetix JAVA AcuSensor fromthe Acunetix UI Copy the Acunetix JAVA AcuSensor (AcuSensor.jar) to %TOMCAT-HOME%\lib - based ontheassumptionsabove, youwouldcopytheAcuSensor.jarfileto /opt/tomcat9/lib 2.3.3 Configure Tomcat to use AspectJWeaver and AcuSensor
Launch Tomcat with Load Time Weaving enabled. This can be done by adding a -javaagent parameter withthe path to aspectjweaver.jar when launching Tomcat, and optionally a parameter to enable AcuSensor debug logging For Centos 8.1and RHEL 8.1, you will need toadd2 parameters intothe Tomcat setenv.sh script (normally you will be creating anewfile): run thecommand: sudonano /opt/tomcat9/bin/setenv.sh attheendofthefile, addtheline: JAVA_OPTS="$JAVA_OPTS -javaagent:$CATALINA_HOME/lib/aspectjweaver.jar -Dacusensor.debug.log=ON" save thefile run thecommand: sudosystemctlrestarttomcat9
Note: The parameter "-Dacusensor.debug.log=ON" is optional, and can be omitted. If this parameter is retained, this will output AcuSensor logging as additional linesinthe Tomcat logs starting with"[Acunetix-debug]".
2.3.4 Disabling and Removing AcuSensor for JAVA
To remove and disable the sensor from your website you need to revert the changes done during the deployment ofthe Agent. Based ontheassumptionsabove:
Remove the Acunetix JAVA AcuSensor (AcuSensor.jar) fromthefolder where it was deployed with: rm /opt/tomcat9/lib/AcuSensor.jar Remove aspectjweaver.jar with: sudo rm /opt/tomcat9/lib/aspectjweaver.jar sudo rm /opt/tomcat9/lib/aspectjweaver-1.9.5.jar Reconfigure Tomcat with Load Time Weaving disabled: remove the"JAVA_OPTS"line added earlier inthe setenv.sh file run thecommand: sudosystemctlrestarttomcat9
Note: Although the Acunetix AcuSensor agent is secured witha strong password, it is recommended that the AcuSensor client files are uninstalled and removed fromthe web application if they are no longer in use.