root@iZj6c6hytildlalnu0cwt4Z:~# cat .bash_history 1 apt update && apt install openjdk-8-jdk && apt install unzip -y 2 vim /etc/profile 3 source /etc/profile 4 wget https://archive.apache.org/dist/tomcat/tomcat-7/v7.0.79/bin/apache-tomcat-7.0.79.zip 5 unzip apache-tomcat-7.0.79.zip 6 mv apache-tomcat-7.0.79 /opt/tomcatmv apache-tomcat-7.0.79 /opt/tomcat 7 mv apache-tomcat-7.0.79 /opt/tomcat 8 chmod +x /opt/tomcat/bin/*.sh 9 ls 10 history 11 flag{vulntarget_very_G00d} 12 /opt/tomcat/bin/startup.sh 13 cp /opt/tomcat/conf/server.xml /opt/tomcat/conf/server.xml.bak 14 vim /opt/tomcat/conf/server.xml 15 ps -axu | grep tomcat 16 kill -9 6961 17 /opt/tomcat/bin/startup.sh 18 cp web.xml web.xml.bak 19 pwd 20 cd .. 21 ls 22 cd /opt/ 23 ls 24 cd tomcat/ 25 ls 26 cd conf/ 27 cp web.xml web.xml.bak 28 vim web.xml 29 ps -axu | grep tomcat 30 kill -9 7409 31 /opt/tomcat/bin/startup.sh 32 pwd 33 cd .. 34 ls 35 cd webapps/ 36 ls 37 cd ROOT/ 38 ls 39 rm favicon.ico 40 cp index.jsp index.jsp.bak 41 ls 42 vim index.jsp 43 rm index.jsp 44 vim index.jsp 45 crontab -e 46 history 47 ls 48 mv vulntargetn.jsp 404.jsp 49 ls 50 rm index.jsp.bak 51 pip3 install rsa 52 ls 53 ls -lha 54 mkdir .vulntarget 55 cd .vulntarget/ 56 ls 57 mkdir keys 58 ls 59 history 60 ls 61 vim get_pem.py 62 python3 get_pem.py 63 ls 64 rm get_pem.py 65 ls 66 cd .. 67 ls 68 cp .vulntarget/keys/pubkey.pem . 69 ls 70 ls | grep jsp 71 vim encrypt_vulntarget.py 72 ls 73 vim flag.jsp 74 ls | grep jsp 75 python3 encrypt_vulntarget.py 76 ls 77 cd .vulntarget/ 78 ls 79 cd keys/ 80 ls 81 cat pubkey.pem 82 cat privkey.pem 83 cd .. 84 ls 85 cd .. 86 ls 87 rm encrypt_vulntarget.py 88 rm pubkey.pem 89 ls 90 vim index.jsp 91 ls 92 cd .. 93 ls 94 cd .. 95 ls 96 cd logs/ 97 ls 98 cat localhost_access_log.2024-06-04.txt 99 vim localhost_access_log.2024-06-04.txt 100 ls 101 vim localhost_access_log.2024-06-04.txt 102 ls 103 history 104 curl http://127.0.0.1 105 ls 106 cd 107 ls 108 ls -lha 109 cat .bashrc 110 ls 111 history > .bash_history apt update && apt install openjdk-8-jdk && apt install unzip -y vim /etc/profile source /etc/profile wget https://archive.apache.org/dist/tomcat/tomcat-7/v7.0.79/bin/apache-tomcat-7.0.79.zip unzip apache-tomcat-7.0.79.zip mv apache-tomcat-7.0.79 /opt/tomcatmv apache-tomcat-7.0.79 /opt/tomcat mv apache-tomcat-7.0.79 /opt/tomcat chmod +x /opt/tomcat/bin/*.sh ls history flag{vulntarget_very_G00d} /opt/tomcat/bin/startup.sh cp /opt/tomcat/conf/server.xml /opt/tomcat/conf/server.xml.bak vim /opt/tomcat/conf/server.xml ps -axu | grep tomcat kill -9 6961 /opt/tomcat/bin/startup.sh cp web.xml web.xml.bak pwd cd .. ls cd /opt/ ls cd tomcat/ ls cd conf/ cp web.xml web.xml.bak vim web.xml ps -axu | grep tomcat kill -9 7409 /opt/tomcat/bin/startup.sh pwd cd .. ls cd webapps/ ls cd ROOT/ ls rm favicon.ico cp index.jsp index.jsp.bak ls vim index.jsp rm index.jsp vim index.jsp crontab -e history ls mv vulntargetn.jsp 404.jsp ls rm index.jsp.bak pip3 install rsa ls ls -lha mkdir .vulntarget cd .vulntarget/ ls mkdir keys ls history ls vim get_pem.py python3 get_pem.py ls rm get_pem.py ls cd .. ls cp .vulntarget/keys/pubkey.pem . ls ls | grep jsp vim encrypt_vulntarget.py ls vim flag.jsp ls | grep jsp python3 encrypt_vulntarget.py ls cd .vulntarget/ ls cd keys/ ls cat pubkey.pem cat privkey.pem cd .. ls cd .. ls rm encrypt_vulntarget.py rm pubkey.pem ls vim index.jsp ls cd .. ls cd .. ls cd logs/ ls cat localhost_access_log.2024-06-04.txt vim localhost_access_log.2024-06-04.txt ls vim localhost_access_log.2024-06-04.txt ls history curl http://127.0.0.1 ls cd ls ls -lha cat .bashrc ls history > .bash_history history exit
from cryptography.hazmat.primitives import serialization, hashes from cryptography.hazmat.primitives.asymmetric import padding from cryptography.hazmat.primitives import serialization from cryptography.hazmat.primitives import hashes from cryptography.hazmat.primitives.asymmetric import rsa from base64 import b64decode