OWASP SG 14nov Ryan Baxendale
OWASP SG 14nov Ryan Baxendale
Who Am I?
I am Ryan I live in Singapore
Microsoft SharePoint
Intranet content management and document management SharePoint can be used to provide:
intranet portals, document & file management, collaboration, social networks, extranets, websites, enterprise search, and business intelligence
Microsoft SharePoint
Intranet content management and document management SharePoint can be used to provide:
intranet portals, document & file management, collaboration, social networks, extranets, websites, enterprise search, and business intelligence
Microsoft SharePoint
Find additional functionality through the SharePoint site Try all the default or well know SharePoint pages:
/AllItems.aspx /Common.aspx /MyPage.aspx /recyclebin.aspx
Also try to look for the admin web interface on a high port, although probably not available over internet due to firewall
Microsoft SharePoint
isaca.org/_layouts/mobile/mbllists.aspx
Username
Microsoft SharePoint
Upload your own page, edit pages
Links to internal team sites and other confidential things
Microsoft SharePoint
Find list of user accounts, guess passwords, get access
All the site content, pages, things that should not be seen by the public, etc This is the list of users from Active Directory
Microsoft SharePoint
Dont have internal or confidential information on external facing SharePoint sites
Administrative Interfaces
Manage web applications and content on web servers
Admin interfaces let you run your own web shell
Administrative Interfaces
Usually on port 8080 (Apache Tomcat) Try default usernames and passwords (tomcat:tomcat, admin:tomcat, both:tomcat, manager:tomcat, etc)
Documentation, if you need help haxx0ring Upload metasploit payload
Administrative Interfaces
Create a metasploit payload
WAR file and upload
Administrative Interfaces
Create a metasploit payload
WAR file and upload
Administrative Interfaces
Create a metasploit payload
WAR file and upload
Administrative Interfaces
HTTP Methods (WebDAV)
PUT Put a file on the server, a web shell perhaps? DELETE Delete a file INDEX List the files PROPFIND Find files, discover backup files
IIS 6.0
WebDAV by default only supports static Web pages, not dynamic pages (ASP)
Administrative Interfaces
Generate metasploit payload
Fix the payload
Administrative Interfaces
Generate metasploit payload
Fix the payload
Administrative Interfaces
Password protected WebDAV methods
Nobody knew that the server had this functionality So nobody changed the password
Guess usernames and passwords with hydra/medusa then PUT a web shell
Administrative Interfaces
Find WebDAV enabled servers with metasploit
Administrative Interfaces
Dont let users connect to admin interfaces Firewall rules https://www.owasp.org/index.php/Administrative_Interface
JavaScript Encryption
JavaScript runs on the client side (browser)
<script> ... JavaScript ... </script>
JavaScript debuggers
Firebug (Firefox) Chrome developer tools Internet Explorer View source
JavaScript Encryption
Client: We dont use SSL/TLS because we have encrypted passwords
Implemented in JavaScript Takes the first character of the username/password ex. a and changes it to 23 Separates characters with 0 admin gets sent as 2305060340560, a = 23, d = 5, m = 6...
JavaScript Encryption
I broke your JavaScript encryption with a l33t BlackHat HaXx0r tool called...
Microsoft Excel
JavaScript Encryption
JavaScript with Public/Private key encryption
Hey ;) Heres my public key
???
Where is the chicken rice?
JavaScript Encryption
A substitution cipher is not encryption JavaScript makes secret keys visible to the user Use public/private key encryption in JavaScript
Most of the time it ends up being knows (password) and has (token) Too factor authentication is...
Now we know all the usernames Continue by doing the same thing on the next step of this broken authentication
Password Reset
Password reset
Typically an admin function to change a users password to a randomly generate password and securely transmit the new password to the user
Password Reset
Once upon a time a lazy developer needed to create a reset password page
Lets just take the change password page and make a few changes Great idea!......for pen testers
If a typical change password page takes username (from session), old password, new password and confirmed new password as input...
Creating a password reset page would only need the following input: username and new password
Password Reset
Password reset page accepted the following:
Hidden input, useraccount to administrator because we are the admin right? Hidden input, oldPassword to administrator Set Password and confirmpasswd to the new password Set userID to the victims username
Lets get access to the admin account with Cross Site Request Forgery (XSRF/CSRF)
Create a image tag with a request to change the password
Password Reset
To get it working: Admin needs to view a page with the CSRF img tag Must be logged into the application in the same web browser Possible ways to share your img tag Web forum Profile signature Create a note with HTML editor (tinymce) Send a personal message You get to login as Administrator with password4444
Password Reset
Dont be a lazy developer
So at this point its one of the most boring (secure) applications a pen tester can come across
This wasnt too interesting because I could only see the directory listing, but never access those files or folders
Something strange was going on...
There's a web application firewall (WAF) that looks at all the requests and decides if they should be forwarded on to the web server
So how do we trick the WAF into forwarding anything
48kb in bytes is 49152. The first request must be larger than 48kb, and the content-length must be larger than 48kb
Now we fill the request with 48kb of garbage This is our normal request that returns 404, but allows us to get our evil request to the web server
-----------------------(snip)------------------------
Probably using IIS 5 or 6 with custom ISAPI filters or an appliance such as CheckPoint FW-1 with Web Intelligence
WAF
Recap
Microsoft SharePoint
Keep internal and external sites separate
Administrative Interfaces
Dont let users connect to them, change default passwords
JavaScript Encryption
Dont use your own encryption, use public/private key crypto
Password Reset
Dont be a lazy developer
Questions? Comments
Contact:
ryan.baxendale@security-assessment.com
?
Think you can hack? Got talent? We are hiring!
Invite more people to OWASP meetings Sign up and be active on the OWASP Singapore mailing list
https://lists.owasp.org/mailman/listinfo/owasp-singapore