Last Friday I decided to build a small tool for CTFs. This time I tried to use Tkinter. Below you'll find few notes about it. Here we go...
Today we'll start here:The goal was to develop a small tool to solve one of the possible scenario(s) we can find on CTF machines (for example from VulnHub). It is a vulnerable Tomcat web server with admin panel available to the public. ;]
So? Our tool should:
- be able to guess the password to the panel,
- be able to upload a webshell to remote host,
- be able to connect with our revshell.
Easy like that. ;) Let's start with our example environment. For this exercise I used CTF prepared by Pentester Lab - Axis2.
As for a 'day-to-day pentest activities' most of time I'm using Kali Linux I decided to build this tool on Kali.
Let's start here:
The name of the app is related to the character from one old PL comic book - Thorgal. If you don't know it yet - it's a good time to check it. ;) Anyway...
I started from building a small window with a very basic functionality:
- connect to target server('s admin panel)
- button to start the 'attack' in our app.
After a while I decided to add few more buttons like:
- Stop - to stop current job
- Run Sh - to connect to a reverse shell
- Save - to save results from main textwindow
- Info - with few notes/link to my twitter
- Quit - to exit.
Tkinter is very interesting so I spent another few days with various manuals and tutorials available online. It was fun and I will definitely get back to that library again. ;]
For our example VM, to start bruteforce functionality I used one of the default wordlist available on Kali (/usr/share/wordlists/dirb/common.txt).
When our 'super h4ck1n9 app' is ready ;> we can start Axis2 CTF and try to use it against the machine (in my case IP was 192.168.1.10).
Checking:
As you can see if password is available in the dictionary we used during the attack - alinoe will find it.
At this stage (when 'OK' button is pressed) we can use another button: Run Sh.
Alinoe will open interactive xterm revshell with the target machine:
One more thing I found using 'Run Sh' - when clicked multiple times...
I think that's all. :)
See you next time!
For obvious reasons this code will not be publicly disclosed. (Beside that: it's pretty lame and any one can write it.;))
Brak komentarzy:
Prześlij komentarz