diff --git a/fence/agents/cisco_ucs/fence_cisco_ucs.py b/fence/agents/cisco_ucs/fence_cisco_ucs.py index 648e45fd2..c8ee4276a 100644 --- a/fence/agents/cisco_ucs/fence_cisco_ucs.py +++ b/fence/agents/cisco_ucs/fence_cisco_ucs.py @@ -7,6 +7,7 @@ sys.path.append("@FENCEAGENTSLIBDIR@") from fencing import * from fencing import fail, EC_STATUS, EC_LOGIN_DENIED, run_delay +import fencing_pycurl #BEGIN_VERSION_GENERATION RELEASE_VERSION="New Cisco UCS Agent - test release on steroids" @@ -103,7 +104,7 @@ def send_command(opt, command, timeout): url += "//" + opt["--ip"] + ":" + str(opt["--ipport"]) + "/nuova" ## send command through pycurl - conn = pycurl.Curl() + conn = fencing_pycurl.FencingPyCurl() web_buffer = io.StringIO() conn.setopt(pycurl.URL, url) conn.setopt(pycurl.HTTPHEADER, ["Content-type: text/xml"]) diff --git a/fence/agents/docker/fence_docker.py b/fence/agents/docker/fence_docker.py index 453a987f4..aa3fa2d85 100644 --- a/fence/agents/docker/fence_docker.py +++ b/fence/agents/docker/fence_docker.py @@ -9,6 +9,7 @@ sys.path.append("@FENCEAGENTSLIBDIR@") from fencing import fail_usage, all_opt, fence_action, atexit_handler, check_input, process_input, show_docs, run_delay +import fencing_pycurl #BEGIN_VERSION_GENERATION RELEASE_VERSION = "" @@ -50,7 +51,7 @@ def get_list(conn, options): def send_cmd(options, cmd, post = False): url = "http%s://%s:%s/v%s/%s" % ("s" if "--ssl" in options else "", options["--ip"], options["--ipport"], options["--api-version"], cmd) - conn = pycurl.Curl() + conn = fencing_pycurl.FencingPyCurl() output_buffer = io.StringIO() if logging.getLogger().getEffectiveLevel() < logging.WARNING: conn.setopt(pycurl.VERBOSE, True) diff --git a/fence/agents/lib/Makefile.am b/fence/agents/lib/Makefile.am index 749de19f3..79553f3af 100644 --- a/fence/agents/lib/Makefile.am +++ b/fence/agents/lib/Makefile.am @@ -1,12 +1,12 @@ MAINTAINERCLEANFILES = Makefile.in -TARGET = fencing.py fencing_snmp.py +TARGET = fencing.py fencing_snmp.py fencing_pycurl.py if BUILD_XENAPILIB TARGET += XenAPI.py endif -SRC = fencing.py.py fencing_snmp.py.py XenAPI.py.py check_used_options.py +SRC = fencing.py.py fencing_snmp.py.py XenAPI.py.py check_used_options.py fencing_pycurl.py.py XSL = fence2man.xsl fence2rng.xsl fence2wiki.xsl diff --git a/fence/agents/lib/fencing.py.py b/fence/agents/lib/fencing.py.py index 4e0b30af0..c43b389a1 100644 --- a/fence/agents/lib/fencing.py.py +++ b/fence/agents/lib/fencing.py.py @@ -897,6 +897,7 @@ def fence_login(options, re_login_string=r"(login\s*: )|((?!Last )Login Name: ) return conn def is_executable(path): + path = shlex.split(path)[0] if os.path.exists(path): stats = os.stat(path) if stat.S_ISREG(stats.st_mode) and os.access(path, os.X_OK): diff --git a/fence/agents/lib/fencing_pycurl.py.py b/fence/agents/lib/fencing_pycurl.py.py new file mode 100644 index 000000000..a3f237705 --- /dev/null +++ b/fence/agents/lib/fencing_pycurl.py.py @@ -0,0 +1,181 @@ +import pycurl +import sys +import atexit +import json +import StringIO +import time +import logging +import pprint + +__all__ = ["FencingPyCurl"] + +## do not add code here. +#BEGIN_VERSION_GENERATION +RELEASE_VERSION = "" +REDHAT_COPYRIGHT = "" +BUILD_DATE = "" +#END_VERSION_GENERATION + + +class FencingPyCurl: + active = False + input_file = None + output_file = None + options = None + actions = None + request_index = 0 + output_buffer = None + write_function = None + pycurl_obj = None + + def __init__(self): + if ( + not FencingPyCurl.active and + (FencingPyCurl.input_file or FencingPyCurl.output_file) + ): + FencingPyCurl.active = True + logging.debug("FencingPyCurl is active now") + if FencingPyCurl.active: + self.options = { + "request": {}, + "response": {}, + "time": {} + } + + self.output_buffer = StringIO.StringIO() + if FencingPyCurl.actions is None: + if FencingPyCurl.input_file: + logging.debug("Reading input file.") + + try: + with open(FencingPyCurl.input_file, "r") as f: + FencingPyCurl.actions = json.load(f) + except Exception as e: + logging.debug( + "Reading input file '{file}' failed: {msg}".format( + file=FencingPyCurl.input_file, msg=e.message + ) + ) + + if FencingPyCurl.output_file: + logging.debug("output file detected") + if not FencingPyCurl.actions: + FencingPyCurl.actions = [] + FencingPyCurl.request_index = 0 + + self.pycurl_obj = pycurl.Curl() + + def setopt(self, opt, value): + if FencingPyCurl.active: + if opt == pycurl.WRITEFUNCTION: + self.write_function = value + value = self.output_buffer.write + else: + self.options["request"][str(opt)] = value + return self.pycurl_obj.setopt(opt, value) + + def perform(self): + req_ind = FencingPyCurl.request_index + actions = FencingPyCurl.actions + if FencingPyCurl.active: + if FencingPyCurl.input_file: + perform_start = time.time() + if self.options["request"] == actions[req_ind]["request"]: + self.options["response"] = actions[req_ind]["response"] + if self.write_function: + self.write_function(self.options["response"]["output"]) + duration = actions[req_ind]["time"]["perform_duration"] + diff = duration - (time.time() - perform_start) + if diff > 0: + logging.debug("sleeping for: %s" % str(diff)) + time.sleep(diff) + FencingPyCurl.last_request_time = time.time() + else: + print "Request:" + pprint.pprint(self.options["request"]) + print "Expected:" + pprint.pprint(actions[req_ind]["request"]) + raise Exception("Invalid request") + else: + response = self.options["response"] + start_time = time.time() + self.pycurl_obj.perform() + duration = FencingPyCurl.last_request_time - start_time + self.options["time"]["perform_duration"] = duration + response["output"] = self.output_buffer.getvalue() + if self.write_function: + self.write_function(response["output"]) + if FencingPyCurl.output_file: + FencingPyCurl.actions.append(self.options) + FencingPyCurl.request_index += 1 + else: + return self.pycurl_obj.perform() + + def unsetopt(self, opt): + if FencingPyCurl.active: + del self.options["request"][str(opt)] + return self.pycurl_obj.unsetopt(opt) + + def getinfo(self, opt): + value = self.pycurl_obj.getinfo(opt) + if FencingPyCurl.active: + if FencingPyCurl.input_file: + value = self.options["response"][str(opt)] + else: + self.options["response"][opt] = value + return value + + def reset(self): + if FencingPyCurl.active: + self.options.clear() + return self.pycurl_obj.reset() + + def close(self): + return self.pycurl_obj.close() + + @staticmethod + def save_log_to_file(): + if FencingPyCurl.output_file and FencingPyCurl.actions: + logging.debug( + "Writing log to file: {0}".format(FencingPyCurl.output_file) + ) + try: + with open(FencingPyCurl.output_file, "w") as f: + json.dump( + FencingPyCurl.actions, + f, + sort_keys=True, + indent=4, + separators=(',', ': ') + ) + except Exception as e: + logging.debug( + "Writing log to file '{file}' failed: {msg}".format( + file=FencingPyCurl.output_file, msg=e.message + ) + ) + + +def get_and_remove_arg(arg, has_value=True): + logging.debug("Getting arg: '{0}'".format(arg)) + if not has_value: + if arg in sys.argv: + sys.argv.remove(arg) + logging.debug(arg + ": True") + return True + if arg in sys.argv: + index = sys.argv.index(arg) + sys.argv.remove(arg) + if len(sys.argv) > index: + value = sys.argv[index] + sys.argv.remove(value) + logging.debug("{arg}: {val}".format(arg=arg, val=value)) + return value + return None + + +FencingPyCurl.input_file = get_and_remove_arg("--fencing_pycurl-log-in") +FencingPyCurl.output_file = get_and_remove_arg("--fencing_pycurl-log-out") + +if FencingPyCurl.output_file: + atexit.register(FencingPyCurl.save_log_to_file) diff --git a/fence/agents/pve/fence_pve.py b/fence/agents/pve/fence_pve.py index 3867047d4..b0167ea55 100755 --- a/fence/agents/pve/fence_pve.py +++ b/fence/agents/pve/fence_pve.py @@ -12,6 +12,7 @@ import logging sys.path.append("@FENCEAGENTSLIBDIR@") from fencing import fail, EC_LOGIN_DENIED, atexit_handler, all_opt, check_input, process_input, show_docs, fence_action, run_delay +import fencing_pycurl if sys.version_info.major > 2: import urllib.parse as urllib else: import urllib @@ -95,7 +96,7 @@ def get_ticket(options): def send_cmd(options, cmd, post=None): url = options["url"] + cmd - conn = pycurl.Curl() + conn = fencing_pycurl.FencingPyCurl() output_buffer = io.StringIO() if logging.getLogger().getEffectiveLevel() < logging.WARNING: conn.setopt(pycurl.VERBOSE, True) diff --git a/mitm/mitmproxy-0.1/INTERNAL.md b/mitm/mitmproxy-0.1/INTERNAL.md new file mode 100644 index 000000000..e8a90e8a7 --- /dev/null +++ b/mitm/mitmproxy-0.1/INTERNAL.md @@ -0,0 +1,140 @@ +MITMPROXY LIBRARY INTERNALS +=========================== + + +Introduction +------------ +The `mitmproxy` library consists of 2 modules: `mitmproxy.py` and `sshdebug.py`. +Module `mitmproxy.py` contains implementation of proxy and replay servers +for supported network protocols. Module `sshdebug.py` serves for more human-friendly +debugging output of unencrypted SSH messages. + +The library is built on the Python Twisted network framework - see the project homepage +at [twistedmatrix.com](http://twistedmatrix.com/). + + +Supported network protocols +--------------------------- +* Telnet +* HTTP +* HTTPS/SSL +* SSH +* SNMP + + +MITM proxy server in general +---------------------------- +``` + +----------------------MITM PROXY---------------------+ + | +--------------+ +-------+ +--------------+ | + | | (receive) | <<< | Queue | <<< | (transmit) | | ++--------+ | | | +-------+ | | | +--------+ +| Client | <--> | | Proxy Server | | Proxy Client | | <--> | Server | ++--------+ | | | +-------+ | | | +--------+ + | | (transmit) | >>> | Queue | >>> | (receive) | | + | +--------------+ +-------+ +--------------+ | + +-----------------------------------------------------+ +``` + +As you can see in the above diagram, the MITM proxy has 2 componets - proxy server +and proxy client. These components communicate internally via deferred queues +and all of the communication is logged for later use by the replay server. +For details about deferred queues RTFM at [defer-intro](http://twistedmatrix.com/documents/current/core/howto/defer-intro.html). + +More info about TCP/UDP clients/servers in Twisted is available on the Twisted core [doc pages](http://twistedmatrix.com/documents/current/core/howto/index.html). +Most of the proxies are quite similar - one exception is SSH because it has multiple layers. +MITM SSH proxy and replay servers are using implementation of SSHv2 protocol +from `twisted.conch.ssh` package. There are some examples of SSH clients and +servers on twisted conch documentation pages: +[conch doc](http://twistedmatrix.com/documents/current/conch/index.html). +Another `twisted.conch.ssh` howto can be found here: +[ticket-5474](http://twistedmatrix.com/trac/ticket/5474) +and +[ticket-6001](http://twistedmatrix.com/trac/ticket/6001). + + +Notes on SSH +------------ +### SSH keypairs +SSH proxy/replay requires SSH keypairs even when they are not being used, +so you should generate them with either `mitmkeygen` or by hand (and specify +their location on command-line if you put them in non-default location). + +### Communication +The communication between proxy components starts during authentication. +Proxy server first negotiates authentication method with the client +and then forwards it to the proxy client, which in turn tries authenticating +against the real server. Then the proxy client informs proxy server about +the authentication result. After SSH transport layer connection is established, +the proxy simply forwards (decrypts and re-encrypts) connection layer packets. +The forwarding is done by the `mitmproxy.ProxySSHConnection` class which is a +subclass of `ssh.connection.SSHConnection`. The `mitmproxy.ProxySSHConnection` class simply +overrides the `packetReceived` method which puts received packets into a queue and logs +the SSH channel data (`SSH_MSG_CHANNEL_DATA` message type), which is assumed to be +the interactive shell channel. + +### Authentication +The client connects to proxy, the proxy in turn creates a connection +to real server and forwards the SSH banner to the client. The client then chooses +an authentication method to use and authenticates against the _proxy_. +In case of password auth the proxy simply forwards it to the real server. +With public key auth, however, the proxy needs to have the corresponding private +key to be able to authenticate client - so the proxy has its own keypair +to use for client connection. This also means that the proxy has to have the client's +keypair (or any other keypair that is accepted as valid for the given user on the real server). +Thus for the proxy to work with pubkey auth you need to add the public key of _proxy_ to +the list of allowed keys for the give user at the given real server (usually ~/.ssh/authorized_keys). + + +The proxy server uses Twisted's [Pluggable Authentication](http://twistedmatrix.com/documents/current/core/howto/cred.html) system. +Proxy authentication is implemented in these classes: +* ProxySSHUserAuthServer +* ProxySSHUserAuthClient +* SSHCredentialsChecker + + +Proxy server side is implemented mostly in the `SSHCredentialsChecker` class. +The `ProxySSHUserAuthServer` is a hack to be able to properly end the communication. +The authentication result is evaluted in callback method `SSHCredentialsChecker.is_auth_succes`. +There are three possible results: +* auth succeeded +* auth failed, more auth methods available - try another one +* auth failed, no more auth methods - disconnect + + +Proxy client auth is implemented in `ProxySSHUserAuthClient`. +It sends/receives information to/from proxy server through deferred queues. +After successful auth the ssh-connection service is started. + + +There are some issues with proxy auth: +* proxy and real client auth method attempt order must be the same +* real server might support less auth methods than proxy + +First issue is solved by sending the name of current auth method used by client to proxy. +Second issue is solved by pretending method failure and waiting for another auth method. + +The proxy tries to be as transparent as possible - everything depends only on server and client configuration +(eg. the number of allowed password auth attemps) - well, at least it *should*. ;) + + +### SSH Replay server +SSH replay server always successfully authenticates client on the first authentication method attempt. +The replay server is implemented in `mitmproxy.SSHReplayServerProtocol` and it is connected to the SSH service in +`mitmproxy.ReplayAvatar` class. + +### SSH proxy drawbacks +The proxy only supports logging of SSH sessions with _only one_ open channel. +It does not support other SSH features like port forwarding. + + +Notes about SNMP proxy and replay server +---------------------------------------- +SNMP proxy is ordinary UDP server that intercepts and forwards UDP packets. +Because of UDP protocol we do not know when the communication ends. +You can save the PID of SNMP proxy process and when the client ends you can terminate the proxy. +SNMP replay reads communication from log and compares received packets with expected packets. +It copes with different request IDs in packets. +There are functions for extracting and replacing the request-id from/in packets - `snmp_extract_request_id` and `snmp_replace_request_id`. +SNMP replay server works only with UDP. + diff --git a/mitm/mitmproxy-0.1/LICENSE b/mitm/mitmproxy-0.1/LICENSE new file mode 100644 index 000000000..32ad1c849 --- /dev/null +++ b/mitm/mitmproxy-0.1/LICENSE @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., [http://fsf.org/] + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + {description} + Copyright (C) {year} {fullname} + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + {signature of Ty Coon}, 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/mitm/mitmproxy-0.1/README.md b/mitm/mitmproxy-0.1/README.md new file mode 100644 index 000000000..6c9d5194e --- /dev/null +++ b/mitm/mitmproxy-0.1/README.md @@ -0,0 +1,215 @@ +MITM Proxy +========== +A collection of multi-protocol logging proxy servers and replay utilities. + +Supported protocols: + * Telnet + * HTTP + * SSL + * SSH + * SNMP + +License +------- +Distributed under the GNU General Public License version 2 (GPLv2). + +Dependencies +------------ +* Python 2.7 +* Twisted Python library (python-twisted) + +Install +------- + +``` +python2 setup.py build +sudo python2 setup.py install +``` + +Or however you like to build&install python packages. + + +Alternatively, you can also use the source RPM listed under Releases on Github. + + +Motivation +---------- +Created as a debugging tool for various enterprise fencing agents that tend +to break with each fencing device firmware upgrade, and then again (after +fixing for the new FW) for older firmware versions. :) + + +How-to +====== +NOTE: assuming fencing-specific usage + +First, generate the required keypairs with `mitmkeygen` (needed for SSL and SSH). These will get saved in `~/.mitmkeys`. + +Telnet +------ +To capture traffic between fencing agent and device, use `mitmproxy_telnet`: + +``` +mitmproxy_telnet [-H REMOTE_HOST] [-P REMOTE_PORT] [-p LOCAL_PORT] [-o OUTPUT_FILE] +``` + +eg.: to proxy requests to device.example.com:123 with proxy running on local port 1234 and outputting the captured traffic to capture.log: + +``` +mitmproxy_telnet -H device.example.com -P 123 -p 1234 -o capture.log +``` + +Once the proxy server starts listening the fencing agent can be launched, eg. for APC: + +``` +fence_apc -a localhost -u 1234 -l username -p password [...ACTION...] +``` + +After the fencing agent finished, you'll find the specified conversation log file (`capture.log` in this example), or STDOUT if you haven't specified any output file. STDOUT redirects work, too - any warnings/errors get logged to STDERR. + +Now you can view the log in more human-friendly format with `mitmlogview`. You can even make it faster or slower with the `-d` option (see `--help` for details). + +``` +mitmlogview -f capture.log +``` + +If you're satisfied with the captured log file, then you can use it with replay server: + +``` +mitmreplay_telnet -f LOG_FILE [-p LOCAL_PORT] +``` + +When the replay server starts listening, launch the fencing agent again, with the same parameters as before. "It should work." ;) + +Other protocols +--------------- +...are not much different. For extra options see the corresponding `--help` outputs. + +Useful tools +------------ +The `mitmlogdiff` provides a nice interface for comparing two proxy logs in case something goes awry (uses vimdiff, strips timestamps from the logs for easy comparison). Usage: + +``` +mitmlogdiff frist.log second.log +``` + +The extra proof-of-concept `fencegenlog` tool facilitates capturing logs and their hierarchical storage for multiple fencing devices (along with multiple protocols, firmware versions, etc). For usage info see the script's source (pretty much self-documenting). The same goes for `fencetestlog` which tests fencing agent against multiple known-good logs in order to see what is broken - essentially regression testing. These two tools could require some level of adaptation for more specific tasks. Example usage: + +``` +# provide args either on commandline or interactively + +fencegenlog [PROTOCOL] [DEVICE_NAME] [FW_VERSION] [OPERATION] [PROXY_ARGS] + +# eg. use mitmproxy_ssh (ssh protocol), save log as "apc" device with +# firmware version "1.2" for action "reboot" (those 3 parameters can be whatever), +# with not extra args for mitmproxy + +fencegenlog ssh apc 1.2 reboot + +# this results in creating ~/.mitmlogs/ssh/apc/1.2/reboot/1.log file, +# which can be used for regression testing later on +# repeat the above for each protocol/device/firmware/operation combination you want to test +# now run the log tester; again, params can ge supplied either on command-line or interactively + +fencetestlog [PROTOCOL] [DEVICE_NAME] [FW_VERSION] [OPERATION] [FENCE_CMD] [REPLAY_ARGS] + +# eg. to test all the apc over ssh logs for rebooting we created: + +fencetestlog ssh apc '*' reboot 'fence_apc blahblahblah' + +# this will run `mitmreplay_ssh` and then `fence_apc blahblahblah` +# (point it to replay server host/port, with correct login credentials, +# give it some action to perform, etc - essentially the same as in the above telnet how-to) +# with each log for each fw version of apc's reboot action over ssh and report +# the success/fail counts, along with list of failed test files +# !! remember to properly quote all the params or enter them interactively if not sure +``` + + +Protocol-specific notes +======================= + +Telnet +------ +Nothing fancy. + +HTTP +---- +* Best to run it as (eg. if used for web pages or something with multiple connections) + + ``` + while true; do mitmproxy_http [options]; done + ``` + + * That's because the proxy terminates after each connection close, which might be OK for some limited amount of tools, but completely unusable with full-blown browsers and such + +* Support for relative links, not absolute + * When the real client sees absolute link, it creates a new, direct connection to the real server (can be overriden via /etc/hosts for local clients; DNS spoofing otherwise) + * The above also fixes the `Host` HTTP header + * However, make sure you're using IP address as an argument to -H option when going the /etc/hosts way! (infinite recursion FTW!) + +* Must bind to port 80 (or whatever the real server is running at) to be compatible with redirects and absolute/relative links + * Either run proxy as root (dirty and insecure) or use authbind / iptables / selinux + +SSL +--- +* Need to have server keys generated (mitmkeygen) +* HTTP notes also apply to SSL +* Connect with SSL: + +``` +openssl s_client -connect localhost:4443 +``` + +SSH +--- +* Supports pubkey and password auth (not eg. keyboard-interactive) +* Requires generated keys (mitmkeygen) +* Make sure server accepts the generated pubkey if using pubkey auth (eg. with `ssh-copy-id -i ~/.mitmkeys/id_rsa user@host`) +* SSH password is neither saved in the log, nor shown on the screen (unless overriden by commandline option). +* Client's SSH pubkey is ignored, proxy replaces it by its own. +* Password is forwarded without problems. +* SSH client will see MITM warning if it connected to the real server before (cached server host key fingerprint). If it's connecting for the first time, then... ;) +* You can have separate keypairs for client/server, just use the -a/-A and -b/-B options (mnemonic: Alice is the client, Bob the server; pubkey is not a big deal, privkey is ;)) + + +Example Usage +------------- +* Fencing-specific usage + * Launch the logging proxy server and fence agent. + + ``` + $ mitmproxy_telnet -H apc.example.com -o fencing_apc.log & + $ fence_apc -a localhost -u 2323 -l login -p password -n 1 + ``` + + APC plug #1 will be powered off and on again and we'll have the session log. + + * Replay the log at twice the speed. + + ``` + $ mitmreplay_telnet -f fencing_apc.log -d 0.5 & + $ fence_apc -a localhost -u 2323 -l user -p password -n 1 + [...] + ERROR: Expected 6d6f67696e0d000a (login...), got 757365720d000a (user...). + FAIL! Premature end: not all messages sent. + Client disconected. + + Unable to connect/login to fencing device + ``` + + Oops, wrong username. ;) + +* Log viewer usage + * The log viewer displays the whole session in real time or with an optional time dilation. + + ``` + $ mitmlogview -f fencing_apc.log -d 10 + ``` + +* Log diff usage + * Shows the diff of two logs in vimdiff without comparing the timestamps. + + ``` + $ mitmlogdiff fencing_apc.log other_fencing_apc.log + ``` diff --git a/mitm/mitmproxy-0.1/extra/fencegenlog b/mitm/mitmproxy-0.1/extra/fencegenlog new file mode 100755 index 000000000..8bd4afada --- /dev/null +++ b/mitm/mitmproxy-0.1/extra/fencegenlog @@ -0,0 +1,33 @@ +#!/usr/bin/env bash + +# params either read from stdin or as positional args +if [ -z "$1" ] ; then + read -p "Protocol [http/ssh/ssl/telnet]: " proto + read -p "Device name: " devname + read -p "Firmware version: " fwver + read -p "Operation: " oper + read -p "Args to proxy: " args +else + proto="$1" + devname="$2" + fwver="$3" + oper="$4" + args="$5" +fi + +# make dir structure if it does not exist +mkdir -p "~/.mitmlogs/${proto}/${devname}/${fwver}/${oper}/" + +# calculate next log index/filename (for multiple samples of same protocol/device/fw/operation) +# will default to 1 of no logs exist yet +files=$(ls "~/.mitmlogs/${proto}/${devname}/${fwver}/${oper}/" | grep '[[:digit:]]*\.log' | sed 's/\.log//') +lastindex=$(echo "$files" | tac | head -n 1) +nextindex=$((lastindex+1)) +newlog="~/.mitmlogs/${proto}/${devname}/${fwver}/${oper}/${nextindex}.log" + +# print the log name +echo "Saving log to ${newlog}" + +mitmproxy_"${proto}" ${args} -o "${newlog}" + +echo "Done." diff --git a/mitm/mitmproxy-0.1/extra/fencetestlog b/mitm/mitmproxy-0.1/extra/fencetestlog new file mode 100755 index 000000000..16465dbaa --- /dev/null +++ b/mitm/mitmproxy-0.1/extra/fencetestlog @@ -0,0 +1,117 @@ +#!/usr/bin/env bash + +# clean up on exit +function on_exit { + [ ! -z $pid ] && kill -9 $pid +} + +# trap signals and clean up +trap on_exit 1 2 15 + +# params either read from stdin or as positional args +if [ -z "$1" ] ; then + read -p "Protocol [http/ssh/ssl/telnet]: " proto + read -p "Device name: " devname + read -p "Firmware version (* for all available): " fwver + read -p "Operation: " oper + read -p "Command to run: " cmd + read -p "Args to replay server: " args +else + proto="$1" + devname="$2" + fwver="$3" + oper="$4" + cmd="$5" + args="$6" +fi + +# check device validity +if [ ! -d "~/.mitmlogs/${proto}/${devname}" ] ; then + echo "No such device: ${devname}" + exit 1 +fi + +# check fw validity +if [ ! "${fwver}" = "*" ] ; then + if [ ! -d "~/.mitmlogs/${proto}/${devname}/${fwver}"] ; then + echo "No such firmware: ${fwver}" + exit 1 + fi +fi + +# get list of firmwares if fwver == '*' and return those that have logs for given operation +if [ "${fwver}" = '*' ] ; then + fwlist=$(ls "~/.mitmlogs/${proto}/${devname}/") + for v in ${fwlist} ; do + if [ -d "~/.mitmlogs/${proto}/${devname}/${v}/${oper}" ] ; then + fw_can_test="${fw_can_test} ${v}" + fi + done + if [ -z "${fw_can_test}" ] ; then + echo "No firmware to test for operation: ${oper}" + exit 1 + fi +else + # check operation validity + if [ ! -d "~/.mitmlogs/${proto}/${devname}/${fwver}/${oper}" ] ; then + echo "No such operation: ${oper}" + exit 1 + fi + fw_can_test="${fwver}" +fi + + +# test all that can be tested +successful_tests=0 +failed_tests=0 +for v in ${fw_can_test} ; do # for all firmware versions + for i in $(ls ~/.mitmlogs/${proto}/${devname}/${v}/${oper}/) ; do # loop over all operation logs for each fw ver + echo "Testing ~/.mitmlogs/${proto}/${devname}/${v}/${oper}/${i}" + + # lanuch replay server in background + mitmreplay_${proto} ${args} -f "~/.mitmlogs/${proto}/${devname}/${v}/${oper}/${i}" & + # and save its PID + pid=$! + # give server some time to start listening + sleep 1 + + # start fence agent + echo "Launching ${cmd}" + eval ${cmd} + result=$? + # fence agent finished + + # wait for replay server to terminate + wait $pid + + # check result of fence agent + echo "Exit code: $result" + + # count successful and failed test + if [ $result -eq 0 ] ; then + ((successful_tests++)) + st="${st} ~/.mitmlogs/${proto}/${devname}/${v}/${oper}/${i}" + else + ((failed_tests++)) + ft="${ft} ~/.mitmlogs/${proto}/${devname}/${v}/${oper}/${i}" + fi + + # some whitespace between test runs + echo + echo + done +done + +# print summary +echo +echo "=====" +echo "Summary: ${successful_tests} tests succeeded, ${failed_tests} failed" + +# list all failed tests +if [ ${failed_tests} -gt 0 ] ; then + echo "List of failed tests:" + for t in ${ft} ; do + echo " $t" + done + exit 1 # indicate failure +fi diff --git a/mitm/mitmproxy-0.1/extra/gendoc b/mitm/mitmproxy-0.1/extra/gendoc new file mode 100755 index 000000000..48e958f66 --- /dev/null +++ b/mitm/mitmproxy-0.1/extra/gendoc @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +# helper script for generating api documentation of mitmproxy with pydoc +# must be executed from extra directory + +set -e +cd .. +mkdir -p doc +pydoc -w mitmproxy +pydoc -w mitmproxy.mitmproxy +pydoc -w mitmproxy.sshdebug +mv *.html doc diff --git a/mitm/mitmproxy-0.1/man1/mitmproxy.1 b/mitm/mitmproxy-0.1/man1/mitmproxy.1 new file mode 100644 index 000000000..78da94fff --- /dev/null +++ b/mitm/mitmproxy-0.1/man1/mitmproxy.1 @@ -0,0 +1,38 @@ +.\" Manpage for mitmproxy. +.\" Contact saironiq@gmail.com to correct errors or typos. +.TH man 8 "22 Jan 2013" "1.0" "mitmproxy man page" +.SH NAME +mitmproxy \- collection of logging proxy/replay servers for multiple protocols +.SH SYNOPSIS +Proxy servers: + mitmproxy_http + mitmproxy_snmp + mitmproxy_ssh + mitmproxy_ssl + mitmproxy_telnet + +Replay servers: + mitmreplay_http + mitmreplay_snmp + mitmreplay_ssh + mitmreplay_ssl + mitmreplay_telnet + +Utils: + mitmkeygen - generate private/public keypairs for proxies + mitmlogdiff - compare two proxy logs + mitmlogview - view a single log file + +Fencing-specific: + fencegenlog - tool for capturing fencing traffic + fencetestlog - utility to replay and compare results +.SH DESCRIPTION +mitmproxy is a suite man-in-the-middle proxies and replay servers designed for quality assurance purposes (regression testing). The proxy scripts act as a pass-through with logging, replay scripts in turn mimic the communication and report any differences. See --help output of specific script for more information. Also see README.md and INTERNAL.md in your system's doc directory. +.SH OPTIONS +See --help output of specific script for a list of options. +.SH BUGS +Solar flares. +.SH AUTHOR +See the project's repository/homepage at http://github.com/saironiq/mitmproxy +.SH COPYRIGHT +Distributed under GNU General Public License version 2. diff --git a/mitm/mitmproxy-0.1/mitmkeygen b/mitm/mitmproxy-0.1/mitmkeygen new file mode 100755 index 000000000..929c655cf --- /dev/null +++ b/mitm/mitmproxy-0.1/mitmkeygen @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + +mkdir -p ~/.mitmkeys + + +### SSH +echo "=> Generating SSH keypair with empty passphrase in ~/.mitmkeys" +ssh-keygen -t rsa -N '' -f ~/.mitmkeys/id_rsa + + +### SSL +echo "=> Generating self-signed SSL certificate with empty passphrase in ~/.mitmkeys" +# Generate the Private Key +openssl genrsa -des3 -passout pass:0000 -out ~/.mitmkeys/server.key 1024 + +# Generate a Certificate Signing Request +openssl req -new -key ~/.mitmkeys/server.key -passin pass:0000 -batch -out ~/.mitmkeys/server.csr + +# Remove Passphrase from Key +cp ~/.mitmkeys/server.key ~/.mitmkeys/server.key.orig +openssl rsa -passin pass:0000 -in ~/.mitmkeys/server.key.orig -out ~/.mitmkeys/server.key +rm ~/.mitmkeys/server.key.orig + +# Generate a Self-Signed Certificate +openssl x509 -req -days 365 -in ~/.mitmkeys/server.csr -signkey ~/.mitmkeys/server.key -out ~/.mitmkeys/server.crt + +echo "=> Done." diff --git a/mitm/mitmproxy-0.1/mitmlogdiff b/mitm/mitmproxy-0.1/mitmlogdiff new file mode 100755 index 000000000..a913cfd43 --- /dev/null +++ b/mitm/mitmproxy-0.1/mitmlogdiff @@ -0,0 +1,13 @@ +#!/usr/bin/env bash +if [[ -z "$2" ]] ; then + echo "Compare two proxy logs in vimdiff, ignoring column with timestamps." + echo + echo "Usage:" + echo " $0 original new" + exit 1 +elif [[ ! -f $1 || ! -f $2 ]] ; then + echo "At least one of the files you specified does not exist." + exit 2 +else + vimdiff <(cut -c14- $1) <(cut -c14- $2) +fi diff --git a/mitm/mitmproxy-0.1/mitmlogview b/mitm/mitmproxy-0.1/mitmlogview new file mode 100755 index 000000000..e63ad047c --- /dev/null +++ b/mitm/mitmproxy-0.1/mitmlogview @@ -0,0 +1,28 @@ +#!/usr/bin/env python2 +''' +View a log file with an optional time dilation. +See --help for usage. +''' + +import sys +import mitmproxy + + +def main(): + ''' + Call the log viewer + ''' + (opts, _) = mitmproxy.viewer_option_parser() + + if opts.inputfile is None: + print "Need to specify an input file." + sys.exit(1) + else: + mitmproxy.logviewer(opts.inputfile, opts.delaymod) + + +if __name__ == "__main__": + try: + main() + except KeyboardInterrupt: + sys.exit(0) diff --git a/mitm/mitmproxy-0.1/mitmproxy.spec b/mitm/mitmproxy-0.1/mitmproxy.spec new file mode 100644 index 000000000..6966b92e4 --- /dev/null +++ b/mitm/mitmproxy-0.1/mitmproxy.spec @@ -0,0 +1,63 @@ +Name: mitmproxy +Version: 0.1 +Release: 1%{?dist} +Summary: Logging proxy/replay servers for Telnet, HTTP, SSL, SSH and SNMP + +Group: Development/Tools +License: GPLv2 +URL: https://github.com/saironiq/mitmproxy +Source0: %{name}-%{version}.tar.gz + +BuildArchitectures: noarch + +Requires: filesystem bash python-twisted-core python-twisted-conch + +%description +Logging proxy/replay servers for multiple protocols. + +Supported protocols: + * Telnet + * HTTP + * SSL + * SSH + * SNMP + +%changelog +* Wed Jan 22 2014 Sairon Istyar 0.1-1 +initial version + +%prep +%setup -qc + + +%build +cd %{name}-%{version} +%{__python} setup.py build +cd man1 +gzip mitmproxy.1 + + +%install +cd %{name}-%{version} +%{__python} setup.py install --root=%{buildroot} +install -Dm 644 man1/mitmproxy.1.gz %{buildroot}/%{_mandir}/man1/mitmproxy.1.gz +cd %{buildroot}/%{_mandir}/man1 +for proto in http snmp ssh ssl telnet ; do + ln -s mitmproxy.1.gz mitmproxy_${proto}.1.gz + ln -s mitmproxy.1.gz mitmreplay_${proto}.1.gz +done +for other in mitmkeygen mitmlogdiff mitmlogview fencegenlog fencetestlog ; do + ln -s mitmproxy.1.gz ${other}.1.gz +done + + +%clean +rm -rf ${buildroot} + + +%files +%defattr(-,root,root) +%doc %{name}-%{version}/{README.md,INTERNAL.md,LICENSE} +%_mandir/man1/*.1.gz +%{python_sitelib} +%{_bindir}/* diff --git a/mitm/mitmproxy-0.1/mitmproxy/__init__.py b/mitm/mitmproxy-0.1/mitmproxy/__init__.py new file mode 100644 index 000000000..edd0492c1 --- /dev/null +++ b/mitm/mitmproxy-0.1/mitmproxy/__init__.py @@ -0,0 +1,4 @@ +''' +MITM Proxy library of multi-protocol logging proxy and replay servers. +''' +from mitmproxy import * diff --git a/mitm/mitmproxy-0.1/mitmproxy/mitmproxy.py b/mitm/mitmproxy-0.1/mitmproxy/mitmproxy.py new file mode 100644 index 000000000..48c76b927 --- /dev/null +++ b/mitm/mitmproxy-0.1/mitmproxy/mitmproxy.py @@ -0,0 +1,1754 @@ +''' +Common MITM proxy classes. +''' + +from twisted.internet import protocol, reactor, defer + +# Twisted imports for SSH. +from twisted.cred import checkers, credentials, portal +from twisted.conch import avatar, error, interfaces +from zope.interface import implements +from twisted.conch.ssh import common, connection, factory, keys, \ + transport, userauth, session +from twisted.python import failure + +import Queue +import optparse +import time +import sys +import string +import re +import os +import sshdebug +import pdb +import difflib +import logging + + +# "undefined" class members, attributes "defined" outside init +# pylint: disable=E1101, W0201 +global exit_code +exit_code = list() +exit_code.append(0) + +def terminate(): + ''' + Shutdown the twisted reactor. + ''' + if reactor.running: + # There is problem with UDP reactor. Exception ReactorNotRunning is + # thrown. + try: + reactor.stop() + except: + pass + + +class MITMException(Exception): + ''' + Custom exception class for MITM proxy + ''' + pass + + +def proxy_option_parser(port, localport): + ''' + Default option parser for MITM proxies + ''' + parser = optparse.OptionParser() + parser.add_option( + '-H', '--host', dest='host', type='string', + metavar='HOST', default='localhost', + help='Hostname/IP of real server (default: %default)') + parser.add_option( + '-P', '--port', dest='port', type='int', + metavar='PORT', default=port, + help='Port of real server (default: %default)') + parser.add_option( + '-p', '--local-port', dest='localport', type='int', + metavar='PORT', default=localport, + help='Local port to listen on (default: %default)') + parser.add_option( + '-o', '--output', dest='logfile', type='string', + metavar='FILE', default=None, + help='Save log to FILE instead of writing to stdout') + opts, args = parser.parse_args() + return (opts, args) + + +def ssh_proxy_option_parser(port, localport): + ''' + Option parser for SSH proxy + ''' + parser = optparse.OptionParser() + parser.add_option( + '-H', '--host', dest='host', type='string', + metavar='HOST', default='localhost', + help='Hostname/IP of real server (default: %default)') + parser.add_option( + '-P', '--port', dest='port', type='int', + metavar='PORT', default=port, + help='Port of real server (default: %default)') + parser.add_option( + '-p', '--local-port', dest='localport', type='int', + metavar='PORT', default=localport, + help='Local port to listen on (default: %default)') + parser.add_option( + '-o', '--output', dest='logfile', type='string', + metavar='FILE', default=None, + help='Save log to FILE instead of writing to stdout') + parser.add_option( + '-a', '--client-pubkey', dest='clientpubkey', type='string', + metavar='FILE', default=os.path.expanduser('~/.mitmkeys/id_rsa.pub'), + help='Use FILE as the client pubkey (default: %default)') + parser.add_option( + '-A', '--client-privkey', dest='clientprivkey', type='string', + metavar='FILE', default=os.path.expanduser('~/.mitmkeys/id_rsa'), + help='Use FILE as the client privkey (default: %default)') + parser.add_option( + '-b', '--server-pubkey', dest='serverpubkey', type='string', + metavar='FILE', default=os.path.expanduser('~/.mitmkeys/id_rsa.pub'), + help='Use FILE as the server pubkey (default: %default)') + parser.add_option( + '-B', '--server-privkey', dest='serverprivkey', type='string', + metavar='FILE', default=os.path.expanduser('~/.mitmkeys/id_rsa'), + help='Use FILE as the server privkey (default: %default)') + parser.add_option( + '-s', '--show-password', dest='showpassword', action='store_true', + default=False, + help='Show SSH password on the screen (default: %default)') + parser.add_option( + '-D', '--debug', dest='debug', action='store_true', + default=False, + help='Enable SSH message logger with output into ssh.debug') + opts, args = parser.parse_args() + return (opts, args) + + +def replay_option_parser(localport): + ''' + Default option parser for replay servers + ''' + parser = optparse.OptionParser() + parser.add_option( + '-p', '--local-port', dest='localport', type='int', + metavar='PORT', default=localport, + help='Local port to listen on (default: %default)') + parser.add_option( + '-f', '--from-file', dest='inputfile', type='string', + metavar='FILE', default=None, + help='Read session capture from FILE instead of STDIN') + parser.add_option( + '-o', '--output', dest='logfile', type='string', + metavar='FILE', default=None, + help='Log into FILE instead of STDOUT') + parser.add_option( + '-d', '--delay-modifier', dest='delaymod', type='float', + metavar='FLOAT', default=1.0, + help='Modify response delay (default: %default)') + opts, args = parser.parse_args() + return (opts, args) + + +def ssh_replay_option_parser(localport): + ''' + Option parser for SSH replay server + ''' + parser = optparse.OptionParser() + parser.add_option( + '-p', '--local-port', dest='localport', type='int', + metavar='PORT', default=localport, + help='Local port to listen on (default: %default)') + parser.add_option( + '-f', '--from-file', dest='inputfile', type='string', + metavar='FILE', default=None, + help='Read session capture from FILE instead of STDIN') + parser.add_option( + '-o', '--output', dest='logfile', type='string', + metavar='FILE', default=None, + help='Log into FILE instead of STDOUT') + parser.add_option( + '-d', '--delay-modifier', dest='delaymod', type='float', + metavar='FLOAT', default=1.0, + help='Modify response delay (default: %default)') + parser.add_option( + '-b', '--server-pubkey', dest='serverpubkey', type='string', + metavar='FILE', default=os.path.expanduser('~/.mitmkeys/id_rsa.pub'), + help='Use FILE as the server pubkey (default: %default)') + parser.add_option( + '-B', '--server-privkey', dest='serverprivkey', type='string', + metavar='FILE', default=os.path.expanduser('~/.mitmkeys/id_rsa'), + help='Use FILE as the server privkey (default: %default)') + parser.add_option( + '-s', '--show-password', dest='showpassword', action='store_true', + default=False, + help='Show SSH password on the screen (default: %default)') + parser.add_option( + '-D', '--debug', dest='debug', action='store_true', + default=False, + help='Enable SSH message logger with output into ssh.debug') + opts, args = parser.parse_args() + return (opts, args) + + +def viewer_option_parser(): + ''' + Default option parser for log viewer + ''' + parser = optparse.OptionParser() + parser.add_option( + '-f', '--from-file', dest='inputfile', type='string', + metavar='FILE', default=None, + help='Read session capture from FILE instead of STDIN') + parser.add_option( + '-d', '--delay-modifier', dest='delaymod', type='float', + metavar='FLOAT', default=1.0, + help='Modify response delay (default: %default)') + opts, args = parser.parse_args() + return (opts, args) + + +PRINTABLE_FILTER = ''.join( + [['.', chr(x)][chr(x) in string.printable[:-5]] for x in xrange(256)]) + + +def snmp_extract_request_id(packet): + ''' + Extract some SNMP request-id information like indicies and value. If an + error occure, raise MITMException. + + @param packet: Bytes of packet. + @return Tuple of request-id start index, end index and value in bytes. + (start index, end index, value in bytes) + ''' + # Squence type 0x30 and SNMP PDU types Ax0* + complex_types = [0x30, 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7] + req_id = None + i = 0 + type_count = 0 + + while i < len(packet): + try: + msg_type = ord(packet[i]) + msg_i = i + type_count += 1 + i += 1 + + length = ord(packet[i]) + if length & 0x80 == 0x80: + # Get length specified by more than one byte. + len_bytes = length & 0x7f + i += 1 + length = int(packet[i:i+len_bytes].encode('hex'), base=16) + i += len_bytes - 1 + + logging.debug("Type (%X) at [%d], Length = %d, bytes ends at [%d]", + msg_type, msg_i, length, i) + + if type_count == 5: + # Request-id is in 5th Type block. + req_id = (i+1, i+1+length, packet[i+1:i+1+length]) + except IndexError: + exit_code.append(1) + raise MITMException("Get other than SNMP packet.") + + # Move to next Type byte. + if msg_type in complex_types: + i += 1 + else: + i += 1 + length + + if req_id == None: + exit_code.append(1) + raise MITMException("Get other than SNMP packet.") + + logging.debug("Request-id (0x%s) at [%d:%d]", req_id[2].encode('hex'), + req_id[0], req_id[1]) + logging.debug("") + return req_id + + +def snmp_replace_request_id(packet, from_packet, value=None): + ''' + Replace SNMP request-id by request-id from other SNMP packet or from + the request-id value. If parameter value is specified, the parameter + from_packet is ignored. + + @param packet: SNMP packet to replace. + @param from_packet: SNMP packet for request-id extracting. + @param value: Correct request-id value. + @return: Packet with replaced request-id. + ''' + try: + i_start, i_end, _ = snmp_extract_request_id(packet) + if value != None: + return packet[0:i_start] + value + packet[i_end:] + _, _, value = snmp_extract_request_id(from_packet) + return packet[0:i_start] + value + packet[i_end:] + except IndexError: + exit_code.append(1) + raise MITMException("Get other than SNMP packet.") + except TypeError: + exit_code.append(1) + raise MITMException("Bad value parameter.") + + +def compare_strings(str_a, str_b, a="A", b="B"): + ''' + Helper function for visualisation of differences between 2 strings. Prints + output only when logging is enabled. + + @param str_a: First string. + @param str_b: Second string. + @param a: Description of first string. + @param b: Description of second string. + @return: None + ''' + logging.debug("MATCHING BLOCKS:") + seq_matcher = difflib.SequenceMatcher(a = str_a, b = str_b) + for block in seq_matcher.get_matching_blocks(): + logging.debug(" a[%d] and b[%d] match for %d elements" % block) + #for opcode in seq_matcher.get_opcodes(): + # logging.debug(" %s\ta[%d:%d] b[%d:%d]" % opcode) + differ = difflib.Differ() + diff = differ.compare([str_a + '\n'], [str_b + '\n']) + logging.debug("DIFF: %s <---> %s", a, b) + for i in diff: + logging.debug("%s", i) + + +class Logger(object): + ''' + logs telnet traffic to STDOUT/file (TAB-delimited) + format: "time_since_start client/server 0xHex_data #plaintext" + eg. "0.0572540760 server 0x0a0d55736572204e616d65203a20 #plaintext" + "0.1084461212 client 0x6170630a #plaintext" + ''' + def __init__(self): + self.starttime = None + self.logfile = None + + def open_log(self, filename): + ''' + Set up a file for writing a log into it. + If not called, log is written to STDOUT. + ''' + self.logfile = open(filename, 'w') + + def close_log(self): + ''' + Try to close a possibly open log file. + ''' + if self.logfile is not None: + self.logfile.close() + self.logfile = None + + def log(self, who, what): + ''' + Add a new message to log. + ''' + # translate non-printable chars to dots + plain = what.decode('hex').translate(PRINTABLE_FILTER) + + if self.starttime is None: + self.starttime = time.time() + + timestamp = time.time() - self.starttime + + if self.logfile is not None: + # write to a file + self.logfile.write( + "%0.10f\t%s\t0x%s\t#%s\n" + % (timestamp, who, what, plain)) + else: + # STDOUT output + sys.stdout.write( + "%0.10f\t%s\t0x%s\t#%s\n" + % (timestamp, who, what, plain)) + + +class ProxyProtocol(protocol.Protocol): + ''' + Protocol class common to both client and server. + ''' + def __init__(self): + # all needed attributes are defined dynamically + pass + + def proxy_data_received(self, data): + ''' + Callback function for both client and server side of the proxy. + Each side specifies its input (receive) and output (transmit) queues. + ''' + if data is False: + # Special value indicating that one side of our proxy + # no longer has an open connection. So we close the + # other end. + self.receive = None + self.transport.loseConnection() + # the reactor should be stopping just about now + elif self.transmit is not None: + # Transmit queue is defined => connection to + # the other side is still open, we can send data to it. + self.transport.write(data) + self.receive.get().addCallback(self.proxy_data_received) + else: + # got some data to be sent, but we no longer + # have a connection to the other side + exit_code.append(1) + sys.stderr.write( + 'Unable to send queued data: not connected to %s.\n' + % (self.origin)) + # the other proxy instance should already be calling + # reactor.stop(), so we can just take a nap + + def dataReceived(self, data): + ''' + Received something from out input. Put it into the output queue. + ''' + self.log.log(self.origin, data.encode('hex')) + self.transmit.put(data) + + def connectionLost(self, reason=protocol.connectionDone): + ''' + Either end of the proxy received a disconnect. + ''' + if self.origin == 'server': + sys.stderr.write('Disconnected from real server.\n') + else: + sys.stderr.write('Client disconnected.\n') + self.log.close_log() + # destroy the receive queue + self.receive = None + # put a special value into tx queue to indicate connecion loss + self.transmit.put(False) + # stop the program + terminate() + +class UDPProxyServer(protocol.DatagramProtocol): + ''' + UDP proxy server. + ''' + def __init__(self, log, ipaddr, port): + ''' + Set logger, address for proxy client and address of origin client. + ''' + self.origin = 'client' + self.client_addr = None + self.client_port = None + self.log = log + self.receive = defer.DeferredQueue() + self.transmit = defer.DeferredQueue() + + # proxy client and proxy server has switched transmit and receive + client = UDPProxyClient(log, ipaddr, port, (self.receive, + self.transmit)) + reactor.listenUDP(0, client) + + def startProtocol(self): + ''' + Start proxy client. + ''' + self.receive.get().addCallback(self.proxy_data_received) + + def stopProtocol(self): + ''' + Terminate reactor. + ''' + sys.stderr.write("%s side - Stop protocol.\n" % self.origin) + terminate() + + def connectionRefused(self): + ''' + Connection was refused. + ''' + exit_code.append(1) + sys.stderr.write("%s side - Connection Refused.\n" % self.origin) + terminate() + + def datagramReceived(self, datagram, (host, port)): + ''' + Received a datagram for opposite origin side. Pass it between proxy + components (proxy server/proxy client). Save address of origin client. + ''' + self.client_addr = host + self.client_port = port + self.log.log(self.origin, datagram.encode('hex')) + self.transmit.put(datagram) + + def proxy_data_received(self, data): + ''' + Callback method for sending data to origin side. + ''' + self.transport.write(data, (self.client_addr, self.client_port)) + self.receive.get().addCallback(self.proxy_data_received) + +class UDPProxyClient(protocol.DatagramProtocol): + ''' + UDP proxy client. + ''' + def __init__(self, log, ipaddr, port, (transmit, receive)): + ''' + Set client. + ''' + self.origin = 'server' + self.log = log + self.ipaddr = ipaddr + self.port = port + self.transmit = transmit + self.receive = receive + + def startProtocol(self): + ''' + Set host for sending datagrams. + ''' + self.transport.connect(self.ipaddr, self.port) + sys.stderr.write("Sending to %s:%d.\n" % (self.ipaddr, self.port)) + self.receive.get().addCallback(self.proxy_data_received) + + def stopProtocol(self): + ''' + Terminate reactor. + ''' + sys.stderr.write("%s side - Stop protocol.\n" % self.origin) + terminate() + + def connectionRefused(self): + ''' + Connection was refused. + ''' + exit_code.append(1) + sys.stderr.write("%s side - Connection Refused.\n" % self.origin) + terminate() + + def datagramReceived(self, datagram, (host, port)): + ''' + Received a datagram for opposite origin side. Pass it between proxy + components (proxy server/proxy client). + ''' + self.log.log(self.origin, datagram.encode('hex')) + self.transmit.put(datagram) + + def proxy_data_received(self, data): + ''' + Callback method for sending data to origin side. + ''' + self.transport.write(data) + self.receive.get().addCallback(self.proxy_data_received) + +class ProxyClient(ProxyProtocol): + ''' + Client part of the MITM proxy + ''' + def connectionMade(self): + ''' + Successfully established a connection to the real server + ''' + sys.stderr.write('Connected to real server.\n') + self.origin = self.factory.origin + # input - data from the real server + self.receive = self.factory.serverq + # output - data for the real client + self.transmit = self.factory.clientq + self.log = self.factory.log + + # callback for the receiver queue + self.receive.get().addCallback(self.proxy_data_received) + + +class ProxyClientFactory(protocol.ClientFactory): + ''' + Factory for proxy clients + ''' + protocol = ProxyClient + + def __init__(self, serverq, clientq, log): + # which side we're talking to? + self.origin = 'server' + self.serverq = serverq + self.clientq = clientq + self.log = log + + def clientConnectionFailed(self, connector, reason): + exit_code.append(1) + self.clientq.put(False) + sys.stderr.write('Unable to connect! %s\n' % reason.getErrorMessage()) + + +class ProxyServer(ProxyProtocol): + ''' + Server part of the MITM proxy + ''' + # pylint: disable=R0201 + def connect_to_server(self): + ''' + Example: + factory = mitmproxy.ProxyClientFactory( + self.transmit, self.receive, self.log) + reactor.connect[PROTOCOL]( + self.host, self.port, factory [, OTHER_OPTIONS]) + ''' + exit_code.append(1) + raise MITMException('You should implement this method in your code.') + # pylint: enable=R0201 + + def connectionMade(self): + ''' + Unsuspecting client connected to our fake server. *evil grin* + ''' + # add callback for the receiver queue + self.receive.get().addCallback(self.proxy_data_received) + sys.stderr.write('Client connected.\n') + # proxy server initialized, connect to real server + sys.stderr.write( + 'Connecting to %s:%d...\n' % (self.host, self.port)) + self.connect_to_server() + + +class ProxyServerFactory(protocol.ServerFactory): + ''' + Factory for proxy servers + ''' + def __init__(self, proto, host, port, log): + self.protocol = proto + # which side we're talking to? + self.protocol.origin = "client" + self.protocol.host = host + self.protocol.port = port + self.protocol.log = log + self.protocol.receive = defer.DeferredQueue() + self.protocol.transmit = defer.DeferredQueue() + + +class ReplayServer(protocol.Protocol): + ''' + Replay server class + ''' + def __init__(self): + pass + + def connectionMade(self): + sys.stderr.write('Client connected.\n') + self.send_next() + + def send_next(self): + ''' + Called after the client connects. + We shall send (with a delay) all the messages + from our queue until encountering either None or + an exception. In case a reply is not expected from + us at this time, the head of queue will hold None + (client is expected to send more messages before + we're supposed to send a reply) - so we just "eat" + the None from head of our queue (sq). + ''' + while True: + try: + # gets either: + # * a message - continue while loop (send the message) + # * None - break from the loop (client talks next) + # * Empty exception - close the session + reply = self.serverq.get(False) + if reply is None: + break + except Queue.Empty: + # both cq and sq empty -> close the session + assert self.serverq.empty() + assert self.clientq.empty() + sys.stderr.write('Success.\n') + self.success = True + self.log.close_log() + self.transport.loseConnection() + break + + (delay, what) = reply + self.log.log('server', what) + # sleep for a while (read from proxy log), + # modified by delayMod + time.sleep(delay * self.delaymod) + self.transport.write(what.decode('hex')) + + def dataReceived(self, data): + ''' + Called when client send us some data. + Compare received data with expected message from + the client message queue (cq), report mismatch (if any) + try sending a reply (if available) by calling sendNext(). + ''' + try: + expected = self.clientq.get(False) + except Queue.Empty: + exit_code.append(1) + raise MITMException("Nothing more expected in this session.") + + exp_hex = expected[1] + got_hex = data.encode('hex') + + if got_hex == exp_hex: + self.log.log('client', expected[1]) + self.send_next() + else: + # received something else, terminate + exit_code.append(1) + sys.stderr.write( + "ERROR: Expected %s (%s), got %s (%s).\n" + % (exp_hex, exp_hex.decode('hex').translate(PRINTABLE_FILTER), + got_hex, got_hex.decode('hex').translate(PRINTABLE_FILTER))) + self.log.close_log() + terminate() + + def connectionLost(self, reason=protocol.connectionDone): + ''' + Remote end closed the session. + ''' + if not self.success: + exit_code.append(1) + sys.stderr.write('FAIL! Premature end: not all messages sent.\n') + sys.stderr.write('Client disconnected.\n') + self.log.close_log() + terminate() + + +class SNMPReplayServer(protocol.DatagramProtocol): + ''' + Replay server for UDP protocol. + ''' + def __init__(self, log, (serverq, clientq), delaymod, clientfirst): + self.log = log + self.serverq = serverq + self.clientq = clientq + self.delaymod = delaymod + self.clientfirst = clientfirst + self.success = False + self.client_addr = None + self.respond_id = None + + def connectionRefused(self): + ''' + Connection was refused. + ''' + exit_code.append(1) + self.error("Client refused connection.") + + def datagramReceived(self, data, (host, port)): + ''' + Called when client send us some data. + Compare received data with expected message from + the client message queue (cq), report mismatch (if any) + try sending a reply (if available) by calling sendNext(). + Different request-ids in SNMP packet are ignored during comparsion. + ''' + # NOTE: this remove sync mark 'None' from serverq, look into logreader + if self.respond_id == None: + self.send_next() + # address for respond + self.client_addr = (host, port) + try: + expected = self.clientq.get(False) + exp_hex = expected[1] + got_hex = data.encode('hex') + compare_strings(got_hex, exp_hex, a='Got packet', + b='Expected packet') + # Save request-id for respond + _, _, self.respond_id = snmp_extract_request_id(data) + # Replace request-id in expected packet by id from got packet. + exp_hex = snmp_replace_request_id(exp_hex.decode('hex'), None, + value=self.respond_id).encode('hex') + except Queue.Empty: + exit_code.append(1) + self.error("Nothing more expected in this session.") + return + except MITMException as exception: + exit_code.append(1) + self.error(exception) + return + + if got_hex == exp_hex: + self.log.log('client', exp_hex) + self.send_next() + else: + exit_code.append(1) + self.error("Expected %s (%s), got %s (%s)." % (exp_hex, + exp_hex.decode('hex').translate(PRINTABLE_FILTER), got_hex, + got_hex.decode('hex').translate(PRINTABLE_FILTER))) + + def error(self, errmsg): + ''' + Write error message on standard error output and exit SNMPReplayServer. + ''' + exit_code.append(1) + sys.stderr.write("ERROR: %s\n" % (errmsg)) + self.log.close_log() + terminate() + + def send_next(self): + ''' + Called after the client connects. + We shall send (with a delay) all the messages + from our queue until encountering either None or + an exception. In case a reply is not expected from + us at this time, the head of queue will hold None + (client is expected to send more messages before + we're supposed to send a reply) - so we just "eat" + the None from head of our queue (sq). + ''' + try: + while True: + # gets either: + # * a message - continue while loop (send the message) + # * None - break from the loop (client talks next) + # * Empty exception - close the session + reply = self.serverq.get(False) + if reply is None: + break + (delay, what) = reply + assert self.respond_id != None + # Set proper request-id for SNMP respond packet. + respond = snmp_replace_request_id(what.decode('hex'), None, + self.respond_id) + compare_strings(what, respond.encode('hex'), + a="respond old_id", b="respond new_id") + self.log.log('server', respond.encode('hex')) + # sleep for a while (read from proxy log), modified by delayMod + time.sleep(delay * self.delaymod) + self.transport.write(respond, self.client_addr) + except Queue.Empty: + # both cq and sq empty -> close the session + assert self.serverq.empty() + assert self.clientq.empty() + sys.stderr.write('Success.\n') + self.success = True + self.log.close_log() + self.transport.stopListening() + terminate() + except MITMException as exception: + exit_code.append(1) + self.error(exception) + + +class ReplayServerFactory(protocol.ServerFactory): + ''' + Factory for replay servers + ''' + protocol = ReplayServer + + def __init__(self, log, (serverq, clientq), delaymod, clientfirst): + self.protocol.log = log + self.protocol.serverq = serverq + self.protocol.clientq = clientq + self.protocol.delaymod = delaymod + self.protocol.clientfirst = clientfirst + self.protocol.success = False + + +def logreader(inputfile, serverq=Queue.Queue(), clientq=Queue.Queue(), + clientfirst=None): + ''' + Read the whole proxy log into two separate queues, + one with the expected client messages (cq) and the + other containing the replies that should be sent + to the client. + ''' + with open(inputfile) as infile: + lasttime = 0 + for line in infile: + # optional fourth field contains comments, + # usually an ASCII representation of the data + (timestamp, who, what, _) = line.rstrip('\n').split('\t') + + # if this is the first line of log, determine who said it + if clientfirst is None: + if who == "client": + clientfirst = True + else: + clientfirst = False + + # strip the pretty-print "0x" prefix from hex data + what = what[2:] + # compute the time between current and previous msg + delay = float(timestamp) - lasttime + lasttime = float(timestamp) + + if who == 'server': + # server reply queue + serverq.put([delay, what]) + elif who == 'client': + # put a sync mark into server reply queue + # to distinguish between cases of: + # * reply consists of a single packet + # * more packets + serverq.put(None) # sync mark + # expected client messages + clientq.put([delay, what]) + else: + exit_code.append(1) + raise MITMException('Malformed proxy log!') + return (serverq, clientq, clientfirst) + + +def logviewer(inputfile, delaymod): + ''' + Loads and simulates a given log file in either real-time + or dilated by a factor of delayMod. + ''' + with open(inputfile) as infile: + lasttime = 0 + for line in infile: + # optional fourth field contains comments, + # usually an ASCII representation of the data + (timestamp, who, what, _) = line.rstrip('\n').split('\t') + # strip the pretty-print "0x" prefix from hex data + what = what[2:] + # strip telnet IAC sequences + what = re.sub('[fF][fF]....', '', what) + # compute the time between current and previous msg + delay = float(timestamp) - lasttime + lasttime = float(timestamp) + + # wait for it... + time.sleep(delay * delaymod) + + if who == 'server': + sys.stdout.write(what.decode('hex')) + sys.stdout.flush() + + +##################### +# SSH related stuff # +##################### + +################################################################################ +# SSH Transport Layer Classes +# * SSHFactory +# * SSHServerFactory +# * ReplaySSHServerFactory +# * SSHClientFactory +# * SSHServerTransport +# * SSHClientTransport +# * ReplaySSHServerTransport +################################################################################ +class SSHFactory(factory.SSHFactory): + ''' + Base factory class for mitmproxy ssh servers. Set defualt ssh protocol and + object attributes. Create and set your authentication checker or subclass + and override defaults: protocol, services, portal, checker and attributes. + + @ivar spub: A path to server public key. + @type spub: C{str} + @ivar spriv: A path to server private key. + @type spriv: C{str} + ''' + def __init__(self, opts): + ''' + SSHFactory construcotr. + + @param opts: Class created by some ssh option parser with atributes + opts.logfile (path to logfile), opts.serverpubkey (path to server + public key), opts.serverprivkey (path to server private key) + ''' + # Default ssh protocol, realm and services. + self.protocol = transport.SSHServerTransport + self.services = { + 'ssh-userauth':userauth.SSHUserAuthServer, + 'ssh-connection':connection.SSHConnection, + } + self.portal = portal.Portal(Realm()) + + # Defaut attributes. + self.log = Logger() + if opts.logfile is not None: + self.log.open_log(opts.logfile) + self.spub = opts.serverpubkey + self.spriv = opts.serverprivkey + self.sshdebug = sshdebug.SSHDebug(opts.showpassword) + + def set_authentication_checker(self, checker): + ''' + Set portal's credentials checker. + ''' + self.portal.checkers = {} + self.portal.registerChecker(checker) + + def getPublicKeys(self): + ''' + Provide public keys for proxy server. + ''' + keypath = self.spub + if not os.path.exists(keypath): + exit_code.append(1) + raise MITMException( + "Private/public keypair not generated in the keys directory.") + + return {'ssh-rsa': keys.Key.fromFile(keypath)} + + def getPrivateKeys(self): + ''' + Provide private keys for proxy server. + ''' + keypath = self.spriv + if not os.path.exists(keypath): + exit_code.append(1) + raise MITMException( + "Private/public keypair not generated in the keys directory.") + return {'ssh-rsa': keys.Key.fromFile(keypath)} + + +class SSHServerFactory(SSHFactory): + ''' + Factory class for proxy SSH server. + ''' + # ignore 'too-many-instance-attributes', 'too-many-arguments' + # pylint: disable=R0902,R0913 + def __init__(self, opts): + ''' + Initialize base class and override defualt protocol, services and set + attributes and credentials checker. + ''' + SSHFactory.__init__(self, opts) + + # Override default protocol and services + self.protocol = SSHServerTransport + self.services = { + 'ssh-userauth':ProxySSHUserAuthServer, + 'ssh-connection':ProxySSHConnection, + } + + # Our attribute settings + self.host = opts.host + self.port = opts.port + self.cpub = opts.clientpubkey + self.cpriv = opts.clientprivkey + self.showpass = opts.showpassword + self.origin = 'client' + self.serverq = defer.DeferredQueue() + self.clientq = defer.DeferredQueue() + # Aliases transmit and receive for the queues. + # serverq - data for server + # clientq - data for client + # Proxy server receive data from client and transmit to server. + self.receive = self.clientq + self.transmit = self.serverq + + # Set our credentials checker. + self.set_authentication_checker(SSHCredentialsChecker(self)) + # pylint: enable=R0913 + # pylint: enable=R0902 + + +class ReplaySSHServerFactory(SSHFactory): + ''' + Factory class for SSH replay server. + ''' + def __init__(self, opts): + ''' + Initialize base class and override protocol, portal and credentials + checker. + ''' + SSHFactory.__init__(self, opts) + self.origin = 'client' + self.protocol = ReplaySSHServerTransport + + # Create our service ReplayAvatar for portal. + (serverq, clientq, clientfirst) = logreader(opts.inputfile) + replay_factory = ReplayServerFactory(self.log, (serverq, clientq), + opts.delaymod, clientfirst) + replay_factory.protocol = SSHReplayServerProtocol + self.avatar = ReplayAvatar(replay_factory.protocol()) + + # Override default protal and credentials checker. + self.portal = portal.Portal(Realm(self.avatar)) + self.set_authentication_checker(ReplaySSHCredentialsChecker()) + + +# ignore 'too-many-instance-attributes' +# pylint: disable=R0902 +class SSHClientFactory(protocol.ClientFactory): + ''' + Factory class for proxy SSH client. + ''' + def __init__(self, proto, proxy_factory, username, password): + # which side we're talking to? + self.origin = 'server' + self.protocol = proto + self.serverq = proxy_factory.serverq + self.clientq = proxy_factory.clientq + self.log = proxy_factory.log + self.username = username + self.password = password + self.showpass = proxy_factory.showpass + self.cpub = proxy_factory.cpub + self.cpriv = proxy_factory.cpriv + # Aliases transmit and receive for the queues. + # serverq - data for server + # clientq - data for client + # Proxy client receive data from server and transmit to client. + self.receive = self.serverq + self.transmit = self.clientq + self.sshdebug = proxy_factory.sshdebug + + def clientConnectionFailed(self, connector, reason): + exit_code.append(1) + self.clientq.put(False) + sys.stderr.write('Unable to connect! %s\n' % reason.getErrorMessage()) + + +# ignore 'too-many-public-methods' +# pylint: disable=R0904,R0902 + + +class SSHServerTransport(transport.SSHServerTransport): + ''' + SSH proxy server protocol. Subclass of SSH transport protocol layer + representation for servers. + ''' + # ignore 'too-many-public-methods' + # pylint: disable=R0904 + def __init__(self): + ''' + Nothing to do. + ''' + pass + + def connectionMade(self): + ''' + Calls parent method after establishing connection + and sets some attributes. + ''' + transport.SSHServerTransport.connectionMade(self) + sys.stderr.write("Original client connected to proxy server.\n") + + def connectionLost(self, reason): + ''' + Either end of the proxy received a disconnect. + ''' + if self.factory.origin == 'server': + sys.stderr.write('Disconnected from real server.\n') + else: + sys.stderr.write('Client disconnected.\n') + self.factory.log.close_log() + # destroy the receive queue + self.factory.receive = None + # put a special value into tx queue to indicate connecion loss + self.factory.transmit.put(False) + # stop the program + terminate() + + def dispatchMessage(self, messageNum, payload): + ''' + In parent method packets are distinguished and dispatched to message + processing methods. Added extended logging. + ''' + self.factory.sshdebug.log_packet(self.factory.origin, 'in', messageNum, + payload) + transport.SSHServerTransport.dispatchMessage(self, messageNum, payload) + + def sendPacket(self, messageType, payload): + ''' + Extending internal logging and set message dispatching between proxy + components if client successfully authenticated. + ''' + self.factory.sshdebug.log_packet(self.factory.origin, 'out', + messageType, payload) + transport.SSHServerTransport.sendPacket(self, messageType, payload) + + if messageType == 52: + # SSH_MSG_USERAUTH_SUCCESS + self.factory.receive.get().addCallback(self.proxy_data_received) + + def proxy_data_received(self, data): + ''' + Callback function for both client and server side of the proxy. + Each side specifies its input (receive) and output (transmit) queues. + ''' + if data is False: + # Special value indicating that one side of our proxy + # no longer has an open connection. So we close the + # other end. + self.factory.receive = None + self.transport.loseConnection() + # the reactor should be stopping just about now + elif self.factory.transmit is not None: + msgnum = ord(data[0]) + payload = data[1:] + # Forward packet to it's intended destination + self.sendPacket(msgnum, payload) + # In case of disconnect packet we lose connection, + # otherwise callback for data processing is set up + if msgnum == 1: + self.transport.loseConnection() + else: + self.factory.receive.get().addCallback(self.proxy_data_received) + else: + # got some data to be sent, but we no longer + # have a connection to the other side + exit_code.append(1) + sys.stderr.write( + 'Unable to send queued data: not connected to %s.\n' + % (self.factory.origin)) + # the other proxy instance should already be calling + # reactor.stop(), so we can just take a nap + + # pylint: enable=R0904 + + +class SSHClientTransport(transport.SSHClientTransport): + ''' + SSH proxy client protocol. Subclass of SSH transport protocol layer + representation for clients. + ''' + def __init__(self): + ''' + Set flag for ssh_DISCONNECT method. + ''' + self.auth_layer = True + + def connectionMade(self): + ''' + Call parent method after enstablishing connection and make some + initialization. + ''' + transport.SSHClientTransport.connectionMade(self) + sys.stderr.write('Connected to real server.\n') + + def ssh_DISCONNECT(self, packet): + ''' + Call parent method and inform proxy server about disconnect recieved + from original server. This information depends on ssh layer. + ''' + if self.auth_layer: + self.factory.transmit.put(-1) + else: + self.factory.transmit.put(packet) + transport.SSHClientTransport.ssh_DISCONNECT(self, packet) + + def connectionLost(self, reason): + ''' + Either end of the proxy received a disconnect. + ''' + sys.stderr.write('Disconnected from real server.\n') + # put a special value into tx queue to indicate connecion loss + self.factory.transmit.put(False) + # destroy the receive queue + self.factory.receive = None + self.factory.log.close_log() + terminate() + + def dispatchMessage(self, messageNum, payload): + ''' + Add internal logging of incoming packets. + ''' + self.factory.sshdebug.log_packet(self.factory.origin, 'in', messageNum, + payload) + transport.SSHClientTransport.dispatchMessage(self, messageNum, payload) + + def sendPacket(self, messageType, payload): + ''' + Add internal logging of outgoing packets. + ''' + self.factory.sshdebug.log_packet(self.factory.origin, 'out', + messageType, payload) + transport.SSHClientTransport.sendPacket(self, messageType, payload) + + def verifyHostKey(self, pubKey, fingerprint): + ''' + Required implementation of server host key verification. + As we're acting as a passthrogh, we can safely leave this + up to the client. + ''' + # ignore 'unused-argument' warning + # pylint: disable=W0613 + return defer.succeed(1) + # pylint: enable=W0613 + + def connectionSecure(self): + ''' + Required implementation of a call to run another service. + ''' + self.requestService( + ProxySSHUserAuthClient( + self.factory.username, ProxySSHConnection())) + + def proxy_data_received(self, data): + ''' + Callback function for both client and server side of the proxy. + Each side specifies its input (receive) and output (transmit) queues. + ''' + if data is False: + # Special value indicating that one side of our proxy + # no longer has an open connection. So we close the + # other end. + self.factory.receive = None + self.transport.loseConnection() + # the reactor should be stopping just about now + elif self.factory.transmit is not None: + # Transmit queue is defined => connection to + # the other side is still open, we can send data to it. + self.sendPacket(ord(data[0]), data[1:]) + self.factory.receive.get().addCallback(self.proxy_data_received) + else: + # got some data to be sent, but we no longer + # have a connection to the other side + exit_code.append(1) + sys.stderr.write( + 'Unable to send queued data: not connected to %s.\n' + % (self.factory.origin)) + # the other proxy instance should already be calling + # reactor.stop(), so we can just take a nap + +# pylint: enable=R0904 + + +# pylint: disable=R0904 +class ReplaySSHServerTransport(transport.SSHServerTransport): + ''' + Provides SSH replay server service. + ''' + def __init__(self): + ''' + Nothing to do. Parent class doesn't have constructor. + ''' + pass + + def connectionMade(self): + ''' + Print info on stderr and call parent method after + establishing connection. + ''' + transport.SSHServerTransport.connectionMade(self) + + def dispatchMessage(self, messageNum, payload): + ''' + Added extended logging. + ''' + self.factory.sshdebug.log_packet(self.factory.origin, 'in', messageNum, + payload) + transport.SSHServerTransport.dispatchMessage(self, messageNum, payload) + + def sendPacket(self, messageType, payload): + ''' + Added extended logging. + ''' + self.factory.sshdebug.log_packet(self.factory.origin, 'out', + messageType, payload) + transport.SSHServerTransport.sendPacket(self, messageType, payload) +# pylint: enable=R0904 + + +################################################################################ +# SSH Authentication Layer Classes +# * ProxySSHUserAuthServer +# * ProxySSHUserAuthClient +# * SSHCredentialsChecker +# * ReplaySSHCredentialsChecker +# * Realm +################################################################################ +class ProxySSHUserAuthServer(userauth.SSHUserAuthServer): + ''' + Implements server side of 'ssh-userauth'. Subclass is needed for + implementation of transparent authentication trough proxy, + concretely for sending disconnect messages. + ''' + def __init__(self): + ''' + Set password delay. + ''' + self.passwordDelay = 0 + + def _ebBadAuth(self, reason): + ''' + A little proxy authentication hack. + Send disconnect if real server send one. + Override this class because we don't have access to transport object + in Credentials checker object, so raised exception is caught here + and disconnect msg is sent. + ''' + if reason.check(MITMException): + exit_code.append(1) + self.transport.sendDisconnect( + transport.DISCONNECT_NO_MORE_AUTH_METHODS_AVAILABLE, + 'too many bad auths') + return + userauth.SSHUserAuthServer._ebBadAuth(self, reason) + + +class ProxySSHUserAuthClient(userauth.SSHUserAuthClient): + ''' + Implements client side of 'ssh-userauth'. + Supported authentication methods are publickey and password. + ''' + def __init__(self, user, instance): + ''' + Call parent constructor. + ''' + userauth.SSHUserAuthClient.__init__(self, user, instance) + + def ssh_USERAUTH_FAILURE(self, packet): + ''' + Inform the proxy server about auth-method failure and attempt to + authenticate with method according to original client. + ''' + if self.lastAuth is not "none": + self.transport.factory.transmit.put(0) + # Supported server methods. + can_continue, _ = common.getNS(packet) + # Get method name trought Deffered object. + deferred_method = self.transport.factory.receive.get() + deferred_method.addCallback(self.try_method, can_continue) + return deferred_method + + def try_method(self, method, can_continue): + ''' + Try authentication method received from proxy server and return boolean + result. + ''' + assert method in ['publickey', 'password', False] + # False means no more authentication methods or client disconnected. + # Proxy server may terminate reactor before proxy client send + # DISCONNECT_MSG, but it doesn't matter. + if method == False: + exit_code.append(1) + can_continue = [] + else: + # Server supports less auth methods than proxy server. We pretend + # that auth methods failed and wait for another auth method. + if method not in can_continue: + self.transport.factory.transmit.put(0) + deferred_method = self.transport.factory.receive.get() + deferred_method.addCallback(self.try_method, can_continue) + return deferred_method + else: + can_continue = [method] + + # fix for python-twisted version 8.2.0 (RHEL 6.x) + try: + return self._cbUserauthFailure(None, iter(can_continue)) + except AttributeError: + # old twisted 8.2.0 + if self.tryAuth(method): + return + exit_code.append(1) + self.transport.sendDisconnect( + transport.DISCONNECT_NO_MORE_AUTH_METHODS_AVAILABLE, + 'no more authentication methods available') + + + def ssh_USERAUTH_SUCCESS(self, packet): + ''' + Add new callback for processing data from proxy server, inform proxy + server about authentication method success and call parent method. + ''' + self.transport.factory.receive.get().addCallback( + self.transport.proxy_data_received) + self.transport.auth_layer = False + self.transport.factory.transmit.put(1) + userauth.SSHUserAuthClient.ssh_USERAUTH_SUCCESS(self, packet) + + + def show_password(self, password): + ''' + Show password on proxy output if option was true. + ''' + #if self.transport.factory.showpass: + if self.transport.factory.showpass: + sys.stderr.write("SSH 'password' for user '%s' is: '%s'\n" % + (self.transport.factory.username, password)) + return password + + + def getPassword(self, prompt = None): + ''' + Return deffered with password from ssh proxy server and add callback + for showing password. + ''' + tmp_deferred = self.transport.factory.password.get() + tmp_deferred.addCallback(self.show_password) + return tmp_deferred + + def getPublicKey(self): + ''' + Create PublicKey blob and return it or raise exception. + ''' + keypath = self.transport.factory.cpub + if not (os.path.exists(keypath)): + exit_code.append(1) + raise MITMException( + "Public/private keypair not generated in the keys directory.") + return keys.Key.fromFile(keypath).blob() + + def getPrivateKey(self): + ''' + Create PrivateKey object and return it or raise exception. + ''' + keypath = self.transport.factory.cpriv + if not (os.path.exists(keypath)): + exit_code.append(1) + raise MITMException( + "Public/private keypair not generated in the keys directory.") + return defer.succeed(keys.Key.fromFile(keypath).keyObject) + + +class SSHCredentialsChecker(object): + ''' + Implement publickey and password authentication method on proxy server + side. + ''' + implements(checkers.ICredentialsChecker) + credentialInterfaces = (credentials.ISSHPrivateKey, + credentials.IUsernamePassword,) + + def __init__(self, proxy_factory): + self.proxy_factory = proxy_factory + self.receive = self.proxy_factory.clientq + self.transmit = self.proxy_factory.serverq + self.password = defer.DeferredQueue() + self.connected = False + # ignore 'invalid-method-name' + # pylint: disable=C0103 + # ignore 'nonstandard-exception' + # pylint: disable=W0710 + def requestAvatarId(self, creds): + ''' + Set a callback for user auth success + ''' + assert hasattr(creds, "username") + # set username for connect_to_server() method + self.username = creds.username + # set callback for evaluation of authentication result + deferred = self.proxy_factory.receive.get().addCallback( + self.is_auth_success) + # inform proxy client about authentication method + if hasattr(creds, 'password'): + # password for proxy client + self.password.put(creds.password) + self.proxy_factory.transmit.put('password') + else: + self.proxy_factory.transmit.put('publickey') + if not self.connected: + self.connect_to_server() + self.connected = True + return deferred + + # pylint: enable=C0103 + + def is_auth_success(self, result): + ''' + Check authentication result from proxy client and raise exception, + or return username for service. + ''' + assert result in [-1, 0, 1] + if result == 1: + # Auth success + return self.username + elif result == 0: + # Authentication Failure, so initiate another authentication + # attempt with this exception. + raise failure.Failure(error.UnauthorizedLogin) + elif result == -1: + # Received disconnect from server. + exit_code.append(1) + raise failure.Failure( + MITMException("No more authentication methods")) + + # pylint: enable=W0710 + + def connect_to_server(self): + ''' + Start mitm proxy client. + ''' + # now connect to the real server and begin proxying... + client_factory = SSHClientFactory(SSHClientTransport, + self.proxy_factory, + self.username, + self.password) + reactor.connectTCP(self.proxy_factory.host, self.proxy_factory.port, + client_factory) + + +class ReplaySSHCredentialsChecker(object): + ''' + Allow access on reply server with publickey or password authentication + method. This class do nothing useful, but it must be implemented because of + twisted authentication framework. + ''' + # ignore 'too-few-public-methods' + # pylint: disable=R0903 + implements(checkers.ICredentialsChecker) + credentialInterfaces = (credentials.ISSHPrivateKey, + credentials.IUsernamePassword,) + def __init__(self): + ''' + Nothing to do. + ''' + pass + + # pylint: disable=C0103,W0613,R0201 + def requestAvatarId(self, creds): + ''' + Return avatar id for any authentication method. + ''' + return "ANONYMOUS" + + # pylint: enable=C0103,R0903,R0201,W0613 + + +class Realm(object): + ''' + The realm connects application-specific objects to the authentication + system. + + Realm connects our service and authentication methods. + ''' + # ignore 'too-few-public-methods' + # pylint: disable=R0903 + implements(portal.IRealm) + + def __init__(self, avatar=avatar.ConchUser()): + ''' + Set the default avatar object. + ''' + self.avatar = avatar + + # ignore 'invalid-name', 'no-self-use' + # pylint: disable=C0103,R0201 + def requestAvatar(self, avatarId, mind, *interfaces): + ''' + Return object which provides one of the given interfaces of service. + + Our object provides no service interface and even won't be used, but + this is needed for proper twisted ssh authentication mechanism. + ''' + # ignore 'unused-argument' warning + # pylint: disable=W0613 + return interfaces[0], self.avatar, lambda: None + # pylint: enable=W0613 + + # pylint: enable=C0103,R0201,R0903 + + +################################################################################ +# SSH Connection Layer Classes +# * ProxySSHConnection +# * ReplayAvatar +# * SSHReplayServerProtocol +################################################################################ +# ignore 'too-many-public-methods' +# pylint: disable=R0904 +class ProxySSHConnection(connection.SSHConnection): + ''' + Overrides regular SSH connection protocol layer. + + Dispatches packets between proxy componets (server/client part) instead of + message processing and performs channel communication logging. + ''' + def packetReceived(self, messageNum, packet): + ''' + Log data and send received packet to the proxy server side. + ''' + self.log_channel_communication(chr(messageNum) + packet) + self.transport.factory.transmit.put(chr(messageNum) + packet) + + def log_channel_communication(self, payload): + ''' + Logs channel communication. + + @param payload: The payload of the message at SSH connection layer. + @type payload: C{str} + ''' + # NOTE: does not distinguish channels, + # could be a problem if multiple channels are used + # (the problem: channel numbers are assigned "randomly") + + # match SSH_MSG_CHANNEL_DATA messages + if ord(payload[0]) == 94: + # Payload: + # byte SSH_MSG_CHANNEL_DATA (94) + # uint32 recipient channel + # string data (string = uint32 + string) + + # ssh message type + msg = payload[0:1] + + # "pseudo-randomly" assigned channel number, + # (almost) always 0x00000000 for shell + channel = payload[1:5] + + # length of shell channel data in bytes, + # undefined for other channel types + datalen = payload[5:9] + + # channel data + data = payload[9:] + + #sys.stderr.write("packet: %s %s %s %s\n" + # % (msg.encode('hex'), channel.encode('hex'), + # datalen.encode('hex'), data.encode('hex'))) + + self.transport.factory.log.log(self.transport.factory.origin, + data.encode('hex')) + +# pylint: enable=R0904 + + +class ReplayAvatarSession(session.SSHSession): + ''' + This fix some problems with client exit codes. Some of them request exit + status after closing the session. + ''' + def __init__(self, *args, **kw): + session.SSHSession.__init__(self, *args, **kw) + + def loseConnection(self): + ''' + Send ssh message with exit-status for ssh client after before session + is closed. Also send SSH_MSG_CHANNEL_EOF before SSH_MSG_CHANNEL_CLOSE. + ''' + self.conn.sendRequest(self, 'exit-status', "\x00"*4) + session.SSHSession.loseConnection(self) + + +class ReplayAvatar(avatar.ConchUser): + ''' + SSH replay service spawning shell + ''' + implements(interfaces.ISession) + + def __init__(self, service_protocol): + avatar.ConchUser.__init__(self) + self.channelLookup.update({'session':ReplayAvatarSession}) + self.service_protocol = service_protocol + def openShell(self, protocol): + self.service_protocol.makeConnection(protocol) + protocol.makeConnection(session.wrapProtocol(self.service_protocol)) + def getPty(self, terminal, windowSize, attrs): + return None + def execCommand(self, protocol, cmd): + raise NotImplementedError + def windowChanged(self, newWindowSize): + pass + def eofReceived(self): + pass + def closed(self): + ''' + Stop reactor after SSH session is closed. + ''' + terminate() + + +class SSHReplayServerProtocol(ReplayServer): + ''' + Override ReplayServer protocol, because we can't stop reactor before client + sends all messages. + ''' + def __init__(self): + ReplayServer.__init__(self) + + def connectionLost(self, reason=protocol.connectionDone): + ''' + Don't terminate reactor like in parent method. It will be terminated + at ssh layer. + ''' + if not self.success: + exit_code.append(1) + sys.stderr.write('FAIL! Premature end: not all messages sent.\n') + self.log.close_log() + diff --git a/mitm/mitmproxy-0.1/mitmproxy/sshdebug.py b/mitm/mitmproxy-0.1/mitmproxy/sshdebug.py new file mode 100644 index 000000000..6defc00b3 --- /dev/null +++ b/mitm/mitmproxy-0.1/mitmproxy/sshdebug.py @@ -0,0 +1,685 @@ +''' +SSH message logger. + +Log unencrypted ssh messages in human readable form. +''' + +import logging +import struct +import textwrap +import sys + +try: + from Crypto import Util +except ImportError: + sys.stderr.write("PyCrypto not installed! Install or disable ssh debug.") + sys.exit(1) + + +class SSHDebug(object): + ''' + Logger for unencrypted SSH messages. + ''' + ssh_messages = { + 1: 'SSH_MSG_DISCONNECT', + 2: 'SSH_MSG_IGNORE', + 3: 'SSH_MSG_UNIMPLEMENTED', + 4: 'SSH_MSG_DEBUG', + 5: 'SSH_MSG_SERVICE_REQUEST', + 6: 'SSH_MSG_SERVICE_ACCEPT', + 20: 'SSH_MSG_KEXINIT', + 30: 'SSH_MSG_KEXDH_INIT', + 31: 'SSH_MSG_KEXDH_REPLY', + 21: 'SSH_MSG_NEWKEYS', + 50: 'SSH_MSG_USERAUTH_REQUEST', + 51: 'SSH_MSG_USERAUTH_FAILURE', + 52: 'SSH_MSG_USERAUTH_SUCCESS', + 53: 'SSH_MSG_USERAUTH_BANNER', + 60: 'SSH_MSG_USERAUTH_PK_OK', + 80: 'SSH_MSG_GLOBAL_REQUEST', + 81: 'SSH_MSG_REQUEST_SUCCESS', + 82: 'SSH_MSG_REQUEST_FAILURE', + 90: 'SSH_MSG_CHANNEL_OPEN', + 91: 'SSH_MSG_CHANNEL_OPEN_CONFIRMATION', + 92: 'SSH_MSG_CHANNEL_OPEN_FAILURE', + 93: 'SSH_MSG_CHANNEL_WINDOW_ADJUST', + 94: 'SSH_MSG_CHANNEL_DATA', + 95: 'SSH_MSG_CHANNEL_EXTENDED_DATA', + 96: 'SSH_MSG_CHANNEL_EOF', + 97: 'SSH_MSG_CHANNEL_CLOSE', + 98: 'SSH_MSG_CHANNEL_REQUEST', + 99: 'SSH_MSG_CHANNEL_SUCCESS', + 100: 'SSH_MSG_CHANNEL_FAILURE'} + + def __init__(self, showpass=False): + super(SSHDebug, self).__init__() + self.output = '' + self.showpass = showpass + + def log_packet(self, who, where, msg_num, payload): + self.output = self.get_direction(who, where) + self.output += "="*70 + "\n" + + if self.ssh_messages.has_key(msg_num): + msg_name = self.ssh_messages[msg_num] + else: + msg_name = "Unknown message name" + self.output += "MSG_TYPE (byte):\n %s (%s)\n" % (msg_num, msg_name) + + func = getattr(self, 'msg_%s' % msg_name[8:].lower(), None) + if func: + self.output += func(payload) + else: + self.output += self.ssh_payload(payload) + + self.output += "="*70 + "\n" + logging.debug(self.output) + + def get_direction(self, who, where): + assert who in ['client', 'server'] + assert where in ['in', 'out'] + + if who == 'client' and where == 'out': + return " SERVER ... PROXY >>> CLIENT\n" + elif who == 'client' and where == 'in': + return " SERVER ... PROXY <<< CLIENT\n" + elif who == 'server' and where == 'out': + return " SERVER <<< PROXY ... CLIENT\n" + elif who == 'server' and where == 'in': + return " SERVER >>> PROXY ... CLIENT\n" + + def indent_break(self, longstr): + result = '' + wrapped = textwrap.fill(longstr.encode('string_escape'), 60) + for line in wrapped.split('\n'): + if not line == "": + result += " " + line + "\n" + return result + + def ssh_payload(self, payload): + ''' + Print indented payload of packet. + + This is used when method for packet parsing don't exists. + ''' + result = "PAYLOAD:\n" + result += self.indent_break(payload) + return result + + def msg_disconnect(self, payload): + ''' + Process SSH_MSG_DISCONNECT + + uint32 reason code + string description in ISO-10646 UTF-8 encoding [RFC3629] + string language tag [RFC3066] + ''' + def decode_code(key): + ''' + Decode simple map from code to string. + ''' + codes = { + 1: "SSH_DISCONNECT_HOST_NOT_ALLOWED_TO_CONNECT", + 2: "SSH_DISCONNECT_PROTOCOL_ERROR", + 3: "SSH_DISCONNECT_KEY_EXCHANGE_FAILED", + 4: "SSH_DISCONNECT_RESERVED", + 5: "SSH_DISCONNECT_MAC_ERROR", + 6: "SSH_DISCONNECT_COMPRESSION_ERROR", + 7: "SSH_DISCONNECT_SERVICE_NOT_AVAILABLE", + 8: "SSH_DISCONNECT_PROTOCOL_VERSION_NOT_SUPPORTED", + 9: "SSH_DISCONNECT_HOST_KEY_NOT_VERIFIABLE", + 10: "SSH_DISCONNECT_CONNECTION_LOST", + 11: "SSH_DISCONNECT_BY_APPLICATION", + 12: "SSH_DISCONNECT_TOO_MANY_CONNECTIONS", + 13: "SSH_DISCONNECT_AUTH_CANCELLED_BY_USER", + 14: "SSH_DISCONNECT_NO_MORE_AUTH_METHODS_AVAILABLE", + 15: "SSH_DISCONNECT_ILLEGAL_USER_NAME" + } + if key in codes.keys(): + return codes[key] + else: + return "UNKNOWN_CODE" + + uints, payload = get_uint32(payload) + result = "REASON_CODE (uint32):\n %s (%s)\n" % (uints[0], + decode_code(uints[0])) + strings, payload = get_net_string(payload, 1) + result += "DESCRIPTION (string %s):\n" % len(strings[0]) + result += self.indent_break(strings[0]) + # some ssh implementations don't send this part of packet + # don't use next 2 lines + #result += "LANGUAGE_TAG (string %s):\n" % len(strings[1]) + #result += self.indent_break(strings[1]) + return result + + def msg_ignore(self, payload): + ''' + Process SSH_MSG_IGNORE 2 + + string data + ''' + strings, payload = get_net_string(payload) + result = "DATA (string %s):\n" % len(strings[0]) + result += self.indent_break(strings[0]) + return result + + def msg_debug(self, payload): + ''' + Process SSH_MSG_DEBUG 3 + + boolean always_display + string message in ISO-10646 UTF-8 encoding [RFC3629] + string language tag [RFC3066] + ''' + bools, payload = get_boolean(payload) + result = "ALWAYS_DISPLAY (boolean):\n %s\n" % bools[0] + strings, payload = get_net_string(payload, 2) + result += "MESSAGE (string %s):\n" % len(strings[0]) + result += self.indent_break(strings[0]) + result += "LANGUAGE_TAG (string %s):\n" % len(strings[1]) + result += self.indent_break(strings[1]) + return result + + def msg_unimplemented(self, payload): + ''' + Process SSH_MSG_UNIMPLEMENTED 3 + uint32 packet sequence number of rejected message + ''' + uints, payload = get_uint32(payload) + result = "REJECTED_PACKET_SEQUENCE_NUMBER (uint32):\n" + result += " %s\n" % uints[0] + return result + + def msg_service_request(self, payload): + ''' + Proces SSH_MSG_SERVICE_REQUEST 5 + + string service name + ''' + strings, payload = get_net_string(payload) + result = "SERVICE_NAME (string %s):\n" % len(strings[0]) + result += self.indent_break(strings[0]) + return result + + def msg_service_accept(self, payload): + ''' + Proces SSH_MSG_SERVICE_ACCEPT 6 + + string service name + ''' + strings, payload = get_net_string(payload) + result = "SERVICE_NAME (string %s):\n" % len(strings[0]) + result += self.indent_break(strings[0]) + return result + + def msg_kexinit(self, payload): + ''' + Process SSH_MSG_KEXINIT 20 + byte[16] cookie (random bytes) + name-list kex_algorithms + name-list server_host_key_algorithms + name-list encryption_algorithms_client_to_server + name-list encryption_algorithms_server_to_client + name-list mac_algorithms_client_to_server + name-list mac_algorithms_server_to_client + name-list compression_algorithms_client_to_server + name-list compression_algorithms_server_to_client + name-list languages_client_to_server + name-list languages_server_to_client + boolean first_kex_packet_follows + uint32 0 (reserved for future extension) + ''' + cookie = payload[0:16] + result = "COOKIE (byte[16]):\n" + result += self.indent_break(cookie) + payload = payload[16:] + lists, payload = get_name_list(payload, 10) + result += "KEX_ALGORITHMS (name-list):\n" + result += self.indent_break(lists[0]) + result += "SERVER_HOST_KEY_ALGORITHMS (name-list):\n" + result += self.indent_break(lists[1]) + result += "ENCRYPTION_ALGORITHMS_CLIENT_TO_SERVER (name-list):\n" + result += self.indent_break(lists[2]) + result += "ENCRYPTION_ALGORITHMS_SERVER_TO_CLIENT (name-list):\n" + result += self.indent_break(lists[3]) + result += "MAC_ALGORITHMS_CLIENT_TO_SERVER (name-list):\n" + result += self.indent_break(lists[4]) + result += "MAC_ALGORITHMS_SERVER_TO_CLIENT (name-list):\n" + result += self.indent_break(lists[5]) + result += "COMPRESSION_ALGORITHMS_CLIENT_TO_SERVER (name-list):\n" + result += self.indent_break(lists[6]) + result += "COMPRESSION_ALGORITHMS_SERVER_TO_CLIENT (name-list):\n" + result += self.indent_break(lists[7]) + result += "LANGUAGES_CLIENT_TO_SERVER (name-list):\n" + result += self.indent_break(lists[8]) + result += "LANGUAGES_SERVER_TO_CLIENT (name-list):\n" + result += self.indent_break(lists[9]) + bools, payload = get_boolean(payload) + result += "FIRST_KEX_PACKET_FOLLOWS (boolean):\n" + result += self.indent_break(str(bools[0])) + uints, payload = get_uint32(payload) + result += "RESERVED_FOR_FUTURE_EXTENSION (uint32):\n" + result += self.indent_break(str(uints[0])) + return result + + def msg_newkeys(self, payload): + ''' + Process SSH_MSG_NEWKEYS 21 + No payload to process. + ''' + return payload + + def msg_kexdh_init(self, payload): + ''' + Process SSH_MSG_KEXDH_INIT 30 + + mpint e + ''' + mpints, payload = get_mpint(payload) + result = "E:\n" + result += self.indent_break(str(mpints[0])) + return result + + #def msg_kexdh_reply(self, payload): + # ''' + # Process SSH_MSG_KEXDH_REPLY 31 + + # string server public host key and certificates (K_S) + # mpint f + # string signature of H + # ''' + # strings, payload = get_net_string(payload) + # result = "SERVER_PUBLIC_HOST_KEY_AND_CERTS (string %s):\n" % len( + # strings[0]) + # result += self.indent_break(strings[0]) + # mpints, payload = get_mpint(payload) + # result += "F:\n %s\n" % mpints[0] + # strings, payload = get_net_string(payload) + # result += "SIGNATURE_OF_H (string %s):\n" % len(strings[0]) + # result += self.indent_break(strings[0]) + # return result + + + def msg_userauth_request(self, payload): + ''' + Process SSH_MSG_USERAUTH_REQUEST 50 + string user name in ISO-10646 UTF-8 encoding [RFC3629] + string service name in US-ASCII + string method name in US-ASCII + .... method specific fields + ''' + strings, payload = get_net_string(payload, 3) + result = "USER_NAME (string %s):\n" % len(strings[0]) + result += self.indent_break(strings[0]) + result += "SERVICE_NAME (string %s):\n" % len(strings[1]) + result += self.indent_break(strings[1]) + result += "METHOD_NAME (string %s):\n" % len(strings[2]) + result += self.indent_break(strings[2]) + method = strings[2] + if method == "publickey": + # boolean has signature + # string public key algorithm name + # string public key blob + bools, payload = get_boolean(payload) + has_signature = bools[0] + result += "HAS_SIGNATURE (boolean):\n %s\n" % has_signature + strings, payload = get_net_string(payload, 2) + result += "PUBLIC_KEY_ALGORITM_NAME (string %s):\n" % len( + strings[0]) + result += self.indent_break(strings[0]) + result += "PUBLIC_KEY_BLOB (string %s):\n" % len(strings[1]) + result += self.indent_break(strings[1]) + if has_signature: + strings, payload = get_net_string(payload) + result += "SIGNATURE (string %s):\n" % len(strings[0]) + result += self.indent_break(strings[0]) + return result + elif method == "password": + # boolean new password + # string plaintext password in ISO-10646 UTF-8 encoding [RFC3629] + # string plaintext new password in ISO-10646 UTF-8 encoding + # [RFC3629] + bools, payload = get_boolean(payload) + has_new_password = bools[0] + result += "HAS_NEW_PASSWORD (boolean):\n %s\n" % has_new_password + strings, payload = get_net_string(payload) + if self.showpass: + password = strings[0] + else: + password = "" + result += "PASSWORD (string %s):\n" % len(password) + result += self.indent_break(password) + if has_new_password: + if self.showpass: + password = strings[0] + else: + password = "" + strings, payload = get_net_string(payload) + result += "NEW_PASSWORD (string %s):\n" % len(password) + result += self.indent_break(password) + return result + elif method == "none": + return result + result += "METHOD_SPECIFIC_FIELDS:\n" + result += self.indent_break(payload) + return result + + def msg_userauth_pk_ok(self, payload): + ''' + Process SSH_MSG_USERAUTH_PK_OK 60 + No payload to process. + ''' + return payload + + def msg_userauth_failure(self, payload): + ''' + Process SSH_MSG_USERAUTH_FAILURE + name-list authentications that can continue + boolean partial success + ''' + lists, payload = get_name_list(payload) + result = "AUTH_CAN_CONTINUE (name-list):\n" + result += self.indent_break(lists[0]) + bools, payload = get_boolean(payload) + result += "PARTIAL_SUCCESS (boolean):\n %s\n" % bools[0] + return result + + def msg_userauth_success(self, payload): + ''' + Process SSH_MSG_USERAUTH_SUCCESS + No payload to process. + ''' + return payload + + def msg_userauth_banner(self, payload): + ''' + Process SSH_MSG_USERAUTH_BANNER + string message in ISO-10646 UTF-8 encoding [RFC3629] + string language tag [RFC3066] + ''' + strings, payload = get_net_string(payload, 2) + result = "MESSAGE (string %s):\n" % len(strings[0]) + result += self.indent_break(strings[0]) + result += "LANGUAGE_TAG (string %s):\n" % len(strings[1]) + result += self.indent_break(strings[1]) + return result + + + def msg_channel_open(self, payload): + ''' + Process SSH_MSG_CHANNEL_OPEN. + + string channel type in US-ASCII only + uint32 sender channel + uint32 initial window size + uint32 maximum packet size + .... channel type specific data follows + ''' + strings, payload = get_net_string(payload) + result = "CHANNEL_TYPE (string %s):\n" % len(strings[0]) + result += self.indent_break(strings[0]) + uints, payload = get_uint32(payload, 3) + result += "SENDER_CHANNEL (uint32):\n %s\n" % uints[0] + result += "INITIAL_WINDOWS_SIZE (uint32):\n %s\n" % uints[1] + result += "MAXIMUM_PACKET_SIZE (uint32):\n %s\n" % uints[2] + result += "CHANNEL_TYPE_SPECIFIC_DATA:\n" + result += self.indent_break(payload) + return result + + def msg_channel_open_confirmation(self, payload): + ''' + Process SSH_MSG_CHANNEL_OPEN_CONFIRMATION + + uint32 recipient channel + uint32 sender channel + uint32 initial window size + uint32 maximum packet size + .... channel type specific data follows + ''' + uints, payload = get_uint32(payload, 4) + result = "RECIPIENT_CHANNEL (uint32):\n %s\n" % uints[0] + result += "SENDER_CHANNEL (uint32):\n %s\n" % uints[1] + result += "INITIAL_WINDOWS_SIZE (uint32):\n %s\n" % uints[2] + result += "MAXIMUM_PACKET_SIZE (uint32):\n %s\n" % uints[3] + result += "CHANNEL_TYPE_SPECIFIC_DATA:\n" + result += self.indent_break(payload) + return result + + def msg_channel_open_failure(self, payload): + ''' + Process SSH_MSG_CHANNEL_OPEN_FAILURE + + uint32 recipient channel + uint32 reason code + string description in ISO-10646 UTF-8 encoding [RFC3629] + string language tag [RFC3066] + ''' + def decode_code(key): + ''' + Decode simple map from code to string. + ''' + codes = { + 1: "SSH_OPEN_ADMINISTRATIVELY_PROHIBITED", + 2: "SSH_OPEN_CONNECT_FAILED", + 3: "SSH_OPEN_UNKNOWN_CHANNEL_TYPE", + 4: "SSH_OPEN_RESOURCE_SHORTAGE", + } + if key in codes.keys(): + return codes[key] + else: + return "UNKNOWN_CODE" + + uints, payload = get_uint32(payload, 2) + result = "RECIPIENT_CHANNEL (uint32):\n %s\n" % uints[0] + result += "REASON_CODE (uint32):\n %s (%s)\n" % (uints[1], + decode_code(uints[1])) + strings, payload = get_net_string(payload, 2) + result += "DESCRIPTION (string %s):\n" % len(strings[0]) + result += self.indent_break(strings[0]) + result += "LANGUAGE (string %s):\n" % len(strings[1]) + result += self.indent_break(strings[1]) + return result + + def msg_channel_window_adjust(self, payload): + ''' + Process SSH_MSG_CHANNEL_DATA + uint32 recipient channel + string data + ''' + uints, payload = get_uint32(payload, 2) + result = "RECIPIENT_CHANNEL (uint32):\n %s\n" % uints[0] + result += "BYTES_TO_ADD (uint32):\n %s\n" % uints[1] + return result + + def msg_channel_data(self, payload): + ''' + Process SSH_MSG_CHANNEL_DATA + + uint32 recipient channel + string data + ''' + uints, payload = get_uint32(payload) + result = "RECIPIENT_CHANNEL (uint32):\n %s\n" % (uints[0]) + strings, payload = get_net_string(payload) + result += "DATA (string %s):\n" % (len(strings[0])) + result += self.indent_break(strings[0]) + return result + + def msg_channel_extended_data(self, payload): + ''' + Process SSH_MSG_CHANNEL_EXTENDED_DATA + uint32 recipient channel + uint32 data_type_code + string data + ''' + def decode_code(key): + ''' + Decode simple map from code to string. + ''' + codes = { + 1: "SSH_EXTENDED_DATA_STDERR", + } + if key in codes.keys(): + return codes[key] + else: + return "UNKNOWN_CODE" + uints, payload = get_uint32(payload, 2) + result = "RECIPIENT_CHANNEL (uint32):\n %s\n" % (uints[0]) + result += "DATA_TYPE_CODE (uint32):\n %s (%s)\n" % (uints[0], + decode_code(uints[0])) + strings, payload = get_net_string(payload) + result += "DATA (string %s):\n" % (len(strings[0])) + result += self.indent_break(strings[0]) + return result + + def msg_channel_eof(self, payload): + ''' + Process SSH_MSG_CHANNEL_EOF + uint32 recipient channel + ''' + uints, payload = get_uint32(payload) + result = "RECIPIENT_CHANNEL (uint32):\n %s\n" % (uints[0]) + return result + + def msg_channel_close(self, payload): + ''' + Process SSH_MSG_CHANNEL_CLOSE + uint32 recipient channel + ''' + uints, payload = get_uint32(payload) + result = "RECIPIENT_CHANNEL (uint32):\n %s\n" % (uints[0]) + return result + + def msg_channel_request(self, payload): + ''' + Process SSH_MSG_CHANNEL_REQUEST + uint32 recipient channel + string request type in US-ASCII characters only + boolean want reply + .... type-specific data follows + ''' + uints, payload = get_uint32(payload) + result = "RECIPIENT_CHANNEL (uint32):\n %s\n" % (uints[0]) + strings, payload = get_net_string(payload) + result += "REQUEST_TYPE (string %s):\n %s\n" % (len(strings[0]), + strings[0]) + bools, payload = get_boolean(payload) + result += "WANT_REPLY (boolean):\n %s\n" % bools[0] + result += "TYPE_SPECIFIC_DATA:\n" + result += self.indent_break(payload) + return result + + def msg_channel_success(self, payload): + ''' + Process SSH_MSG_CHANNEL_SUCCESS + uint32 recipient channel + ''' + uints, payload = get_uint32(payload) + result = "RECIPIENT_CHANNEL (uint32):\n %s\n" % (uints[0]) + return result + + def msg_channel_failure(self, payload): + ''' + Process SSH_MSG_CHANNEL_FAILURE + uint32 recipient channel + ''' + uints, payload = get_uint32(payload) + result = "RECIPIENT_CHANNEL (uint32):\n %s\n" % (uints[0]) + return result + + def msg_global_request(self, payload): + ''' + Process SSH_MSG_GLOBAL_REQUEST + string request name in US-ASCII only + boolean want reply + .... request-specific data + ''' + strings, payload = get_net_string(payload) + result = "REQUEST_NAME (string %s):\n %s\n" % (len(strings[0]), + strings[0]) + bools, payload = get_boolean(payload) + result += "WANT_REPLY (boolean):\n %s\n" % bools[0] + result += "REQUEST_SPECIFIC_DATA:\n" + result += self.indent_break(payload) + return result + + def msg_request_failure(self, payload): + ''' + Process SSH_MSG_REQUEST_FAILURE + ''' + result = self.indent_break(payload) + return result + + def msg_request_success(self, payload): + ''' + Process SSH_MSG_REQUEST_SUCCESS + .... response specific data + ''' + result = "RESPONSE_SPECIFIC_DATA:\n" + result += self.indent_break(payload) + return result + +def get_uint32(payload, count=1): + ''' + Get uint32 values. [rfc4251#section-5] + ''' + uints = [] + index = 0 + for _ in range(count): + uint, = struct.unpack('!L', payload[index:index+4]) + uints.append(uint) + index += 4 + return (uints, payload[index:]) + + +def get_name_list(payload, count=1): + ''' + Get name list. [rfc4251#section-5] + ''' + lists = [] + for _ in range(count): + uints, payload = get_uint32(payload) + length = uints[0] + lists.append(payload[:length]) + payload = payload[length:] + return (lists, payload) + +def get_mpint(payload, count=1): + ''' + Get mpint number. [rfc4251#section-5] + ''' + mpints = [] + index = 0 + for _ in range(count): + length, = struct.unpack('>L', payload[index:index+4]) + mpints.append(Util.number.bytes_to_long( + payload[index+4:index+4+length])) + index += 4 + length + return (mpints, payload[index:]) + +def get_boolean(payload, count=1): + ''' + Get boolean values. [rfc4251#section-5] + ''' + bools = [] + index = 0 + for _ in range(count): + if payload[index] != "\x00": + bools.append(True) + else: + bools.append(False) + index += 1 + return (bools, payload[index:]) + +def get_net_string(payload, count=1): + ''' + Get net string. [rfc4251#section-5] + ''' + strings = [] + index = 0 + for _ in range(count): + length, = struct.unpack('!L', payload[index:index+4]) + strings.append(payload[index+4:index+4+length]) + index += length + 4 + return (strings, payload[index:]) + diff --git a/mitm/mitmproxy-0.1/mitmproxy_http b/mitm/mitmproxy-0.1/mitmproxy_http new file mode 100755 index 000000000..54e1a8985 --- /dev/null +++ b/mitm/mitmproxy-0.1/mitmproxy_http @@ -0,0 +1,53 @@ +#!/usr/bin/env python2 +''' +HTTP interceptor and logger. +See --help for usage, README.md for solutions to common problems. +''' + +from twisted.internet import reactor +import sys +import mitmproxy + +# disable reporting of bogus "no-member" errors +# pylint: disable=E1101 + + +class ProxyServer(mitmproxy.ProxyServer): + ''' + ProxyServer with implemented connect procedure + ''' + def connect_to_server(self): + ''' + Connect over raw TCP + ''' + factory = mitmproxy.ProxyClientFactory( + self.transmit, self.receive, self.log) + reactor.connectTCP( + self.host, self.port, factory) + + +def main(): + ''' + Parse options, open log and start proxy server + ''' + (opts, _) = mitmproxy.proxy_option_parser(80, 8080) + + log = mitmproxy.Logger() + if opts.logfile is not None: + log.open_log(opts.logfile) + + sys.stderr.write( + 'Server running on localhost:%d...\n' % opts.localport) + + factory = mitmproxy.ProxyServerFactory( + ProxyServer, opts.host, opts.port, log) + reactor.listenTCP(opts.localport, factory) + reactor.run() + sys.exit(mitmproxy.exit_code.pop()) + + +if __name__ == "__main__": + try: + main() + except KeyboardInterrupt: + sys.exit(0) diff --git a/mitm/mitmproxy-0.1/mitmproxy_snmp b/mitm/mitmproxy-0.1/mitmproxy_snmp new file mode 100755 index 000000000..53011d52d --- /dev/null +++ b/mitm/mitmproxy-0.1/mitmproxy_snmp @@ -0,0 +1,40 @@ +#!/usr/bin/env python2 +''' +SNMP interceptor and logger. +See --help for usage. +''' + +from twisted.internet import reactor +import sys +import mitmproxy + +def got_ip(ipaddr, opts): + ''' + Start UDP proxy when ip address is resolved. + ''' + # set logger + log = mitmproxy.Logger() + if opts.logfile is not None: + log.open_log(opts.logfile) + + server = mitmproxy.UDPProxyServer(log, ipaddr, opts.port) + reactor.listenUDP(opts.localport, server) + +def main(): + ''' + Parse options, open log and start proxy server + ''' + (opts, _) = mitmproxy.proxy_option_parser(161, 1610) + + sys.stderr.write( + 'Server running on localhost:%d...\n' % (opts.localport)) + + reactor.resolve(opts.host).addCallback(got_ip, opts) + reactor.run() + sys.exit(mitmproxy.exit_code.pop()) + +if __name__ == "__main__": + try: + main() + except KeyboardInterrupt: + sys.exit(0) diff --git a/mitm/mitmproxy-0.1/mitmproxy_ssh b/mitm/mitmproxy-0.1/mitmproxy_ssh new file mode 100755 index 000000000..241479863 --- /dev/null +++ b/mitm/mitmproxy-0.1/mitmproxy_ssh @@ -0,0 +1,37 @@ +#!/usr/bin/env python2 +''' +SSH interceptor and logger. +See --help for usage. +''' + +from twisted.internet import reactor +import sys +import mitmproxy +import logging + +def main(): + ''' + Parse options, open log and start proxy server + ''' + (opts, _) = mitmproxy.ssh_proxy_option_parser(22, 2222) + + if opts.debug: + logging.basicConfig(filename='ssh.log', + filemode='w', + format='%(levelname)s:%(message)s', + level=logging.DEBUG) + + sys.stderr.write( + 'Server running on localhost:%d...\n' % (opts.localport)) + + factory = mitmproxy.SSHServerFactory(opts) + reactor.listenTCP(opts.localport, factory) + reactor.run() + sys.exit(mitmproxy.exit_code.pop()) + + +if __name__ == "__main__": + try: + main() + except KeyboardInterrupt: + sys.exit(0) diff --git a/mitm/mitmproxy-0.1/mitmproxy_ssl b/mitm/mitmproxy-0.1/mitmproxy_ssl new file mode 100755 index 000000000..49492e557 --- /dev/null +++ b/mitm/mitmproxy-0.1/mitmproxy_ssl @@ -0,0 +1,62 @@ +#!/usr/bin/env python2 +''' +SSL interceptor and logger. +See --help for usage. +''' + +from twisted.internet import reactor, ssl +import sys +import os +import mitmproxy + +# disable reporting of bogus "no-member" errors +# pylint: disable=E1101 + + +class ProxyServer(mitmproxy.ProxyServer): + ''' + ProxyServer with implemented connect procedure + ''' + def connect_to_server(self): + ''' + Connect over SSL-encrypted raw socket + ''' + factory = mitmproxy.ProxyClientFactory( + self.transmit, self.receive, self.log) + reactor.connectSSL( + self.host, self.port, factory, ssl.ClientContextFactory()) + + +def main(): + ''' + Parse options, open log and start proxy server + ''' + (opts, _) = mitmproxy.proxy_option_parser(443, 4443) + + if not os.path.exists(os.path.expanduser('~/.mitmkeys/server.key')) \ + or not os.path.exists(os.path.expanduser('~/.mitmkeys/server.crt')): + print "Please do create server certificates (see readme)." + sys.exit(1) + + log = mitmproxy.Logger() + if opts.logfile is not None: + log.open_log(opts.logfile) + + sys.stderr.write( + 'Server running on localhost:%d...\n' % opts.localport) + + factory = mitmproxy.ProxyServerFactory( + ProxyServer, opts.host, opts.port, log) + reactor.listenSSL( + opts.localport, factory, ssl.DefaultOpenSSLContextFactory( + os.path.expanduser('~/.mitmkeys/server.key'), + os.path.expanduser('~/.mitmkeys/server.crt'))) + reactor.run() + sys.exit(mitmproxy.exit_code.pop()) + + +if __name__ == '__main__': + try: + main() + except KeyboardInterrupt: + sys.exit(0) diff --git a/mitm/mitmproxy-0.1/mitmproxy_telnet b/mitm/mitmproxy-0.1/mitmproxy_telnet new file mode 100755 index 000000000..442a46e1a --- /dev/null +++ b/mitm/mitmproxy-0.1/mitmproxy_telnet @@ -0,0 +1,52 @@ +#!/usr/bin/env python2 +''' +Telnet (or any other protocol running over port 23) interceptor and logger. +See --help for usage. +''' + +from twisted.internet import reactor +import sys +import mitmproxy + +# disable reporting of bogus "no-member" errors +# pylint: disable=E1101 + + +class ProxyServer(mitmproxy.ProxyServer): + ''' + ProxyServer with implemented connect procedure + ''' + def connect_to_server(self): + ''' + Connect over raw TCP + ''' + factory = mitmproxy.ProxyClientFactory( + self.transmit, self.receive, self.log) + reactor.connectTCP(self.host, self.port, factory) + + +def main(): + ''' + Parse options, open log and start proxy server + ''' + (opts, _) = mitmproxy.proxy_option_parser(23, 2323) + + log = mitmproxy.Logger() + if opts.logfile is not None: + log.open_log(opts.logfile) + + sys.stderr.write( + 'Server running on localhost:%d...\n' % (opts.localport)) + + factory = mitmproxy.ProxyServerFactory( + ProxyServer, opts.host, opts.port, log) + reactor.listenTCP(opts.localport, factory) + reactor.run() + sys.exit(mitmproxy.exit_code.pop()) + + +if __name__ == "__main__": + try: + main() + except KeyboardInterrupt: + sys.exit(0) diff --git a/mitm/mitmproxy-0.1/mitmreplay_http b/mitm/mitmproxy-0.1/mitmreplay_http new file mode 100755 index 000000000..c9cfaa051 --- /dev/null +++ b/mitm/mitmproxy-0.1/mitmreplay_http @@ -0,0 +1,46 @@ +#!/usr/bin/env python2 +''' +Replay server for HTTP. +See --help for usage, README.md for solutions to common problems. +''' + +from twisted.internet import reactor +import Queue +import sys +import mitmproxy + + +def main(): + ''' + Parser options, open and read log file, start replay server + ''' + (opts, _) = mitmproxy.replay_option_parser(8080) + + if opts.inputfile is None: + print "Need to specify an input file." + sys.exit(1) + else: + log = mitmproxy.Logger() + if opts.logfile is not None: + log.open_log(opts.logfile) + + serverq = Queue.Queue() + clientq = Queue.Queue() + clientfirst = None + + mitmproxy.logreader(opts.inputfile, serverq, clientq, clientfirst) + + sys.stderr.write( + 'Server running on localhost:%d\n' % opts.localport) + factory = mitmproxy.ReplayServerFactory( + log, (serverq, clientq), opts.delaymod, clientfirst) + reactor.listenTCP(opts.localport, factory) + reactor.run() + sys.exit(mitmproxy.exit_code.pop()) + + +if __name__ == "__main__": + try: + main() + except KeyboardInterrupt: + sys.exit(0) diff --git a/mitm/mitmproxy-0.1/mitmreplay_snmp b/mitm/mitmproxy-0.1/mitmreplay_snmp new file mode 100755 index 000000000..739991fdb --- /dev/null +++ b/mitm/mitmproxy-0.1/mitmreplay_snmp @@ -0,0 +1,47 @@ +#!/usr/bin/env python2 +''' +Replay server for snmp. +See --help for usage. +''' + +from twisted.internet import reactor +import Queue +import sys +import mitmproxy +import logging + +def main(): + ''' + Parse options, open and read log file, start replay server + ''' + # uncomment next lines to enable debugging output + #logging.basicConfig(stream=sys.stderr, + # format='%(levelname)s:%(message)s', + # level=logging.DEBUG) + + (opts, _) = mitmproxy.replay_option_parser(1610) + + if opts.inputfile is None: + sys.stderr.write("ERROR: Need to specify an input file.\n") + sys.exit(1) + else: + log = mitmproxy.Logger() + if opts.logfile is not None: + log.open_log(opts.logfile) + + (serverq, clientq, clientfirst) = mitmproxy.logreader(opts.inputfile) + + sys.stderr.write( + 'Server running on localhost:%d\n' % opts.localport) + server = mitmproxy.SNMPReplayServer(log, (serverq, clientq), + opts.delaymod, clientfirst) + reactor.listenUDP(opts.localport, server) + reactor.run() + sys.exit(mitmproxy.exit_code.pop()) + + +if __name__ == "__main__": + try: + main() + except KeyboardInterrupt: + sys.exit(0) diff --git a/mitm/mitmproxy-0.1/mitmreplay_ssh b/mitm/mitmproxy-0.1/mitmreplay_ssh new file mode 100755 index 000000000..d5f8251d7 --- /dev/null +++ b/mitm/mitmproxy-0.1/mitmreplay_ssh @@ -0,0 +1,42 @@ +#!/usr/bin/env python2 +''' +Replay server for SSH. +See --help for usage. +''' + +from twisted.internet import reactor +import sys +import mitmproxy +import logging + + +def main(): + ''' + parse options, open and read log file, start replay server + ''' + (opts, _) = mitmproxy.ssh_replay_option_parser(2222) + + if opts.debug: + logging.basicConfig(filename='ssh.log', + filemode='w', + format='%(levelname)s:%(message)s', + level=logging.DEBUG) + + if opts.inputfile is None: + sys.stderr.write('Need to specify an input file.\n') + sys.exit(1) + + sys.stderr.write( + 'Server running on localhost:%d\n' % opts.localport) + + factory = mitmproxy.ReplaySSHServerFactory(opts) + reactor.listenTCP(opts.localport, factory) + reactor.run() + sys.exit(mitmproxy.exit_code.pop()) + + +if __name__ == '__main__': + try: + main() + except KeyboardInterrupt: + sys.exit(0) diff --git a/mitm/mitmproxy-0.1/mitmreplay_ssl b/mitm/mitmproxy-0.1/mitmreplay_ssl new file mode 100755 index 000000000..5693bb83b --- /dev/null +++ b/mitm/mitmproxy-0.1/mitmreplay_ssl @@ -0,0 +1,55 @@ +#!/usr/bin/env python2 +''' +Replay server for SSL-encrytped raw TCP connections running over port 443. +See --help for usage. +''' + +from twisted.internet import reactor, ssl +import Queue +import sys +import os +import mitmproxy + + +def main(): + ''' + Parse options, open and read log file, start replay server + ''' + (opts, _) = mitmproxy.replay_option_parser(4443) + + if not os.path.exists(os.path.expanduser('~/.mitmkeys/server.key')) \ + or not os.path.exists(os.path.expanduser('~/.mitmkeys/server.crt')): + print "Please do create server certificates (see readme)." + sys.exit(1) + + if opts.inputfile is None: + print "Need to specify an input file." + sys.exit(1) + else: + log = mitmproxy.Logger() + if opts.logfile is not None: + log.open_log(opts.logfile) + + serverq = Queue.Queue() + clientq = Queue.Queue() + clientfirst = None + + mitmproxy.logreader(opts.inputfile, serverq, clientq, clientfirst) + + sys.stderr.write( + 'Server running on localhost:%d\n' % opts.localport) + factory = mitmproxy.ReplayServerFactory( + log, (serverq, clientq), opts.delaymod, clientfirst) + reactor.listenSSL(opts.localport, factory, + ssl.DefaultOpenSSLContextFactory( + os.path.expanduser('~/.mitmkeys/server.key'), + os.path.expanduser('~/.mitmkeys/server.crt'))) + reactor.run() + sys.exit(mitmproxy.exit_code.pop()) + + +if __name__ == '__main__': + try: + main() + except KeyboardInterrupt: + sys.exit(0) diff --git a/mitm/mitmproxy-0.1/mitmreplay_telnet b/mitm/mitmproxy-0.1/mitmreplay_telnet new file mode 100755 index 000000000..bc4cfbb4e --- /dev/null +++ b/mitm/mitmproxy-0.1/mitmreplay_telnet @@ -0,0 +1,46 @@ +#!/usr/bin/env python2 +''' +Replay server for telnet (or any other protocol running over port 23). +See --help for usage. +''' + +from twisted.internet import reactor +import Queue +import sys +import mitmproxy + + +def main(): + ''' + Parse options, open and read log file, start replay server + ''' + (opts, _) = mitmproxy.replay_option_parser(2323) + + if opts.inputfile is None: + print "Need to specify an input file." + sys.exit(1) + else: + log = mitmproxy.Logger() + if opts.logfile is not None: + log.open_log(opts.logfile) + + serverq = Queue.Queue() + clientq = Queue.Queue() + clientfirst = None + + mitmproxy.logreader(opts.inputfile, serverq, clientq, clientfirst) + + sys.stderr.write( + 'Server running on localhost:%d\n' % opts.localport) + factory = mitmproxy.ReplayServerFactory( + log, (serverq, clientq), opts.delaymod, clientfirst) + reactor.listenTCP(opts.localport, factory) + reactor.run() + sys.exit(mitmproxy.exit_code.pop()) + + +if __name__ == "__main__": + try: + main() + except KeyboardInterrupt: + sys.exit(0) diff --git a/mitm/mitmproxy-0.1/setup.py b/mitm/mitmproxy-0.1/setup.py new file mode 100644 index 000000000..e6c23c9bf --- /dev/null +++ b/mitm/mitmproxy-0.1/setup.py @@ -0,0 +1,9 @@ +#!/usr/bin/env python2 + +from distutils.core import setup + +setup(name='mitmproxy', + version='0.1', + packages=['mitmproxy'], + scripts=['extra/fencegenlog', 'extra/fencetestlog', 'mitmkeygen', 'mitmlogdiff', 'mitmlogview', 'mitmproxy_http', 'mitmproxy_snmp', 'mitmproxy_ssh', 'mitmproxy_ssl', 'mitmproxy_telnet', 'mitmreplay_http', 'mitmreplay_snmp', 'mitmreplay_ssh', 'mitmreplay_ssl', 'mitmreplay_telnet'], + ) diff --git a/mitm/mitmproxy-0.1/test/test_snmp.sh b/mitm/mitmproxy-0.1/test/test_snmp.sh new file mode 100755 index 000000000..7d52fc5e6 --- /dev/null +++ b/mitm/mitmproxy-0.1/test/test_snmp.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash + +set -e +HOST=${HOST:-""} +PASS=${PASS:-""} +LOGIN=${LOGIN:-""} +SRC_ROOT=.. + +if [ -z "$HOST" -o -z "$PASS" -o -z "$LOGIN" ]; then + echo "*** Set variables! 'HOST=example.example.com PASS=pass LOGIN=user ./$0'" + exit 1 +fi + +for action in status on off reboot ; do + echo "# Testing action: ${action}" + $SRC_ROOT/mitmproxy_snmp -H $HOST -o ${action}.log & + PID=$! + sleep 2 + fence_apc_snmp -a localhost -u 1610 -l $LOGIN -p $PASS -n 1 -d 1 -o ${action} + kill -15 $PID + $SRC_ROOT/mitmreplay_snmp -f ${action}.log > /dev/null & + sleep 2 + fence_apc_snmp -a localhost -u 1610 -l $LOGIN -p $PASS -n 1 -d 1 -o ${action} + rm -f ${action}.log +done diff --git a/mitm/mitmproxy-0.1/test/test_ssh.sh b/mitm/mitmproxy-0.1/test/test_ssh.sh new file mode 100755 index 000000000..84f4133e1 --- /dev/null +++ b/mitm/mitmproxy-0.1/test/test_ssh.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash + +set -e +HOST=${HOST:-""} +PASS=${PASS:-""} +LOGIN=${LOGIN:-""} +SRC_ROOT=.. + +if [ -z $HOST -o -z $PASS -o -z $LOGIN ]; then + echo "*** Set variables! 'HOST=example.example.com PASS=pass LOGIN=user ./$0'" + exit 1 +fi + +for action in status on off reboot ; do + echo "# Testing action: ${action}" + $SRC_ROOT/mitmproxy_ssh -H $HOST -o ${action}.log & + sleep 2 + fence_apc -a localhost -u 2222 -l $LOGIN -p $PASS -n 1 -x -o ${action} \ + --ssh-options="-2 -o PubKeyAuthentication=no" --login-timeout=100 + $SRC_ROOT/mitmreplay_ssh -f ${action}.log > /dev/null & + sleep 2 + fence_apc -a localhost -u 2222 -l $LOGIN -p $PASS -n 1 -x -o ${action} \ + --ssh-options="-2 -o PubKeyAuthentication=no" --login-timeout=100 + rm -f ${action}.log +done diff --git a/tests/actions.d/already-off.cfg b/tests/actions.d/already-off.cfg new file mode 100644 index 000000000..3f62be2bd --- /dev/null +++ b/tests/actions.d/already-off.cfg @@ -0,0 +1,2 @@ +name = "Already OFF" +actions = [ { "command" : "off", "return_code" : "^0$" } ] diff --git a/tests/actions.d/already-on.cfg b/tests/actions.d/already-on.cfg new file mode 100644 index 000000000..9e2edb388 --- /dev/null +++ b/tests/actions.d/already-on.cfg @@ -0,0 +1,2 @@ +name = "Already ON" +actions = [ { "command" : "on", "return_code" : "^0$" } ] diff --git a/tests/actions.d/off.cfg b/tests/actions.d/off.cfg new file mode 100644 index 000000000..6dab24892 --- /dev/null +++ b/tests/actions.d/off.cfg @@ -0,0 +1,2 @@ +name = "Off" +actions = [ { "command" : "off", "return_code" : "^0$" } ] \ No newline at end of file diff --git a/tests/actions.d/on.cfg b/tests/actions.d/on.cfg new file mode 100644 index 000000000..78c50d7f0 --- /dev/null +++ b/tests/actions.d/on.cfg @@ -0,0 +1,2 @@ +name = "On" +actions = [ { "command" : "on", "return_code" : "^0$" } ] \ No newline at end of file diff --git a/tests/actions.d/reboot.cfg b/tests/actions.d/reboot.cfg new file mode 100644 index 000000000..50464e759 --- /dev/null +++ b/tests/actions.d/reboot.cfg @@ -0,0 +1,2 @@ +name = "Reboot" +actions = [ { "command" : "reboot", "return_code" : "^0$" } ] diff --git a/tests/actions.d/sleep.cfg b/tests/actions.d/sleep.cfg deleted file mode 100644 index c0fad72ca..000000000 --- a/tests/actions.d/sleep.cfg +++ /dev/null @@ -1,2 +0,0 @@ -name = "Pure Sleep" -actions = [ { "command" : "sleep(1)", "return_code" : "^0$" }, { "command" : "sleep(3)", "return_code" : "^0$" }, { "command" : "sleep(5)", "return_code" : "^0$" } ] diff --git a/tests/actions.d/status-off.cfg b/tests/actions.d/status-off.cfg new file mode 100644 index 000000000..8a8d07812 --- /dev/null +++ b/tests/actions.d/status-off.cfg @@ -0,0 +1,2 @@ +name = "Status OFF" +actions = [ { "command" : "status", "return_code" : "^2$" } ] diff --git a/tests/actions.d/status-on.cfg b/tests/actions.d/status-on.cfg new file mode 100644 index 000000000..a24b5c98b --- /dev/null +++ b/tests/actions.d/status-on.cfg @@ -0,0 +1,2 @@ +name = "Status ON" +actions = [ { "command" : "status", "return_code" : "^0$" } ] diff --git a/tests/actions.d/status.cfg b/tests/actions.d/status.cfg index 760f94bd5..e2701a6f5 100644 --- a/tests/actions.d/status.cfg +++ b/tests/actions.d/status.cfg @@ -1,2 +1,2 @@ name = "Simple Status" -actions = [ { "command" : "status", "return_code" : "^[02]$" }, { "command" : "sleep(1)", "return_code" : "^0$" } ] +actions = [ { "command" : "status", "return_code" : "^[02]$" }] diff --git a/tests/binmitm.py b/tests/binmitm.py new file mode 100755 index 000000000..c1c80e38c --- /dev/null +++ b/tests/binmitm.py @@ -0,0 +1,208 @@ +#!/usr/bin/python + +import sys +import os +import subprocess +import logging +import json +import time + +INPUT_FILE = os.environ["BINMITM_INPUT"]\ + if "BINMITM_INPUT" in os.environ else None +OUTPUT_FILE = os.environ["BINMITM_OUTPUT"]\ + if "BINMITM_OUTPUT" in os.environ else None +COUNTER_FILE = os.environ["BINMITM_COUNTER_FILE"]\ + if "BINMITM_COUNTER_FILE" in os.environ else ".binmitm_counter" +ENV_VARS = os.environ["BINMITM_ENV"].split(",")\ + if "BINMITM_ENV" in os.environ else [] +IGNORE_TIMING = "BINMITM_IGNORE_TIMING" in os.environ +DEBUG = "BINMITM_DEBUG" in os.environ + + +def log_debug(msg): + if DEBUG: + logging.error(msg) + + +def _exit(ret): + if COUNTER_FILE and os.path.isfile(COUNTER_FILE): + try: + os.remove(COUNTER_FILE) + except Exception as e: + log_debug("Unable to delete counter file ({0}): {1}".format( + COUNTER_FILE, e.message + )) + try: + with open(COUNTER_FILE, "w") as f: + f.write("0\n") + log_debug( + "0 written into counter file ({0})".format(COUNTER_FILE) + ) + except Exception as e: + log_debug("Unable to write 0 to counter file ({0}): {1}".format( + COUNTER_FILE, e.message + )) + sys.exit(ret) + + +def get_count(max_count): + count = 0 + if os.path.isfile(COUNTER_FILE): + try: + with open(COUNTER_FILE, "r+") as f: + count = int(f.readline().strip()) + f.seek(0) + f.truncate() + f.write("{0}\n".format((count+1) % max_count)) + except Exception as e: + log_debug("Unable to read/write from/to '{0}': {1}".format( + COUNTER_FILE, e.message + )) + else: + if max_count != 1: + try: + with open(COUNTER_FILE, "w") as f: + f.write("1\n") + except Exception as e: + log_debug("Unable to write to '{0}': {1}".format( + COUNTER_FILE, e.message + )) + return count + + +def record(argv): + output = OUTPUT_FILE and not INPUT_FILE + env = os.environ.copy() + + cur_output = { + "request": { + "argv": argv, + "env": {} + }, + "response": {}, + "time": {} + } + + for e in ENV_VARS: + if e in env: + cur_output["request"]["env"][e] = env[e] + + proc_start_time = time.time() + process = None + + try: + process = subprocess.Popen( + argv, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=env + ) + except OSError as e: + log_debug("Unable to run command '{0}': {1}".format( + " ".join(argv), e.message + )) + _exit(127) + + status = process.wait() + cur_output["time"]["perform_duration"] = time.time() - proc_start_time + + (pipe_stdout, pipe_stderr) = process.communicate() + process.stdout.close() + process.stderr.close() + + cur_output["response"]["stderr"] = pipe_stderr + cur_output["response"]["stdout"] = pipe_stdout + cur_output["response"]["return_code"] = status + + sys.stderr.write(pipe_stderr) + sys.stdout.write(pipe_stdout) + + if output: + try: + if os.path.isfile(OUTPUT_FILE): + with open(OUTPUT_FILE, "r+") as f: + output_values = [] + + try: + output_values = json.load(f) + except: + log_debug( + "Parsing output file '{0}' failed. It is " + "considered as empty.".format(OUTPUT_FILE) + ) + + output_values.append(cur_output) + f.truncate() + f.seek(0) + json.dump(output_values, f, indent=4) + else: + with open(OUTPUT_FILE, "w") as f: + json.dump([cur_output], f, indent=4) + except (IOError, ValueError) as e: + log_debug("Unable to store data to file '{0}': {1}".format( + OUTPUT_FILE, e.message + )) + sys.exit(status) + + +def replay(argv): + start_time = time.time() + env = os.environ.copy() + input_values = [] + + try: + with open(INPUT_FILE) as f: + input_values = json.load(f) + except (ValueError, IOError) as e: + log_debug("Unable to parse input file '{0}': {1}".format( + OUTPUT_FILE, e.message + )) + + if not input_values: + log_debug("Empty input") + _exit(127) + + input_number = get_count(len(input_values)) + if input_number >= len(input_values): + log_debug("Unable to get current input") + _exit(127) + + cur_input = input_values[input_number] + if cur_input["request"]["argv"] != argv: + log_debug( + "Expected different command (Expected: '{0}', Given: '{1}')".format( + " ".join(cur_input["request"]["argv"]), + " ".join(argv) + ) + ) + _exit(127) + + env.update(cur_input["request"]["env"]) + sys.stderr.write(cur_input["response"]["stderr"]) + sys.stdout.write(cur_input["response"]["stdout"]) + + if not IGNORE_TIMING: + time_left = cur_input["time"]["perform_duration"] - ( + time.time() - start_time + ) + + if time_left > 0: + log_debug("Sleeping for {0} s".format(time_left)) + time.sleep(time_left) + else: + log_debug("Uooops! We are running {0} s longer.".format( + abs(time_left) + )) + + sys.exit(cur_input["response"]["return_code"]) + + +def main(argv): + if not argv: + print "No command to run" + _exit(127) + if INPUT_FILE: + replay(argv) + else: + record(argv) + + +if __name__ == "__main__": + main(sys.argv[1:]) diff --git a/tests/create_test_data.py b/tests/create_test_data.py new file mode 100755 index 000000000..d3993410d --- /dev/null +++ b/tests/create_test_data.py @@ -0,0 +1,275 @@ +#!/usr/bin/python -tt + +import sys +import logging +import os +import re +from configobj import ConfigObj + +import fence_tests_lib as ftl + + +class RecordException(Exception): + pass + + +VERBOSE = not set(["-v", "--verbose"]).isdisjoint(sys.argv) + +avail_opt = { + "verbose": { + "getopt": "v", + "longopt": "verbose", + "description": "Verbose mode" + }, + "help": { + "getopt": "h", + "longopt": "help", + "description": "Display help and exit" + }, + "device": { + "getopt": "d:", + "longopt": "device", + "description": "List of devices to test (e.g.: apc,docker)", + "default": None + }, + "action": { + "getopt": "a:", + "longopt": "action", + "description": "List of actions to test", + "default": None + }, + "test-config": { + "getopt": "t", + "longopt": "test-config", + "description": "Test device config", + "default": False + }, + "force": { + "getopt": "f", + "longopt": "force", + "description": "force rewrite existing log file", + "default": False + }, + "port": { + "getopt": "p:", + "longopt": "port", + "description": + "Local port for communication between agent and mitmproxy", + "default": "4242" + } +} + + +class RecordTestData(object): + def __init__( + self, device_cfg, action_cfg, local_port, force=False + ): + self.local_port = local_port + self.device_cfg = device_cfg + self.action_cfg = action_cfg + self.device_cfg_obj = ConfigObj(device_cfg, unrepr=True) + self.action_cfg_obj = ConfigObj(action_cfg, unrepr=True) + logs_path = os.path.join( + ftl.MITM_LOGS_PATH, self.device_cfg_obj["agent"][6:] + ) + if "subdir" in self.device_cfg_obj: + logs_path = os.path.join(logs_path, self.device_cfg_obj["subdir"]) + self.log = os.path.join( + logs_path, "{name}.log".format(name=ftl.get_basename(action_cfg)) + ) + logging.debug("Log file: {log}".format(log=self.log)) + + if os.path.isfile(self.log) and not force: + if force: + os.remove(self.log) + else: + raise RecordException( + "Log file already exists. Use --force to overwrite it." + ) + + self.mitm_process = None + self.params = "" + self.env = {} + self.type = self.device_cfg_obj["agent_type"].lower() + + def set_up_mitm(self): + self.mitm_process = ftl.start_mitm_server( + *ftl.get_mitm_record_cmd( + self.device_cfg_obj, self.log, self.local_port + ) + ) + + if "ipaddr" in self.device_cfg_obj["options"]: + self.device_cfg_obj["options"]["ipaddr"][0] = "localhost" + if "ipport" in self.device_cfg_obj["options"]: + self.device_cfg_obj["options"]["ipport"][0] = self.local_port + + def tear_down_mitm(self): + ftl.stop_mitm_server(self.mitm_process) + + def set_up_pycurl(self): + self.params = "--fencing_pycurl-log-out {log}".format(log=self.log) + + def tear_down_pycurl(self): + pass + + def set_up_binmitm(self): + cf = os.path.abspath(ftl.BINMITM_COUNTERFILE) + if os.path.exists(cf): + os.remove(cf) + if "BINMITM_INPUT" in os.environ: + del os.environ["BINMITM_INPUT"] + if "BINMITM_DEBUG" in os.environ: + del os.environ["BINMITM_DEBUG"] + self.env = { + "BINMITM_COUNTER_FILE": ftl.BINMITM_COUNTERFILE, + "BINMITM_OUTPUT": self.log + } + + def tear_down_binmitm(self): + cf = os.path.abspath(ftl.BINMITM_COUNTERFILE) + if os.path.exists(cf): + os.remove(cf) + + def set_up(self): + if self.type == "mitmproxy": + self.set_up_mitm() + elif self.type == "pycurl": + self.set_up_pycurl() + elif self.type == "binmitm": + self.set_up_binmitm() + + def tear_down(self): + if self.type == "mitmproxy": + self.tear_down_mitm() + elif self.type == "pycurl": + self.tear_down_pycurl() + elif self.type == "binmitm": + self.tear_down_binmitm() + + def record(self): + self.set_up() + + success = True + actions = self.action_cfg_obj + + for action in actions["actions"]: + if not success: + break + cmd, stdin, env = ftl.prepare_command( + self.device_cfg_obj, self.params + ) + + env.update(self.env) + cmd += " -o {action}".format(action=(action["command"])) + + status, stdout, stderr = ftl.run_agent(cmd, stdin, env) + + logging.debug("AGENT EXITCODE: {0}".format(str(status))) + logging.debug("AGENT STDOUT: {0}".format(stdout)) + logging.debug("AGENT STDERR: {0}".format(stderr)) + + success = success and bool( + re.search(action["return_code"], str(status), re.IGNORECASE) + ) + if not success: + logging.error( + "EXITCODE: {actual} (expected: {expected})".format( + actual=str(status), + expected=action["return_code"] + ) + ) + + self.tear_down() + return success + + +def get_device_cfg_path(device): + device_cfg = os.path.join( + ftl.DEVICES_PATH, "{name}.cfg".format(name=device) + ) + if not os.path.isfile(device_cfg): + raise RecordException( + "Device config '{cfg}' not found.".format(cfg=device_cfg) + ) + return device_cfg + + +def get_action_cfg_path(action): + action_cfg = os.path.join( + ftl.ACTIONS_PATH, "{name}.cfg".format(name=action) + ) + if not os.path.isfile(action_cfg): + raise RecordException( + "Action config '{cfg}' not found.".format(cfg=action_cfg) + ) + return action_cfg + + +def main(): + if VERBOSE: + logging.getLogger().setLevel(logging.DEBUG) + else: + logging.getLogger().setLevel(logging.INFO) + + opt = ftl.get_options(avail_opt) + + if "--help" in opt: + ftl.show_help( + avail_opt, + "This program can create testing data for MITM tests of " + "fence-agents." + ) + sys.exit(0) + + if opt["--device"] is None: + logging.error("Device has to be defined.") + ftl.show_help(avail_opt) + sys.exit(1) + + if opt["--action"] is None and not opt["--test-config"]: + logging.error("Action has to be defined when not testing config.") + ftl.show_help(avail_opt) + sys.exit(1) + + device_cfg = get_device_cfg_path(opt["--device"]) + + if opt["--test-config"]: + config = ConfigObj(device_cfg, unrepr=True) + + cmd, stdin, env = ftl.prepare_command(config) + cmd += " -o status" + status, stdout, stderr = ftl.run_agent(cmd, stdin, env) + + if status != 0 and status != 2: + logging.error("Cannot obtain status)") + logging.error("Agent RETURNCODE: {0}".format(str(status))) + logging.error("Agent STDOUT: {0}".format(stdout)) + logging.error("Agent STDERR: {0}".format(stdout)) + sys.exit(1) + print stdout, + + sys.exit(0) + + action_cfg = get_action_cfg_path(opt["--action"]) + + try: + status = RecordTestData( + device_cfg, + action_cfg, + opt["--port"], + opt["--force"] + ).record() + except (ftl.LibException, RecordException) as e: + logging.error(str(e)) + logging.error("Obtaining testing data failed.") + sys.exit(1) + + if not status: + logging.error("Obtaining testing data failed.") + sys.exit(1) + print "Obtaining log file was successful." + + +if __name__ == "__main__": + main() diff --git a/tests/data/mitm-logs/apc/ssh-user/already-off.log b/tests/data/mitm-logs/apc/ssh-user/already-off.log new file mode 100644 index 000000000..92b61a151 --- /dev/null +++ b/tests/data/mitm-logs/apc/ssh-user/already-off.log @@ -0,0 +1,13 @@ +0.0000009537 server 0x0a0a0a0d416d65726963616e20506f77657220436f6e76657273696f6e2020202020202020202020202020204e6574776f726b204d616e6167656d656e74204361726420414f5320202020202076322e372e300d0a28632920436f70797269676874203230303420416c6c2052696768747320526573657276656420205261636b205044552041505020202020202020202020202020202020202020202076322e372e330d0a2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a4e616d652020202020203a205044552d424152202020202020202020202020202020202020202020202020202020202020202020202044617465203a2030382f31322f323031340d0a436f6e746163742020203a2020202020202020202020202020202020202020202020202020202020202020202020202020202020202054696d65203a2031313a34353a35390a0d4c6f636174696f6e20203a20425251204c61622c207261636b202339202d20726573657276656420666f7220636c757374657220202055736572203a204f75746c657420557365720a0d55702054696d652020203a2033352044617973203020486f757273203138204d696e757465732020202020202020202020202020202053746174203a20502b204e2b20412b0d0a0d0a5377697463686564205261636b205044553a20436f6d6d756e69636174696f6e2045737461626c69736865640a0a0d2d2d2d2d2d2d2d20436f6e74726f6c20436f6e736f6c65202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d20446576696365204d616e616765720d0a2020202020322d204e6574776f726b0d0a2020202020332d2053797374656d0d0a2020202020342d204c6f676f75740d0a0d0a20202020203c4553433e2d204d61696e204d656e752c203c454e5445523e2d20526566726573680d0a3e20 #....American Power Conversion Network Management Card AOS v2.7.0..(c) Copyright 2004 All Rights Reserved Rack PDU APP v2.7.3..-------------------------------------------------------------------------------..Name : PDU-BAR Date : 08/12/2014..Contact : Time : 11:45:59..Location : BRQ Lab, rack #9 - reserved for cluster User : Outlet User..Up Time : 35 Days 0 Hours 18 Minutes Stat : P+ N+ A+....Switched Rack PDU: Communication Established...------- Control Console -------------------------------------------------------.... 1- Device Manager.. 2- Network.. 3- System.. 4- Logout.... - Main Menu, - Refresh..> +0.0539131165 client 0x310d0a #1.. +0.2373480797 server 0x310a0a0d2d2d2d2d2d2d2d20446576696365204d616e61676572202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d205068617365204d6f6e69746f720d0a2020202020322d204f75746c657420436f6e74726f6c0d0a2020202020332d20506f77657220537570706c79205374617475730d0a0d0a20202020203c4553433e2d204261636b2c203c454e5445523e2d20526566726573680d0a3e20 #1...------- Device Manager --------------------------------------------------------.... 1- Phase Monitor.. 2- Outlet Control.. 3- Power Supply Status.... - Back, - Refresh..> +0.2908310890 client 0x320d0a #2.. +0.5854060650 server 0x320a0a0d2d2d2d2d2d2d2d204f75746c657420436f6e74726f6c202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d202d2020202020202020202020202020202020202020202020204f46460d0a2020202020322d20454d43202855505329202020202020202020202020202020204f4e0d0a2020202020332d20454d43202020202020202020202020202020202020202020204f4e0d0a2020202020342d20464320537769746368202020202020202020202020202020204f4e0d0a2020202020352d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020362d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020372d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020382d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020392d202d2020202020202020202020202020202020202020202020204f46460d0a2020202031302d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031312d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031322d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031332d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031342d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031352d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031362d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031372d202d2020202020202020202020202020202020202020202020204f4e0d0a2020202031382d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031392d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032302d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032312d206261722d3032202020202020202020202020202020202020204f4e0d0a2020202032322d206261722d3032202020202020202020202020202020202020204f4e0d0a0d20202020202020205072657373203c454e5445523e20746f20636f6e74696e75652e2e2e0d2020202020202020202020202020202020202020202020202020202020202020202020200d2020202032332d206261722d3031202020202020 #2...------- Outlet Control --------------------------------------------------------.... 1- - OFF.. 2- EMC (UPS) ON.. 3- EMC ON.. 4- FC Switch ON.. 5- EqualLogic ON.. 6- EqualLogic ON.. 7- [nothing] ON.. 8- [nothing] ON.. 9- - OFF.. 10- Saturnin ON.. 11- Saturnin ON.. 12- [nothing] OFF.. 13- [nothing] OFF.. 14- bar-05 ON.. 15- bar-05 ON.. 16- bar-04 ON.. 17- - ON.. 18- bar-04 ON.. 19- bar-03 ON.. 20- bar-03 ON.. 21- bar-02 ON.. 22- bar-02 ON... Press to continue.... . 23- bar-01 +0.6406350136 client 0x0d0a #.. +0.6872971058 server 0x202020202020202020202020204f4e0d0a2020202032342d206261722d3031202020202020202020202020202020202020204f4e0d0a2020202032352d20414c4c2041636365737369626c65204f75746c6574730d0a0d0a20202020203c4553433e2d204261636b2c203c454e5445523e2d20526566726573680d0a3e20 # ON.. 24- bar-01 ON.. 25- ALL Accessible Outlets.... - Back, - Refresh..> +0.7414140701 client 0x0d0a #.. +0.7921981812 client 0x03 #. +0.9241399765 server 0x0a0a0d2d2d2d2d2d2d2d204f75746c657420436f6e74726f6c202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d202d2020202020202020202020202020202020202020202020204f46460d0a2020202020322d20454d43202855505329202020202020202020202020202020204f4e0d0a2020202020332d20454d43202020202020202020202020202020202020202020204f4e0d0a2020202020342d20464320537769746368202020202020202020202020202020204f4e0d0a2020202020352d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020362d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020372d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020382d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020392d202d2020202020202020202020202020202020202020202020204f46460d0a2020202031302d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031312d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031322d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031332d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031342d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031352d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031362d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031372d202d2020202020202020202020202020202020202020202020204f4e0d0a2020202031382d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031392d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032302d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032312d206261722d3032202020202020202020202020202020202020204f4e0d0a2020202032322d206261722d3032202020202020202020202020202020202020204f4e0d0a0d20202020202020205072657373203c454e5445523e20746f20636f6e74696e75652e2e2e0d2020202020202020202020202020202020202020202020202020202020202020202020200d2020202032332d206261722d303120202020202020 #...------- Outlet Control --------------------------------------------------------.... 1- - OFF.. 2- EMC (UPS) ON.. 3- EMC ON.. 4- FC Switch ON.. 5- EqualLogic ON.. 6- EqualLogic ON.. 7- [nothing] ON.. 8- [nothing] ON.. 9- - OFF.. 10- Saturnin ON.. 11- Saturnin ON.. 12- [nothing] OFF.. 13- [nothing] OFF.. 14- bar-05 ON.. 15- bar-05 ON.. 16- bar-04 ON.. 17- - ON.. 18- bar-04 ON.. 19- bar-03 ON.. 20- bar-03 ON.. 21- bar-02 ON.. 22- bar-02 ON... Press to continue.... . 23- bar-01 +1.2100620270 server 0x2020202020202020202020204f4e0d0a2020202032342d206261722d3031202020202020202020202020202020202020204f4e0d0a2020202032352d20414c4c2041636365737369626c65204f75746c6574730d0a0d0a20202020203c4553433e2d204261636b2c203c454e5445523e2d20526566726573680d0a3e200a0a0d2d2d2d2d2d2d2d204f75746c657420436f6e74726f6c202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d202d2020202020202020202020202020202020202020202020204f46460d0a2020202020322d20454d43202855505329202020202020202020202020202020204f4e0d0a2020202020332d20454d43202020202020202020202020202020202020202020204f4e0d0a2020202020342d20464320537769746368202020202020202020202020202020204f4e0d0a2020202020352d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020362d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020372d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020382d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020392d202d2020202020202020202020202020202020202020202020204f46460d0a2020202031302d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031312d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031322d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031332d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031342d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031352d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031362d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031372d202d2020202020202020202020202020202020202020202020204f4e0d0a2020202031382d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031392d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032302d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032312d206261722d3032202020202020202020202020202020202020204f4e0d0a2020202032322d20 # ON.. 24- bar-01 ON.. 25- ALL Accessible Outlets.... - Back, - Refresh..> ...------- Outlet Control --------------------------------------------------------.... 1- - OFF.. 2- EMC (UPS) ON.. 3- EMC ON.. 4- FC Switch ON.. 5- EqualLogic ON.. 6- EqualLogic ON.. 7- [nothing] ON.. 8- [nothing] ON.. 9- - OFF.. 10- Saturnin ON.. 11- Saturnin ON.. 12- [nothing] OFF.. 13- [nothing] OFF.. 14- bar-05 ON.. 15- bar-05 ON.. 16- bar-04 ON.. 17- - ON.. 18- bar-04 ON.. 19- bar-03 ON.. 20- bar-03 ON.. 21- bar-02 ON.. 22- +1.4352209568 server 0x6261722d3032202020202020202020202020202020202020204f4e0d0a0d20202020202020205072657373203c454e5445523e20746f20636f6e74696e75652e2e2e0d2020202020202020202020202020202020202020202020202020202020202020202020200d2020202032332d206261722d3031202020202020202020202020202020202020204f4e0d0a2020202032342d206261722d3031202020202020202020202020202020202020204f4e0d0a2020202032352d20414c4c2041636365737369626c65204f75746c6574730d0a0d0a20202020203c4553433e2d204261636b2c203c454e5445523e2d20526566726573680d0a3e200a0a0a0d416d65726963616e20506f77657220436f6e76657273696f6e2020202020202020202020202020204e6574776f726b204d616e6167656d656e74204361726420414f5320202020202076322e372e300d0a28632920436f70797269676874203230303420416c6c2052696768747320526573657276656420205261636b205044552041505020202020202020202020202020202020202020202076322e372e330d0a2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a4e616d652020202020203a205044552d424152202020202020202020202020202020202020202020202020202020202020202020202044617465203a2030382f31322f323031340d0a436f6e746163742020203a2020202020202020202020202020202020202020202020202020202020202020202020202020202020202054696d65203a2031313a34363a30300a0d4c6f636174696f6e20203a20425251204c61622c207261636b202339202d20726573657276656420666f7220636c757374657220202055736572203a204f75746c657420557365720a0d55702054696d652020203a2033352044617973203020486f757273203138204d696e757465732020202020202020202020202020202053746174203a20502b204e2b20412b0d0a0d0a5377697463686564205261636b205044553a20436f6d6d756e69636174696f6e2045737461626c69736865640a0a0d2d2d2d2d2d2d2d20436f6e74726f6c20436f6e736f6c65202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d20446576696365204d616e616765720d0a2020202020322d204e6574776f726b0d0a2020202020332d2053797374656d0d0a2020202020342d204c6f676f75740d0a0d0a20202020203c45 #bar-02 ON... Press to continue.... . 23- bar-01 ON.. 24- bar-01 ON.. 25- ALL Accessible Outlets.... - Back, - Refresh..> ....American Power Conversion Network Management Card AOS v2.7.0..(c) Copyright 2004 All Rights Reserved Rack PDU APP v2.7.3..-------------------------------------------------------------------------------..Name : PDU-BAR Date : 08/12/2014..Contact : Time : 11:46:00..Location : BRQ Lab, rack #9 - reserved for cluster User : Outlet User..Up Time : 35 Days 0 Hours 18 Minutes Stat : P+ N+ A+....Switched Rack PDU: Communication Established...------- Control Console -------------------------------------------------------.... 1- Device Manager.. 2- Network.. 3- System.. 4- Logout.... - Main Menu, - Refresh..> diff --git a/tests/data/mitm-logs/apc/ssh-user/already-on.log b/tests/data/mitm-logs/apc/ssh-user/already-on.log new file mode 100644 index 000000000..da14fe763 --- /dev/null +++ b/tests/data/mitm-logs/apc/ssh-user/already-on.log @@ -0,0 +1,13 @@ +0.0000009537 server 0x0a0a0a0d416d65726963616e20506f77657220436f6e76657273696f6e2020202020202020202020202020204e6574776f726b204d616e6167656d656e74204361726420414f5320202020202076322e372e300d0a28632920436f70797269676874203230303420416c6c2052696768747320526573657276656420205261636b205044552041505020202020202020202020202020202020202020202076322e372e330d0a2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a4e616d652020202020203a205044552d424152202020202020202020202020202020202020202020202020202020202020202020202044617465203a2030382f31322f323031340d0a436f6e746163742020203a2020202020202020202020202020202020202020202020202020202020202020202020202020202020202054696d65203a2031313a35303a35360a0d4c6f636174696f6e20203a20425251204c61622c207261636b202339202d20726573657276656420666f7220636c757374657220202055736572203a204f75746c657420557365720a0d55702054696d652020203a2033352044617973203020486f757273203233204d696e757465732020202020202020202020202020202053746174203a20502b204e2b20412b0d0a0d0a5377697463686564205261636b205044553a20436f6d6d756e69636174696f6e2045737461626c69736865640a0a0d2d2d2d2d2d2d2d20436f6e74726f6c20436f6e736f6c65202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d20446576696365204d616e616765720d0a2020202020322d204e6574776f726b0d0a2020202020332d2053797374656d0d0a2020202020342d204c6f676f75740d0a0d0a20202020203c4553433e2d204d61696e204d656e752c203c454e5445523e2d20526566726573680d0a3e20 #....American Power Conversion Network Management Card AOS v2.7.0..(c) Copyright 2004 All Rights Reserved Rack PDU APP v2.7.3..-------------------------------------------------------------------------------..Name : PDU-BAR Date : 08/12/2014..Contact : Time : 11:50:56..Location : BRQ Lab, rack #9 - reserved for cluster User : Outlet User..Up Time : 35 Days 0 Hours 23 Minutes Stat : P+ N+ A+....Switched Rack PDU: Communication Established...------- Control Console -------------------------------------------------------.... 1- Device Manager.. 2- Network.. 3- System.. 4- Logout.... - Main Menu, - Refresh..> +0.0560309887 client 0x310d0a #1.. +0.2476198673 server 0x310a0a0d2d2d2d2d2d2d2d20446576696365204d616e61676572202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d205068617365204d6f6e69746f720d0a2020202020322d204f75746c657420436f6e74726f6c0d0a2020202020332d20506f77657220537570706c79205374617475730d0a0d0a20202020203c4553433e2d204261636b2c203c454e5445523e2d20526566726573680d0a3e20 #1...------- Device Manager --------------------------------------------------------.... 1- Phase Monitor.. 2- Outlet Control.. 3- Power Supply Status.... - Back, - Refresh..> +0.3028409481 client 0x320d0a #2.. +0.5794909000 server 0x320a0a0d2d2d2d2d2d2d2d204f75746c657420436f6e74726f6c202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d202d2020202020202020202020202020202020202020202020204f4e0d0a2020202020322d20454d43202855505329202020202020202020202020202020204f4e0d0a2020202020332d20454d43202020202020202020202020202020202020202020204f4e0d0a2020202020342d20464320537769746368202020202020202020202020202020204f4e0d0a2020202020352d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020362d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020372d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020382d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020392d202d2020202020202020202020202020202020202020202020204f46460d0a2020202031302d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031312d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031322d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031332d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031342d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031352d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031362d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031372d202d2020202020202020202020202020202020202020202020204f4e0d0a2020202031382d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031392d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032302d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032312d206261722d3032202020202020202020202020202020202020204f4e0d0a2020202032322d206261722d3032202020202020202020202020202020202020204f4e0d0a0d20202020202020205072657373203c454e5445523e20746f20636f6e74696e75652e2e2e0d2020202020202020202020202020202020202020202020202020202020202020202020200d2020202032332d206261722d303120202020202020 #2...------- Outlet Control --------------------------------------------------------.... 1- - ON.. 2- EMC (UPS) ON.. 3- EMC ON.. 4- FC Switch ON.. 5- EqualLogic ON.. 6- EqualLogic ON.. 7- [nothing] ON.. 8- [nothing] ON.. 9- - OFF.. 10- Saturnin ON.. 11- Saturnin ON.. 12- [nothing] OFF.. 13- [nothing] OFF.. 14- bar-05 ON.. 15- bar-05 ON.. 16- bar-04 ON.. 17- - ON.. 18- bar-04 ON.. 19- bar-03 ON.. 20- bar-03 ON.. 21- bar-02 ON.. 22- bar-02 ON... Press to continue.... . 23- bar-01 +0.6347999573 client 0x0d0a #.. +0.6963539124 server 0x2020202020202020202020204f4e0d0a2020202032342d206261722d3031202020202020202020202020202020202020204f4e0d0a2020202032352d20414c4c2041636365737369626c65204f75746c6574730d0a0d0a20202020203c4553433e2d204261636b2c203c454e5445523e2d20526566726573680d0a3e20 # ON.. 24- bar-01 ON.. 25- ALL Accessible Outlets.... - Back, - Refresh..> +0.7486109734 client 0x0d0a #.. +0.7987270355 client 0x03 #. +0.9118950367 server 0x0a0a0d2d2d2d2d2d2d2d204f75746c657420436f6e74726f6c202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d202d2020202020202020202020202020202020202020202020204f4e0d0a2020202020322d20454d43202855505329202020202020202020202020202020204f4e0d0a2020202020332d20454d43202020202020202020202020202020202020202020204f4e0d0a2020202020342d20464320537769746368202020202020202020202020202020204f4e0d0a2020202020352d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020362d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020372d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020382d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020392d202d2020202020202020202020202020202020202020202020204f46460d0a2020202031302d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031312d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031322d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031332d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031342d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031352d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031362d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031372d202d2020202020202020202020202020202020202020202020204f4e0d0a2020202031382d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031392d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032302d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032312d206261722d3032202020202020202020202020202020202020204f4e0d0a2020202032322d206261722d3032202020202020202020202020202020202020204f4e0d0a0d20202020202020205072657373203c454e5445523e20746f20636f6e74696e75652e2e2e0d2020202020202020202020202020202020202020202020202020202020202020202020200d2020202032332d206261722d30312020202020202020 #...------- Outlet Control --------------------------------------------------------.... 1- - ON.. 2- EMC (UPS) ON.. 3- EMC ON.. 4- FC Switch ON.. 5- EqualLogic ON.. 6- EqualLogic ON.. 7- [nothing] ON.. 8- [nothing] ON.. 9- - OFF.. 10- Saturnin ON.. 11- Saturnin ON.. 12- [nothing] OFF.. 13- [nothing] OFF.. 14- bar-05 ON.. 15- bar-05 ON.. 16- bar-04 ON.. 17- - ON.. 18- bar-04 ON.. 19- bar-03 ON.. 20- bar-03 ON.. 21- bar-02 ON.. 22- bar-02 ON... Press to continue.... . 23- bar-01 +1.1821279526 server 0x20202020202020202020204f4e0d0a2020202032342d206261722d3031202020202020202020202020202020202020204f4e0d0a2020202032352d20414c4c2041636365737369626c65204f75746c6574730d0a0d0a20202020203c4553433e2d204261636b2c203c454e5445523e2d20526566726573680d0a3e200a0a0d2d2d2d2d2d2d2d204f75746c657420436f6e74726f6c202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d202d2020202020202020202020202020202020202020202020204f4e0d0a2020202020322d20454d43202855505329202020202020202020202020202020204f4e0d0a2020202020332d20454d43202020202020202020202020202020202020202020204f4e0d0a2020202020342d20464320537769746368202020202020202020202020202020204f4e0d0a2020202020352d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020362d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020372d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020382d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020392d202d2020202020202020202020202020202020202020202020204f46460d0a2020202031302d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031312d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031322d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031332d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031342d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031352d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031362d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031372d202d2020202020202020202020202020202020202020202020204f4e0d0a2020202031382d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031392d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032302d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032312d206261722d3032202020202020202020202020202020202020204f4e0d0a2020202032322d206261 # ON.. 24- bar-01 ON.. 25- ALL Accessible Outlets.... - Back, - Refresh..> ...------- Outlet Control --------------------------------------------------------.... 1- - ON.. 2- EMC (UPS) ON.. 3- EMC ON.. 4- FC Switch ON.. 5- EqualLogic ON.. 6- EqualLogic ON.. 7- [nothing] ON.. 8- [nothing] ON.. 9- - OFF.. 10- Saturnin ON.. 11- Saturnin ON.. 12- [nothing] OFF.. 13- [nothing] OFF.. 14- bar-05 ON.. 15- bar-05 ON.. 16- bar-04 ON.. 17- - ON.. 18- bar-04 ON.. 19- bar-03 ON.. 20- bar-03 ON.. 21- bar-02 ON.. 22- ba +1.4058299065 server 0x722d3032202020202020202020202020202020202020204f4e0d0a0d20202020202020205072657373203c454e5445523e20746f20636f6e74696e75652e2e2e0d2020202020202020202020202020202020202020202020202020202020202020202020200d2020202032332d206261722d3031202020202020202020202020202020202020204f4e0d0a2020202032342d206261722d3031202020202020202020202020202020202020204f4e0d0a2020202032352d20414c4c2041636365737369626c65204f75746c6574730d0a0d0a20202020203c4553433e2d204261636b2c203c454e5445523e2d20526566726573680d0a3e200a0a0a0d416d65726963616e20506f77657220436f6e76657273696f6e2020202020202020202020202020204e6574776f726b204d616e6167656d656e74204361726420414f5320202020202076322e372e300d0a28632920436f70797269676874203230303420416c6c2052696768747320526573657276656420205261636b205044552041505020202020202020202020202020202020202020202076322e372e330d0a2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a4e616d652020202020203a205044552d424152202020202020202020202020202020202020202020202020202020202020202020202044617465203a2030382f31322f323031340d0a436f6e746163742020203a2020202020202020202020202020202020202020202020202020202020202020202020202020202020202054696d65203a2031313a35303a35380a0d4c6f636174696f6e20203a20425251204c61622c207261636b202339202d20726573657276656420666f7220636c757374657220202055736572203a204f75746c657420557365720a0d55702054696d652020203a2033352044617973203020486f757273203233204d696e757465732020202020202020202020202020202053746174203a20502b204e2b20412b0d0a0d0a5377697463686564205261636b205044553a20436f6d6d756e69636174696f6e2045737461626c69736865640a0a0d2d2d2d2d2d2d2d20436f6e74726f6c20436f6e736f6c65202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d20446576696365204d616e616765720d0a2020202020322d204e6574776f726b0d0a2020202020332d2053797374656d0d0a2020202020342d204c6f676f75740d0a0d0a20202020203c455343 #r-02 ON... Press to continue.... . 23- bar-01 ON.. 24- bar-01 ON.. 25- ALL Accessible Outlets.... - Back, - Refresh..> ....American Power Conversion Network Management Card AOS v2.7.0..(c) Copyright 2004 All Rights Reserved Rack PDU APP v2.7.3..-------------------------------------------------------------------------------..Name : PDU-BAR Date : 08/12/2014..Contact : Time : 11:50:58..Location : BRQ Lab, rack #9 - reserved for cluster User : Outlet User..Up Time : 35 Days 0 Hours 23 Minutes Stat : P+ N+ A+....Switched Rack PDU: Communication Established...------- Control Console -------------------------------------------------------.... 1- Device Manager.. 2- Network.. 3- System.. 4- Logout.... - Main Menu, - Refresh..> diff --git a/tests/data/mitm-logs/apc/ssh-user/list.log b/tests/data/mitm-logs/apc/ssh-user/list.log new file mode 100644 index 000000000..d88bcfa91 --- /dev/null +++ b/tests/data/mitm-logs/apc/ssh-user/list.log @@ -0,0 +1,12 @@ +0.0000009537 server 0x0a0a0a0d416d65726963616e20506f77657220436f6e76657273696f6e2020202020202020202020202020204e6574776f726b204d616e6167656d656e74204361726420414f5320202020202076322e372e300d0a28632920436f70797269676874203230303420416c6c2052696768747320526573657276656420205261636b205044552041505020202020202020202020202020202020202020202076322e372e330d0a2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a4e616d652020202020203a205044552d424152202020202020202020202020202020202020202020202020202020202020202020202044617465203a2030382f31312f323031340d0a436f6e746163742020203a2020202020202020202020202020202020202020202020202020202020202020202020202020202020202054696d65203a2031363a33333a31340a0d4c6f636174696f6e20203a20425251204c61622c207261636b202339202d20726573657276656420666f7220636c757374657220202055736572203a204f75746c657420557365720a0d55702054696d652020203a2033342044617973203520486f7572732036204d696e75746573202020202020202020202020202020202053746174203a20502b204e2b20412b0d0a0d0a5377697463686564205261636b205044553a20436f6d6d756e69636174696f6e2045737461626c69736865640a0a0d2d2d2d2d2d2d2d20436f6e74726f6c20436f6e736f6c65202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d20446576696365204d616e616765720d0a2020202020322d204e6574776f726b0d0a2020202020332d2053797374656d0d0a2020202020342d204c6f676f75740d0a0d0a20202020203c4553433e2d204d61696e204d656e752c203c454e5445523e2d20526566726573680d0a3e20 #....American Power Conversion Network Management Card AOS v2.7.0..(c) Copyright 2004 All Rights Reserved Rack PDU APP v2.7.3..-------------------------------------------------------------------------------..Name : PDU-BAR Date : 08/11/2014..Contact : Time : 16:33:14..Location : BRQ Lab, rack #9 - reserved for cluster User : Outlet User..Up Time : 34 Days 5 Hours 6 Minutes Stat : P+ N+ A+....Switched Rack PDU: Communication Established...------- Control Console -------------------------------------------------------.... 1- Device Manager.. 2- Network.. 3- System.. 4- Logout.... - Main Menu, - Refresh..> +0.0544900894 client 0x310d0a #1.. +0.1561701298 server 0x310a0a0d2d2d2d2d2d2d2d20446576696365204d616e61676572202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d205068617365204d6f6e69746f720d0a2020202020322d204f75746c657420436f6e74726f6c0d0a2020202020332d20506f77657220537570706c79205374617475730d0a0d0a20202020203c4553433e2d204261636b2c203c454e5445523e2d20526566726573680d0a3e20 #1...------- Device Manager --------------------------------------------------------.... 1- Phase Monitor.. 2- Outlet Control.. 3- Power Supply Status.... - Back, - Refresh..> +0.2095320225 client 0x320d0a #2.. +0.4070229530 server 0x320a0a0d2d2d2d2d2d2d2d204f75746c657420436f6e74726f6c202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d202d2020202020202020202020202020202020202020202020204f4e0d0a2020202020322d20454d43202855505329202020202020202020202020202020204f4e0d0a2020202020332d20454d43202020202020202020202020202020202020202020204f4e0d0a2020202020342d20464320537769746368202020202020202020202020202020204f4e0d0a2020202020352d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020362d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020372d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020382d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020392d202d2020202020202020202020202020202020202020202020204f46460d0a2020202031302d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031312d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031322d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031332d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031342d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031352d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031362d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031372d202d2020202020202020202020202020202020202020202020204f4e0d0a2020202031382d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031392d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032302d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032312d206261722d3032202020202020202020202020202020202020204f4e0d0a2020202032322d206261722d3032202020202020202020202020202020202020204f4e0d0a0d20202020202020205072657373203c454e5445523e20746f20636f6e74696e75652e2e2e0d2020202020202020202020202020202020202020202020202020202020202020202020200d2020202032332d206261722d303120202020202020 #2...------- Outlet Control --------------------------------------------------------.... 1- - ON.. 2- EMC (UPS) ON.. 3- EMC ON.. 4- FC Switch ON.. 5- EqualLogic ON.. 6- EqualLogic ON.. 7- [nothing] ON.. 8- [nothing] ON.. 9- - OFF.. 10- Saturnin ON.. 11- Saturnin ON.. 12- [nothing] OFF.. 13- [nothing] OFF.. 14- bar-05 ON.. 15- bar-05 ON.. 16- bar-04 ON.. 17- - ON.. 18- bar-04 ON.. 19- bar-03 ON.. 20- bar-03 ON.. 21- bar-02 ON.. 22- bar-02 ON... Press to continue.... . 23- bar-01 +0.4620509148 client 0x0d0a #.. +0.7898139954 server 0x2020202020202020202020200d4e0d0a2020202032342d206261722d3031202020202020202020202020202020202020204f4e0d0a2020202032352d20414c4c2041636365737369626c65204f75746c6574730d0a0d0a20202020203c4553433e2d204261636b2c203c454e5445523e2d20526566726573680d0a3e200a0a0d2d2d2d2d2d2d2d204f75746c657420436f6e74726f6c202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d202d2020202020202020202020202020202020202020202020204f4e0d0a2020202020322d20454d43202855505329202020202020202020202020202020204f4e0d0a2020202020332d20454d43202020202020202020202020202020202020202020204f4e0d0a2020202020342d20464320537769746368202020202020202020202020202020204f4e0d0a2020202020352d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020362d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020372d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020382d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020392d202d2020202020202020202020202020202020202020202020204f46460d0a2020202031302d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031312d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031322d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031332d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031342d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031352d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031362d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031372d202d2020202020202020202020202020202020202020202020204f4e0d0a2020202031382d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031392d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032302d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032312d206261722d3032202020202020202020202020202020202020204f4e0d0a2020202032322d2062 # .N.. 24- bar-01 ON.. 25- ALL Accessible Outlets.... - Back, - Refresh..> ...------- Outlet Control --------------------------------------------------------.... 1- - ON.. 2- EMC (UPS) ON.. 3- EMC ON.. 4- FC Switch ON.. 5- EqualLogic ON.. 6- EqualLogic ON.. 7- [nothing] ON.. 8- [nothing] ON.. 9- - OFF.. 10- Saturnin ON.. 11- Saturnin ON.. 12- [nothing] OFF.. 13- [nothing] OFF.. 14- bar-05 ON.. 15- bar-05 ON.. 16- bar-04 ON.. 17- - ON.. 18- bar-04 ON.. 19- bar-03 ON.. 20- bar-03 ON.. 21- bar-02 ON.. 22- b +0.8314230442 server 0x61722d3032202020202020202020202020202020202020204f4e0d0a0d20202020202020205072657373203c454e5445523e20746f20636f6e74696e75652e2e2e0d2020202020202020202020202020202020202020202020202020202020202020202020200d2020202032332d206261722d3031202020202020202020202020202020202020204f4e0d0a2020202032342d206261722d3031202020202020202020202020202020202020204f4e0d0a2020202032352d20414c4c2041636365737369626c65204f75746c6574730d0a0d0a20202020203c4553433e2d204261636b2c203c454e5445523e2d20526566726573680d0a3e20 #ar-02 ON... Press to continue.... . 23- bar-01 ON.. 24- bar-01 ON.. 25- ALL Accessible Outlets.... - Back, - Refresh..> +0.8428540230 client 0x0d0a #.. +0.8931241035 client 0x03 #. +1.0387880802 server 0x0a0a0d2d2d2d2d2d2d2d204f75746c657420436f6e74726f6c202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d202d2020202020202020202020202020202020202020202020204f4e0d0a2020202020322d20454d43202855505329202020202020202020202020202020204f4e0d0a2020202020332d20454d43202020202020202020202020202020202020202020204f4e0d0a2020202020342d20464320537769746368202020202020202020202020202020204f4e0d0a2020202020352d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020362d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020372d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020382d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020392d202d2020202020202020202020202020202020202020202020204f46460d0a2020202031302d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031312d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031322d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031332d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031342d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031352d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031362d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031372d202d2020202020202020202020202020202020202020202020204f4e0d0a2020202031382d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031392d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032302d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032312d206261722d3032202020202020202020202020202020202020204f4e0d0a2020202032322d206261722d3032202020202020202020202020202020202020204f4e0d0a0d20202020202020205072657373203c454e5445523e20746f20636f6e74696e75652e2e2e0d2020202020202020202020202020202020202020202020202020202020202020202020200d2020202032332d206261722d30312020202020202020 #...------- Outlet Control --------------------------------------------------------.... 1- - ON.. 2- EMC (UPS) ON.. 3- EMC ON.. 4- FC Switch ON.. 5- EqualLogic ON.. 6- EqualLogic ON.. 7- [nothing] ON.. 8- [nothing] ON.. 9- - OFF.. 10- Saturnin ON.. 11- Saturnin ON.. 12- [nothing] OFF.. 13- [nothing] OFF.. 14- bar-05 ON.. 15- bar-05 ON.. 16- bar-04 ON.. 17- - ON.. 18- bar-04 ON.. 19- bar-03 ON.. 20- bar-03 ON.. 21- bar-02 ON.. 22- bar-02 ON... Press to continue.... . 23- bar-01 +1.6368620396 server 0x20202020202020202020204f4e0d0a2020202032342d206261722d3031202020202020202020202020202020202020204f4e0d0a2020202032352d20414c4c2041636365737369626c65204f75746c6574730d0a0d0a20202020203c4553433e2d204261636b2c203c454e5445523e2d20526566726573680d0a3e200a0a0a0d416d65726963616e20506f77657220436f6e76657273696f6e2020202020202020202020202020204e6574776f726b204d616e6167656d656e74204361726420414f5320202020202076322e372e300d0a28632920436f70797269676874203230303420416c6c2052696768747320526573657276656420205261636b205044552041505020202020202020202020202020202020202020202076322e372e330d0a2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a4e616d652020202020203a205044552d424152202020202020202020202020202020202020202020202020202020202020202020202044617465203a2030382f31312f323031340d0a436f6e746163742020203a2020202020202020202020202020202020202020202020202020202020202020202020202020202020202054696d65203a2031363a33333a31360a0d4c6f636174696f6e20203a20425251204c61622c207261636b202339202d20726573657276656420666f7220636c757374657220202055736572203a204f75746c657420557365720a0d55702054696d652020203a2033342044617973203520486f7572732036204d696e75746573202020202020202020202020202020202053746174203a20502b204e2b20412b0d0a0d0a5377697463686564205261636b205044553a20436f6d6d756e69636174696f6e2045737461626c69736865640a0a0d2d2d2d2d2d2d2d20436f6e74726f6c20436f6e736f6c65202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d20446576696365204d616e616765720d0a2020202020322d204e6574776f726b0d0a2020202020332d2053797374656d0d0a2020202020342d204c6f676f75740d0a0d0a20202020203c4553433e2d204d61696e204d656e752c203c454e5445523e2d20526566726573680d0a3e20 # ON.. 24- bar-01 ON.. 25- ALL Accessible Outlets.... - Back, - Refresh..> ....American Power Conversion Network Management Card AOS v2.7.0..(c) Copyright 2004 All Rights Reserved Rack PDU APP v2.7.3..-------------------------------------------------------------------------------..Name : PDU-BAR Date : 08/11/2014..Contact : Time : 16:33:16..Location : BRQ Lab, rack #9 - reserved for cluster User : Outlet User..Up Time : 34 Days 5 Hours 6 Minutes Stat : P+ N+ A+....Switched Rack PDU: Communication Established...------- Control Console -------------------------------------------------------.... 1- Device Manager.. 2- Network.. 3- System.. 4- Logout.... - Main Menu, - Refresh..> diff --git a/tests/data/mitm-logs/apc/ssh-user/off.log b/tests/data/mitm-logs/apc/ssh-user/off.log new file mode 100644 index 000000000..028cb0102 --- /dev/null +++ b/tests/data/mitm-logs/apc/ssh-user/off.log @@ -0,0 +1,39 @@ +0.0000019073 server 0x0a0a0a0d416d65726963616e20506f77657220436f6e76657273696f6e2020202020202020202020202020204e6574776f726b204d616e6167656d656e74204361726420414f5320202020202076322e372e300d0a28632920436f70797269676874203230303420416c6c2052696768747320526573657276656420205261636b205044552041505020202020202020202020202020202020202020202076322e372e330d0a2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a4e616d652020202020203a205044552d424152202020202020202020202020202020202020202020202020202020202020202020202044617465203a2030382f31312f323031340d0a436f6e746163742020203a2020202020202020202020202020202020202020202020202020202020202020202020202020202020202054696d65203a2031363a32363a33380a0d4c6f636174696f6e20203a20425251204c61622c207261636b202339202d20726573657276656420666f7220636c757374657220202055736572203a204f75746c657420557365720a0d55702054696d652020203a2033342044617973203420486f757273203539204d696e757465732020202020202020202020202020202053746174203a20502b204e2b20412b0d0a0d0a5377697463686564205261636b205044553a20436f6d6d756e69636174696f6e2045737461626c69736865640a0a0d2d2d2d2d2d2d2d20436f6e74726f6c20436f6e736f6c65202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d20446576696365204d616e616765720d0a2020202020322d204e6574776f726b0d0a2020202020332d2053797374656d0d0a2020202020342d204c6f676f75740d0a0d0a20202020203c4553433e2d204d61696e204d656e752c203c454e5445523e2d20526566726573680d0a3e20 #....American Power Conversion Network Management Card AOS v2.7.0..(c) Copyright 2004 All Rights Reserved Rack PDU APP v2.7.3..-------------------------------------------------------------------------------..Name : PDU-BAR Date : 08/11/2014..Contact : Time : 16:26:38..Location : BRQ Lab, rack #9 - reserved for cluster User : Outlet User..Up Time : 34 Days 4 Hours 59 Minutes Stat : P+ N+ A+....Switched Rack PDU: Communication Established...------- Control Console -------------------------------------------------------.... 1- Device Manager.. 2- Network.. 3- System.. 4- Logout.... - Main Menu, - Refresh..> +0.0558919907 client 0x310d0a #1.. +0.1556630135 server 0x310a0a0d2d2d2d2d2d2d2d20446576696365204d616e61676572202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d205068617365204d6f6e69746f720d0a2020202020322d204f75746c657420436f6e74726f6c0d0a2020202020332d20506f77657220537570706c79205374617475730d0a0d0a20202020203c4553433e2d204261636b2c203c454e5445523e2d20526566726573680d0a3e20 #1...------- Device Manager --------------------------------------------------------.... 1- Phase Monitor.. 2- Outlet Control.. 3- Power Supply Status.... - Back, - Refresh..> +0.2101099491 client 0x320d0a #2.. +0.7173500061 server 0x320a0a0d2d2d2d2d2d2d2d204f75746c657420436f6e74726f6c202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d202d2020202020202020202020202020202020202020202020204f4e0d0a2020202020322d20454d43202855505329202020202020202020202020202020204f4e0d0a2020202020332d20454d43202020202020202020202020202020202020202020204f4e0d0a2020202020342d20464320537769746368202020202020202020202020202020204f4e0d0a2020202020352d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020362d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020372d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020382d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020392d202d2020202020202020202020202020202020202020202020204f46460d0a2020202031302d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031312d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031322d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031332d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031342d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031352d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031362d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031372d202d2020202020202020202020202020202020202020202020204f4e0d0a2020202031382d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031392d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032302d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032312d206261722d3032202020202020202020202020202020202020204f4e0d0a2020202032322d206261722d3032202020202020202020202020202020202020204f4e0d0a0d20202020202020205072657373203c454e5445523e20746f20636f6e74696e75652e2e2e0d2020202020202020202020202020202020202020202020202020202020202020202020200d2020202032332d206261722d303120202020202020 #2...------- Outlet Control --------------------------------------------------------.... 1- - ON.. 2- EMC (UPS) ON.. 3- EMC ON.. 4- FC Switch ON.. 5- EqualLogic ON.. 6- EqualLogic ON.. 7- [nothing] ON.. 8- [nothing] ON.. 9- - OFF.. 10- Saturnin ON.. 11- Saturnin ON.. 12- [nothing] OFF.. 13- [nothing] OFF.. 14- bar-05 ON.. 15- bar-05 ON.. 16- bar-04 ON.. 17- - ON.. 18- bar-04 ON.. 19- bar-03 ON.. 20- bar-03 ON.. 21- bar-02 ON.. 22- bar-02 ON... Press to continue.... . 23- bar-01 +0.7728559971 client 0x0d0a #.. +0.9672200680 server 0x2020202020202020202020204f4e0d0a2020202032342d206261722d3031202020202020202020202020202020202020204f4e0d0a2020202032352d20414c4c2041636365737369626c65204f75746c6574730d0a0d0a20202020203c4553433e2d204261636b2c203c454e5445523e2d20526566726573680d0a3e200a0a0d2d2d2d2d2d2d2d204f75746c657420436f6e74726f6c202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d202d2020202020202020202020202020202020202020202020204f4e0d0a2020202020322d20454d43202855505329202020202020202020202020202020204f4e0d0a2020202020332d20454d43202020202020202020202020202020202020202020204f4e0d0a2020202020342d20464320537769746368202020202020202020202020202020204f4e0d0a2020202020352d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020362d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020372d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020382d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020392d202d2020202020202020202020202020202020202020202020204f46460d0a2020202031302d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031312d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031322d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031332d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031342d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031352d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031362d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031372d202d2020202020202020202020202020202020202020202020204f4e0d0a2020202031382d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031392d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032302d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032312d206261722d3032202020202020202020202020202020202020204f4e0d0a2020202032322d2062 # ON.. 24- bar-01 ON.. 25- ALL Accessible Outlets.... - Back, - Refresh..> ...------- Outlet Control --------------------------------------------------------.... 1- - ON.. 2- EMC (UPS) ON.. 3- EMC ON.. 4- FC Switch ON.. 5- EqualLogic ON.. 6- EqualLogic ON.. 7- [nothing] ON.. 8- [nothing] ON.. 9- - OFF.. 10- Saturnin ON.. 11- Saturnin ON.. 12- [nothing] OFF.. 13- [nothing] OFF.. 14- bar-05 ON.. 15- bar-05 ON.. 16- bar-04 ON.. 17- - ON.. 18- bar-04 ON.. 19- bar-03 ON.. 20- bar-03 ON.. 21- bar-02 ON.. 22- b +1.0213611126 client 0x0d0a #.. +1.0719149113 client 0x03 #. +2.0663061142 server 0x61722d3032202020202020202003202020202020202020204f4e0d0a0d20202020202020205072657373203c454e5445523e20746f20636f6e74696e75652e2e2e0d2020202020202020202020202020202020202020202020202020202020202020202020200d2020202032332d206261722d3031202020202020202020202020202020202020204f4e0d0a2020202032342d206261722d3031202020202020202020202020202020202020204f4e0d0a2020202032352d20414c4c2041636365737369626c65204f75746c6574730d0a0d0a20202020203c4553433e2d204261636b2c203c454e5445523e2d20526566726573680d0a3e200a0a0d2d2d2d2d2d2d2d204f75746c657420436f6e74726f6c202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d202d2020202020202020202020202020202020202020202020204f4e0d0a2020202020322d20454d43202855505329202020202020202020202020202020204f4e0d0a2020202020332d20454d43202020202020202020202020202020202020202020204f4e0d0a2020202020342d20464320537769746368202020202020202020202020202020204f4e0d0a2020202020352d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020362d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020372d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020382d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020392d202d2020202020202020202020202020202020202020202020204f46460d0a2020202031302d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031312d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031322d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031332d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031342d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031352d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031362d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031372d202d2020202020202020202020202020202020202020202020204f4e0d0a2020202031382d206261722d303420202020202020202020202020202020202020 #ar-02 . ON... Press to continue.... . 23- bar-01 ON.. 24- bar-01 ON.. 25- ALL Accessible Outlets.... - Back, - Refresh..> ...------- Outlet Control --------------------------------------------------------.... 1- - ON.. 2- EMC (UPS) ON.. 3- EMC ON.. 4- FC Switch ON.. 5- EqualLogic ON.. 6- EqualLogic ON.. 7- [nothing] ON.. 8- [nothing] ON.. 9- - OFF.. 10- Saturnin ON.. 11- Saturnin ON.. 12- [nothing] OFF.. 13- [nothing] OFF.. 14- bar-05 ON.. 15- bar-05 ON.. 16- bar-04 ON.. 17- - ON.. 18- bar-04 +2.2501029968 server 0x4f4e0d0a2020202031392d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032302d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032312d206261722d3032202020202020202020202020202020202020204f4e0d0a2020202032322d206261722d3032202020202020202020202020202020202020204f4e0d0a0d20202020202020205072657373203c454e5445523e20746f20636f6e74696e75652e2e2e0d2020202020202020202020202020202020202020202020202020202020202020202020200d2020202032332d206261722d3031202020202020202020202020202020202020204f4e0d0a2020202032342d206261722d3031202020202020202020202020202020202020204f4e0d0a2020202032352d20414c4c2041636365737369626c65204f75746c6574730d0a0d0a20202020203c4553433e2d204261636b2c203c454e5445523e2d20526566726573680d0a3e200a0a0a0d416d65726963616e20506f77657220436f6e76657273696f6e2020202020202020202020202020204e6574776f726b204d616e6167656d656e74204361726420414f5320202020202076322e372e300d0a28632920436f70797269676874203230303420416c6c2052696768747320526573657276656420205261636b205044552041505020202020202020202020202020202020202020202076322e372e330d0a2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a4e616d652020202020203a205044552d424152202020202020202020202020202020202020202020202020202020202020202020202044617465203a2030382f31312f323031340d0a436f6e746163742020203a2020202020202020202020202020202020202020202020202020202020202020202020202020202020202054696d65203a2031363a32363a34300a0d4c6f636174696f6e20203a20425251204c61622c207261636b202339202d20726573657276656420666f7220636c757374657220202055736572203a204f75746c657420557365720a0d55702054696d652020203a2033342044617973203420486f757273203539204d696e757465732020202020202020202020202020202053746174203a20502b204e2b20412b0d0a0d0a5377697463686564205261636b205044553a20436f6d6d756e69636174696f6e2045737461626c69736865640a0a0d2d2d2d2d2d2d2d20436f6e74726f6c20436f6e736f6c65202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d #ON.. 19- bar-03 ON.. 20- bar-03 ON.. 21- bar-02 ON.. 22- bar-02 ON... Press to continue.... . 23- bar-01 ON.. 24- bar-01 ON.. 25- ALL Accessible Outlets.... - Back, - Refresh..> ....American Power Conversion Network Management Card AOS v2.7.0..(c) Copyright 2004 All Rights Reserved Rack PDU APP v2.7.3..-------------------------------------------------------------------------------..Name : PDU-BAR Date : 08/11/2014..Contact : Time : 16:26:40..Location : BRQ Lab, rack #9 - reserved for cluster User : Outlet User..Up Time : 34 Days 4 Hours 59 Minutes Stat : P+ N+ A+....Switched Rack PDU: Communication Established...------- Control Console ------------------ +2.3728139400 server 0x2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d20446576696365204d616e616765720d0a2020202020322d204e6574776f726b0d0a2020202020332d2053797374656d0d0a2020202020342d204c6f676f75740d0a0d0a20202020203c4553433e2d204d61696e204d656e752c203c454e5445523e2d20526566726573680d0a3e20 #-------------------------------------.... 1- Device Manager.. 2- Network.. 3- System.. 4- Logout.... - Main Menu, - Refresh..> +2.4260799885 client 0x310d0a #1.. +2.5300741196 server 0x310a0a0d2d2d2d2d2d2d2d20446576696365204d616e61676572202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d205068617365204d6f6e69746f720d0a2020202020322d204f75746c657420436f6e74726f6c0d0a2020202020332d20506f77657220537570706c79205374617475730d0a0d0a20202020203c4553433e2d204261636b2c203c454e5445523e2d20526566726573680d0a3e20 #1...------- Device Manager --------------------------------------------------------.... 1- Phase Monitor.. 2- Outlet Control.. 3- Power Supply Status.... - Back, - Refresh..> +2.5834779739 client 0x320d0a #2.. +2.7810430527 server 0x320a0a0d2d2d2d2d2d2d2d204f75746c657420436f6e74726f6c202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d202d2020202020202020202020202020202020202020202020204f4e0d0a2020202020322d20454d43202855505329202020202020202020202020202020204f4e0d0a2020202020332d20454d43202020202020202020202020202020202020202020204f4e0d0a2020202020342d20464320537769746368202020202020202020202020202020204f4e0d0a2020202020352d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020362d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020372d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020382d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020392d202d2020202020202020202020202020202020202020202020204f46460d0a2020202031302d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031312d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031322d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031332d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031342d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031352d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031362d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031372d202d2020202020202020202020202020202020202020202020204f4e0d0a2020202031382d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031392d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032302d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032312d206261722d3032202020202020202020202020202020202020204f4e0d0a2020202032322d206261722d3032202020202020202020202020202020202020204f4e0d0a0d20202020202020205072657373203c454e5445523e20746f20636f6e74696e75652e2e2e0d2020202020202020202020202020202020202020202020202020202020202020202020200d2020202032332d206261722d303120202020202020 #2...------- Outlet Control --------------------------------------------------------.... 1- - ON.. 2- EMC (UPS) ON.. 3- EMC ON.. 4- FC Switch ON.. 5- EqualLogic ON.. 6- EqualLogic ON.. 7- [nothing] ON.. 8- [nothing] ON.. 9- - OFF.. 10- Saturnin ON.. 11- Saturnin ON.. 12- [nothing] OFF.. 13- [nothing] OFF.. 14- bar-05 ON.. 15- bar-05 ON.. 16- bar-04 ON.. 17- - ON.. 18- bar-04 ON.. 19- bar-03 ON.. 20- bar-03 ON.. 21- bar-02 ON.. 22- bar-02 ON... Press to continue.... . 23- bar-01 +2.8345079422 client 0x0d0a #.. +3.0447781086 server 0x2020202020202020202020204f4e0d0a2020202032342d206261722d3031202020202020202020202020202020202020204f4e0d0a2020202032352d20414c4c2041636365737369626c65204f75746c6574730d0a0d0a20202020203c4553433e2d204261636b2c203c454e5445523e2d20526566726573680d0a3e200a0a0d2d2d2d2d2d2d2d204f75746c657420436f6e74726f6c202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d202d2020202020202020202020202020202020202020202020204f4e0d0a2020202020322d20454d43202855505329202020202020202020202020202020204f4e0d0a2020202020332d20454d43202020202020202020202020202020202020202020204f4e0d0a2020202020342d20464320537769746368202020202020202020202020202020204f4e0d0a2020202020352d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020362d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020372d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020382d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020392d202d2020202020202020202020202020202020202020202020204f46460d0a2020202031302d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031312d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031322d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031332d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031342d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031352d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031362d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031372d202d2020202020202020202020202020202020202020202020204f4e0d0a2020202031382d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031392d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032302d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032312d206261722d3032202020202020202020202020202020202020204f4e0d0a2020202032322d2062 # ON.. 24- bar-01 ON.. 25- ALL Accessible Outlets.... - Back, - Refresh..> ...------- Outlet Control --------------------------------------------------------.... 1- - ON.. 2- EMC (UPS) ON.. 3- EMC ON.. 4- FC Switch ON.. 5- EqualLogic ON.. 6- EqualLogic ON.. 7- [nothing] ON.. 8- [nothing] ON.. 9- - OFF.. 10- Saturnin ON.. 11- Saturnin ON.. 12- [nothing] OFF.. 13- [nothing] OFF.. 14- bar-05 ON.. 15- bar-05 ON.. 16- bar-04 ON.. 17- - ON.. 18- bar-04 ON.. 19- bar-03 ON.. 20- bar-03 ON.. 21- bar-02 ON.. 22- b +3.0986220837 client 0x310d0a #1.. +3.2340810299 server 0x61722d3032202020202020202020202020202020202020204f4e0d0a0d20202020202020205072657373203c454e5445523e20746f20636f6e74696e75652e2e2e0d2020202020202020202020202020202020202020202020202020202020202020202020200d2020202032332d206261722d3031202020202020202020202020202020202020204f4e0d0a2020202032342d206261722d3031202020202020202020202020202020202020204f4e0d0a2020202032352d20414c4c2041636365737369626c65204f75746c6574730d0a0d0a20202020203c4553433e2d204261636b2c203c454e5445523e2d20526566726573680d0a3e20310a0a0d2d2d2d2d2d2d2d202d202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a20202020202020204e616d652020202020202020203a202d0d0a20202020202020204f75746c6574202020202020203a20310d0a2020202020202020537461746520202020202020203a204f4e0d0a0d0a2020202020312d20496d6d656469617465204f6e20202020202020202020202020200d0a2020202020322d20496d6d656469617465204f6666202020202020202020202020200d0a2020202020332d20496d6d656469617465205265626f6f74202020202020202020200d0a2020202020342d2044656c61796564204f6e202020202020202020202020202020200d0a2020202020352d2044656c61796564204f66662020202020202020202020202020200d0a2020202020362d2044656c61796564205265626f6f742020202020202020202020200d0a2020202020372d2043616e63656c20202020202020202020202020202020202020200d0a0d0a20202020203f2d2048656c702c203c4553433e2d204261636b2c203c454e5445523e2d20526566726573680d0a3e20 #ar-02 ON... Press to continue.... . 23- bar-01 ON.. 24- bar-01 ON.. 25- ALL Accessible Outlets.... - Back, - Refresh..> 1...------- - ---------------------------------------------------------------------.... Name : -.. Outlet : 1.. State : ON.... 1- Immediate On .. 2- Immediate Off .. 3- Immediate Reboot .. 4- Delayed On .. 5- Delayed Off .. 6- Delayed Reboot .. 7- Cancel .... ?- Help, - Back, - Refresh..> +3.2877900600 client 0x320d0a #2.. +3.3528931141 server 0x320d0a20202020202020202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a2020202020202020496d6d656469617465204f6666202020202020202020202020200d0a0d0a20202020202020205468697320636f6d6d616e642077696c6c20696d6d6564696174656c79207475726e0d0a20202020202020206f75746c65742031206e616d656420272d27204f46462e0d0a0d0a2020202020202020456e74657220275945532720746f20636f6e74696e7565206f72203c454e5445523e20746f2063616e63656c203a20 #2.. -----------------------------------------------------------------------.. Immediate Off .... This command will immediately turn.. outlet 1 named '-' OFF..... Enter 'YES' to continue or to cancel : +3.4056971073 client 0x5945530d0a #YES.. +3.5787301064 server 0x5945530d0a2020202020202020436f6d6d616e64207375636365737366756c6c79206973737565642e0d0a0d0a20202020202020205072657373203c454e5445523e20746f20636f6e74696e75652e2e2e0d0a0a0a0d2d2d2d2d2d2d2d202d202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a20202020202020204e616d652020202020202020203a202d0d0a20202020202020204f75746c6574202020202020203a20310d0a2020202020202020537461746520202020202020203a204f46460d0a0d0a2020202020312d20496d6d656469617465204f6e20202020202020202020202020200d0a2020202020322d20496d6d656469617465204f6666202020202020202020202020200d0a2020202020332d20496d6d656469617465205265626f6f74202020202020202020200d0a2020202020342d2044656c61796564204f6e202020202020202020202020202020200d0a2020202020352d2044656c61796564204f66662020202020202020202020202020200d0a2020202020362d2044656c61796564205265626f6f742020202020202020202020200d0a2020202020372d2043616e63656c20202020202020202020202020202020202020200d0a0d0a20202020203f2d2048656c702c203c4553433e2d204261636b2c203c454e5445523e2d20526566726573680d0a3e20 #YES.. Command successfully issued..... Press to continue........------- - ---------------------------------------------------------------------.... Name : -.. Outlet : 1.. State : OFF.... 1- Immediate On .. 2- Immediate Off .. 3- Immediate Reboot .. 4- Delayed On .. 5- Delayed Off .. 6- Delayed Reboot .. 7- Cancel .... ?- Help, - Back, - Refresh..> +3.6329920292 client 0x0d0a #.. +3.6832959652 client 0x03 #. +3.7309191227 server 0x0a0a0d2d2d2d2d2d2d2d202d202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a20202020202020204e616d652020202020202020203a202d0d0a20202020202020204f75746c6574202020202020203a20310d0a2020202020202020537461746520202020202020203a204f46460d0a0d0a2020202020312d20496d6d656469617465204f6e20202020202020202020202020200d0a2020202020322d20496d6d656469617465204f6666202020202020202020202020200d0a2020202020332d20496d6d656469617465205265626f6f74202020202020202020200d0a2020202020342d2044656c61796564204f6e202020202020202020202020202020200d0a2020202020352d2044656c61796564204f66662020202020202020202020202020200d0a2020202020362d2044656c61796564205265626f6f742020202020202020202020200d0a2020202020372d2043616e63656c20202020202020202020202020202020202020200d0a0d0a20202020203f2d2048656c702c203c4553433e2d204261636b2c203c454e5445523e2d20526566726573680d0a3e20 #...------- - ---------------------------------------------------------------------.... Name : -.. Outlet : 1.. State : OFF.... 1- Immediate On .. 2- Immediate Off .. 3- Immediate Reboot .. 4- Delayed On .. 5- Delayed Off .. 6- Delayed Reboot .. 7- Cancel .... ?- Help, - Back, - Refresh..> +3.8638169765 server 0x0a0a0a0d416d65726963616e20506f77657220436f6e76657273696f6e2020202020202020202020202020204e6574776f726b204d616e6167656d656e74204361726420414f5320202020202076322e372e300d0a28632920436f70797269676874203230303420416c6c2052696768747320526573657276656420205261636b205044552041505020202020202020202020202020202020202020202076322e372e330d0a2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a4e616d652020202020203a205044552d424152202020202020202020202020202020202020202020202020202020202020202020202044617465203a2030382f31312f323031340d0a436f6e746163742020203a2020202020202020202020202020202020202020202020202020202020202020202020202020202020202054696d65203a2031363a32363a34320a0d4c6f636174696f6e20203a20425251204c61622c207261636b202339202d20726573657276656420666f7220636c757374657220202055736572203a204f75746c657420557365720a0d55702054696d652020203a2033342044617973203420486f757273203539204d696e757465732020202020202020202020202020202053746174203a20502b204e2b20412b0d0a0d0a5377697463686564205261636b205044553a20436f6d6d756e69636174696f6e2045737461626c69736865640a0a0d2d2d2d2d2d2d2d20436f6e74726f6c20436f6e736f6c65202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d20446576696365204d616e616765720d0a2020202020322d204e6574776f726b0d0a2020202020332d2053797374656d0d0a2020202020342d204c6f676f75740d0a0d0a20202020203c4553433e2d204d61696e204d656e752c203c454e5445523e2d20526566726573680d0a3e20 #....American Power Conversion Network Management Card AOS v2.7.0..(c) Copyright 2004 All Rights Reserved Rack PDU APP v2.7.3..-------------------------------------------------------------------------------..Name : PDU-BAR Date : 08/11/2014..Contact : Time : 16:26:42..Location : BRQ Lab, rack #9 - reserved for cluster User : Outlet User..Up Time : 34 Days 4 Hours 59 Minutes Stat : P+ N+ A+....Switched Rack PDU: Communication Established...------- Control Console -------------------------------------------------------.... 1- Device Manager.. 2- Network.. 3- System.. 4- Logout.... - Main Menu, - Refresh..> +3.9195821285 client 0x310d0a #1.. +4.0205070972 server 0x310a0a0d2d2d2d2d2d2d2d20446576696365204d616e61676572202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d205068617365204d6f6e69746f720d0a2020202020322d204f75746c657420436f6e74726f6c0d0a2020202020332d20506f77657220537570706c79205374617475730d0a0d0a20202020203c4553433e2d204261636b2c203c454e5445523e2d20526566726573680d0a3e20 #1...------- Device Manager --------------------------------------------------------.... 1- Phase Monitor.. 2- Outlet Control.. 3- Power Supply Status.... - Back, - Refresh..> +4.0736050606 client 0x320d0a #2.. +4.2776079178 server 0x320a0a0d2d2d2d2d2d2d2d204f75746c657420436f6e74726f6c202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d202d2020202020202020202020202020202020202020202020204f46460d0a2020202020322d20454d43202855505329202020202020202020202020202020204f4e0d0a2020202020332d20454d43202020202020202020202020202020202020202020204f4e0d0a2020202020342d20464320537769746368202020202020202020202020202020204f4e0d0a2020202020352d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020362d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020372d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020382d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020392d202d2020202020202020202020202020202020202020202020204f46460d0a2020202031302d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031312d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031322d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031332d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031342d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031352d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031362d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031372d202d2020202020202020202020202020202020202020202020204f4e0d0a2020202031382d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031392d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032302d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032312d206261722d3032202020202020202020202020202020202020204f4e0d0a2020202032322d206261722d3032202020202020202020202020202020202020204f4e0d0a0d20202020202020205072657373203c454e5445523e20746f20636f6e74696e75652e2e2e0d2020202020202020202020202020202020202020202020202020202020202020202020200d2020202032332d206261722d3031202020202020 #2...------- Outlet Control --------------------------------------------------------.... 1- - OFF.. 2- EMC (UPS) ON.. 3- EMC ON.. 4- FC Switch ON.. 5- EqualLogic ON.. 6- EqualLogic ON.. 7- [nothing] ON.. 8- [nothing] ON.. 9- - OFF.. 10- Saturnin ON.. 11- Saturnin ON.. 12- [nothing] OFF.. 13- [nothing] OFF.. 14- bar-05 ON.. 15- bar-05 ON.. 16- bar-04 ON.. 17- - ON.. 18- bar-04 ON.. 19- bar-03 ON.. 20- bar-03 ON.. 21- bar-02 ON.. 22- bar-02 ON... Press to continue.... . 23- bar-01 +4.3305690289 client 0x0d0a #.. +5.2724790573 server 0x202020202020202020202020204f4e0d0a2020202032342d206261722d3031202020202020202020202020202020202020204f4e0d0a2020202032352d20414c4c2041636365737369626c65204f75746c6574730d0a0d0a20202020203c4553433e2d204261636b2c203c454e5445523e2d20526566726573680d0a3e200a0a0d2d2d2d2d2d2d2d204f75746c657420436f6e74726f6c202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d202d2020202020202020202020202020202020202020202020204f46460d0a2020202020322d20454d43202855505329202020202020202020202020202020204f4e0d0a2020202020332d20454d43202020202020202020202020202020202020202020204f4e0d0a2020202020342d20464320537769746368202020202020202020202020202020204f4e0d0a2020202020352d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020362d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020372d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020382d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020392d202d2020202020202020202020202020202020202020202020204f46460d0a2020202031302d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031312d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031322d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031332d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031342d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031352d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031362d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031372d202d2020202020202020202020202020202020202020202020204f4e0d0a2020202031382d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031392d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032302d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032312d206261722d3032202020202020202020202020202020202020204f4e0d0a2020202032322d # ON.. 24- bar-01 ON.. 25- ALL Accessible Outlets.... - Back, - Refresh..> ...------- Outlet Control --------------------------------------------------------.... 1- - OFF.. 2- EMC (UPS) ON.. 3- EMC ON.. 4- FC Switch ON.. 5- EqualLogic ON.. 6- EqualLogic ON.. 7- [nothing] ON.. 8- [nothing] ON.. 9- - OFF.. 10- Saturnin ON.. 11- Saturnin ON.. 12- [nothing] OFF.. 13- [nothing] OFF.. 14- bar-05 ON.. 15- bar-05 ON.. 16- bar-04 ON.. 17- - ON.. 18- bar-04 ON.. 19- bar-03 ON.. 20- bar-03 ON.. 21- bar-02 ON.. 22- +5.3163449764 server 0x206261722d3032202020202020202020202020202020202020204f4e0d0a0d20202020202020205072657373203c454e5445523e20746f20636f6e74696e75652e2e2e0d2020202020202020202020202020202020202020202020202020202020202020202020200d2020202032332d206261722d3031202020202020202020202020202020202020204f4e0d0a2020202032342d206261722d3031202020202020202020202020202020202020204f4e0d0a2020202032352d20414c4c2041636365737369626c65204f75746c6574730d0a0d0a20202020203c4553433e2d204261636b2c203c454e5445523e2d20526566726573680d0a3e20 # bar-02 ON... Press to continue.... . 23- bar-01 ON.. 24- bar-01 ON.. 25- ALL Accessible Outlets.... - Back, - Refresh..> +5.3254759312 client 0x0d0a #.. +5.3757460117 client 0x03 #. +6.2303800583 server 0x0a0a0d2d2d2d2d2d2d2d204f75746c657420436f6e74726f6c202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d202d2020202020202020202020202020202020202020202020204f46460d0a2020202020322d20454d43202855505329202020202020202020202020202020204f4e0d0a2020202020332d20454d43202020202020202020202020202020202020202020204f4e0d0a2020202020342d20464320537769746368202020202020202020202020202020204f4e0d0a2020202020352d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020362d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020372d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020382d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020392d202d2020202020202020202020202020202020202020202020204f46460d0a2020202031302d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031312d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031322d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031332d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031342d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031352d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031362d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031372d202d2020202020202020202020202020202020202020202020204f4e0d0a2020202031382d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031392d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032302d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032312d206261722d3032202020202020202020202020202020202020204f4e0d0a2020202032322d206261722d3032202020202020202020202020202020202020204f4e0d0a0d20202020202020205072657373203c454e5445523e20746f20636f6e74696e75652e2e2e0d2020202020202020202020202020202020202020202020202020202020202020202020200d2020202032332d206261722d303120202020202020 #...------- Outlet Control --------------------------------------------------------.... 1- - OFF.. 2- EMC (UPS) ON.. 3- EMC ON.. 4- FC Switch ON.. 5- EqualLogic ON.. 6- EqualLogic ON.. 7- [nothing] ON.. 8- [nothing] ON.. 9- - OFF.. 10- Saturnin ON.. 11- Saturnin ON.. 12- [nothing] OFF.. 13- [nothing] OFF.. 14- bar-05 ON.. 15- bar-05 ON.. 16- bar-04 ON.. 17- - ON.. 18- bar-04 ON.. 19- bar-03 ON.. 20- bar-03 ON.. 21- bar-02 ON.. 22- bar-02 ON... Press to continue.... . 23- bar-01 +6.4452850819 server 0x2020202020202020202020204f4e0d0a2020202032342d206261722d3031202020202020202020202020202020202020204f4e0d0a2020202032352d20414c4c2041636365737369626c65204f75746c6574730d0a0d0a20202020203c4553433e2d204261636b2c203c454e5445523e2d20526566726573680d0a3e200a0a0a0d416d65726963616e20506f77657220436f6e76657273696f6e2020202020202020202020202020204e6574776f726b204d616e6167656d656e74204361726420414f5320202020202076322e372e300d0a28632920436f70797269676874203230303420416c6c2052696768747320526573657276656420205261636b205044552041505020202020202020202020202020202020202020202076322e372e330d0a2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a4e616d652020202020203a205044552d424152202020202020202020202020202020202020202020202020202020202020202020202044617465203a2030382f31312f323031340d0a436f6e746163742020203a2020202020202020202020202020202020202020202020202020202020202020202020202020202020202054696d65203a2031363a32363a34350a0d4c6f636174696f6e20203a20425251204c61622c207261636b202339202d20726573657276656420666f7220636c757374657220202055736572203a204f75746c657420557365720a0d55702054696d652020203a2033342044617973203420486f757273203539204d696e757465732020202020202020202020202020202053746174203a20502b204e2b20412b0d0a0d0a5377697463686564205261636b205044553a20436f6d6d756e69636174696f6e2045737461626c69736865640a0a0d2d2d2d2d2d2d2d20436f6e74726f6c20436f6e736f6c65202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d20446576696365204d616e616765720d0a2020202020322d204e6574776f726b0d0a2020202020332d2053797374656d0d0a2020202020342d204c6f676f75740d0a0d0a20202020203c4553433e2d204d61696e204d656e752c203c454e5445523e2d20526566726573680d0a3e20 # ON.. 24- bar-01 ON.. 25- ALL Accessible Outlets.... - Back, - Refresh..> ....American Power Conversion Network Management Card AOS v2.7.0..(c) Copyright 2004 All Rights Reserved Rack PDU APP v2.7.3..-------------------------------------------------------------------------------..Name : PDU-BAR Date : 08/11/2014..Contact : Time : 16:26:45..Location : BRQ Lab, rack #9 - reserved for cluster User : Outlet User..Up Time : 34 Days 4 Hours 59 Minutes Stat : P+ N+ A+....Switched Rack PDU: Communication Established...------- Control Console -------------------------------------------------------.... 1- Device Manager.. 2- Network.. 3- System.. 4- Logout.... - Main Menu, - Refresh..> diff --git a/tests/data/mitm-logs/apc/ssh-user/on.log b/tests/data/mitm-logs/apc/ssh-user/on.log new file mode 100644 index 000000000..95b99f383 --- /dev/null +++ b/tests/data/mitm-logs/apc/ssh-user/on.log @@ -0,0 +1,42 @@ +0.0000009537 server 0x0a0a0a0d416d65726963616e20506f77657220436f6e76657273696f6e2020202020202020202020202020204e6574776f726b204d616e6167656d656e74204361726420414f5320202020202076322e372e300d0a28632920436f70797269676874203230303420416c6c2052696768747320526573657276656420205261636b205044552041505020202020202020202020202020202020202020202076322e372e330d0a2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a4e616d652020202020203a205044552d424152202020202020202020202020202020202020202020202020202020202020202020202044617465203a2030382f31312f323031340d0a436f6e746163742020203a2020202020202020202020202020202020202020202020202020202020202020202020202020202020202054696d65203a2031363a33303a33340a0d4c6f636174696f6e20203a20425251204c61622c207261636b202339202d20726573657276656420666f7220636c757374657220202055736572203a204f75746c657420557365720a0d55702054696d652020203a2033342044617973203520486f7572732033204d696e75746573202020202020202020202020202020202053746174203a20502b204e2b20412b0d0a0d0a5377697463686564205261636b205044553a20436f6d6d756e69636174696f6e2045737461626c69736865640a0a0d2d2d2d2d2d2d2d20436f6e74726f6c20436f6e736f6c65202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d20446576696365204d616e616765720d0a2020202020322d204e6574776f726b0d0a2020202020332d2053797374656d0d0a2020202020342d204c6f676f75740d0a0d0a20202020203c4553433e2d204d61696e204d656e752c203c454e5445523e2d20526566726573680d0a3e20 #....American Power Conversion Network Management Card AOS v2.7.0..(c) Copyright 2004 All Rights Reserved Rack PDU APP v2.7.3..-------------------------------------------------------------------------------..Name : PDU-BAR Date : 08/11/2014..Contact : Time : 16:30:34..Location : BRQ Lab, rack #9 - reserved for cluster User : Outlet User..Up Time : 34 Days 5 Hours 3 Minutes Stat : P+ N+ A+....Switched Rack PDU: Communication Established...------- Control Console -------------------------------------------------------.... 1- Device Manager.. 2- Network.. 3- System.. 4- Logout.... - Main Menu, - Refresh..> +0.0547740459 client 0x310d0a #1.. +0.4945909977 server 0x310a0a0d2d2d2d2d2d2d2d20446576696365204d616e61676572202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d205068617365204d6f6e69746f720d0a2020202020322d204f75746c657420436f6e74726f6c0d0a2020202020332d20506f77657220537570706c79205374617475730d0a0d0a20202020203c4553433e2d204261636b2c203c454e5445523e2d20526566726573680d0a3e20 #1...------- Device Manager --------------------------------------------------------.... 1- Phase Monitor.. 2- Outlet Control.. 3- Power Supply Status.... - Back, - Refresh..> +0.5494749546 client 0x320d0a #2.. +1.2894780636 server 0x320a0a0d2d2d2d2d2d2d2d204f75746c657420436f6e74726f6c202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d202d2020202020202020202020202020202020202020202020204f46460d0a2020202020322d20454d43202855505329202020202020202020202020202020204f4e0d0a2020202020332d20454d43202020202020202020202020202020202020202020204f4e0d0a2020202020342d20464320537769746368202020202020202020202020202020204f4e0d0a2020202020352d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020362d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020372d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020382d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020392d202d2020202020202020202020202020202020202020202020204f46460d0a2020202031302d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031312d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031322d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031332d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031342d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031352d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031362d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031372d202d2020202020202020202020202020202020202020202020204f4e0d0a2020202031382d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031392d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032302d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032312d206261722d3032202020202020202020202020202020202020204f4e0d0a2020202032322d206261722d3032202020202020202020202020202020202020204f4e0d0a0d20202020202020205072657373203c454e5445523e20746f20636f6e74696e75652e2e2e0d2020202020202020202020202020202020202020202020202020202020202020202020200d2020202032332d206261722d3031202020202020 #2...------- Outlet Control --------------------------------------------------------.... 1- - OFF.. 2- EMC (UPS) ON.. 3- EMC ON.. 4- FC Switch ON.. 5- EqualLogic ON.. 6- EqualLogic ON.. 7- [nothing] ON.. 8- [nothing] ON.. 9- - OFF.. 10- Saturnin ON.. 11- Saturnin ON.. 12- [nothing] OFF.. 13- [nothing] OFF.. 14- bar-05 ON.. 15- bar-05 ON.. 16- bar-04 ON.. 17- - ON.. 18- bar-04 ON.. 19- bar-03 ON.. 20- bar-03 ON.. 21- bar-02 ON.. 22- bar-02 ON... Press to continue.... . 23- bar-01 +1.3459181786 client 0x0d0a #.. +1.5060820580 server 0x202020202020202020202020204f4e0d0a2020202032342d206261722d3031202020202020202020202020202020202020204f4e0d0a2020202032352d20414c4c2041636365737369626c65204f75746c6574730d0a0d0a20202020203c4553433e2d204261636b2c203c454e5445523e2d20526566726573680d0a3e20 # ON.. 24- bar-01 ON.. 25- ALL Accessible Outlets.... - Back, - Refresh..> +1.5591611862 client 0x0d0a #.. +1.6094529629 client 0x03 #. +1.9053211212 server 0x0a0a0d2d2d2d2d2d2d2d204f75746c657420436f6e74726f6c202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d202d2020202020202020202020202020202020202020202020204f46460d0a2020202020322d20454d43202855505329202020202020202020202020202020204f4e0d0a2020202020332d20454d43202020202020202020202020202020202020202020204f4e0d0a2020202020342d20464320537769746368202020202020202020202020202020204f4e0d0a2020202020352d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020362d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020372d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020382d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020392d202d2020202020202020202020202020202020202020202020204f46460d0a2020202031302d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031312d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031322d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031332d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031342d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031352d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031362d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031372d202d2020202020202020202020202020202020202020202020204f4e0d0a2020202031382d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031392d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032302d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032312d206261722d3032202020202020202020202020202020202020204f4e0d0a2020202032322d206261722d3032202020202020202020202020202020202020204f4e0d0a0d20202020202020205072657373203c454e5445523e20746f20636f6e74696e75652e2e2e0d2020202020202020202020202020202020202020202020202020202020202020202020200d2020202032332d206261722d303120202020202020 #...------- Outlet Control --------------------------------------------------------.... 1- - OFF.. 2- EMC (UPS) ON.. 3- EMC ON.. 4- FC Switch ON.. 5- EqualLogic ON.. 6- EqualLogic ON.. 7- [nothing] ON.. 8- [nothing] ON.. 9- - OFF.. 10- Saturnin ON.. 11- Saturnin ON.. 12- [nothing] OFF.. 13- [nothing] OFF.. 14- bar-05 ON.. 15- bar-05 ON.. 16- bar-04 ON.. 17- - ON.. 18- bar-04 ON.. 19- bar-03 ON.. 20- bar-03 ON.. 21- bar-02 ON.. 22- bar-02 ON... Press to continue.... . 23- bar-01 +2.3759641647 server 0x2020202020202020202020204f4e0d0a2020202032342d206261722d3031202020202020202020202020202020202020204f4e0d0a2020202032352d20414c4c2041636365737369626c65204f75746c6574730d0a0d0a20202020203c4553433e2d204261636b2c203c454e5445523e2d20526566726573680d0a3e200a0a0d2d2d2d2d2d2d2d204f75746c657420436f6e74726f6c202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d202d2020202020202020202020202020202020202020202020204f46460d0a2020202020322d20454d43202855505329202020202020202020202020202020204f4e0d0a2020202020332d20454d43202020202020202020202020202020202020202020204f4e0d0a2020202020342d20464320537769746368202020202020202020202020202020204f4e0d0a2020202020352d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020362d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020372d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020382d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020392d202d2020202020202020202020202020202020202020202020204f46460d0a2020202031302d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031312d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031322d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031332d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031342d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031352d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031362d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031372d202d2020202020202020202020202020202020202020202020204f4e0d0a2020202031382d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031392d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032302d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032312d206261722d3032202020202020202020202020202020202020204f4e0d0a2020202032322d20 # ON.. 24- bar-01 ON.. 25- ALL Accessible Outlets.... - Back, - Refresh..> ...------- Outlet Control --------------------------------------------------------.... 1- - OFF.. 2- EMC (UPS) ON.. 3- EMC ON.. 4- FC Switch ON.. 5- EqualLogic ON.. 6- EqualLogic ON.. 7- [nothing] ON.. 8- [nothing] ON.. 9- - OFF.. 10- Saturnin ON.. 11- Saturnin ON.. 12- [nothing] OFF.. 13- [nothing] OFF.. 14- bar-05 ON.. 15- bar-05 ON.. 16- bar-04 ON.. 17- - ON.. 18- bar-04 ON.. 19- bar-03 ON.. 20- bar-03 ON.. 21- bar-02 ON.. 22- +2.7305700779 server 0x6261722d3032202020202020202020202020202020202020204f4e0d0a0d20202020202020205072657373203c454e5445523e20746f20636f6e74696e75652e2e2e0d2020202020202020202020202020202020202020202020202020202020202020202020200d2020202032332d206261722d3031202020202020202020202020202020202020204f4e0d0a2020202032342d206261722d3031202020202020202020202020202020202020204f4e0d0a2020202032352d20414c4c2041636365737369626c65204f75746c6574730d0a0d0a20202020203c4553433e2d204261636b2c203c454e5445523e2d20526566726573680d0a3e200a0a0a0d416d65726963616e20506f77657220436f6e76657273696f6e2020202020202020202020202020204e6574776f726b204d616e6167656d656e74204361726420414f5320202020202076322e372e300d0a28632920436f70797269676874203230303420416c6c2052696768747320526573657276656420205261636b205044552041505020202020202020202020202020202020202020202076322e372e330d0a2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a4e616d652020202020203a205044552d424152202020202020202020202020202020202020202020202020202020202020202020202044617465203a2030382f31312f323031340d0a436f6e746163742020203a2020202020202020202020202020202020202020202020202020202020202020202020202020202020202054696d65203a2031363a33303a33360a0d4c6f636174696f6e20203a20425251204c61622c207261636b202339202d20726573657276656420666f7220636c757374657220202055736572203a204f75746c657420557365720a0d55702054696d652020203a2033342044617973203520486f7572732033204d696e75746573202020202020202020202020202020202053746174203a20502b204e2b20412b0d0a0d0a5377697463686564205261636b205044553a20436f6d6d756e69636174696f6e2045737461626c69736865640a0a0d2d2d2d2d2d2d2d20436f6e74726f6c20436f6e736f6c65202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d20446576696365204d616e616765720d0a2020202020322d204e6574776f726b0d0a2020202020332d2053797374656d0d0a2020202020342d204c6f676f75740d0a0d0a20202020203c45 #bar-02 ON... Press to continue.... . 23- bar-01 ON.. 24- bar-01 ON.. 25- ALL Accessible Outlets.... - Back, - Refresh..> ....American Power Conversion Network Management Card AOS v2.7.0..(c) Copyright 2004 All Rights Reserved Rack PDU APP v2.7.3..-------------------------------------------------------------------------------..Name : PDU-BAR Date : 08/11/2014..Contact : Time : 16:30:36..Location : BRQ Lab, rack #9 - reserved for cluster User : Outlet User..Up Time : 34 Days 5 Hours 3 Minutes Stat : P+ N+ A+....Switched Rack PDU: Communication Established...------- Control Console -------------------------------------------------------.... 1- Device Manager.. 2- Network.. 3- System.. 4- Logout.... - Main Menu, - Refresh..> +2.9917371273 client 0x310d0a #1.. +3.4272589684 server 0x310a0a0d2d2d2d2d2d2d2d20446576696365204d616e61676572202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d205068617365204d6f6e69746f720d0a2020202020322d204f75746c657420436f6e74726f6c0d0a2020202020332d20506f77657220537570706c79205374617475730d0a0d0a20202020203c4553433e2d204261636b2c203c454e5445523e2d20526566726573680d0a3e20 #1...------- Device Manager --------------------------------------------------------.... 1- Phase Monitor.. 2- Outlet Control.. 3- Power Supply Status.... - Back, - Refresh..> +3.4792201519 client 0x320d0a #2.. +4.0161559582 server 0x320a0a0d2d2d2d2d2d2d2d204f75746c657420436f6e74726f6c202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d202d2020202020202020202020202020202020202020202020204f46460d0a2020202020322d20454d43202855505329202020202020202020202020202020204f4e0d0a2020202020332d20454d43202020202020202020202020202020202020202020204f4e0d0a2020202020342d20464320537769746368202020202020202020202020202020204f4e0d0a2020202020352d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020362d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020372d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020382d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020392d202d2020202020202020202020202020202020202020202020204f46460d0a2020202031302d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031312d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031322d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031332d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031342d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031352d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031362d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031372d202d2020202020202020202020202020202020202020202020204f4e0d0a2020202031382d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031392d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032302d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032312d206261722d3032202020202020202020202020202020202020204f4e0d0a2020202032322d206261722d3032202020202020202020202020202020202020204f4e0d0a0d20202020202020205072657373203c454e5445523e20746f20636f6e74696e75652e2e2e0d2020202020202020202020202020202020202020202020202020202020202020202020200d2020202032332d206261722d3031202020202020 #2...------- Outlet Control --------------------------------------------------------.... 1- - OFF.. 2- EMC (UPS) ON.. 3- EMC ON.. 4- FC Switch ON.. 5- EqualLogic ON.. 6- EqualLogic ON.. 7- [nothing] ON.. 8- [nothing] ON.. 9- - OFF.. 10- Saturnin ON.. 11- Saturnin ON.. 12- [nothing] OFF.. 13- [nothing] OFF.. 14- bar-05 ON.. 15- bar-05 ON.. 16- bar-04 ON.. 17- - ON.. 18- bar-04 ON.. 19- bar-03 ON.. 20- bar-03 ON.. 21- bar-02 ON.. 22- bar-02 ON... Press to continue.... . 23- bar-01 +4.0683641434 client 0x0d0a #.. +4.2361841202 server 0x202020202020202020202020204f4e0d0a2020202032342d206261722d3031202020202020202020202020202020202020204f4e0d0a2020202032352d20414c4c2041636365737369626c65204f75746c6574730d0a0d0a20202020203c4553433e2d204261636b2c203c454e5445523e2d20526566726573680d0a3e20 # ON.. 24- bar-01 ON.. 25- ALL Accessible Outlets.... - Back, - Refresh..> +4.2885639668 client 0x310d0a #1.. +4.6393141747 server 0x0a0a0d2d2d2d2d2d2d2d204f75746c657420436f6e74726f6c202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d202d2020202020202020202020202020202020202020202020204f46460d0a2020202020322d20454d43202855505329202020202020202020202020202020204f4e0d0a2020202020332d20454d43202020202020202020202020202020202020202020204f4e0d0a2020202020342d20464320537769746368202020202020202020202020202020204f4e0d0a2020202020352d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020362d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020372d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020382d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020392d202d2020202020202020202020202020202020202020202020204f46460d0a2020202031302d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031312d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031322d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031332d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031342d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031352d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031362d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031372d202d2020202020202020202020202020202020202020202020204f4e0d0a2020202031382d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031392d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032302d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032312d206261722d3032202020202020202020202020202020202020204f4e0d0a2020202032322d206261722d3032202020202020202020202020202020202020204f4e0d0a0d20202020202020205072657373203c454e5445523e20746f20636f6e74696e75652e2e2e0d2020202020202020202020202020202020202020202020202020202020202020202020200d2020202032332d206261722d303120202020202020 #...------- Outlet Control --------------------------------------------------------.... 1- - OFF.. 2- EMC (UPS) ON.. 3- EMC ON.. 4- FC Switch ON.. 5- EqualLogic ON.. 6- EqualLogic ON.. 7- [nothing] ON.. 8- [nothing] ON.. 9- - OFF.. 10- Saturnin ON.. 11- Saturnin ON.. 12- [nothing] OFF.. 13- [nothing] OFF.. 14- bar-05 ON.. 15- bar-05 ON.. 16- bar-04 ON.. 17- - ON.. 18- bar-04 ON.. 19- bar-03 ON.. 20- bar-03 ON.. 21- bar-02 ON.. 22- bar-02 ON... Press to continue.... . 23- bar-01 +4.9311809540 server 0x2020202020202020202020204f4e0d0a2020202032342d206261722d3031202020202020202020202020202020202020204f4e0d0a2020202032352d20414c4c2041636365737369626c65204f75746c6574730d0a0d0a20202020203c4553433e2d204261636b2c203c454e5445523e2d20526566726573680d0a3e20310a0a0d2d2d2d2d2d2d2d202d202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a20202020202020204e616d652020202020202020203a202d0d0a20202020202020204f75746c6574202020202020203a20310d0a2020202020202020537461746520202020202020203a204f46460d0a0d0a2020202020312d20496d6d656469617465204f6e20202020202020202020202020200d0a2020202020322d20496d6d656469617465204f6666202020202020202020202020200d0a2020202020332d20496d6d656469617465205265626f6f74202020202020202020200d0a2020202020342d2044656c61796564204f6e202020202020202020202020202020200d0a2020202020352d2044656c61796564204f66662020202020202020202020202020200d0a2020202020362d2044656c61796564205265626f6f742020202020202020202020200d0a2020202020372d2043616e63656c20202020202020202020202020202020202020200d0a0d0a20202020203f2d2048656c702c203c4553433e2d204261636b2c203c454e5445523e2d20526566726573680d0a3e20 # ON.. 24- bar-01 ON.. 25- ALL Accessible Outlets.... - Back, - Refresh..> 1...------- - ---------------------------------------------------------------------.... Name : -.. Outlet : 1.. State : OFF.... 1- Immediate On .. 2- Immediate Off .. 3- Immediate Reboot .. 4- Delayed On .. 5- Delayed Off .. 6- Delayed Reboot .. 7- Cancel .... ?- Help, - Back, - Refresh..> +4.9839141369 client 0x310d0a #1.. +5.3821799755 server 0x310d0a20202020202020202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a2020202020202020496d6d656469617465204f6e20202020202020202020202020200d0a0d0a20202020202020205468697320636f6d6d616e642077696c6c20696d6d6564696174656c79207475726e0d0a20202020202020206f75746c65742031206e616d656420272d27204f4e2e0d0a0d0a2020202020202020456e74657220275945532720746f20636f6e74696e7565206f72203c454e5445523e20746f2063616e63656c203a20 #1.. -----------------------------------------------------------------------.. Immediate On .... This command will immediately turn.. outlet 1 named '-' ON..... Enter 'YES' to continue or to cancel : +5.4358270168 client 0x5945530d0a #YES.. +6.2980310917 server 0x5945530d0a2020202020202020436f6d6d616e64207375636365737366756c6c79206973737565642e0d0a0d0a20202020202020205072657373203c454e5445523e20746f20636f6e74696e75652e2e2e0d0a0a0a0d2d2d2d2d2d2d2d202d202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a20202020202020204e616d652020202020202020203a202d0d0a20202020202020204f75746c6574202020202020203a20310d0a2020202020202020537461746520202020202020203a204f4e0d0a0d0a2020202020312d20496d6d656469617465204f6e20202020202020202020202020200d0a2020202020322d20496d6d656469617465204f6666202020202020202020202020200d0a2020202020332d20496d6d656469617465205265626f6f74202020202020202020200d0a2020202020342d2044656c61796564204f6e202020202020202020202020202020200d0a2020202020352d2044656c61796564204f66662020202020202020202020202020200d0a2020202020362d2044656c61796564205265626f6f742020202020202020202020200d0a2020202020372d2043616e63656c20202020202020202020202020202020202020200d0a0d0a20202020203f2d2048656c702c203c4553433e2d204261636b2c203c454e5445523e2d20526566726573680d0a3e20 #YES.. Command successfully issued..... Press to continue........------- - ---------------------------------------------------------------------.... Name : -.. Outlet : 1.. State : ON.... 1- Immediate On .. 2- Immediate Off .. 3- Immediate Reboot .. 4- Delayed On .. 5- Delayed Off .. 6- Delayed Reboot .. 7- Cancel .... ?- Help, - Back, - Refresh..> +6.3521461487 client 0x0d0a #.. +6.4026451111 client 0x03 #. +6.7796490192 server 0x0a0a0d2d2d2d2d2d2d2d202d202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a20202020202020204e616d652020202020202020203a202d0d0a20202020202020204f75746c6574202020202020203a20310d0a2020202020202020537461746520202020202020203a204f4e0d0a0d0a2020202020312d20496d6d656469617465204f6e20202020202020202020202020200d0a2020202020322d20496d6d656469617465204f6666202020202020202020202020200d0a2020202020332d20496d6d656469617465205265626f6f74202020202020202020200d0a2020202020342d2044656c61796564204f6e202020202020202020202020202020200d0a2020202020352d2044656c61796564204f66662020202020202020202020202020200d0a2020202020362d2044656c61796564205265626f6f742020202020202020202020200d0a2020202020372d2043616e63656c20202020202020202020202020202020202020200d0a0d0a20202020203f2d2048656c702c203c4553433e2d204261636b2c203c454e5445523e2d20526566726573680d0a3e20 #...------- - ---------------------------------------------------------------------.... Name : -.. Outlet : 1.. State : ON.... 1- Immediate On .. 2- Immediate Off .. 3- Immediate Reboot .. 4- Delayed On .. 5- Delayed Off .. 6- Delayed Reboot .. 7- Cancel .... ?- Help, - Back, - Refresh..> +7.3215401173 server 0x0a0a0a0d416d65726963616e20506f77657220436f6e76657273696f6e2020202020202020202020202020204e6574776f726b204d616e6167656d656e74204361726420414f5320202020202076322e372e300d0a28632920436f70797269676874203230303420416c6c2052696768747320526573657276656420205261636b205044552041505020202020202020202020202020202020202020202076322e372e330d0a2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a4e616d652020202020203a205044552d424152202020202020202020202020202020202020202020202020202020202020202020202044617465203a2030382f31312f323031340d0a436f6e746163742020203a2020202020202020202020202020202020202020202020202020202020202020202020202020202020202054696d65203a2031363a33303a34310a0d4c6f636174696f6e20203a20425251204c61622c207261636b202339202d20726573657276656420666f7220636c757374657220202055736572203a204f75746c657420557365720a0d55702054696d652020203a2033342044617973203520486f7572732033204d696e75746573202020202020202020202020202020202053746174203a20502b204e2b20412b0d0a0d0a5377697463686564205261636b205044553a20436f6d6d756e69636174696f6e2045737461626c69736865640a0a0d2d2d2d2d2d2d2d20436f6e74726f6c20436f6e736f6c65202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d20446576696365204d616e616765720d0a2020202020322d204e6574776f726b0d0a2020202020332d2053797374656d0d0a2020202020342d204c6f676f75740d0a0d0a20202020203c4553433e2d204d61696e204d656e752c203c454e5445523e2d20526566726573680d0a3e20 #....American Power Conversion Network Management Card AOS v2.7.0..(c) Copyright 2004 All Rights Reserved Rack PDU APP v2.7.3..-------------------------------------------------------------------------------..Name : PDU-BAR Date : 08/11/2014..Contact : Time : 16:30:41..Location : BRQ Lab, rack #9 - reserved for cluster User : Outlet User..Up Time : 34 Days 5 Hours 3 Minutes Stat : P+ N+ A+....Switched Rack PDU: Communication Established...------- Control Console -------------------------------------------------------.... 1- Device Manager.. 2- Network.. 3- System.. 4- Logout.... - Main Menu, - Refresh..> +7.3750531673 client 0x310d0a #1.. +7.8055181503 server 0x310a0a0d2d2d2d2d2d2d2d20446576696365204d616e61676572202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d205068617365204d6f6e69746f720d0a2020202020322d204f75746c657420436f6e74726f6c0d0a2020202020332d20506f77657220537570706c79205374617475730d0a0d0a20202020203c4553433e2d204261636b2c203c454e5445523e2d20526566726573680d0a3e20 #1...------- Device Manager --------------------------------------------------------.... 1- Phase Monitor.. 2- Outlet Control.. 3- Power Supply Status.... - Back, - Refresh..> +7.8578650951 client 0x320d0a #2.. +8.3829820156 server 0x320a0a0d2d2d2d2d2d2d2d204f75746c657420436f6e74726f6c202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d202d2020202020202020202020202020202020202020202020204f4e0d0a2020202020322d20454d43202855505329202020202020202020202020202020204f4e0d0a2020202020332d20454d43202020202020202020202020202020202020202020204f4e0d0a2020202020342d20464320537769746368202020202020202020202020202020204f4e0d0a2020202020352d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020362d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020372d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020382d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020392d202d2020202020202020202020202020202020202020202020204f46460d0a2020202031302d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031312d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031322d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031332d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031342d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031352d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031362d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031372d202d2020202020202020202020202020202020202020202020204f4e0d0a2020202031382d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031392d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032302d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032312d206261722d3032202020202020202020202020202020202020204f4e0d0a2020202032322d206261722d3032202020202020202020202020202020202020204f4e0d0a0d20202020202020205072657373203c454e5445523e20746f20636f6e74696e75652e2e2e0d2020202020202020202020202020202020202020202020202020202020202020202020200d2020202032332d206261722d303120202020202020 #2...------- Outlet Control --------------------------------------------------------.... 1- - ON.. 2- EMC (UPS) ON.. 3- EMC ON.. 4- FC Switch ON.. 5- EqualLogic ON.. 6- EqualLogic ON.. 7- [nothing] ON.. 8- [nothing] ON.. 9- - OFF.. 10- Saturnin ON.. 11- Saturnin ON.. 12- [nothing] OFF.. 13- [nothing] OFF.. 14- bar-05 ON.. 15- bar-05 ON.. 16- bar-04 ON.. 17- - ON.. 18- bar-04 ON.. 19- bar-03 ON.. 20- bar-03 ON.. 21- bar-02 ON.. 22- bar-02 ON... Press to continue.... . 23- bar-01 +8.4366099834 client 0x0d0a #.. +8.6087989807 server 0x2020202020202020202020204f4e0d0a2020202032342d206261722d3031202020202020202020202020202020202020204f4e0d0a2020202032352d20414c4c2041636365737369626c65204f75746c6574730d0a0d0a20202020203c4553433e2d204261636b2c203c454e5445523e2d20526566726573680d0a3e20 # ON.. 24- bar-01 ON.. 25- ALL Accessible Outlets.... - Back, - Refresh..> +8.6616239548 client 0x0d0a #.. +8.7118079662 client 0x03 #. +8.9992990494 server 0x0a0a0d2d2d2d2d2d2d2d204f75746c657420436f6e74726f6c202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d202d2020202020202020202020202020202020202020202020204f4e0d0a2020202020322d20454d43202855505329202020202020202020202020202020204f4e0d0a2020202020332d20454d43202020202020202020202020202020202020202020204f4e0d0a2020202020342d20464320537769746368202020202020202020202020202020204f4e0d0a2020202020352d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020362d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020372d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020382d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020392d202d2020202020202020202020202020202020202020202020204f46460d0a2020202031302d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031312d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031322d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031332d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031342d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031352d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031362d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031372d202d2020202020202020202020202020202020202020202020204f4e0d0a2020202031382d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031392d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032302d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032312d206261722d3032202020202020202020202020202020202020204f4e0d0a2020202032322d206261722d3032202020202020202020202020202020202020204f4e0d0a0d20202020202020205072657373203c454e5445523e20746f20636f6e74696e75652e2e2e0d2020202020202020202020202020202020202020202020202020202020202020202020200d2020202032332d206261722d30312020202020202020 #...------- Outlet Control --------------------------------------------------------.... 1- - ON.. 2- EMC (UPS) ON.. 3- EMC ON.. 4- FC Switch ON.. 5- EqualLogic ON.. 6- EqualLogic ON.. 7- [nothing] ON.. 8- [nothing] ON.. 9- - OFF.. 10- Saturnin ON.. 11- Saturnin ON.. 12- [nothing] OFF.. 13- [nothing] OFF.. 14- bar-05 ON.. 15- bar-05 ON.. 16- bar-04 ON.. 17- - ON.. 18- bar-04 ON.. 19- bar-03 ON.. 20- bar-03 ON.. 21- bar-02 ON.. 22- bar-02 ON... Press to continue.... . 23- bar-01 +9.3358800411 server 0x20202020202020202020204f4e0d0a2020202032342d206261722d3031202020202020202020202020202020202020204f4e0d0a2020202032352d20414c4c2041636365737369626c65204f75746c6574730d0a0d0a20202020203c4553433e2d204261636b2c203c454e5445523e2d20526566726573680d0a3e200a0a0d2d2d2d2d2d2d2d204f75746c657420436f6e74726f6c202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d202d2020202020202020202020202020202020202020202020204f4e0d0a2020202020322d20454d43202855505329202020202020202020202020202020204f4e0d0a2020202020332d20454d43202020202020202020202020202020202020202020204f4e0d0a2020202020342d20464320537769746368202020202020202020202020202020204f4e0d0a2020202020352d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020362d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020372d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020382d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020392d202d2020202020202020202020202020202020202020202020204f46460d0a2020202031302d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031312d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031322d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031332d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031342d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031352d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031362d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031372d202d2020202020202020202020202020202020202020202020204f4e0d0a2020202031382d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031392d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032302d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032312d206261722d3032202020202020202020202020202020202020204f4e0d0a2020202032322d206261 # ON.. 24- bar-01 ON.. 25- ALL Accessible Outlets.... - Back, - Refresh..> ...------- Outlet Control --------------------------------------------------------.... 1- - ON.. 2- EMC (UPS) ON.. 3- EMC ON.. 4- FC Switch ON.. 5- EqualLogic ON.. 6- EqualLogic ON.. 7- [nothing] ON.. 8- [nothing] ON.. 9- - OFF.. 10- Saturnin ON.. 11- Saturnin ON.. 12- [nothing] OFF.. 13- [nothing] OFF.. 14- bar-05 ON.. 15- bar-05 ON.. 16- bar-04 ON.. 17- - ON.. 18- bar-04 ON.. 19- bar-03 ON.. 20- bar-03 ON.. 21- bar-02 ON.. 22- ba +9.6466891766 server 0x722d3032202020202020202020202020202020202020204f4e0d0a0d20202020202020205072657373203c454e5445523e20746f20636f6e74696e75652e2e2e0d2020202020202020202020202020202020202020202020202020202020202020202020200d2020202032332d206261722d3031202020202020202020202020202020202020204f4e0d0a2020202032342d206261722d3031202020202020202020202020202020202020204f4e0d0a2020202032352d20414c4c2041636365737369626c65204f75746c6574730d0a0d0a20202020203c4553433e2d204261636b2c203c454e5445523e2d20526566726573680d0a3e200a0a0a0d416d65726963616e20506f77657220436f6e76657273696f6e2020202020202020202020202020204e6574776f726b204d616e6167656d656e74204361726420414f5320202020202076322e372e300d0a28632920436f70797269676874203230303420416c6c2052696768747320526573657276656420205261636b205044552041505020202020202020202020202020202020202020202076322e372e330d0a2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a4e616d652020202020203a205044552d424152202020202020202020202020202020202020202020202020202020202020202020202044617465203a2030382f31312f323031340d0a436f6e746163742020203a2020202020202020202020202020202020202020202020202020202020202020202020202020202020202054696d65203a2031363a33303a34330a0d4c6f636174696f6e20203a20425251204c61622c207261636b202339202d20726573657276656420666f7220636c757374657220202055736572203a204f75746c657420557365720a0d55702054696d652020203a2033342044617973203520486f7572732033204d696e75746573202020202020202020202020202020202053746174203a20502b204e2b20412b0d0a0d0a5377697463686564205261636b205044553a20436f6d6d756e69636174696f6e2045737461626c69736865640a0a0d2d2d2d2d2d2d2d20436f6e74726f6c20436f6e736f6c65202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d20446576696365204d616e616765720d0a2020202020322d204e6574776f726b0d0a2020202020332d2053797374656d0d0a2020202020342d204c6f676f75740d0a0d0a20202020203c455343 #r-02 ON... Press to continue.... . 23- bar-01 ON.. 24- bar-01 ON.. 25- ALL Accessible Outlets.... - Back, - Refresh..> ....American Power Conversion Network Management Card AOS v2.7.0..(c) Copyright 2004 All Rights Reserved Rack PDU APP v2.7.3..-------------------------------------------------------------------------------..Name : PDU-BAR Date : 08/11/2014..Contact : Time : 16:30:43..Location : BRQ Lab, rack #9 - reserved for cluster User : Outlet User..Up Time : 34 Days 5 Hours 3 Minutes Stat : P+ N+ A+....Switched Rack PDU: Communication Established...------- Control Console -------------------------------------------------------.... 1- Device Manager.. 2- Network.. 3- System.. 4- Logout.... - Main Menu, - Refresh..> diff --git a/tests/data/mitm-logs/apc/ssh-user/reboot.log b/tests/data/mitm-logs/apc/ssh-user/reboot.log new file mode 100644 index 000000000..4b8da566f --- /dev/null +++ b/tests/data/mitm-logs/apc/ssh-user/reboot.log @@ -0,0 +1,66 @@ +0.0000011921 server 0x0a0a0a0d416d65726963616e20506f77657220436f6e76657273696f6e2020202020202020202020202020204e6574776f726b204d616e6167656d656e74204361726420414f5320202020202076322e372e300d0a28632920436f70797269676874203230303420416c6c2052696768747320526573657276656420205261636b205044552041505020202020202020202020202020202020202020202076322e372e330d0a2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a4e616d652020202020203a205044552d424152202020202020202020202020202020202020202020202020202020202020202020202044617465203a2030382f31312f323031340d0a436f6e746163742020203a2020202020202020202020202020202020202020202020202020202020202020202020202020202020202054696d65203a2031363a33353a33330a0d4c6f636174696f6e20203a20425251204c61622c207261636b202339202d20726573657276656420666f7220636c757374657220202055736572203a204f75746c657420557365720a0d55702054696d652020203a2033342044617973203520486f7572732038204d696e75746573202020202020202020202020202020202053746174203a20502b204e2b20412b0d0a0d0a5377697463686564205261636b205044553a20436f6d6d756e69636174696f6e2045737461626c69736865640a0a0d2d2d2d2d2d2d2d20436f6e74726f6c20436f6e736f6c65202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d20446576696365204d616e616765720d0a2020202020322d204e6574776f726b0d0a2020202020332d2053797374656d0d0a2020202020342d204c6f676f75740d0a0d0a20202020203c4553433e2d204d61696e204d656e752c203c454e5445523e2d20526566726573680d0a3e20 #....American Power Conversion Network Management Card AOS v2.7.0..(c) Copyright 2004 All Rights Reserved Rack PDU APP v2.7.3..-------------------------------------------------------------------------------..Name : PDU-BAR Date : 08/11/2014..Contact : Time : 16:35:33..Location : BRQ Lab, rack #9 - reserved for cluster User : Outlet User..Up Time : 34 Days 5 Hours 8 Minutes Stat : P+ N+ A+....Switched Rack PDU: Communication Established...------- Control Console -------------------------------------------------------.... 1- Device Manager.. 2- Network.. 3- System.. 4- Logout.... - Main Menu, - Refresh..> +0.0529010296 client 0x310d0a #1.. +0.1490261555 server 0x310a0a0d2d2d2d2d2d2d2d20446576696365204d616e61676572202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d205068617365204d6f6e69746f720d0a2020202020322d204f75746c657420436f6e74726f6c0d0a2020202020332d20506f77657220537570706c79205374617475730d0a0d0a20202020203c4553433e2d204261636b2c203c454e5445523e2d20526566726573680d0a3e20 #1...------- Device Manager --------------------------------------------------------.... 1- Phase Monitor.. 2- Outlet Control.. 3- Power Supply Status.... - Back, - Refresh..> +0.2017440796 client 0x320d0a #2.. +0.4140250683 server 0x320a0a0d2d2d2d2d2d2d2d204f75746c657420436f6e74726f6c202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d202d2020202020202020202020202020202020202020202020204f4e0d0a2020202020322d20454d43202855505329202020202020202020202020202020204f4e0d0a2020202020332d20454d43202020202020202020202020202020202020202020204f4e0d0a2020202020342d20464320537769746368202020202020202020202020202020204f4e0d0a2020202020352d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020362d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020372d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020382d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020392d202d2020202020202020202020202020202020202020202020204f46460d0a2020202031302d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031312d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031322d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031332d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031342d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031352d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031362d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031372d202d2020202020202020202020202020202020202020202020204f4e0d0a2020202031382d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031392d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032302d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032312d206261722d3032202020202020202020202020202020202020204f4e0d0a2020202032322d206261722d3032202020202020202020202020202020202020204f4e0d0a0d20202020202020205072657373203c454e5445523e20746f20636f6e74696e75652e2e2e0d2020202020202020202020202020202020202020202020202020202020202020202020200d2020202032332d206261722d303120202020202020 #2...------- Outlet Control --------------------------------------------------------.... 1- - ON.. 2- EMC (UPS) ON.. 3- EMC ON.. 4- FC Switch ON.. 5- EqualLogic ON.. 6- EqualLogic ON.. 7- [nothing] ON.. 8- [nothing] ON.. 9- - OFF.. 10- Saturnin ON.. 11- Saturnin ON.. 12- [nothing] OFF.. 13- [nothing] OFF.. 14- bar-05 ON.. 15- bar-05 ON.. 16- bar-04 ON.. 17- - ON.. 18- bar-04 ON.. 19- bar-03 ON.. 20- bar-03 ON.. 21- bar-02 ON.. 22- bar-02 ON... Press to continue.... . 23- bar-01 +0.4666321278 client 0x0d0a #.. +0.6696100235 server 0x2020202020202020202020204f4e0d0a2020202032342d206261722d3031202020202020202020202020202020202020204f4e0d0a2020202032352d20414c4c2041636365737369626c65204f75746c6574730d0a0d0a20202020203c4553433e2d204261636b2c203c454e5445523e2d20526566726573680d0a3e200a0a0d2d2d2d2d2d2d2d204f75746c657420436f6e74726f6c202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d202d2020202020202020202020202020202020202020202020204f4e0d0a2020202020322d20454d43202855505329202020202020202020202020202020204f4e0d0a2020202020332d20454d43202020202020202020202020202020202020202020204f4e0d0a2020202020342d20464320537769746368202020202020202020202020202020204f4e0d0a2020202020352d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020362d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020372d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020382d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020392d202d2020202020202020202020202020202020202020202020204f46460d0a2020202031302d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031312d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031322d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031332d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031342d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031352d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031362d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031372d202d2020202020202020202020202020202020202020202020204f4e0d0a2020202031382d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031392d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032302d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032312d206261722d3032202020202020202020202020202020202020204f4e0d0a2020202032322d2062 # ON.. 24- bar-01 ON.. 25- ALL Accessible Outlets.... - Back, - Refresh..> ...------- Outlet Control --------------------------------------------------------.... 1- - ON.. 2- EMC (UPS) ON.. 3- EMC ON.. 4- FC Switch ON.. 5- EqualLogic ON.. 6- EqualLogic ON.. 7- [nothing] ON.. 8- [nothing] ON.. 9- - OFF.. 10- Saturnin ON.. 11- Saturnin ON.. 12- [nothing] OFF.. 13- [nothing] OFF.. 14- bar-05 ON.. 15- bar-05 ON.. 16- bar-04 ON.. 17- - ON.. 18- bar-04 ON.. 19- bar-03 ON.. 20- bar-03 ON.. 21- bar-02 ON.. 22- b +0.7218770981 client 0x0d0a #.. +0.7722530365 client 0x03 #. +0.9395830631 server 0x61722d3032202020202020202020202020202020202020204f4e0d0a0d20202020202020205072657373203c454e5445523e20746f20636f6e74696e75652e2e2e0d2020202020202020202020202020202020202020202020202020202020202020202020200d2020202032332d206261722d3031202020202020202020202020202020202020204f4e0d0a2020202032342d206261722d3031202020202020202020202020202020202020204f4e0d0a2020202032352d20414c4c2041636365737369626c65204f75746c6574730d0a0d0a20202020203c4553433e2d204261636b2c203c454e5445523e2d20526566726573680d0a3e200a0a0d2d2d2d2d2d2d2d204f75746c657420436f6e74726f6c202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d202d2020202020202020202020202020202020202020202020204f4e0d0a2020202020322d20454d43202855505329202020202020202020202020202020204f4e0d0a2020202020332d20454d43202020202020202020202020202020202020202020204f4e0d0a2020202020342d20464320537769746368202020202020202020202020202020204f4e0d0a2020202020352d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020362d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020372d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020382d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020392d202d2020202020202020202020202020202020202020202020204f46460d0a2020202031302d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031312d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031322d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031332d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031342d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031352d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031362d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031372d202d2020202020202020202020202020202020202020202020204f4e0d0a2020202031382d206261722d303420202020202020202020202020202020202020 #ar-02 ON... Press to continue.... . 23- bar-01 ON.. 24- bar-01 ON.. 25- ALL Accessible Outlets.... - Back, - Refresh..> ...------- Outlet Control --------------------------------------------------------.... 1- - ON.. 2- EMC (UPS) ON.. 3- EMC ON.. 4- FC Switch ON.. 5- EqualLogic ON.. 6- EqualLogic ON.. 7- [nothing] ON.. 8- [nothing] ON.. 9- - OFF.. 10- Saturnin ON.. 11- Saturnin ON.. 12- [nothing] OFF.. 13- [nothing] OFF.. 14- bar-05 ON.. 15- bar-05 ON.. 16- bar-04 ON.. 17- - ON.. 18- bar-04 +1.1538431644 server 0x4f4e0d0a2020202031392d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032302d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032312d206261722d3032202020202020202020202020202020202020204f4e0d0a2020202032322d206261722d3032202020202020202020202020202020202020204f4e0d0a0d20202020202020205072657373203c454e5445523e20746f20636f6e74696e75652e2e2e0d2020202020202020202020202020202020202020202020202020202020202020202020200d2020202032332d206261722d3031202020202020202020202020202020202020204f4e0d0a2020202032342d206261722d3031202020202020202020202020202020202020204f4e0d0a2020202032352d20414c4c2041636365737369626c65204f75746c6574730d0a0d0a20202020203c4553433e2d204261636b2c203c454e5445523e2d20526566726573680d0a3e200a0a0a0d416d65726963616e20506f77657220436f6e76657273696f6e2020202020202020202020202020204e6574776f726b204d616e6167656d656e74204361726420414f5320202020202076322e372e300d0a28632920436f70797269676874203230303420416c6c2052696768747320526573657276656420205261636b205044552041505020202020202020202020202020202020202020202076322e372e330d0a2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a4e616d652020202020203a205044552d424152202020202020202020202020202020202020202020202020202020202020202020202044617465203a2030382f31312f323031340d0a436f6e746163742020203a2020202020202020202020202020202020202020202020202020202020202020202020202020202020202054696d65203a2031363a33353a33340a0d4c6f636174696f6e20203a20425251204c61622c207261636b202339202d20726573657276656420666f7220636c757374657220202055736572203a204f75746c657420557365720a0d55702054696d652020203a2033342044617973203520486f7572732038204d696e75746573202020202020202020202020202020202053746174203a20502b204e2b20412b0d0a0d0a5377697463686564205261636b205044553a20436f6d6d756e69636174696f6e2045737461626c69736865640a0a0d2d2d2d2d2d2d2d20436f6e74726f6c20436f6e736f6c65202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d #ON.. 19- bar-03 ON.. 20- bar-03 ON.. 21- bar-02 ON.. 22- bar-02 ON... Press to continue.... . 23- bar-01 ON.. 24- bar-01 ON.. 25- ALL Accessible Outlets.... - Back, - Refresh..> ....American Power Conversion Network Management Card AOS v2.7.0..(c) Copyright 2004 All Rights Reserved Rack PDU APP v2.7.3..-------------------------------------------------------------------------------..Name : PDU-BAR Date : 08/11/2014..Contact : Time : 16:35:34..Location : BRQ Lab, rack #9 - reserved for cluster User : Outlet User..Up Time : 34 Days 5 Hours 8 Minutes Stat : P+ N+ A+....Switched Rack PDU: Communication Established...------- Control Console ------------------ +1.2784380913 server 0x2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d20446576696365204d616e616765720d0a2020202020322d204e6574776f726b0d0a2020202020332d2053797374656d0d0a2020202020342d204c6f676f75740d0a0d0a20202020203c4553433e2d204d61696e204d656e752c203c454e5445523e2d20526566726573680d0a3e20 #-------------------------------------.... 1- Device Manager.. 2- Network.. 3- System.. 4- Logout.... - Main Menu, - Refresh..> +1.3304111958 client 0x310d0a #1.. +1.4332730770 server 0x310a0a0d2d2d2d2d2d2d2d20446576696365204d616e61676572202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d205068617365204d6f6e69746f720d0a2020202020322d204f75746c657420436f6e74726f6c0d0a2020202020332d20506f77657220537570706c79205374617475730d0a0d0a20202020203c4553433e2d204261636b2c203c454e5445523e2d20526566726573680d0a3e20 #1...------- Device Manager --------------------------------------------------------.... 1- Phase Monitor.. 2- Outlet Control.. 3- Power Supply Status.... - Back, - Refresh..> +1.4851341248 client 0x320d0a #2.. +1.6762020588 server 0x320a0a0d2d2d2d2d2d2d2d204f75746c657420436f6e74726f6c202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d202d2020202020202020202020202020202020202020202020204f4e0d0a2020202020322d20454d43202855505329202020202020202020202020202020204f4e0d0a2020202020332d20454d43202020202020202020202020202020202020202020204f4e0d0a2020202020342d20464320537769746368202020202020202020202020202020204f4e0d0a2020202020352d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020362d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020372d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020382d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020392d202d2020202020202020202020202020202020202020202020204f46460d0a2020202031302d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031312d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031322d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031332d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031342d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031352d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031362d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031372d202d2020202020202020202020202020202020202020202020204f4e0d0a2020202031382d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031392d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032302d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032312d206261722d3032202020202020202020202020202020202020204f4e0d0a2020202032322d206261722d3032202020202020202020202020202020202020204f4e0d0a0d20202020202020205072657373203c454e5445523e20746f20636f6e74696e75652e2e2e0d2020202020202020202020202020202020202020202020202020202020202020202020200d2020202032332d206261722d303120202020202020 #2...------- Outlet Control --------------------------------------------------------.... 1- - ON.. 2- EMC (UPS) ON.. 3- EMC ON.. 4- FC Switch ON.. 5- EqualLogic ON.. 6- EqualLogic ON.. 7- [nothing] ON.. 8- [nothing] ON.. 9- - OFF.. 10- Saturnin ON.. 11- Saturnin ON.. 12- [nothing] OFF.. 13- [nothing] OFF.. 14- bar-05 ON.. 15- bar-05 ON.. 16- bar-04 ON.. 17- - ON.. 18- bar-04 ON.. 19- bar-03 ON.. 20- bar-03 ON.. 21- bar-02 ON.. 22- bar-02 ON... Press to continue.... . 23- bar-01 +1.7284960747 client 0x0d0a #.. +2.3394441605 server 0x2020202020202020202020204f4e0d0a2020202032342d206261722d3031202020202020202020202020202020202020204f4e0d0a2020202032352d20414c4c2041636365737369626c65204f75746c6574730d0a0d0a20202020203c4553433e2d204261636b2c203c454e5445523e2d20526566726573680d0a3e200a0a0d2d2d2d2d2d2d2d204f75746c657420436f6e74726f6c202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d202d2020202020202020202020202020202020202020202020204f4e0d0a2020202020322d20454d43202855505329202020202020202020202020202020204f4e0d0a2020202020332d20454d43202020202020202020202020202020202020202020204f4e0d0a2020202020342d20464320537769746368202020202020202020202020202020204f4e0d0a2020202020352d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020362d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020372d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020382d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020392d202d2020202020202020202020202020202020202020202020204f46460d0a2020202031302d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031312d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031322d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031332d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031342d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031352d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031362d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031372d202d2020202020202020202020202020202020202020202020204f4e0d0a2020202031382d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031392d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032302d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032312d206261722d3032202020202020202020202020202020202020204f4e0d0a2020202032322d2062 # ON.. 24- bar-01 ON.. 25- ALL Accessible Outlets.... - Back, - Refresh..> ...------- Outlet Control --------------------------------------------------------.... 1- - ON.. 2- EMC (UPS) ON.. 3- EMC ON.. 4- FC Switch ON.. 5- EqualLogic ON.. 6- EqualLogic ON.. 7- [nothing] ON.. 8- [nothing] ON.. 9- - OFF.. 10- Saturnin ON.. 11- Saturnin ON.. 12- [nothing] OFF.. 13- [nothing] OFF.. 14- bar-05 ON.. 15- bar-05 ON.. 16- bar-04 ON.. 17- - ON.. 18- bar-04 ON.. 19- bar-03 ON.. 20- bar-03 ON.. 21- bar-02 ON.. 22- b +2.3922331333 client 0x310d0a #1.. +2.5189039707 server 0x61722d3032202020202020202020202020202020202020204f4e0d0a0d20202020202020205072657373203c454e5445523e20746f20636f6e74696e75652e2e2e0d2020202020202020202020202020202020202020202020202020202020202020202020200d2020202032332d206261722d3031202020202020202020202020202020202020204f4e0d0a2020202032342d206261722d3031202020202020202020202020202020202020204f4e0d0a2020202032352d20414c4c2041636365737369626c65204f75746c6574730d0a0d0a20202020203c4553433e2d204261636b2c203c454e5445523e2d20526566726573680d0a3e20310a0a0d2d2d2d2d2d2d2d202d202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a20202020202020204e616d652020202020202020203a202d0d0a20202020202020204f75746c6574202020202020203a20310d0a2020202020202020537461746520202020202020203a204f4e0d0a0d0a2020202020312d20496d6d656469617465204f6e20202020202020202020202020200d0a2020202020322d20496d6d656469617465204f6666202020202020202020202020200d0a2020202020332d20496d6d656469617465205265626f6f74202020202020202020200d0a2020202020342d2044656c61796564204f6e202020202020202020202020202020200d0a2020202020352d2044656c61796564204f66662020202020202020202020202020200d0a2020202020362d2044656c61796564205265626f6f742020202020202020202020200d0a2020202020372d2043616e63656c20202020202020202020202020202020202020200d0a0d0a20202020203f2d2048656c702c203c4553433e2d204261636b2c203c454e5445523e2d20526566726573680d0a3e20 #ar-02 ON... Press to continue.... . 23- bar-01 ON.. 24- bar-01 ON.. 25- ALL Accessible Outlets.... - Back, - Refresh..> 1...------- - ---------------------------------------------------------------------.... Name : -.. Outlet : 1.. State : ON.... 1- Immediate On .. 2- Immediate Off .. 3- Immediate Reboot .. 4- Delayed On .. 5- Delayed Off .. 6- Delayed Reboot .. 7- Cancel .... ?- Help, - Back, - Refresh..> +2.5714001656 client 0x320d0a #2.. +2.6408710480 server 0x320d0a20202020202020202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a2020202020202020496d6d656469617465204f6666202020202020202020202020200d0a0d0a20202020202020205468697320636f6d6d616e642077696c6c20696d6d6564696174656c79207475726e0d0a20202020202020206f75746c65742031206e616d656420272d27204f46462e0d0a0d0a2020202020202020456e74657220275945532720746f20636f6e74696e7565206f72203c454e5445523e20746f2063616e63656c203a20 #2.. -----------------------------------------------------------------------.. Immediate Off .... This command will immediately turn.. outlet 1 named '-' OFF..... Enter 'YES' to continue or to cancel : +2.6934661865 client 0x5945530d0a #YES.. +2.8660931587 server 0x5945530d0a2020202020202020436f6d6d616e64207375636365737366756c6c79206973737565642e0d0a0d0a20202020202020205072657373203c454e5445523e20746f20636f6e74696e75652e2e2e0d0a0a0a0d2d2d2d2d2d2d2d202d202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a20202020202020204e616d652020202020202020203a202d0d0a20202020202020204f75746c6574202020202020203a20310d0a2020202020202020537461746520202020202020203a204f46460d0a0d0a2020202020312d20496d6d656469617465204f6e20202020202020202020202020200d0a2020202020322d20496d6d656469617465204f6666202020202020202020202020200d0a2020202020332d20496d6d656469617465205265626f6f74202020202020202020200d0a2020202020342d2044656c61796564204f6e202020202020202020202020202020200d0a2020202020352d2044656c61796564204f66662020202020202020202020202020200d0a2020202020362d2044656c61796564205265626f6f742020202020202020202020200d0a2020202020372d2043616e63656c20202020202020202020202020202020202020200d0a0d0a20202020203f2d2048656c702c203c4553433e2d204261636b2c203c454e5445523e2d20526566726573680d0a3e20 #YES.. Command successfully issued..... Press to continue........------- - ---------------------------------------------------------------------.... Name : -.. Outlet : 1.. State : OFF.... 1- Immediate On .. 2- Immediate Off .. 3- Immediate Reboot .. 4- Delayed On .. 5- Delayed Off .. 6- Delayed Reboot .. 7- Cancel .... ?- Help, - Back, - Refresh..> +2.9183230400 client 0x0d0a #.. +2.9684669971 client 0x03 #. +3.0102670193 server 0x0a0a0d2d2d2d2d2d2d2d202d202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a20202020202020204e616d652020202020202020203a202d0d0a20202020202020204f75746c6574202020202020203a20310d0a2020202020202020537461746520202020202020203a204f46460d0a0d0a2020202020312d20496d6d656469617465204f6e20202020202020202020202020200d0a2020202020322d20496d6d656469617465204f6666202020202020202020202020200d0a2020202020332d20496d6d656469617465205265626f6f74202020202020202020200d0a2020202020342d2044656c61796564204f6e202020202020202020202020202020200d0a2020202020352d2044656c61796564204f66662020202020202020202020202020200d0a2020202020362d2044656c61796564205265626f6f742020202020202020202020200d0a2020202020372d2043616e63656c20202020202020202020202020202020202020200d0a0d0a20202020203f2d2048656c702c203c4553433e2d204261636b2c203c454e5445523e2d20526566726573680d0a3e20 #...------- - ---------------------------------------------------------------------.... Name : -.. Outlet : 1.. State : OFF.... 1- Immediate On .. 2- Immediate Off .. 3- Immediate Reboot .. 4- Delayed On .. 5- Delayed Off .. 6- Delayed Reboot .. 7- Cancel .... ?- Help, - Back, - Refresh..> +3.1484491825 server 0x0a0a0a0d416d65726963616e20506f77657220436f6e76657273696f6e2020202020202020202020202020204e6574776f726b204d616e6167656d656e74204361726420414f5320202020202076322e372e300d0a28632920436f70797269676874203230303420416c6c2052696768747320526573657276656420205261636b205044552041505020202020202020202020202020202020202020202076322e372e330d0a2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a4e616d652020202020203a205044552d424152202020202020202020202020202020202020202020202020202020202020202020202044617465203a2030382f31312f323031340d0a436f6e746163742020203a2020202020202020202020202020202020202020202020202020202020202020202020202020202020202054696d65203a2031363a33353a33360a0d4c6f636174696f6e20203a20425251204c61622c207261636b202339202d20726573657276656420666f7220636c757374657220202055736572203a204f75746c657420557365720a0d55702054696d652020203a2033342044617973203520486f7572732038204d696e75746573202020202020202020202020202020202053746174203a20502b204e2b20412b0d0a0d0a5377697463686564205261636b205044553a20436f6d6d756e69636174696f6e2045737461626c69736865640a0a0d2d2d2d2d2d2d2d20436f6e74726f6c20436f6e736f6c65202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d20446576696365204d616e616765720d0a2020202020322d204e6574776f726b0d0a2020202020332d2053797374656d0d0a2020202020342d204c6f676f75740d0a0d0a20202020203c4553433e2d204d61696e204d656e752c203c454e5445523e2d20526566726573680d0a3e20 #....American Power Conversion Network Management Card AOS v2.7.0..(c) Copyright 2004 All Rights Reserved Rack PDU APP v2.7.3..-------------------------------------------------------------------------------..Name : PDU-BAR Date : 08/11/2014..Contact : Time : 16:35:36..Location : BRQ Lab, rack #9 - reserved for cluster User : Outlet User..Up Time : 34 Days 5 Hours 8 Minutes Stat : P+ N+ A+....Switched Rack PDU: Communication Established...------- Control Console -------------------------------------------------------.... 1- Device Manager.. 2- Network.. 3- System.. 4- Logout.... - Main Menu, - Refresh..> +3.2012140751 client 0x310d0a #1.. +3.3028790951 server 0x310a0a0d2d2d2d2d2d2d2d20446576696365204d616e61676572202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d205068617365204d6f6e69746f720d0a2020202020322d204f75746c657420436f6e74726f6c0d0a2020202020332d20506f77657220537570706c79205374617475730d0a0d0a20202020203c4553433e2d204261636b2c203c454e5445523e2d20526566726573680d0a3e20 #1...------- Device Manager --------------------------------------------------------.... 1- Phase Monitor.. 2- Outlet Control.. 3- Power Supply Status.... - Back, - Refresh..> +3.3551721573 client 0x320d0a #2.. +3.5533120632 server 0x320a0a0d2d2d2d2d2d2d2d204f75746c657420436f6e74726f6c202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d202d2020202020202020202020202020202020202020202020204f46460d0a2020202020322d20454d43202855505329202020202020202020202020202020204f4e0d0a2020202020332d20454d43202020202020202020202020202020202020202020204f4e0d0a2020202020342d20464320537769746368202020202020202020202020202020204f4e0d0a2020202020352d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020362d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020372d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020382d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020392d202d2020202020202020202020202020202020202020202020204f46460d0a2020202031302d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031312d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031322d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031332d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031342d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031352d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031362d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031372d202d2020202020202020202020202020202020202020202020204f4e0d0a2020202031382d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031392d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032302d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032312d206261722d3032202020202020202020202020202020202020204f4e0d0a2020202032322d206261722d3032202020202020202020202020202020202020204f4e0d0a0d20202020202020205072657373203c454e5445523e20746f20636f6e74696e75652e2e2e0d2020202020202020202020202020202020202020202020202020202020202020202020200d2020202032332d206261722d3031202020202020 #2...------- Outlet Control --------------------------------------------------------.... 1- - OFF.. 2- EMC (UPS) ON.. 3- EMC ON.. 4- FC Switch ON.. 5- EqualLogic ON.. 6- EqualLogic ON.. 7- [nothing] ON.. 8- [nothing] ON.. 9- - OFF.. 10- Saturnin ON.. 11- Saturnin ON.. 12- [nothing] OFF.. 13- [nothing] OFF.. 14- bar-05 ON.. 15- bar-05 ON.. 16- bar-04 ON.. 17- - ON.. 18- bar-04 ON.. 19- bar-03 ON.. 20- bar-03 ON.. 21- bar-02 ON.. 22- bar-02 ON... Press to continue.... . 23- bar-01 +3.6058371067 client 0x0d0a #.. +3.8190891743 server 0x202020202020202020202020204f4e0d0a2020202032342d206261722d3031202020202020202020202020202020202020204f4e0d0a2020202032352d20414c4c2041636365737369626c65204f75746c6574730d0a0d0a20202020203c4553433e2d204261636b2c203c454e5445523e2d20526566726573680d0a3e200a0a0d2d2d2d2d2d2d2d204f75746c657420436f6e74726f6c202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d202d2020202020202020202020202020202020202020202020204f46460d0a2020202020322d20454d43202855505329202020202020202020202020202020204f4e0d0a2020202020332d20454d43202020202020202020202020202020202020202020204f4e0d0a2020202020342d20464320537769746368202020202020202020202020202020204f4e0d0a2020202020352d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020362d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020372d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020382d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020392d202d2020202020202020202020202020202020202020202020204f46460d0a2020202031302d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031312d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031322d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031332d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031342d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031352d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031362d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031372d202d2020202020202020202020202020202020202020202020204f4e0d0a2020202031382d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031392d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032302d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032312d206261722d3032202020202020202020202020202020202020204f4e0d0a2020202032322d # ON.. 24- bar-01 ON.. 25- ALL Accessible Outlets.... - Back, - Refresh..> ...------- Outlet Control --------------------------------------------------------.... 1- - OFF.. 2- EMC (UPS) ON.. 3- EMC ON.. 4- FC Switch ON.. 5- EqualLogic ON.. 6- EqualLogic ON.. 7- [nothing] ON.. 8- [nothing] ON.. 9- - OFF.. 10- Saturnin ON.. 11- Saturnin ON.. 12- [nothing] OFF.. 13- [nothing] OFF.. 14- bar-05 ON.. 15- bar-05 ON.. 16- bar-04 ON.. 17- - ON.. 18- bar-04 ON.. 19- bar-03 ON.. 20- bar-03 ON.. 21- bar-02 ON.. 22- +3.8711111546 client 0x0d0a #.. +3.9213659763 client 0x03 #. +4.0694720745 server 0x206261722d3032202020202020202020202020202020202020204f4e0d0a0d20202020202020205072657373203c454e5445523e20746f20636f6e74696e75652e2e2e0d2020202020202020202020202020202020202020202020202020202020202020202020200d2020202032332d206261722d3031202020202020202020202020202020202020204f4e0d0a2020202032342d206261722d3031202020202020202020202020202020202020204f4e0d0a2020202032352d20414c4c2041636365737369626c65204f75746c6574730d0a0d0a20202020203c4553433e2d204261636b2c203c454e5445523e2d20526566726573680d0a3e200a0a0d2d2d2d2d2d2d2d204f75746c657420436f6e74726f6c202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d202d2020202020202020202020202020202020202020202020204f46460d0a2020202020322d20454d43202855505329202020202020202020202020202020204f4e0d0a2020202020332d20454d43202020202020202020202020202020202020202020204f4e0d0a2020202020342d20464320537769746368202020202020202020202020202020204f4e0d0a2020202020352d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020362d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020372d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020382d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020392d202d2020202020202020202020202020202020202020202020204f46460d0a2020202031302d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031312d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031322d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031332d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031342d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031352d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031362d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031372d202d2020202020202020202020202020202020202020202020204f4e0d0a2020202031382d206261722d303420202020202020202020202020202020 # bar-02 ON... Press to continue.... . 23- bar-01 ON.. 24- bar-01 ON.. 25- ALL Accessible Outlets.... - Back, - Refresh..> ...------- Outlet Control --------------------------------------------------------.... 1- - OFF.. 2- EMC (UPS) ON.. 3- EMC ON.. 4- FC Switch ON.. 5- EqualLogic ON.. 6- EqualLogic ON.. 7- [nothing] ON.. 8- [nothing] ON.. 9- - OFF.. 10- Saturnin ON.. 11- Saturnin ON.. 12- [nothing] OFF.. 13- [nothing] OFF.. 14- bar-05 ON.. 15- bar-05 ON.. 16- bar-04 ON.. 17- - ON.. 18- bar-04 +4.3005349636 server 0x2020204f4e0d0a2020202031392d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032302d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032312d206261722d3032202020202020202020202020202020202020204f4e0d0a2020202032322d206261722d3032202020202020202020202020202020202020204f4e0d0a0d20202020202020205072657373203c454e5445523e20746f20636f6e74696e75652e2e2e0d2020202020202020202020202020202020202020202020202020202020202020202020200d2020202032332d206261722d3031202020202020202020202020202020202020204f4e0d0a2020202032342d206261722d3031202020202020202020202020202020202020204f4e0d0a2020202032352d20414c4c2041636365737369626c65204f75746c6574730d0a0d0a20202020203c4553433e2d204261636b2c203c454e5445523e2d20526566726573680d0a3e200a0a0a0d416d65726963616e20506f77657220436f6e76657273696f6e2020202020202020202020202020204e6574776f726b204d616e6167656d656e74204361726420414f5320202020202076322e372e300d0a28632920436f70797269676874203230303420416c6c2052696768747320526573657276656420205261636b205044552041505020202020202020202020202020202020202020202076322e372e330d0a2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a4e616d652020202020203a205044552d424152202020202020202020202020202020202020202020202020202020202020202020202044617465203a2030382f31312f323031340d0a436f6e746163742020203a2020202020202020202020202020202020202020202020202020202020202020202020202020202020202054696d65203a2031363a33353a33370a0d4c6f636174696f6e20203a20425251204c61622c207261636b202339202d20726573657276656420666f7220636c757374657220202055736572203a204f75746c657420557365720a0d55702054696d652020203a2033342044617973203520486f7572732038204d696e75746573202020202020202020202020202020202053746174203a20502b204e2b20412b0d0a0d0a5377697463686564205261636b205044553a20436f6d6d756e69636174696f6e2045737461626c69736865640a0a0d2d2d2d2d2d2d2d20436f6e74726f6c20436f6e736f6c65202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d # ON.. 19- bar-03 ON.. 20- bar-03 ON.. 21- bar-02 ON.. 22- bar-02 ON... Press to continue.... . 23- bar-01 ON.. 24- bar-01 ON.. 25- ALL Accessible Outlets.... - Back, - Refresh..> ....American Power Conversion Network Management Card AOS v2.7.0..(c) Copyright 2004 All Rights Reserved Rack PDU APP v2.7.3..-------------------------------------------------------------------------------..Name : PDU-BAR Date : 08/11/2014..Contact : Time : 16:35:37..Location : BRQ Lab, rack #9 - reserved for cluster User : Outlet User..Up Time : 34 Days 5 Hours 8 Minutes Stat : P+ N+ A+....Switched Rack PDU: Communication Established...------- Control Console --------------- +4.4164841175 server 0x2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d20446576696365204d616e616765720d0a2020202020322d204e6574776f726b0d0a2020202020332d2053797374656d0d0a2020202020342d204c6f676f75740d0a0d0a20202020203c4553433e2d204d61696e204d656e752c203c454e5445523e2d20526566726573680d0a3e20 #----------------------------------------.... 1- Device Manager.. 2- Network.. 3- System.. 4- Logout.... - Main Menu, - Refresh..> +4.4687070847 client 0x310d0a #1.. +4.5739951134 server 0x310a0a0d2d2d2d2d2d2d2d20446576696365204d616e61676572202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d205068617365204d6f6e69746f720d0a2020202020322d204f75746c657420436f6e74726f6c0d0a2020202020332d20506f77657220537570706c79205374617475730d0a0d0a20202020203c4553433e2d204261636b2c203c454e5445523e2d20526566726573680d0a3e20 #1...------- Device Manager --------------------------------------------------------.... 1- Phase Monitor.. 2- Outlet Control.. 3- Power Supply Status.... - Back, - Refresh..> +4.6265890598 client 0x320d0a #2.. +4.8224670887 server 0x320a0a0d2d2d2d2d2d2d2d204f75746c657420436f6e74726f6c202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d202d2020202020202020202020202020202020202020202020204f46460d0a2020202020322d20454d43202855505329202020202020202020202020202020204f4e0d0a2020202020332d20454d43202020202020202020202020202020202020202020204f4e0d0a2020202020342d20464320537769746368202020202020202020202020202020204f4e0d0a2020202020352d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020362d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020372d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020382d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020392d202d2020202020202020202020202020202020202020202020204f46460d0a2020202031302d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031312d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031322d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031332d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031342d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031352d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031362d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031372d202d2020202020202020202020202020202020202020202020204f4e0d0a2020202031382d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031392d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032302d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032312d206261722d3032202020202020202020202020202020202020204f4e0d0a2020202032322d206261722d3032202020202020202020202020202020202020204f4e0d0a0d20202020202020205072657373203c454e5445523e20746f20636f6e74696e75652e2e2e0d2020202020202020202020202020202020202020202020202020202020202020202020200d2020202032332d206261722d3031202020202020 #2...------- Outlet Control --------------------------------------------------------.... 1- - OFF.. 2- EMC (UPS) ON.. 3- EMC ON.. 4- FC Switch ON.. 5- EqualLogic ON.. 6- EqualLogic ON.. 7- [nothing] ON.. 8- [nothing] ON.. 9- - OFF.. 10- Saturnin ON.. 11- Saturnin ON.. 12- [nothing] OFF.. 13- [nothing] OFF.. 14- bar-05 ON.. 15- bar-05 ON.. 16- bar-04 ON.. 17- - ON.. 18- bar-04 ON.. 19- bar-03 ON.. 20- bar-03 ON.. 21- bar-02 ON.. 22- bar-02 ON... Press to continue.... . 23- bar-01 +4.8759989738 client 0x0d0a #.. +5.5716981888 server 0x202020202020202020202020204f4e0d0a2020202032342d206261722d3031202020202020202020202020202020202020204f4e0d0a2020202032352d20414c4c2041636365737369626c65204f75746c6574730d0a0d0a20202020203c4553433e2d204261636b2c203c454e5445523e2d20526566726573680d0a3e200a0a0d2d2d2d2d2d2d2d204f75746c657420436f6e74726f6c202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d202d2020202020202020202020202020202020202020202020204f46460d0a2020202020322d20454d43202855505329202020202020202020202020202020204f4e0d0a2020202020332d20454d43202020202020202020202020202020202020202020204f4e0d0a2020202020342d20464320537769746368202020202020202020202020202020204f4e0d0a2020202020352d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020362d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020372d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020382d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020392d202d2020202020202020202020202020202020202020202020204f46460d0a2020202031302d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031312d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031322d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031332d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031342d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031352d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031362d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031372d202d2020202020202020202020202020202020202020202020204f4e0d0a2020202031382d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031392d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032302d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032312d206261722d3032202020202020202020202020202020202020204f4e0d0a2020202032322d # ON.. 24- bar-01 ON.. 25- ALL Accessible Outlets.... - Back, - Refresh..> ...------- Outlet Control --------------------------------------------------------.... 1- - OFF.. 2- EMC (UPS) ON.. 3- EMC ON.. 4- FC Switch ON.. 5- EqualLogic ON.. 6- EqualLogic ON.. 7- [nothing] ON.. 8- [nothing] ON.. 9- - OFF.. 10- Saturnin ON.. 11- Saturnin ON.. 12- [nothing] OFF.. 13- [nothing] OFF.. 14- bar-05 ON.. 15- bar-05 ON.. 16- bar-04 ON.. 17- - ON.. 18- bar-04 ON.. 19- bar-03 ON.. 20- bar-03 ON.. 21- bar-02 ON.. 22- +5.6243510246 client 0x310d0a #1.. +6.1654109955 server 0x206261722d3032202020202020202020202020202020202020204f4e0d0a0d20202020202020205072657373203c454e5445523e20746f20636f6e74696e75652e2e2e0d2020202020202020202020202020202020202020202020202020202020202020202020200d2020202032332d206261722d3031202020202020202020202020202020202020204f4e0d0a2020202032342d206261722d3031202020202020202020202020202020202020204f4e0d0a2020202032352d20414c4c2041636365737369626c65204f75746c6574730d0a0d0a20202020203c4553433e2d204261636b2c203c454e5445523e2d20526566726573680d0a3e20310a0a0d2d2d2d2d2d2d2d202d202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a20202020202020204e616d652020202020202020203a202d0d0a20202020202020204f75746c6574202020202020203a20310d0a2020202020202020537461746520202020202020203a204f46460d0a0d0a2020202020312d20496d6d656469617465204f6e20202020202020202020202020200d0a2020202020322d20496d6d656469617465204f6666202020202020202020202020200d0a2020202020332d20496d6d656469617465205265626f6f74202020202020202020200d0a2020202020342d2044656c61796564204f6e202020202020202020202020202020200d0a2020202020352d2044656c61796564204f66662020202020202020202020202020200d0a2020202020362d2044656c61796564205265626f6f742020202020202020202020200d0a2020202020372d2043616e63656c20202020202020202020202020202020202020200d0a0d0a20202020203f2d2048656c702c203c4553433e2d204261636b2c203c454e5445523e2d20526566726573680d0a3e20 # bar-02 ON... Press to continue.... . 23- bar-01 ON.. 24- bar-01 ON.. 25- ALL Accessible Outlets.... - Back, - Refresh..> 1...------- - ---------------------------------------------------------------------.... Name : -.. Outlet : 1.. State : OFF.... 1- Immediate On .. 2- Immediate Off .. 3- Immediate Reboot .. 4- Delayed On .. 5- Delayed Off .. 6- Delayed Reboot .. 7- Cancel .... ?- Help, - Back, - Refresh..> +6.2175550461 client 0x310d0a #1.. +6.2828969955 server 0x310d0a20202020202020202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a2020202020202020496d6d656469617465204f6e20202020202020202020202020200d0a0d0a20202020202020205468697320636f6d6d616e642077696c6c20696d6d6564696174656c79207475726e0d0a20202020202020206f75746c65742031206e616d656420272d27204f4e2e0d0a0d0a2020202020202020456e74657220275945532720746f20636f6e74696e7565206f72203c454e5445523e20746f2063616e63656c203a20 #1.. -----------------------------------------------------------------------.. Immediate On .... This command will immediately turn.. outlet 1 named '-' ON..... Enter 'YES' to continue or to cancel : +6.3353931904 client 0x5945530d0a #YES.. +6.5034971237 server 0x5945530d0a2020202020202020436f6d6d616e64207375636365737366756c6c79206973737565642e0d0a0d0a20202020202020205072657373203c454e5445523e20746f20636f6e74696e75652e2e2e0d0a0a0a0d2d2d2d2d2d2d2d202d202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a20202020202020204e616d652020202020202020203a202d0d0a20202020202020204f75746c6574202020202020203a20310d0a2020202020202020537461746520202020202020203a204f4e0d0a0d0a2020202020312d20496d6d656469617465204f6e20202020202020202020202020200d0a2020202020322d20496d6d656469617465204f6666202020202020202020202020200d0a2020202020332d20496d6d656469617465205265626f6f74202020202020202020200d0a2020202020342d2044656c61796564204f6e202020202020202020202020202020200d0a2020202020352d2044656c61796564204f66662020202020202020202020202020200d0a2020202020362d2044656c61796564205265626f6f742020202020202020202020200d0a2020202020372d2043616e63656c20202020202020202020202020202020202020200d0a0d0a20202020203f2d2048656c702c203c4553433e2d204261636b2c203c454e5445523e2d20526566726573680d0a3e20 #YES.. Command successfully issued..... Press to continue........------- - ---------------------------------------------------------------------.... Name : -.. Outlet : 1.. State : ON.... 1- Immediate On .. 2- Immediate Off .. 3- Immediate Reboot .. 4- Delayed On .. 5- Delayed Off .. 6- Delayed Reboot .. 7- Cancel .... ?- Help, - Back, - Refresh..> +6.5558459759 client 0x0d0a #.. +6.6058681011 client 0x03 #. +6.6489369869 server 0x0a0a0d2d2d2d2d2d2d2d202d202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a20202020202020204e616d652020202020202020203a202d0d0a20202020202020204f75746c6574202020202020203a20310d0a2020202020202020537461746520202020202020203a204f4e0d0a0d0a2020202020312d20496d6d656469617465204f6e20202020202020202020202020200d0a2020202020322d20496d6d656469617465204f6666202020202020202020202020200d0a2020202020332d20496d6d656469617465205265626f6f74202020202020202020200d0a2020202020342d2044656c61796564204f6e202020202020202020202020202020200d0a2020202020352d2044656c61796564204f66662020202020202020202020202020200d0a2020202020362d2044656c61796564205265626f6f742020202020202020202020200d0a2020202020372d2043616e63656c20202020202020202020202020202020202020200d0a0d0a20202020203f2d2048656c702c203c4553433e2d204261636b2c203c454e5445523e2d20526566726573680d0a3e20 #...------- - ---------------------------------------------------------------------.... Name : -.. Outlet : 1.. State : ON.... 1- Immediate On .. 2- Immediate Off .. 3- Immediate Reboot .. 4- Delayed On .. 5- Delayed Off .. 6- Delayed Reboot .. 7- Cancel .... ?- Help, - Back, - Refresh..> +6.7828090191 server 0x0a0a0a0d416d65726963616e20506f77657220436f6e76657273696f6e2020202020202020202020202020204e6574776f726b204d616e6167656d656e74204361726420414f5320202020202076322e372e300d0a28632920436f70797269676874203230303420416c6c2052696768747320526573657276656420205261636b205044552041505020202020202020202020202020202020202020202076322e372e330d0a2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a4e616d652020202020203a205044552d424152202020202020202020202020202020202020202020202020202020202020202020202044617465203a2030382f31312f323031340d0a436f6e746163742020203a2020202020202020202020202020202020202020202020202020202020202020202020202020202020202054696d65203a2031363a33353a34300a0d4c6f636174696f6e20203a20425251204c61622c207261636b202339202d20726573657276656420666f7220636c757374657220202055736572203a204f75746c657420557365720a0d55702054696d652020203a2033342044617973203520486f7572732038204d696e75746573202020202020202020202020202020202053746174203a20502b204e2b20412b0d0a0d0a5377697463686564205261636b205044553a20436f6d6d756e69636174696f6e2045737461626c69736865640a0a0d2d2d2d2d2d2d2d20436f6e74726f6c20436f6e736f6c65202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d20446576696365204d616e616765720d0a2020202020322d204e6574776f726b0d0a2020202020332d2053797374656d0d0a2020202020342d204c6f676f75740d0a0d0a20202020203c4553433e2d204d61696e204d656e752c203c454e5445523e2d20526566726573680d0a3e20 #....American Power Conversion Network Management Card AOS v2.7.0..(c) Copyright 2004 All Rights Reserved Rack PDU APP v2.7.3..-------------------------------------------------------------------------------..Name : PDU-BAR Date : 08/11/2014..Contact : Time : 16:35:40..Location : BRQ Lab, rack #9 - reserved for cluster User : Outlet User..Up Time : 34 Days 5 Hours 8 Minutes Stat : P+ N+ A+....Switched Rack PDU: Communication Established...------- Control Console -------------------------------------------------------.... 1- Device Manager.. 2- Network.. 3- System.. 4- Logout.... - Main Menu, - Refresh..> +6.8353819847 client 0x310d0a #1.. +6.9369339943 server 0x310a0a0d2d2d2d2d2d2d2d20446576696365204d616e61676572202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d205068617365204d6f6e69746f720d0a2020202020322d204f75746c657420436f6e74726f6c0d0a2020202020332d20506f77657220537570706c79205374617475730d0a0d0a20202020203c4553433e2d204261636b2c203c454e5445523e2d20526566726573680d0a3e20 #1...------- Device Manager --------------------------------------------------------.... 1- Phase Monitor.. 2- Outlet Control.. 3- Power Supply Status.... - Back, - Refresh..> +6.9887120724 client 0x320d0a #2.. +7.1946370602 server 0x320a0a0d2d2d2d2d2d2d2d204f75746c657420436f6e74726f6c202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d202d2020202020202020202020202020202020202020202020204f4e0d0a2020202020322d20454d43202855505329202020202020202020202020202020204f4e0d0a2020202020332d20454d43202020202020202020202020202020202020202020204f4e0d0a2020202020342d20464320537769746368202020202020202020202020202020204f4e0d0a2020202020352d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020362d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020372d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020382d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020392d202d2020202020202020202020202020202020202020202020204f46460d0a2020202031302d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031312d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031322d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031332d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031342d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031352d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031362d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031372d202d2020202020202020202020202020202020202020202020204f4e0d0a2020202031382d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031392d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032302d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032312d206261722d3032202020202020202020202020202020202020204f4e0d0a2020202032322d206261722d3032202020202020202020202020202020202020204f4e0d0a0d20202020202020205072657373203c454e5445523e20746f20636f6e74696e75652e2e2e0d2020202020202020202020202020202020202020202020202020202020202020202020200d2020202032332d206261722d303120202020202020 #2...------- Outlet Control --------------------------------------------------------.... 1- - ON.. 2- EMC (UPS) ON.. 3- EMC ON.. 4- FC Switch ON.. 5- EqualLogic ON.. 6- EqualLogic ON.. 7- [nothing] ON.. 8- [nothing] ON.. 9- - OFF.. 10- Saturnin ON.. 11- Saturnin ON.. 12- [nothing] OFF.. 13- [nothing] OFF.. 14- bar-05 ON.. 15- bar-05 ON.. 16- bar-04 ON.. 17- - ON.. 18- bar-04 ON.. 19- bar-03 ON.. 20- bar-03 ON.. 21- bar-02 ON.. 22- bar-02 ON... Press to continue.... . 23- bar-01 +7.2470071316 client 0x0d0a #.. +7.4591891766 server 0x2020202020202020202020204f4e0d0a2020202032342d206261722d3031202020202020202020202020202020202020204f4e0d0a2020202032352d20414c4c2041636365737369626c65204f75746c6574730d0a0d0a20202020203c4553433e2d204261636b2c203c454e5445523e2d20526566726573680d0a3e200a0a0d2d2d2d2d2d2d2d204f75746c657420436f6e74726f6c202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d202d2020202020202020202020202020202020202020202020204f4e0d0a2020202020322d20454d43202855505329202020202020202020202020202020204f4e0d0a2020202020332d20454d43202020202020202020202020202020202020202020204f4e0d0a2020202020342d20464320537769746368202020202020202020202020202020204f4e0d0a2020202020352d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020362d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020372d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020382d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020392d202d2020202020202020202020202020202020202020202020204f46460d0a2020202031302d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031312d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031322d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031332d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031342d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031352d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031362d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031372d202d2020202020202020202020202020202020202020202020204f4e0d0a2020202031382d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031392d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032302d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032312d206261722d3032202020202020202020202020202020202020204f4e0d0a2020202032322d2062 # ON.. 24- bar-01 ON.. 25- ALL Accessible Outlets.... - Back, - Refresh..> ...------- Outlet Control --------------------------------------------------------.... 1- - ON.. 2- EMC (UPS) ON.. 3- EMC ON.. 4- FC Switch ON.. 5- EqualLogic ON.. 6- EqualLogic ON.. 7- [nothing] ON.. 8- [nothing] ON.. 9- - OFF.. 10- Saturnin ON.. 11- Saturnin ON.. 12- [nothing] OFF.. 13- [nothing] OFF.. 14- bar-05 ON.. 15- bar-05 ON.. 16- bar-04 ON.. 17- - ON.. 18- bar-04 ON.. 19- bar-03 ON.. 20- bar-03 ON.. 21- bar-02 ON.. 22- b +7.5117349625 client 0x0d0a #.. +7.5621170998 client 0x03 #. +7.7122750282 server 0x61722d3032202020202020202020202020202020202020204f4e0d0a0d20202020202020205072657373203c454e5445523e20746f20636f6e74696e75652e2e2e0d2020202020202020202020202020202020202020202020202020202020202020202020200d2020202032332d206261722d3031202020202020202020202020202020202020204f4e0d0a2020202032342d206261722d3031202020202020202020202020202020202020204f4e0d0a2020202032352d20414c4c2041636365737369626c65204f75746c6574730d0a0d0a20202020203c4553433e2d204261636b2c203c454e5445523e2d20526566726573680d0a3e200a0a0d2d2d2d2d2d2d2d204f75746c657420436f6e74726f6c202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d202d2020202020202020202020202020202020202020202020204f4e0d0a2020202020322d20454d43202855505329202020202020202020202020202020204f4e0d0a2020202020332d20454d43202020202020202020202020202020202020202020204f4e0d0a2020202020342d20464320537769746368202020202020202020202020202020204f4e0d0a2020202020352d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020362d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020372d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020382d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020392d202d2020202020202020202020202020202020202020202020204f46460d0a2020202031302d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031312d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031322d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031332d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031342d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031352d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031362d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031372d202d2020202020202020202020202020202020202020202020204f4e0d0a2020202031382d206261722d303420202020202020202020202020202020202020 #ar-02 ON... Press to continue.... . 23- bar-01 ON.. 24- bar-01 ON.. 25- ALL Accessible Outlets.... - Back, - Refresh..> ...------- Outlet Control --------------------------------------------------------.... 1- - ON.. 2- EMC (UPS) ON.. 3- EMC ON.. 4- FC Switch ON.. 5- EqualLogic ON.. 6- EqualLogic ON.. 7- [nothing] ON.. 8- [nothing] ON.. 9- - OFF.. 10- Saturnin ON.. 11- Saturnin ON.. 12- [nothing] OFF.. 13- [nothing] OFF.. 14- bar-05 ON.. 15- bar-05 ON.. 16- bar-04 ON.. 17- - ON.. 18- bar-04 +7.9471471310 server 0x4f4e0d0a2020202031392d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032302d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032312d206261722d3032202020202020202020202020202020202020204f4e0d0a2020202032322d206261722d3032202020202020202020202020202020202020204f4e0d0a0d20202020202020205072657373203c454e5445523e20746f20636f6e74696e75652e2e2e0d2020202020202020202020202020202020202020202020202020202020202020202020200d2020202032332d206261722d3031202020202020202020202020202020202020204f4e0d0a2020202032342d206261722d3031202020202020202020202020202020202020204f4e0d0a2020202032352d20414c4c2041636365737369626c65204f75746c6574730d0a0d0a20202020203c4553433e2d204261636b2c203c454e5445523e2d20526566726573680d0a3e200a0a0a0d416d65726963616e20506f77657220436f6e76657273696f6e2020202020202020202020202020204e6574776f726b204d616e6167656d656e74204361726420414f5320202020202076322e372e300d0a28632920436f70797269676874203230303420416c6c2052696768747320526573657276656420205261636b205044552041505020202020202020202020202020202020202020202076322e372e330d0a2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a4e616d652020202020203a205044552d424152202020202020202020202020202020202020202020202020202020202020202020202044617465203a2030382f31312f323031340d0a436f6e746163742020203a2020202020202020202020202020202020202020202020202020202020202020202020202020202020202054696d65203a2031363a33353a34310a0d4c6f636174696f6e20203a20425251204c61622c207261636b202339202d20726573657276656420666f7220636c757374657220202055736572203a204f75746c657420557365720a0d55702054696d652020203a2033342044617973203520486f7572732038204d696e75746573202020202020202020202020202020202053746174203a20502b204e2b20412b0d0a0d0a5377697463686564205261636b205044553a20436f6d6d756e69636174696f6e2045737461626c69736865640a0a0d2d2d2d2d2d2d2d20436f6e74726f6c20436f6e736f6c65202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d #ON.. 19- bar-03 ON.. 20- bar-03 ON.. 21- bar-02 ON.. 22- bar-02 ON... Press to continue.... . 23- bar-01 ON.. 24- bar-01 ON.. 25- ALL Accessible Outlets.... - Back, - Refresh..> ....American Power Conversion Network Management Card AOS v2.7.0..(c) Copyright 2004 All Rights Reserved Rack PDU APP v2.7.3..-------------------------------------------------------------------------------..Name : PDU-BAR Date : 08/11/2014..Contact : Time : 16:35:41..Location : BRQ Lab, rack #9 - reserved for cluster User : Outlet User..Up Time : 34 Days 5 Hours 8 Minutes Stat : P+ N+ A+....Switched Rack PDU: Communication Established...------- Control Console ------------------ +8.0603120327 server 0x2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d20446576696365204d616e616765720d0a2020202020322d204e6574776f726b0d0a2020202020332d2053797374656d0d0a2020202020342d204c6f676f75740d0a0d0a20202020203c4553433e2d204d61696e204d656e752c203c454e5445523e2d20526566726573680d0a3e20 #-------------------------------------.... 1- Device Manager.. 2- Network.. 3- System.. 4- Logout.... - Main Menu, - Refresh..> diff --git a/tests/data/mitm-logs/apc/ssh-user/status-off.log b/tests/data/mitm-logs/apc/ssh-user/status-off.log new file mode 100644 index 000000000..e367be5d0 --- /dev/null +++ b/tests/data/mitm-logs/apc/ssh-user/status-off.log @@ -0,0 +1,12 @@ +0.0000009537 server 0x0a0a0a0d416d65726963616e20506f77657220436f6e76657273696f6e2020202020202020202020202020204e6574776f726b204d616e6167656d656e74204361726420414f5320202020202076322e372e300d0a28632920436f70797269676874203230303420416c6c2052696768747320526573657276656420205261636b205044552041505020202020202020202020202020202020202020202076322e372e330d0a2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a4e616d652020202020203a205044552d424152202020202020202020202020202020202020202020202020202020202020202020202044617465203a2030382f31312f323031340d0a436f6e746163742020203a2020202020202020202020202020202020202020202020202020202020202020202020202020202020202054696d65203a2031363a33383a33330a0d4c6f636174696f6e20203a20425251204c61622c207261636b202339202d20726573657276656420666f7220636c757374657220202055736572203a204f75746c657420557365720a0d55702054696d652020203a2033342044617973203520486f757273203131204d696e757465732020202020202020202020202020202053746174203a20502b204e2b20412b0d0a0d0a5377697463686564205261636b205044553a20436f6d6d756e69636174696f6e2045737461626c69736865640a0a0d2d2d2d2d2d2d2d20436f6e74726f6c20436f6e736f6c65202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d20446576696365204d616e616765720d0a2020202020322d204e6574776f726b0d0a2020202020332d2053797374656d0d0a2020202020342d204c6f676f75740d0a0d0a20202020203c4553433e2d204d61696e204d656e752c203c454e5445523e2d20526566726573680d0a3e20 #....American Power Conversion Network Management Card AOS v2.7.0..(c) Copyright 2004 All Rights Reserved Rack PDU APP v2.7.3..-------------------------------------------------------------------------------..Name : PDU-BAR Date : 08/11/2014..Contact : Time : 16:38:33..Location : BRQ Lab, rack #9 - reserved for cluster User : Outlet User..Up Time : 34 Days 5 Hours 11 Minutes Stat : P+ N+ A+....Switched Rack PDU: Communication Established...------- Control Console -------------------------------------------------------.... 1- Device Manager.. 2- Network.. 3- System.. 4- Logout.... - Main Menu, - Refresh..> +0.0536310673 client 0x310d0a #1.. +0.1547870636 server 0x310a0a0d2d2d2d2d2d2d2d20446576696365204d616e61676572202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d205068617365204d6f6e69746f720d0a2020202020322d204f75746c657420436f6e74726f6c0d0a2020202020332d20506f77657220537570706c79205374617475730d0a0d0a20202020203c4553433e2d204261636b2c203c454e5445523e2d20526566726573680d0a3e20 #1...------- Device Manager --------------------------------------------------------.... 1- Phase Monitor.. 2- Outlet Control.. 3- Power Supply Status.... - Back, - Refresh..> +0.2093031406 client 0x320d0a #2.. +0.4058711529 server 0x320a0a0d2d2d2d2d2d2d2d204f75746c657420436f6e74726f6c202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d202d2020202020202020202020202020202020202020202020204f46460d0a2020202020322d20454d43202855505329202020202020202020202020202020204f4e0d0a2020202020332d20454d43202020202020202020202020202020202020202020204f4e0d0a2020202020342d20464320537769746368202020202020202020202020202020204f4e0d0a2020202020352d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020362d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020372d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020382d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020392d202d2020202020202020202020202020202020202020202020204f46460d0a2020202031302d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031312d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031322d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031332d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031342d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031352d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031362d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031372d202d2020202020202020202020202020202020202020202020204f4e0d0a2020202031382d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031392d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032302d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032312d206261722d3032202020202020202020202020202020202020204f4e0d0a2020202032322d206261722d3032202020202020202020202020202020202020204f4e0d0a0d20202020202020205072657373203c454e5445523e20746f20636f6e74696e75652e2e2e0d2020202020202020202020202020202020202020202020202020202020202020202020200d2020202032332d206261722d3031202020202020 #2...------- Outlet Control --------------------------------------------------------.... 1- - OFF.. 2- EMC (UPS) ON.. 3- EMC ON.. 4- FC Switch ON.. 5- EqualLogic ON.. 6- EqualLogic ON.. 7- [nothing] ON.. 8- [nothing] ON.. 9- - OFF.. 10- Saturnin ON.. 11- Saturnin ON.. 12- [nothing] OFF.. 13- [nothing] OFF.. 14- bar-05 ON.. 15- bar-05 ON.. 16- bar-04 ON.. 17- - ON.. 18- bar-04 ON.. 19- bar-03 ON.. 20- bar-03 ON.. 21- bar-02 ON.. 22- bar-02 ON... Press to continue.... . 23- bar-01 +0.4591591358 client 0x0d0a #.. +0.6733131409 server 0x202020202020202020202020204f4e0d0a2020202032342d206261722d3031202020202020202020202020202020202020204f4e0d0a2020202032352d20414c4c2041636365737369626c65204f75746c6574730d0a0d0a20202020203c4553433e2d204261636b2c203c454e5445523e2d20526566726573680d0a3e200a0a0d2d2d2d2d2d2d2d204f75746c657420436f6e74726f6c202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d202d2020202020202020202020202020202020202020202020204f46460d0a2020202020322d20454d43202855505329202020202020202020202020202020204f4e0d0a2020202020332d20454d43202020202020202020202020202020202020202020204f4e0d0a2020202020342d20464320537769746368202020202020202020202020202020204f4e0d0a2020202020352d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020362d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020372d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020382d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020392d202d2020202020202020202020202020202020202020202020204f46460d0a2020202031302d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031312d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031322d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031332d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031342d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031352d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031362d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031372d202d2020202020202020202020202020202020202020202020204f4e0d0a2020202031382d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031392d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032302d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032312d206261722d3032202020202020202020202020202020202020204f4e0d0a2020202032322d # ON.. 24- bar-01 ON.. 25- ALL Accessible Outlets.... - Back, - Refresh..> ...------- Outlet Control --------------------------------------------------------.... 1- - OFF.. 2- EMC (UPS) ON.. 3- EMC ON.. 4- FC Switch ON.. 5- EqualLogic ON.. 6- EqualLogic ON.. 7- [nothing] ON.. 8- [nothing] ON.. 9- - OFF.. 10- Saturnin ON.. 11- Saturnin ON.. 12- [nothing] OFF.. 13- [nothing] OFF.. 14- bar-05 ON.. 15- bar-05 ON.. 16- bar-04 ON.. 17- - ON.. 18- bar-04 ON.. 19- bar-03 ON.. 20- bar-03 ON.. 21- bar-02 ON.. 22- +0.7261059284 client 0x0d0a #.. +0.7764570713 client 0x03 #. +0.9265871048 server 0x206261722d3032202020202020202020202020202020202020204f4e0d0a0d20202020202020205072657373203c454e5445523e20746f20636f6e74696e75652e2e2e0d2020202020202020202020202020202020202020202020202020202020202020202020200d2020202032332d206261722d3031202020202020202020202020202020202020204f4e0d0a2020202032342d206261722d3031202020202020202020202020202020202020204f4e0d0a2020202032352d20414c4c2041636365737369626c65204f75746c6574730d0a0d0a20202020203c4553433e2d204261636b2c203c454e5445523e2d20526566726573680d0a3e200a0a0d2d2d2d2d2d2d2d204f75746c657420436f6e74726f6c202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d202d2020202020202020202020202020202020202020202020204f46460d0a2020202020322d20454d43202855505329202020202020202020202020202020204f4e0d0a2020202020332d20454d43202020202020202020202020202020202020202020204f4e0d0a2020202020342d20464320537769746368202020202020202020202020202020204f4e0d0a2020202020352d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020362d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020372d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020382d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020392d202d2020202020202020202020202020202020202020202020204f46460d0a2020202031302d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031312d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031322d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031332d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031342d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031352d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031362d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031372d202d2020202020202020202020202020202020202020202020204f4e0d0a2020202031382d206261722d303420202020202020202020202020202020 # bar-02 ON... Press to continue.... . 23- bar-01 ON.. 24- bar-01 ON.. 25- ALL Accessible Outlets.... - Back, - Refresh..> ...------- Outlet Control --------------------------------------------------------.... 1- - OFF.. 2- EMC (UPS) ON.. 3- EMC ON.. 4- FC Switch ON.. 5- EqualLogic ON.. 6- EqualLogic ON.. 7- [nothing] ON.. 8- [nothing] ON.. 9- - OFF.. 10- Saturnin ON.. 11- Saturnin ON.. 12- [nothing] OFF.. 13- [nothing] OFF.. 14- bar-05 ON.. 15- bar-05 ON.. 16- bar-04 ON.. 17- - ON.. 18- bar-04 +1.1544470787 server 0x2020204f4e0d0a2020202031392d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032302d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032312d206261722d3032202020202020202020202020202020202020204f4e0d0a2020202032322d206261722d3032202020202020202020202020202020202020204f4e0d0a0d20202020202020205072657373203c454e5445523e20746f20636f6e74696e75652e2e2e0d2020202020202020202020202020202020202020202020202020202020202020202020200d2020202032332d206261722d3031202020202020202020202020202020202020204f4e0d0a2020202032342d206261722d3031202020202020202020202020202020202020204f4e0d0a2020202032352d20414c4c2041636365737369626c65204f75746c6574730d0a0d0a20202020203c4553433e2d204261636b2c203c454e5445523e2d20526566726573680d0a3e200a0a0a0d416d65726963616e20506f77657220436f6e76657273696f6e2020202020202020202020202020204e6574776f726b204d616e6167656d656e74204361726420414f5320202020202076322e372e300d0a28632920436f70797269676874203230303420416c6c2052696768747320526573657276656420205261636b205044552041505020202020202020202020202020202020202020202076322e372e330d0a2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a4e616d652020202020203a205044552d424152202020202020202020202020202020202020202020202020202020202020202020202044617465203a2030382f31312f323031340d0a436f6e746163742020203a2020202020202020202020202020202020202020202020202020202020202020202020202020202020202054696d65203a2031363a33383a33340a0d4c6f636174696f6e20203a20425251204c61622c207261636b202339202d20726573657276656420666f7220636c757374657220202055736572203a204f75746c657420557365720a0d55702054696d652020203a2033342044617973203520486f757273203131204d696e757465732020202020202020202020202020202053746174203a20502b204e2b20412b0d0a0d0a5377697463686564205261636b205044553a20436f6d6d756e69636174696f6e2045737461626c69736865640a0a0d2d2d2d2d2d2d2d20436f6e74726f6c20436f6e736f6c65202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d # ON.. 19- bar-03 ON.. 20- bar-03 ON.. 21- bar-02 ON.. 22- bar-02 ON... Press to continue.... . 23- bar-01 ON.. 24- bar-01 ON.. 25- ALL Accessible Outlets.... - Back, - Refresh..> ....American Power Conversion Network Management Card AOS v2.7.0..(c) Copyright 2004 All Rights Reserved Rack PDU APP v2.7.3..-------------------------------------------------------------------------------..Name : PDU-BAR Date : 08/11/2014..Contact : Time : 16:38:34..Location : BRQ Lab, rack #9 - reserved for cluster User : Outlet User..Up Time : 34 Days 5 Hours 11 Minutes Stat : P+ N+ A+....Switched Rack PDU: Communication Established...------- Control Console --------------- +1.2727770805 server 0x2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d20446576696365204d616e616765720d0a2020202020322d204e6574776f726b0d0a2020202020332d2053797374656d0d0a2020202020342d204c6f676f75740d0a0d0a20202020203c4553433e2d204d61696e204d656e752c203c454e5445523e2d20526566726573680d0a3e20 #----------------------------------------.... 1- Device Manager.. 2- Network.. 3- System.. 4- Logout.... - Main Menu, - Refresh..> diff --git a/tests/data/mitm-logs/apc/ssh-user/status-on.log b/tests/data/mitm-logs/apc/ssh-user/status-on.log new file mode 100644 index 000000000..b3df618b7 --- /dev/null +++ b/tests/data/mitm-logs/apc/ssh-user/status-on.log @@ -0,0 +1,12 @@ +0.0000021458 server 0x0a0a0a0d416d65726963616e20506f77657220436f6e76657273696f6e2020202020202020202020202020204e6574776f726b204d616e6167656d656e74204361726420414f5320202020202076322e372e300d0a28632920436f70797269676874203230303420416c6c2052696768747320526573657276656420205261636b205044552041505020202020202020202020202020202020202020202076322e372e330d0a2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a4e616d652020202020203a205044552d424152202020202020202020202020202020202020202020202020202020202020202020202044617465203a2030382f31312f323031340d0a436f6e746163742020203a2020202020202020202020202020202020202020202020202020202020202020202020202020202020202054696d65203a2031353a30363a35340a0d4c6f636174696f6e20203a20425251204c61622c207261636b202339202d20726573657276656420666f7220636c757374657220202055736572203a204f75746c657420557365720a0d55702054696d652020203a2033342044617973203320486f757273203339204d696e757465732020202020202020202020202020202053746174203a20502b204e2b20412b0d0a0d0a5377697463686564205261636b205044553a20436f6d6d756e69636174696f6e2045737461626c69736865640a0a0d2d2d2d2d2d2d2d20436f6e74726f6c20436f6e736f6c65202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d20446576696365204d616e616765720d0a2020202020322d204e6574776f726b0d0a2020202020332d2053797374656d0d0a2020202020342d204c6f676f75740d0a0d0a20202020203c4553433e2d204d61696e204d656e752c203c454e5445523e2d20526566726573680d0a3e20 #....American Power Conversion Network Management Card AOS v2.7.0..(c) Copyright 2004 All Rights Reserved Rack PDU APP v2.7.3..-------------------------------------------------------------------------------..Name : PDU-BAR Date : 08/11/2014..Contact : Time : 15:06:54..Location : BRQ Lab, rack #9 - reserved for cluster User : Outlet User..Up Time : 34 Days 3 Hours 39 Minutes Stat : P+ N+ A+....Switched Rack PDU: Communication Established...------- Control Console -------------------------------------------------------.... 1- Device Manager.. 2- Network.. 3- System.. 4- Logout.... - Main Menu, - Refresh..> +0.0556550026 client 0x310d0a #1.. +0.1538040638 server 0x310a0a0d2d2d2d2d2d2d2d20446576696365204d616e61676572202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d205068617365204d6f6e69746f720d0a2020202020322d204f75746c657420436f6e74726f6c0d0a2020202020332d20506f77657220537570706c79205374617475730d0a0d0a20202020203c4553433e2d204261636b2c203c454e5445523e2d20526566726573680d0a3e20 #1...------- Device Manager --------------------------------------------------------.... 1- Phase Monitor.. 2- Outlet Control.. 3- Power Supply Status.... - Back, - Refresh..> +0.2082490921 client 0x320d0a #2.. +0.4066820145 server 0x320a0a0d2d2d2d2d2d2d2d204f75746c657420436f6e74726f6c202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d202d2020202020202020202020202020202020202020202020204f4e0d0a2020202020322d20454d43202855505329202020202020202020202020202020204f4e0d0a2020202020332d20454d43202020202020202020202020202020202020202020204f4e0d0a2020202020342d20464320537769746368202020202020202020202020202020204f4e0d0a2020202020352d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020362d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020372d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020382d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020392d202d2020202020202020202020202020202020202020202020204f46460d0a2020202031302d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031312d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031322d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031332d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031342d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031352d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031362d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031372d202d2020202020202020202020202020202020202020202020204f4e0d0a2020202031382d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031392d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032302d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032312d206261722d3032202020202020202020202020202020202020204f4e0d0a2020202032322d206261722d3032202020202020202020202020202020202020204f4e0d0a0d20202020202020205072657373203c454e5445523e20746f20636f6e74696e75652e2e2e0d2020202020202020202020202020202020202020202020202020202020202020202020200d2020202032332d206261722d303120202020202020 #2...------- Outlet Control --------------------------------------------------------.... 1- - ON.. 2- EMC (UPS) ON.. 3- EMC ON.. 4- FC Switch ON.. 5- EqualLogic ON.. 6- EqualLogic ON.. 7- [nothing] ON.. 8- [nothing] ON.. 9- - OFF.. 10- Saturnin ON.. 11- Saturnin ON.. 12- [nothing] OFF.. 13- [nothing] OFF.. 14- bar-05 ON.. 15- bar-05 ON.. 16- bar-04 ON.. 17- - ON.. 18- bar-04 ON.. 19- bar-03 ON.. 20- bar-03 ON.. 21- bar-02 ON.. 22- bar-02 ON... Press to continue.... . 23- bar-01 +0.4609460831 client 0x0d0a #.. +0.6601610184 server 0x2020202020202020202020204f4e0d0a2020202032342d206261722d3031202020202020202020202020202020202020204f4e0d0a2020202032352d20414c4c2041636365737369626c65204f75746c6574730d0a0d0a20202020203c4553433e2d204261636b2c203c454e5445523e2d20526566726573680d0a3e200a0a0d2d2d2d2d2d2d2d204f75746c657420436f6e74726f6c202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d202d2020202020202020202020202020202020202020202020204f4e0d0a2020202020322d20454d43202855505329202020202020202020202020202020204f4e0d0a2020202020332d20454d43202020202020202020202020202020202020202020204f4e0d0a2020202020342d20464320537769746368202020202020202020202020202020204f4e0d0a2020202020352d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020362d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020372d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020382d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020392d202d2020202020202020202020202020202020202020202020204f46460d0a2020202031302d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031312d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031322d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031332d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031342d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031352d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031362d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031372d202d2020202020202020202020202020202020202020202020204f4e0d0a2020202031382d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031392d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032302d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032312d206261722d3032202020202020202020202020202020202020204f4e0d0a2020202032322d2062 # ON.. 24- bar-01 ON.. 25- ALL Accessible Outlets.... - Back, - Refresh..> ...------- Outlet Control --------------------------------------------------------.... 1- - ON.. 2- EMC (UPS) ON.. 3- EMC ON.. 4- FC Switch ON.. 5- EqualLogic ON.. 6- EqualLogic ON.. 7- [nothing] ON.. 8- [nothing] ON.. 9- - OFF.. 10- Saturnin ON.. 11- Saturnin ON.. 12- [nothing] OFF.. 13- [nothing] OFF.. 14- bar-05 ON.. 15- bar-05 ON.. 16- bar-04 ON.. 17- - ON.. 18- bar-04 ON.. 19- bar-03 ON.. 20- bar-03 ON.. 21- bar-02 ON.. 22- b +0.7139239311 client 0x0d0a #.. +0.7647180557 client 0x03 #. +0.9245150089 server 0x61722d3032202020202020202020202020202020202020204f4e0d0a0d20202020202020205072657373203c454e5445523e20746f20636f6e74696e75652e2e2e0d2020202020202020202020202020202020202020202020202020202020202020202020200d2020202032332d206261722d3031202020202020202020202020202020202020204f4e0d0a2020202032342d206261722d3031202020202020202020202020202020202020204f4e0d0a2020202032352d20414c4c2041636365737369626c65204f75746c6574730d0a0d0a20202020203c4553433e2d204261636b2c203c454e5445523e2d20526566726573680d0a3e200a0a0d2d2d2d2d2d2d2d204f75746c657420436f6e74726f6c202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d202d2020202020202020202020202020202020202020202020204f4e0d0a2020202020322d20454d43202855505329202020202020202020202020202020204f4e0d0a2020202020332d20454d43202020202020202020202020202020202020202020204f4e0d0a2020202020342d20464320537769746368202020202020202020202020202020204f4e0d0a2020202020352d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020362d20457175616c4c6f6769632020202020202020202020202020204f4e0d0a2020202020372d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020382d205b6e6f7468696e675d202020202020202020202020202020204f4e0d0a2020202020392d202d2020202020202020202020202020202020202020202020204f46460d0a2020202031302d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031312d2053617475726e696e20202020202020202020202020202020204f4e0d0a2020202031322d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031332d205b6e6f7468696e675d202020202020202020202020202020204f46460d0a2020202031342d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031352d206261722d3035202020202020202020202020202020202020204f4e0d0a2020202031362d206261722d3034202020202020202020202020202020202020204f4e0d0a2020202031372d202d2020202020202020202020202020202020202020202020204f4e0d0a2020202031382d206261722d303420202020202020202020202020202020202020 #ar-02 ON... Press to continue.... . 23- bar-01 ON.. 24- bar-01 ON.. 25- ALL Accessible Outlets.... - Back, - Refresh..> ...------- Outlet Control --------------------------------------------------------.... 1- - ON.. 2- EMC (UPS) ON.. 3- EMC ON.. 4- FC Switch ON.. 5- EqualLogic ON.. 6- EqualLogic ON.. 7- [nothing] ON.. 8- [nothing] ON.. 9- - OFF.. 10- Saturnin ON.. 11- Saturnin ON.. 12- [nothing] OFF.. 13- [nothing] OFF.. 14- bar-05 ON.. 15- bar-05 ON.. 16- bar-04 ON.. 17- - ON.. 18- bar-04 +1.4699161053 server 0x4f4e0d0a2020202031392d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032302d206261722d3033202020202020202020202020202020202020204f4e0d0a2020202032312d206261722d3032202020202020202020202020202020202020204f4e0d0a2020202032322d206261722d3032202020202020202020202020202020202020204f4e0d0a0d20202020202020205072657373203c454e5445523e20746f20636f6e74696e75652e2e2e0d2020202020202020202020202020202020202020202020202020202020202020202020200d2020202032332d206261722d3031202020202020202020202020202020202020204f4e0d0a2020202032342d206261722d3031202020202020202020202020202020202020204f4e0d0a2020202032352d20414c4c2041636365737369626c65204f75746c6574730d0a0d0a20202020203c4553433e2d204261636b2c203c454e5445523e2d20526566726573680d0a3e200a0a0a0d416d65726963616e20506f77657220436f6e76657273696f6e2020202020202020202020202020204e6574776f726b204d616e6167656d656e74204361726420414f5320202020202076322e372e300d0a28632920436f70797269676874203230303420416c6c2052696768747320526573657276656420205261636b205044552041505020202020202020202020202020202020202020202076322e372e330d0a2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a4e616d652020202020203a205044552d424152202020202020202020202020202020202020202020202020202020202020202020202044617465203a2030382f31312f323031340d0a436f6e746163742020203a2020202020202020202020202020202020202020202020202020202020202020202020202020202020202054696d65203a2031353a30363a35350a0d4c6f636174696f6e20203a20425251204c61622c207261636b202339202d20726573657276656420666f7220636c757374657220202055736572203a204f75746c657420557365720a0d55702054696d652020203a2033342044617973203320486f757273203339204d696e757465732020202020202020202020202020202053746174203a20502b204e2b20412b0d0a0d0a5377697463686564205261636b205044553a20436f6d6d756e69636174696f6e2045737461626c69736865640a0a0d2d2d2d2d2d2d2d20436f6e74726f6c20436f6e736f6c65202d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d #ON.. 19- bar-03 ON.. 20- bar-03 ON.. 21- bar-02 ON.. 22- bar-02 ON... Press to continue.... . 23- bar-01 ON.. 24- bar-01 ON.. 25- ALL Accessible Outlets.... - Back, - Refresh..> ....American Power Conversion Network Management Card AOS v2.7.0..(c) Copyright 2004 All Rights Reserved Rack PDU APP v2.7.3..-------------------------------------------------------------------------------..Name : PDU-BAR Date : 08/11/2014..Contact : Time : 15:06:55..Location : BRQ Lab, rack #9 - reserved for cluster User : Outlet User..Up Time : 34 Days 3 Hours 39 Minutes Stat : P+ N+ A+....Switched Rack PDU: Communication Established...------- Control Console ------------------ +1.5116031170 server 0x2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d0d0a0d0a2020202020312d20446576696365204d616e616765720d0a2020202020322d204e6574776f726b0d0a2020202020332d2053797374656d0d0a2020202020342d204c6f676f75740d0a0d0a20202020203c4553433e2d204d61696e204d656e752c203c454e5445523e2d20526566726573680d0a3e20 #-------------------------------------.... 1- Device Manager.. 2- Network.. 3- System.. 4- Logout.... - Main Menu, - Refresh..> diff --git a/tests/data/mitm-logs/docker/no-auth/already-off.log b/tests/data/mitm-logs/docker/no-auth/already-off.log new file mode 100644 index 000000000..f6ad7051e --- /dev/null +++ b/tests/data/mitm-logs/docker/no-auth/already-off.log @@ -0,0 +1,19 @@ +[ + { + "request": { + "10002": "http://fedora1:80/v1.11/containers/594388bee400fbe4d20885e08def4ba98e1b96f7c5196f586749f4ad650d5bc7/json", + "13": 3, + "64": 0, + "80": 1, + "81": 0 + }, + "response": { + "2097154": 200, + "output": "{\"ID\":\"594388bee400fbe4d20885e08def4ba98e1b96f7c5196f586749f4ad650d5bc7\",\"Created\":\"2014-05-14T08:36:21.317950112Z\",\"Path\":\"ping\",\"Args\":[\"192.168.122.1\"],\"Config\":{\"Hostname\":\"594388bee400\",\"Domainname\":\"\",\"User\":\"\",\"Memory\":0,\"MemorySwap\":0,\"CpuShares\":0,\"Cpuset\":\"\",\"AttachStdin\":false,\"AttachStdout\":true,\"AttachStderr\":true,\"PortSpecs\":null,\"ExposedPorts\":null,\"Tty\":false,\"OpenStdin\":false,\"StdinOnce\":false,\"Env\":[\"HOME=/\",\"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\"],\"Cmd\":[\"ping\",\"192.168.122.1\"],\"Image\":\"fedora:20\",\"Volumes\":null,\"WorkingDir\":\"\",\"Entrypoint\":null,\"NetworkDisabled\":false,\"OnBuild\":null},\"State\":{\"Running\":false,\"Paused\":false,\"Pid\":0,\"ExitCode\":-1,\"StartedAt\":\"2014-10-16T12:55:11.058107967Z\",\"FinishedAt\":\"2014-10-16T12:55:19.555035484Z\"},\"Image\":\"105182bb5e8bed742e4063e9486afa5f51328fc007e74f6c9f29cd1f75971357\",\"NetworkSettings\":{\"IPAddress\":\"\",\"IPPrefixLen\":0,\"Gateway\":\"\",\"Bridge\":\"\",\"PortMapping\":null,\"Ports\":null},\"ResolvConfPath\":\"/etc/resolv.conf\",\"HostnamePath\":\"/var/lib/docker/containers/594388bee400fbe4d20885e08def4ba98e1b96f7c5196f586749f4ad650d5bc7/hostname\",\"HostsPath\":\"/var/lib/docker/containers/594388bee400fbe4d20885e08def4ba98e1b96f7c5196f586749f4ad650d5bc7/hosts\",\"Name\":\"/cocky_poincare\",\"Driver\":\"devicemapper\",\"ExecDriver\":\"native-0.1\",\"MountLabel\":\"\",\"ProcessLabel\":\"\",\"Volumes\":{},\"VolumesRW\":{},\"HostConfig\":{\"Binds\":null,\"ContainerIDFile\":\"\",\"LxcConf\":null,\"Privileged\":false,\"PortBindings\":null,\"Links\":null,\"PublishAllPorts\":false,\"Dns\":null,\"DnsSearch\":null,\"VolumesFrom\":null,\"NetworkMode\":\"\"}}" + }, + "time": { + "perform_duration": 0.005480051040649414, + "time_from_last_request": 0.0 + } + } +] \ No newline at end of file diff --git a/tests/data/mitm-logs/docker/no-auth/already-on.log b/tests/data/mitm-logs/docker/no-auth/already-on.log new file mode 100644 index 000000000..2911a7e86 --- /dev/null +++ b/tests/data/mitm-logs/docker/no-auth/already-on.log @@ -0,0 +1,19 @@ +[ + { + "request": { + "10002": "http://fedora1:80/v1.11/containers/594388bee400fbe4d20885e08def4ba98e1b96f7c5196f586749f4ad650d5bc7/json", + "13": 3, + "64": 0, + "80": 1, + "81": 0 + }, + "response": { + "2097154": 200, + "output": "{\"ID\":\"594388bee400fbe4d20885e08def4ba98e1b96f7c5196f586749f4ad650d5bc7\",\"Created\":\"2014-05-14T08:36:21.317950112Z\",\"Path\":\"ping\",\"Args\":[\"192.168.122.1\"],\"Config\":{\"Hostname\":\"594388bee400\",\"Domainname\":\"\",\"User\":\"\",\"Memory\":0,\"MemorySwap\":0,\"CpuShares\":0,\"Cpuset\":\"\",\"AttachStdin\":false,\"AttachStdout\":true,\"AttachStderr\":true,\"PortSpecs\":null,\"ExposedPorts\":null,\"Tty\":false,\"OpenStdin\":false,\"StdinOnce\":false,\"Env\":[\"HOME=/\",\"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\"],\"Cmd\":[\"ping\",\"192.168.122.1\"],\"Image\":\"fedora:20\",\"Volumes\":null,\"WorkingDir\":\"\",\"Entrypoint\":null,\"NetworkDisabled\":false,\"OnBuild\":null},\"State\":{\"Running\":true,\"Paused\":false,\"Pid\":759,\"ExitCode\":0,\"StartedAt\":\"2014-10-16T12:54:24.655481895Z\",\"FinishedAt\":\"2014-10-14T14:38:09.451955433Z\"},\"Image\":\"105182bb5e8bed742e4063e9486afa5f51328fc007e74f6c9f29cd1f75971357\",\"NetworkSettings\":{\"IPAddress\":\"172.17.0.2\",\"IPPrefixLen\":16,\"Gateway\":\"172.17.42.1\",\"Bridge\":\"docker0\",\"PortMapping\":null,\"Ports\":{}},\"ResolvConfPath\":\"/etc/resolv.conf\",\"HostnamePath\":\"/var/lib/docker/containers/594388bee400fbe4d20885e08def4ba98e1b96f7c5196f586749f4ad650d5bc7/hostname\",\"HostsPath\":\"/var/lib/docker/containers/594388bee400fbe4d20885e08def4ba98e1b96f7c5196f586749f4ad650d5bc7/hosts\",\"Name\":\"/cocky_poincare\",\"Driver\":\"devicemapper\",\"ExecDriver\":\"native-0.1\",\"MountLabel\":\"\",\"ProcessLabel\":\"\",\"Volumes\":{},\"VolumesRW\":{},\"HostConfig\":{\"Binds\":null,\"ContainerIDFile\":\"\",\"LxcConf\":null,\"Privileged\":false,\"PortBindings\":null,\"Links\":null,\"PublishAllPorts\":false,\"Dns\":null,\"DnsSearch\":null,\"VolumesFrom\":null,\"NetworkMode\":\"\"}}" + }, + "time": { + "perform_duration": 0.006002902984619141, + "time_from_last_request": 0.0 + } + } +] \ No newline at end of file diff --git a/tests/data/mitm-logs/docker/no-auth/list.log b/tests/data/mitm-logs/docker/no-auth/list.log new file mode 100644 index 000000000..5967d03c2 --- /dev/null +++ b/tests/data/mitm-logs/docker/no-auth/list.log @@ -0,0 +1,19 @@ +[ + { + "request": { + "10002": "http://fedora1:80/v1.11/containers/json?all=1", + "13": 3, + "64": 0, + "80": 1, + "81": 0 + }, + "response": { + "2097154": 200, + "output": "[{\"Command\":\"ping 192.168.122.1\",\"Created\":1400056581,\"Id\":\"594388bee400fbe4d20885e08def4ba98e1b96f7c5196f586749f4ad650d5bc7\",\"Image\":\"fedora:20\",\"Names\":[\"/cocky_poincare\"],\"Ports\":[],\"Status\":\"Exited (-1) 46 hours ago\"}\n,{\"Command\":\"ping host\",\"Created\":1400056433,\"Id\":\"3e8559dc2b09819d3a48757333db98bf275d5ebfaa3d259a8559c3ed2947c426\",\"Image\":\"fedora:20\",\"Names\":[\"/sharp_turing\"],\"Ports\":[],\"Status\":\"Exited (2) 5 months ago\"}\n,{\"Command\":\"/bin/bash\",\"Created\":1398324218,\"Id\":\"ca18a15ef368d43f1e4756b042ee1d61b67b6d0276fd2bc3436416abc2883d4b\",\"Image\":\"fedora:20\",\"Names\":[\"/sick_lumiere\"],\"Ports\":[],\"Status\":\"Exited (0) 5 months ago\"}\n]" + }, + "time": { + "perform_duration": 0.006206989288330078, + "time_from_last_request": 0.0 + } + } +] \ No newline at end of file diff --git a/tests/data/mitm-logs/docker/no-auth/off.log b/tests/data/mitm-logs/docker/no-auth/off.log new file mode 100644 index 000000000..0bc88ec07 --- /dev/null +++ b/tests/data/mitm-logs/docker/no-auth/off.log @@ -0,0 +1,55 @@ +[ + { + "request": { + "10002": "http://fedora1:80/v1.11/containers/594388bee400fbe4d20885e08def4ba98e1b96f7c5196f586749f4ad650d5bc7/json", + "13": 3, + "64": 0, + "80": 1, + "81": 0 + }, + "response": { + "2097154": 200, + "output": "{\"ID\":\"594388bee400fbe4d20885e08def4ba98e1b96f7c5196f586749f4ad650d5bc7\",\"Created\":\"2014-05-14T08:36:21.317950112Z\",\"Path\":\"ping\",\"Args\":[\"192.168.122.1\"],\"Config\":{\"Hostname\":\"594388bee400\",\"Domainname\":\"\",\"User\":\"\",\"Memory\":0,\"MemorySwap\":0,\"CpuShares\":0,\"Cpuset\":\"\",\"AttachStdin\":false,\"AttachStdout\":true,\"AttachStderr\":true,\"PortSpecs\":null,\"ExposedPorts\":null,\"Tty\":false,\"OpenStdin\":false,\"StdinOnce\":false,\"Env\":[\"HOME=/\",\"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\"],\"Cmd\":[\"ping\",\"192.168.122.1\"],\"Image\":\"fedora:20\",\"Volumes\":null,\"WorkingDir\":\"\",\"Entrypoint\":null,\"NetworkDisabled\":false,\"OnBuild\":null},\"State\":{\"Running\":true,\"Paused\":false,\"Pid\":782,\"ExitCode\":0,\"StartedAt\":\"2014-10-16T12:55:11.058107967Z\",\"FinishedAt\":\"2014-10-16T12:55:10.76558189Z\"},\"Image\":\"105182bb5e8bed742e4063e9486afa5f51328fc007e74f6c9f29cd1f75971357\",\"NetworkSettings\":{\"IPAddress\":\"172.17.0.3\",\"IPPrefixLen\":16,\"Gateway\":\"172.17.42.1\",\"Bridge\":\"docker0\",\"PortMapping\":null,\"Ports\":{}},\"ResolvConfPath\":\"/etc/resolv.conf\",\"HostnamePath\":\"/var/lib/docker/containers/594388bee400fbe4d20885e08def4ba98e1b96f7c5196f586749f4ad650d5bc7/hostname\",\"HostsPath\":\"/var/lib/docker/containers/594388bee400fbe4d20885e08def4ba98e1b96f7c5196f586749f4ad650d5bc7/hosts\",\"Name\":\"/cocky_poincare\",\"Driver\":\"devicemapper\",\"ExecDriver\":\"native-0.1\",\"MountLabel\":\"\",\"ProcessLabel\":\"\",\"Volumes\":{},\"VolumesRW\":{},\"HostConfig\":{\"Binds\":null,\"ContainerIDFile\":\"\",\"LxcConf\":null,\"Privileged\":false,\"PortBindings\":null,\"Links\":null,\"PublishAllPorts\":false,\"Dns\":null,\"DnsSearch\":null,\"VolumesFrom\":null,\"NetworkMode\":\"\"}}" + }, + "time": { + "perform_duration": 0.00534510612487793, + "time_from_last_request": 0.0 + } + }, + { + "request": { + "10002": "http://fedora1:80/v1.11/containers/594388bee400fbe4d20885e08def4ba98e1b96f7c5196f586749f4ad650d5bc7/kill", + "13": 3, + "30120": 0, + "47": 1, + "64": 0, + "80": 1, + "81": 0 + }, + "response": { + "2097154": 204, + "output": "" + }, + "time": { + "perform_duration": 0.008481025695800781, + "time_from_last_request": 0.0004138946533203125 + } + }, + { + "request": { + "10002": "http://fedora1:80/v1.11/containers/594388bee400fbe4d20885e08def4ba98e1b96f7c5196f586749f4ad650d5bc7/json", + "13": 3, + "64": 0, + "80": 1, + "81": 0 + }, + "response": { + "2097154": 200, + "output": "{\"ID\":\"594388bee400fbe4d20885e08def4ba98e1b96f7c5196f586749f4ad650d5bc7\",\"Created\":\"2014-05-14T08:36:21.317950112Z\",\"Path\":\"ping\",\"Args\":[\"192.168.122.1\"],\"Config\":{\"Hostname\":\"594388bee400\",\"Domainname\":\"\",\"User\":\"\",\"Memory\":0,\"MemorySwap\":0,\"CpuShares\":0,\"Cpuset\":\"\",\"AttachStdin\":false,\"AttachStdout\":true,\"AttachStderr\":true,\"PortSpecs\":null,\"ExposedPorts\":null,\"Tty\":false,\"OpenStdin\":false,\"StdinOnce\":false,\"Env\":[\"HOME=/\",\"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\"],\"Cmd\":[\"ping\",\"192.168.122.1\"],\"Image\":\"fedora:20\",\"Volumes\":null,\"WorkingDir\":\"\",\"Entrypoint\":null,\"NetworkDisabled\":false,\"OnBuild\":null},\"State\":{\"Running\":false,\"Paused\":false,\"Pid\":0,\"ExitCode\":-1,\"StartedAt\":\"2014-10-16T12:55:11.058107967Z\",\"FinishedAt\":\"2014-10-16T12:55:19.555035484Z\"},\"Image\":\"105182bb5e8bed742e4063e9486afa5f51328fc007e74f6c9f29cd1f75971357\",\"NetworkSettings\":{\"IPAddress\":\"\",\"IPPrefixLen\":0,\"Gateway\":\"\",\"Bridge\":\"\",\"PortMapping\":null,\"Ports\":null},\"ResolvConfPath\":\"/etc/resolv.conf\",\"HostnamePath\":\"/var/lib/docker/containers/594388bee400fbe4d20885e08def4ba98e1b96f7c5196f586749f4ad650d5bc7/hostname\",\"HostsPath\":\"/var/lib/docker/containers/594388bee400fbe4d20885e08def4ba98e1b96f7c5196f586749f4ad650d5bc7/hosts\",\"Name\":\"/cocky_poincare\",\"Driver\":\"devicemapper\",\"ExecDriver\":\"native-0.1\",\"MountLabel\":\"\",\"ProcessLabel\":\"\",\"Volumes\":{},\"VolumesRW\":{},\"HostConfig\":{\"Binds\":null,\"ContainerIDFile\":\"\",\"LxcConf\":null,\"Privileged\":false,\"PortBindings\":null,\"Links\":null,\"PublishAllPorts\":false,\"Dns\":null,\"DnsSearch\":null,\"VolumesFrom\":null,\"NetworkMode\":\"\"}}" + }, + "time": { + "perform_duration": 0.005722999572753906, + "time_from_last_request": 0.00035500526428222656 + } + } +] \ No newline at end of file diff --git a/tests/data/mitm-logs/docker/no-auth/on.log b/tests/data/mitm-logs/docker/no-auth/on.log new file mode 100644 index 000000000..eabddee2f --- /dev/null +++ b/tests/data/mitm-logs/docker/no-auth/on.log @@ -0,0 +1,55 @@ +[ + { + "request": { + "10002": "http://fedora1:80/v1.11/containers/594388bee400fbe4d20885e08def4ba98e1b96f7c5196f586749f4ad650d5bc7/json", + "13": 3, + "64": 0, + "80": 1, + "81": 0 + }, + "response": { + "2097154": 200, + "output": "{\"ID\":\"594388bee400fbe4d20885e08def4ba98e1b96f7c5196f586749f4ad650d5bc7\",\"Created\":\"2014-05-14T08:36:21.317950112Z\",\"Path\":\"ping\",\"Args\":[\"192.168.122.1\"],\"Config\":{\"Hostname\":\"594388bee400\",\"Domainname\":\"\",\"User\":\"\",\"Memory\":0,\"MemorySwap\":0,\"CpuShares\":0,\"Cpuset\":\"\",\"AttachStdin\":false,\"AttachStdout\":true,\"AttachStderr\":true,\"PortSpecs\":null,\"ExposedPorts\":null,\"Tty\":false,\"OpenStdin\":false,\"StdinOnce\":false,\"Env\":[\"HOME=/\",\"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\"],\"Cmd\":[\"ping\",\"192.168.122.1\"],\"Image\":\"fedora:20\",\"Volumes\":null,\"WorkingDir\":\"\",\"Entrypoint\":null,\"NetworkDisabled\":false,\"OnBuild\":null},\"State\":{\"Running\":false,\"Paused\":false,\"Pid\":0,\"ExitCode\":-1,\"StartedAt\":\"2014-10-14T13:23:17.322432299Z\",\"FinishedAt\":\"2014-10-14T14:38:09.451955433Z\"},\"Image\":\"105182bb5e8bed742e4063e9486afa5f51328fc007e74f6c9f29cd1f75971357\",\"NetworkSettings\":{\"IPAddress\":\"\",\"IPPrefixLen\":0,\"Gateway\":\"\",\"Bridge\":\"\",\"PortMapping\":null,\"Ports\":null},\"ResolvConfPath\":\"/etc/resolv.conf\",\"HostnamePath\":\"/var/lib/docker/containers/594388bee400fbe4d20885e08def4ba98e1b96f7c5196f586749f4ad650d5bc7/hostname\",\"HostsPath\":\"/var/lib/docker/containers/594388bee400fbe4d20885e08def4ba98e1b96f7c5196f586749f4ad650d5bc7/hosts\",\"Name\":\"/cocky_poincare\",\"Driver\":\"devicemapper\",\"ExecDriver\":\"native-0.1\",\"MountLabel\":\"\",\"ProcessLabel\":\"\",\"Volumes\":{},\"VolumesRW\":{},\"HostConfig\":{\"Binds\":null,\"ContainerIDFile\":\"\",\"LxcConf\":null,\"Privileged\":false,\"PortBindings\":null,\"Links\":null,\"PublishAllPorts\":false,\"Dns\":null,\"DnsSearch\":null,\"VolumesFrom\":null,\"NetworkMode\":\"\"}}" + }, + "time": { + "perform_duration": 0.0062007904052734375, + "time_from_last_request": 0.0 + } + }, + { + "request": { + "10002": "http://fedora1:80/v1.11/containers/594388bee400fbe4d20885e08def4ba98e1b96f7c5196f586749f4ad650d5bc7/start", + "13": 3, + "30120": 0, + "47": 1, + "64": 0, + "80": 1, + "81": 0 + }, + "response": { + "2097154": 204, + "output": "" + }, + "time": { + "perform_duration": 0.10239195823669434, + "time_from_last_request": 0.0005431175231933594 + } + }, + { + "request": { + "10002": "http://fedora1:80/v1.11/containers/594388bee400fbe4d20885e08def4ba98e1b96f7c5196f586749f4ad650d5bc7/json", + "13": 3, + "64": 0, + "80": 1, + "81": 0 + }, + "response": { + "2097154": 200, + "output": "{\"ID\":\"594388bee400fbe4d20885e08def4ba98e1b96f7c5196f586749f4ad650d5bc7\",\"Created\":\"2014-05-14T08:36:21.317950112Z\",\"Path\":\"ping\",\"Args\":[\"192.168.122.1\"],\"Config\":{\"Hostname\":\"594388bee400\",\"Domainname\":\"\",\"User\":\"\",\"Memory\":0,\"MemorySwap\":0,\"CpuShares\":0,\"Cpuset\":\"\",\"AttachStdin\":false,\"AttachStdout\":true,\"AttachStderr\":true,\"PortSpecs\":null,\"ExposedPorts\":null,\"Tty\":false,\"OpenStdin\":false,\"StdinOnce\":false,\"Env\":[\"HOME=/\",\"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\"],\"Cmd\":[\"ping\",\"192.168.122.1\"],\"Image\":\"fedora:20\",\"Volumes\":null,\"WorkingDir\":\"\",\"Entrypoint\":null,\"NetworkDisabled\":false,\"OnBuild\":null},\"State\":{\"Running\":true,\"Paused\":false,\"Pid\":759,\"ExitCode\":0,\"StartedAt\":\"2014-10-16T12:54:24.655481895Z\",\"FinishedAt\":\"2014-10-14T14:38:09.451955433Z\"},\"Image\":\"105182bb5e8bed742e4063e9486afa5f51328fc007e74f6c9f29cd1f75971357\",\"NetworkSettings\":{\"IPAddress\":\"172.17.0.2\",\"IPPrefixLen\":16,\"Gateway\":\"172.17.42.1\",\"Bridge\":\"docker0\",\"PortMapping\":null,\"Ports\":{}},\"ResolvConfPath\":\"/etc/resolv.conf\",\"HostnamePath\":\"/var/lib/docker/containers/594388bee400fbe4d20885e08def4ba98e1b96f7c5196f586749f4ad650d5bc7/hostname\",\"HostsPath\":\"/var/lib/docker/containers/594388bee400fbe4d20885e08def4ba98e1b96f7c5196f586749f4ad650d5bc7/hosts\",\"Name\":\"/cocky_poincare\",\"Driver\":\"devicemapper\",\"ExecDriver\":\"native-0.1\",\"MountLabel\":\"\",\"ProcessLabel\":\"\",\"Volumes\":{},\"VolumesRW\":{},\"HostConfig\":{\"Binds\":null,\"ContainerIDFile\":\"\",\"LxcConf\":null,\"Privileged\":false,\"PortBindings\":null,\"Links\":null,\"PublishAllPorts\":false,\"Dns\":null,\"DnsSearch\":null,\"VolumesFrom\":null,\"NetworkMode\":\"\"}}" + }, + "time": { + "perform_duration": 0.005280017852783203, + "time_from_last_request": 0.0004200935363769531 + } + } +] \ No newline at end of file diff --git a/tests/data/mitm-logs/docker/no-auth/reboot.log b/tests/data/mitm-logs/docker/no-auth/reboot.log new file mode 100644 index 000000000..272ead633 --- /dev/null +++ b/tests/data/mitm-logs/docker/no-auth/reboot.log @@ -0,0 +1,91 @@ +[ + { + "request": { + "10002": "http://fedora1:80/v1.11/containers/594388bee400fbe4d20885e08def4ba98e1b96f7c5196f586749f4ad650d5bc7/json", + "13": 3, + "64": 0, + "80": 1, + "81": 0 + }, + "response": { + "2097154": 200, + "output": "{\"ID\":\"594388bee400fbe4d20885e08def4ba98e1b96f7c5196f586749f4ad650d5bc7\",\"Created\":\"2014-05-14T08:36:21.317950112Z\",\"Path\":\"ping\",\"Args\":[\"192.168.122.1\"],\"Config\":{\"Hostname\":\"594388bee400\",\"Domainname\":\"\",\"User\":\"\",\"Memory\":0,\"MemorySwap\":0,\"CpuShares\":0,\"Cpuset\":\"\",\"AttachStdin\":false,\"AttachStdout\":true,\"AttachStderr\":true,\"PortSpecs\":null,\"ExposedPorts\":null,\"Tty\":false,\"OpenStdin\":false,\"StdinOnce\":false,\"Env\":[\"HOME=/\",\"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\"],\"Cmd\":[\"ping\",\"192.168.122.1\"],\"Image\":\"fedora:20\",\"Volumes\":null,\"WorkingDir\":\"\",\"Entrypoint\":null,\"NetworkDisabled\":false,\"OnBuild\":null},\"State\":{\"Running\":true,\"Paused\":false,\"Pid\":759,\"ExitCode\":0,\"StartedAt\":\"2014-10-16T12:54:24.655481895Z\",\"FinishedAt\":\"2014-10-14T14:38:09.451955433Z\"},\"Image\":\"105182bb5e8bed742e4063e9486afa5f51328fc007e74f6c9f29cd1f75971357\",\"NetworkSettings\":{\"IPAddress\":\"172.17.0.2\",\"IPPrefixLen\":16,\"Gateway\":\"172.17.42.1\",\"Bridge\":\"docker0\",\"PortMapping\":null,\"Ports\":{}},\"ResolvConfPath\":\"/etc/resolv.conf\",\"HostnamePath\":\"/var/lib/docker/containers/594388bee400fbe4d20885e08def4ba98e1b96f7c5196f586749f4ad650d5bc7/hostname\",\"HostsPath\":\"/var/lib/docker/containers/594388bee400fbe4d20885e08def4ba98e1b96f7c5196f586749f4ad650d5bc7/hosts\",\"Name\":\"/cocky_poincare\",\"Driver\":\"devicemapper\",\"ExecDriver\":\"native-0.1\",\"MountLabel\":\"\",\"ProcessLabel\":\"\",\"Volumes\":{},\"VolumesRW\":{},\"HostConfig\":{\"Binds\":null,\"ContainerIDFile\":\"\",\"LxcConf\":null,\"Privileged\":false,\"PortBindings\":null,\"Links\":null,\"PublishAllPorts\":false,\"Dns\":null,\"DnsSearch\":null,\"VolumesFrom\":null,\"NetworkMode\":\"\"}}" + }, + "time": { + "perform_duration": 0.005760908126831055, + "time_from_last_request": 0.0 + } + }, + { + "request": { + "10002": "http://fedora1:80/v1.11/containers/594388bee400fbe4d20885e08def4ba98e1b96f7c5196f586749f4ad650d5bc7/kill", + "13": 3, + "30120": 0, + "47": 1, + "64": 0, + "80": 1, + "81": 0 + }, + "response": { + "2097154": 204, + "output": "" + }, + "time": { + "perform_duration": 0.010181188583374023, + "time_from_last_request": 0.00043892860412597656 + } + }, + { + "request": { + "10002": "http://fedora1:80/v1.11/containers/594388bee400fbe4d20885e08def4ba98e1b96f7c5196f586749f4ad650d5bc7/json", + "13": 3, + "64": 0, + "80": 1, + "81": 0 + }, + "response": { + "2097154": 200, + "output": "{\"ID\":\"594388bee400fbe4d20885e08def4ba98e1b96f7c5196f586749f4ad650d5bc7\",\"Created\":\"2014-05-14T08:36:21.317950112Z\",\"Path\":\"ping\",\"Args\":[\"192.168.122.1\"],\"Config\":{\"Hostname\":\"594388bee400\",\"Domainname\":\"\",\"User\":\"\",\"Memory\":0,\"MemorySwap\":0,\"CpuShares\":0,\"Cpuset\":\"\",\"AttachStdin\":false,\"AttachStdout\":true,\"AttachStderr\":true,\"PortSpecs\":null,\"ExposedPorts\":null,\"Tty\":false,\"OpenStdin\":false,\"StdinOnce\":false,\"Env\":[\"HOME=/\",\"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\"],\"Cmd\":[\"ping\",\"192.168.122.1\"],\"Image\":\"fedora:20\",\"Volumes\":null,\"WorkingDir\":\"\",\"Entrypoint\":null,\"NetworkDisabled\":false,\"OnBuild\":null},\"State\":{\"Running\":false,\"Paused\":false,\"Pid\":0,\"ExitCode\":-1,\"StartedAt\":\"2014-10-16T12:54:24.655481895Z\",\"FinishedAt\":\"2014-10-16T12:55:10.76558189Z\"},\"Image\":\"105182bb5e8bed742e4063e9486afa5f51328fc007e74f6c9f29cd1f75971357\",\"NetworkSettings\":{\"IPAddress\":\"\",\"IPPrefixLen\":0,\"Gateway\":\"\",\"Bridge\":\"\",\"PortMapping\":null,\"Ports\":null},\"ResolvConfPath\":\"/etc/resolv.conf\",\"HostnamePath\":\"/var/lib/docker/containers/594388bee400fbe4d20885e08def4ba98e1b96f7c5196f586749f4ad650d5bc7/hostname\",\"HostsPath\":\"/var/lib/docker/containers/594388bee400fbe4d20885e08def4ba98e1b96f7c5196f586749f4ad650d5bc7/hosts\",\"Name\":\"/cocky_poincare\",\"Driver\":\"devicemapper\",\"ExecDriver\":\"native-0.1\",\"MountLabel\":\"\",\"ProcessLabel\":\"\",\"Volumes\":{},\"VolumesRW\":{},\"HostConfig\":{\"Binds\":null,\"ContainerIDFile\":\"\",\"LxcConf\":null,\"Privileged\":false,\"PortBindings\":null,\"Links\":null,\"PublishAllPorts\":false,\"Dns\":null,\"DnsSearch\":null,\"VolumesFrom\":null,\"NetworkMode\":\"\"}}" + }, + "time": { + "perform_duration": 0.0070002079010009766, + "time_from_last_request": 0.0004317760467529297 + } + }, + { + "request": { + "10002": "http://fedora1:80/v1.11/containers/594388bee400fbe4d20885e08def4ba98e1b96f7c5196f586749f4ad650d5bc7/start", + "13": 3, + "30120": 0, + "47": 1, + "64": 0, + "80": 1, + "81": 0 + }, + "response": { + "2097154": 204, + "output": "" + }, + "time": { + "perform_duration": 0.2847788333892822, + "time_from_last_request": 0.000514984130859375 + } + }, + { + "request": { + "10002": "http://fedora1:80/v1.11/containers/594388bee400fbe4d20885e08def4ba98e1b96f7c5196f586749f4ad650d5bc7/json", + "13": 3, + "64": 0, + "80": 1, + "81": 0 + }, + "response": { + "2097154": 200, + "output": "{\"ID\":\"594388bee400fbe4d20885e08def4ba98e1b96f7c5196f586749f4ad650d5bc7\",\"Created\":\"2014-05-14T08:36:21.317950112Z\",\"Path\":\"ping\",\"Args\":[\"192.168.122.1\"],\"Config\":{\"Hostname\":\"594388bee400\",\"Domainname\":\"\",\"User\":\"\",\"Memory\":0,\"MemorySwap\":0,\"CpuShares\":0,\"Cpuset\":\"\",\"AttachStdin\":false,\"AttachStdout\":true,\"AttachStderr\":true,\"PortSpecs\":null,\"ExposedPorts\":null,\"Tty\":false,\"OpenStdin\":false,\"StdinOnce\":false,\"Env\":[\"HOME=/\",\"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\"],\"Cmd\":[\"ping\",\"192.168.122.1\"],\"Image\":\"fedora:20\",\"Volumes\":null,\"WorkingDir\":\"\",\"Entrypoint\":null,\"NetworkDisabled\":false,\"OnBuild\":null},\"State\":{\"Running\":true,\"Paused\":false,\"Pid\":782,\"ExitCode\":0,\"StartedAt\":\"2014-10-16T12:55:11.058107967Z\",\"FinishedAt\":\"2014-10-16T12:55:10.76558189Z\"},\"Image\":\"105182bb5e8bed742e4063e9486afa5f51328fc007e74f6c9f29cd1f75971357\",\"NetworkSettings\":{\"IPAddress\":\"172.17.0.3\",\"IPPrefixLen\":16,\"Gateway\":\"172.17.42.1\",\"Bridge\":\"docker0\",\"PortMapping\":null,\"Ports\":{}},\"ResolvConfPath\":\"/etc/resolv.conf\",\"HostnamePath\":\"/var/lib/docker/containers/594388bee400fbe4d20885e08def4ba98e1b96f7c5196f586749f4ad650d5bc7/hostname\",\"HostsPath\":\"/var/lib/docker/containers/594388bee400fbe4d20885e08def4ba98e1b96f7c5196f586749f4ad650d5bc7/hosts\",\"Name\":\"/cocky_poincare\",\"Driver\":\"devicemapper\",\"ExecDriver\":\"native-0.1\",\"MountLabel\":\"\",\"ProcessLabel\":\"\",\"Volumes\":{},\"VolumesRW\":{},\"HostConfig\":{\"Binds\":null,\"ContainerIDFile\":\"\",\"LxcConf\":null,\"Privileged\":false,\"PortBindings\":null,\"Links\":null,\"PublishAllPorts\":false,\"Dns\":null,\"DnsSearch\":null,\"VolumesFrom\":null,\"NetworkMode\":\"\"}}" + }, + "time": { + "perform_duration": 0.005919933319091797, + "time_from_last_request": 0.00048804283142089844 + } + } +] \ No newline at end of file diff --git a/tests/data/mitm-logs/docker/no-auth/status-off.log b/tests/data/mitm-logs/docker/no-auth/status-off.log new file mode 100644 index 000000000..7441bbf7d --- /dev/null +++ b/tests/data/mitm-logs/docker/no-auth/status-off.log @@ -0,0 +1,19 @@ +[ + { + "request": { + "10002": "http://fedora1:80/v1.11/containers/594388bee400fbe4d20885e08def4ba98e1b96f7c5196f586749f4ad650d5bc7/json", + "13": 3, + "64": 0, + "80": 1, + "81": 0 + }, + "response": { + "2097154": 200, + "output": "{\"ID\":\"594388bee400fbe4d20885e08def4ba98e1b96f7c5196f586749f4ad650d5bc7\",\"Created\":\"2014-05-14T08:36:21.317950112Z\",\"Path\":\"ping\",\"Args\":[\"192.168.122.1\"],\"Config\":{\"Hostname\":\"594388bee400\",\"Domainname\":\"\",\"User\":\"\",\"Memory\":0,\"MemorySwap\":0,\"CpuShares\":0,\"Cpuset\":\"\",\"AttachStdin\":false,\"AttachStdout\":true,\"AttachStderr\":true,\"PortSpecs\":null,\"ExposedPorts\":null,\"Tty\":false,\"OpenStdin\":false,\"StdinOnce\":false,\"Env\":[\"HOME=/\",\"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\"],\"Cmd\":[\"ping\",\"192.168.122.1\"],\"Image\":\"fedora:20\",\"Volumes\":null,\"WorkingDir\":\"\",\"Entrypoint\":null,\"NetworkDisabled\":false,\"OnBuild\":null},\"State\":{\"Running\":false,\"Paused\":false,\"Pid\":0,\"ExitCode\":-1,\"StartedAt\":\"2014-10-14T13:23:17.322432299Z\",\"FinishedAt\":\"2014-10-14T14:38:09.451955433Z\"},\"Image\":\"105182bb5e8bed742e4063e9486afa5f51328fc007e74f6c9f29cd1f75971357\",\"NetworkSettings\":{\"IPAddress\":\"\",\"IPPrefixLen\":0,\"Gateway\":\"\",\"Bridge\":\"\",\"PortMapping\":null,\"Ports\":null},\"ResolvConfPath\":\"/etc/resolv.conf\",\"HostnamePath\":\"/var/lib/docker/containers/594388bee400fbe4d20885e08def4ba98e1b96f7c5196f586749f4ad650d5bc7/hostname\",\"HostsPath\":\"/var/lib/docker/containers/594388bee400fbe4d20885e08def4ba98e1b96f7c5196f586749f4ad650d5bc7/hosts\",\"Name\":\"/cocky_poincare\",\"Driver\":\"devicemapper\",\"ExecDriver\":\"native-0.1\",\"MountLabel\":\"\",\"ProcessLabel\":\"\",\"Volumes\":{},\"VolumesRW\":{},\"HostConfig\":{\"Binds\":null,\"ContainerIDFile\":\"\",\"LxcConf\":null,\"Privileged\":false,\"PortBindings\":null,\"Links\":null,\"PublishAllPorts\":false,\"Dns\":null,\"DnsSearch\":null,\"VolumesFrom\":null,\"NetworkMode\":\"\"}}" + }, + "time": { + "perform_duration": 0.005589962005615234, + "time_from_last_request": 0.0 + } + } +] \ No newline at end of file diff --git a/tests/data/mitm-logs/docker/no-auth/status-on.log b/tests/data/mitm-logs/docker/no-auth/status-on.log new file mode 100644 index 000000000..9ba4ecd51 --- /dev/null +++ b/tests/data/mitm-logs/docker/no-auth/status-on.log @@ -0,0 +1,19 @@ +[ + { + "request": { + "10002": "http://fedora1:80/v1.11/containers/594388bee400fbe4d20885e08def4ba98e1b96f7c5196f586749f4ad650d5bc7/json", + "13": 3, + "64": 0, + "80": 1, + "81": 0 + }, + "response": { + "2097154": 200, + "output": "{\"ID\":\"594388bee400fbe4d20885e08def4ba98e1b96f7c5196f586749f4ad650d5bc7\",\"Created\":\"2014-05-14T08:36:21.317950112Z\",\"Path\":\"ping\",\"Args\":[\"192.168.122.1\"],\"Config\":{\"Hostname\":\"594388bee400\",\"Domainname\":\"\",\"User\":\"\",\"Memory\":0,\"MemorySwap\":0,\"CpuShares\":0,\"Cpuset\":\"\",\"AttachStdin\":false,\"AttachStdout\":true,\"AttachStderr\":true,\"PortSpecs\":null,\"ExposedPorts\":null,\"Tty\":false,\"OpenStdin\":false,\"StdinOnce\":false,\"Env\":[\"HOME=/\",\"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\"],\"Cmd\":[\"ping\",\"192.168.122.1\"],\"Image\":\"fedora:20\",\"Volumes\":null,\"WorkingDir\":\"\",\"Entrypoint\":null,\"NetworkDisabled\":false,\"OnBuild\":null},\"State\":{\"Running\":true,\"Paused\":false,\"Pid\":759,\"ExitCode\":0,\"StartedAt\":\"2014-10-16T12:54:24.655481895Z\",\"FinishedAt\":\"2014-10-14T14:38:09.451955433Z\"},\"Image\":\"105182bb5e8bed742e4063e9486afa5f51328fc007e74f6c9f29cd1f75971357\",\"NetworkSettings\":{\"IPAddress\":\"172.17.0.2\",\"IPPrefixLen\":16,\"Gateway\":\"172.17.42.1\",\"Bridge\":\"docker0\",\"PortMapping\":null,\"Ports\":{}},\"ResolvConfPath\":\"/etc/resolv.conf\",\"HostnamePath\":\"/var/lib/docker/containers/594388bee400fbe4d20885e08def4ba98e1b96f7c5196f586749f4ad650d5bc7/hostname\",\"HostsPath\":\"/var/lib/docker/containers/594388bee400fbe4d20885e08def4ba98e1b96f7c5196f586749f4ad650d5bc7/hosts\",\"Name\":\"/cocky_poincare\",\"Driver\":\"devicemapper\",\"ExecDriver\":\"native-0.1\",\"MountLabel\":\"\",\"ProcessLabel\":\"\",\"Volumes\":{},\"VolumesRW\":{},\"HostConfig\":{\"Binds\":null,\"ContainerIDFile\":\"\",\"LxcConf\":null,\"Privileged\":false,\"PortBindings\":null,\"Links\":null,\"PublishAllPorts\":false,\"Dns\":null,\"DnsSearch\":null,\"VolumesFrom\":null,\"NetworkMode\":\"\"}}" + }, + "time": { + "perform_duration": 0.005934000015258789, + "time_from_last_request": 0.0 + } + } +] \ No newline at end of file diff --git a/tests/data/mitm-logs/ipmilan/already-off.log b/tests/data/mitm-logs/ipmilan/already-off.log new file mode 100644 index 000000000..714b84697 --- /dev/null +++ b/tests/data/mitm-logs/ipmilan/already-off.log @@ -0,0 +1,33 @@ +[ + { + "request": { + "env": {}, + "argv": [ + "/usr/bin/ipmitool", + "-I", + "lanplus", + "-H", + "fence_ipmilan.test", + "-U", + "user", + "-P", + "pass", + "-p", + "623", + "-L", + "ADMINISTRATOR", + "chassis", + "power", + "status" + ] + }, + "response": { + "return_code": 0, + "stderr": "", + "stdout": "Chassis Power is off\n" + }, + "time": { + "perform_duration": 2.7017760276794434 + } + } +] \ No newline at end of file diff --git a/tests/data/mitm-logs/ipmilan/already-on.log b/tests/data/mitm-logs/ipmilan/already-on.log new file mode 100644 index 000000000..e8c0471cb --- /dev/null +++ b/tests/data/mitm-logs/ipmilan/already-on.log @@ -0,0 +1,33 @@ +[ + { + "request": { + "env": {}, + "argv": [ + "/usr/bin/ipmitool", + "-I", + "lanplus", + "-H", + "fence_ipmilan.test", + "-U", + "user", + "-P", + "pass", + "-p", + "623", + "-L", + "ADMINISTRATOR", + "chassis", + "power", + "status" + ] + }, + "response": { + "return_code": 0, + "stderr": "", + "stdout": "Chassis Power is on\n" + }, + "time": { + "perform_duration": 0.9178590774536133 + } + } +] \ No newline at end of file diff --git a/tests/data/mitm-logs/ipmilan/off.log b/tests/data/mitm-logs/ipmilan/off.log new file mode 100644 index 000000000..4dc43db72 --- /dev/null +++ b/tests/data/mitm-logs/ipmilan/off.log @@ -0,0 +1,188 @@ +[ + { + "request": { + "argv": [ + "/usr/bin/ipmitool", + "-I", + "lanplus", + "-H", + "fence_ipmilan.test", + "-U", + "user", + "-P", + "pass", + "-p", + "623", + "-L", + "ADMINISTRATOR", + "chassis", + "power", + "status" + ], + "env": {} + }, + "response": { + "return_code": 0, + "stderr": "", + "stdout": "Chassis Power is on\n" + }, + "time": { + "perform_duration": 0.9692540168762207 + } + }, + { + "request": { + "env": {}, + "argv": [ + "/usr/bin/ipmitool", + "-I", + "lanplus", + "-H", + "fence_ipmilan.test", + "-U", + "user", + "-P", + "pass", + "-p", + "623", + "-L", + "ADMINISTRATOR", + "chassis", + "power", + "off" + ] + }, + "response": { + "return_code": 0, + "stderr": "", + "stdout": "Chassis Power Control: Down/Off\n" + }, + "time": { + "perform_duration": 0.6728107929229736 + } + }, + { + "request": { + "argv": [ + "/usr/bin/ipmitool", + "-I", + "lanplus", + "-H", + "fence_ipmilan.test", + "-U", + "user", + "-P", + "pass", + "-p", + "623", + "-L", + "ADMINISTRATOR", + "chassis", + "power", + "status" + ], + "env": {} + }, + "response": { + "return_code": 0, + "stderr": "", + "stdout": "Chassis Power is on\n" + }, + "time": { + "perform_duration": 0.694404125213623 + } + }, + { + "request": { + "env": {}, + "argv": [ + "/usr/bin/ipmitool", + "-I", + "lanplus", + "-H", + "fence_ipmilan.test", + "-U", + "user", + "-P", + "pass", + "-p", + "623", + "-L", + "ADMINISTRATOR", + "chassis", + "power", + "status" + ] + }, + "response": { + "return_code": 0, + "stderr": "", + "stdout": "Chassis Power is on\n" + }, + "time": { + "perform_duration": 0.695688009262085 + } + }, + { + "request": { + "argv": [ + "/usr/bin/ipmitool", + "-I", + "lanplus", + "-H", + "fence_ipmilan.test", + "-U", + "user", + "-P", + "pass", + "-p", + "623", + "-L", + "ADMINISTRATOR", + "chassis", + "power", + "status" + ], + "env": {} + }, + "response": { + "return_code": 1, + "stderr": "Error in open session response message : insufficient resources for session\n\nError: Unable to establish IPMI v2 / RMCP+ session\nUnable to get Chassis Power Status\n", + "stdout": "" + }, + "time": { + "perform_duration": 0.14334893226623535 + } + }, + { + "request": { + "env": {}, + "argv": [ + "/usr/bin/ipmitool", + "-I", + "lanplus", + "-H", + "fence_ipmilan.test", + "-U", + "user", + "-P", + "pass", + "-p", + "623", + "-L", + "ADMINISTRATOR", + "chassis", + "power", + "status" + ] + }, + "response": { + "return_code": 0, + "stderr": "", + "stdout": "Chassis Power is off\n" + }, + "time": { + "perform_duration": 4.748305082321167 + } + } +] \ No newline at end of file diff --git a/tests/data/mitm-logs/ipmilan/on.log b/tests/data/mitm-logs/ipmilan/on.log new file mode 100644 index 000000000..8f4746e18 --- /dev/null +++ b/tests/data/mitm-logs/ipmilan/on.log @@ -0,0 +1,126 @@ +[ + { + "request": { + "argv": [ + "/usr/bin/ipmitool", + "-I", + "lanplus", + "-H", + "fence_ipmilan.test", + "-U", + "user", + "-P", + "pass", + "-p", + "623", + "-L", + "ADMINISTRATOR", + "chassis", + "power", + "status" + ], + "env": {} + }, + "response": { + "return_code": 0, + "stderr": "", + "stdout": "Chassis Power is off\n" + }, + "time": { + "perform_duration": 1.0733919143676758 + } + }, + { + "request": { + "env": {}, + "argv": [ + "/usr/bin/ipmitool", + "-I", + "lanplus", + "-H", + "fence_ipmilan.test", + "-U", + "user", + "-P", + "pass", + "-p", + "623", + "-L", + "ADMINISTRATOR", + "chassis", + "power", + "on" + ] + }, + "response": { + "return_code": 0, + "stderr": "", + "stdout": "Chassis Power Control: Up/On\n" + }, + "time": { + "perform_duration": 0.6707351207733154 + } + }, + { + "request": { + "argv": [ + "/usr/bin/ipmitool", + "-I", + "lanplus", + "-H", + "fence_ipmilan.test", + "-U", + "user", + "-P", + "pass", + "-p", + "623", + "-L", + "ADMINISTRATOR", + "chassis", + "power", + "status" + ], + "env": {} + }, + "response": { + "return_code": 1, + "stderr": "Error: Unable to establish IPMI v2 / RMCP+ session\nUnable to get Chassis Power Status\n", + "stdout": "" + }, + "time": { + "perform_duration": 15.120256900787354 + } + }, + { + "request": { + "env": {}, + "argv": [ + "/usr/bin/ipmitool", + "-I", + "lanplus", + "-H", + "fence_ipmilan.test", + "-U", + "user", + "-P", + "pass", + "-p", + "623", + "-L", + "ADMINISTRATOR", + "chassis", + "power", + "status" + ] + }, + "response": { + "return_code": 0, + "stderr": "", + "stdout": "Chassis Power is on\n" + }, + "time": { + "perform_duration": 0.6681029796600342 + } + } +] \ No newline at end of file diff --git a/tests/data/mitm-logs/ipmilan/reboot.log b/tests/data/mitm-logs/ipmilan/reboot.log new file mode 100644 index 000000000..1e84077ad --- /dev/null +++ b/tests/data/mitm-logs/ipmilan/reboot.log @@ -0,0 +1,188 @@ +[ + { + "request": { + "argv": [ + "/usr/bin/ipmitool", + "-I", + "lanplus", + "-H", + "fence_ipmilan.test", + "-U", + "user", + "-P", + "pass", + "-p", + "623", + "-L", + "ADMINISTRATOR", + "chassis", + "power", + "status" + ], + "env": {} + }, + "response": { + "return_code": 0, + "stderr": "", + "stdout": "Chassis Power is on\n" + }, + "time": { + "perform_duration": 0.9481310844421387 + } + }, + { + "request": { + "env": {}, + "argv": [ + "/usr/bin/ipmitool", + "-I", + "lanplus", + "-H", + "fence_ipmilan.test", + "-U", + "user", + "-P", + "pass", + "-p", + "623", + "-L", + "ADMINISTRATOR", + "chassis", + "power", + "off" + ] + }, + "response": { + "return_code": 0, + "stderr": "Close Session command failed\n", + "stdout": "Chassis Power Control: Down/Off\n" + }, + "time": { + "perform_duration": 4.669372081756592 + } + }, + { + "request": { + "argv": [ + "/usr/bin/ipmitool", + "-I", + "lanplus", + "-H", + "fence_ipmilan.test", + "-U", + "user", + "-P", + "pass", + "-p", + "623", + "-L", + "ADMINISTRATOR", + "chassis", + "power", + "status" + ], + "env": {} + }, + "response": { + "return_code": 0, + "stderr": "", + "stdout": "Chassis Power is off\n" + }, + "time": { + "perform_duration": 2.691959857940674 + } + }, + { + "request": { + "env": {}, + "argv": [ + "/usr/bin/ipmitool", + "-I", + "lanplus", + "-H", + "fence_ipmilan.test", + "-U", + "user", + "-P", + "pass", + "-p", + "623", + "-L", + "ADMINISTRATOR", + "chassis", + "power", + "on" + ] + }, + "response": { + "return_code": 0, + "stderr": "", + "stdout": "Chassis Power Control: Up/On\n" + }, + "time": { + "perform_duration": 0.6918978691101074 + } + }, + { + "request": { + "argv": [ + "/usr/bin/ipmitool", + "-I", + "lanplus", + "-H", + "fence_ipmilan.test", + "-U", + "user", + "-P", + "pass", + "-p", + "623", + "-L", + "ADMINISTRATOR", + "chassis", + "power", + "status" + ], + "env": {} + }, + "response": { + "return_code": 1, + "stderr": "Error: Unable to establish IPMI v2 / RMCP+ session\nUnable to get Chassis Power Status\n", + "stdout": "" + }, + "time": { + "perform_duration": 10.091929912567139 + } + }, + { + "request": { + "env": {}, + "argv": [ + "/usr/bin/ipmitool", + "-I", + "lanplus", + "-H", + "fence_ipmilan.test", + "-U", + "user", + "-P", + "pass", + "-p", + "623", + "-L", + "ADMINISTRATOR", + "chassis", + "power", + "status" + ] + }, + "response": { + "return_code": 0, + "stderr": "", + "stdout": "Chassis Power is on\n" + }, + "time": { + "perform_duration": 0.6657240390777588 + } + } +] \ No newline at end of file diff --git a/tests/data/mitm-logs/ipmilan/status-off.log b/tests/data/mitm-logs/ipmilan/status-off.log new file mode 100644 index 000000000..d883d7acb --- /dev/null +++ b/tests/data/mitm-logs/ipmilan/status-off.log @@ -0,0 +1,33 @@ +[ + { + "request": { + "env": {}, + "argv": [ + "/usr/bin/ipmitool", + "-I", + "lanplus", + "-H", + "fence_ipmilan.test", + "-U", + "user", + "-P", + "pass", + "-p", + "623", + "-L", + "ADMINISTRATOR", + "chassis", + "power", + "status" + ] + }, + "response": { + "return_code": 0, + "stderr": "", + "stdout": "Chassis Power is off\n" + }, + "time": { + "perform_duration": 0.688668966293335 + } + } +] \ No newline at end of file diff --git a/tests/data/mitm-logs/ipmilan/status-on.log b/tests/data/mitm-logs/ipmilan/status-on.log new file mode 100644 index 000000000..202beca82 --- /dev/null +++ b/tests/data/mitm-logs/ipmilan/status-on.log @@ -0,0 +1,33 @@ +[ + { + "request": { + "argv": [ + "/usr/bin/ipmitool", + "-I", + "lanplus", + "-H", + "fence_ipmilan.test", + "-U", + "user", + "-P", + "pass", + "-p", + "623", + "-L", + "ADMINISTRATOR", + "chassis", + "power", + "status" + ], + "env": {} + }, + "response": { + "return_code": 0, + "stderr": "", + "stdout": "Chassis Power is on\n" + }, + "time": { + "perform_duration": 0.6785368919372559 + } + } +] \ No newline at end of file diff --git a/tests/data/mitm-logs/rsa_keys/id_rsa b/tests/data/mitm-logs/rsa_keys/id_rsa new file mode 100644 index 000000000..abd79c066 --- /dev/null +++ b/tests/data/mitm-logs/rsa_keys/id_rsa @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEowIBAAKCAQEAtrut82OuI3/rVEE15hBDXjkeZoMM6XlrLp/wn8fcbVM5HESP +Ky5SoCJdkH/0naCp8UT/Lcb/BM4jyVWe0r3YgH2SEwb3G4N1GkW1kqeOP8KcLwZp +cFn85/n3J/6k3UkOWqgM9dZARn9APemKkn7WRF+xOn1/p+NnSKUEPxxEnDML4yCI +NxLb/6PzGxkB9WTDesL9cQjAin6VNwanm2uuTeda4+3BFevYw7UZpuL6zoEPpSOg +FltRj6l5BEZ3gvztVCAkvWlbQy1fNlSP1nUwrrREPSp09etKHLmqS7V8IxLep2Xp +vUSzBXaENjrYhMZ2mkaNKETUwwuVb2pCAgXjTQIDAQABAoIBACES+zswcZZvUtLf +Mrg/fVISmJQJaE7h8SpxPIZPEHChPZcGObuhGMdvMOw0nLvjFp9a060fdY0TGpsY +ajTOs98d21CiVBugwZNNxr2SokacHNTOHkt9ni8GqVuN1Z1P2c9C14Wvj9aytZf/ +K1u0pWeewl9J0885c7pMU+ZwYWK78+9lbjHfBdOgMupchSieMOeXfpxzF9GI4Eqz +0WrJQiAUmhPXRB8tllDkiuwefyhF09oZzyCBYsQRBFbI/31UxfvrrCLy3Yq0IW8H +0VTo8ZLyUMjqqATYN2E8VC98MxWfy71oaOHeuJ9ZuWtSRuUpqQ2msmRQiegdCkv9 +T6ThiSkCgYEA7Ls2efaCCoaZ+E8HstCDK6c6XXcGfEMtLukzw5gMH6KmX7sqJhKK +1aRCyPNrRZHyJQ0R+HMSFP5RdlCIACkZ5T7rwYZWqVsJsIscWLGr45BB3JNNMPfH +lSqs3K677dHg+r698+jaVTM8j8f2au5AnxgO9MArJE6LBYzNEHLssOsCgYEAxZtN +gxwRD+ptgIEP+0DzhBsAyVP3jnZZxul3pDSFelp65wkjxgmDrtu0iAWThUQMITJi +V92hpnVg+s68Nz801x73hsSgTWOt2B+aclkB9sCGyJ/Rw5fsoD00AflV3o+h/5fw +H2PEvUDNeC9Xlnm4mM7AKYrIiblInSg+lo5s7qcCgYEAmmq/7SxzxOPp+UOr1OMY +PNhXRPJH47R5+5iYcGR0vAn/loBizPTZZORBwAywE3BQ0ARHjZWZ3OHLR27eV6R3 +xMaXR+QWEWBV4LfNJLm4UrcdjwDyoBdwM4fjvAuqgEWgCE91Xm2sRVknju4zeaqx +slUiJFpZidRF8LfYZ3tfk0MCgYB5l/nXToL1PzSIWWKDIdF2ncMbH476W7scmfbj +1Om5g0mTNt2Lc7lS9KCe/odq/pdUKhO3q4pXymyViHbqq/sQ0F5R0FYvqMGFdtTr +vfdmZcvKUgWajLavV1nUSR/cppdxloXMWvDp36FPbhpAXsAHT1mRdnO1w4x6IBR7 +QkKniwKBgH21zhteIoOj/VvXWhAZ5428dXhH5QjPFP3YoIGZ4FiN/NtijcQstFiM +z1k4NgI+yhWikm1ZFAIbSUcMNonPEwtPJN+bTipfvYA/0wPhdHL6Fwlk1a4PfRkK +ith9c7Yn8XQqOWMSOEggVh9oDNM4NAazYmCrg4/++JjzQSFk/kBP +-----END RSA PRIVATE KEY----- diff --git a/tests/data/mitm-logs/rsa_keys/id_rsa.pub b/tests/data/mitm-logs/rsa_keys/id_rsa.pub new file mode 100644 index 000000000..7a6e2e83e --- /dev/null +++ b/tests/data/mitm-logs/rsa_keys/id_rsa.pub @@ -0,0 +1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC2u63zY64jf+tUQTXmEENeOR5mgwzpeWsun/Cfx9xtUzkcRI8rLlKgIl2Qf/SdoKnxRP8txv8EziPJVZ7SvdiAfZITBvcbg3UaRbWSp44/wpwvBmlwWfzn+fcn/qTdSQ5aqAz11kBGf0A96YqSftZEX7E6fX+n42dIpQQ/HEScMwvjIIg3Etv/o/MbGQH1ZMN6wv1xCMCKfpU3Bqeba65N51rj7cEV69jDtRmm4vrOgQ+lI6AWW1GPqXkERneC/O1UICS9aVtDLV82VI/WdTCutEQ9KnT160ocuapLtXwjEt6nZem9RLMFdoQ2OtiExnaaRo0oRNTDC5VvakICBeNN test@test diff --git a/tests/devices.d/apc.cfg b/tests/devices.d/apc.cfg new file mode 100644 index 000000000..e83dea64d --- /dev/null +++ b/tests/devices.d/apc.cfg @@ -0,0 +1,18 @@ +name = "fence_apc test config for non admin user" +replay_server_type = "ssh" +replay_server_args = "-b data/mitm-logs/rsa_keys/id_rsa.pub -B data/mitm-logs/rsa_keys/id_rsa" # additional options for replay server (not required) +subdir = "ssh-user" # subdir for mitm logs, e.g.: different firmware for one agent (not required) +agent_type = "mitmproxy" +agent = "fence_apc" + +[options] # options for fence-agent + # option = [ "value", "long-opt", "short-opt" ] + # option: name of the option which is used in fence-agent stdin + # short-opt: not required + login = [ "test", "--username", "-l" ] + passwd = [ "test", "--password", "-p" ] + ipaddr = [ "localhost", "--ip", "-a" ] + port = [ "1", "--plug", "-n" ] + ipport = [ "4242", "--ipport", "-u" ] + ssh_options = [ "-c blowfish", "--ssh-options" ] # can't use option -1 (ssh v1) mitm supports only ssh v2 + secure = [ None, "--ssh", "-x" ] diff --git a/tests/devices.d/docker.cfg b/tests/devices.d/docker.cfg new file mode 100644 index 000000000..e47d0ff6a --- /dev/null +++ b/tests/devices.d/docker.cfg @@ -0,0 +1,8 @@ +name = "fence_docker test config without auth" +agent_type = "pycurl" +agent = "fence_docker" +subdir = "no-auth" + +[options] + ipaddr = [ "fedora1", "--ip", "-a" ] + port = [ "594388bee400fbe4d20885e08def4ba98e1b96f7c5196f586749f4ad650d5bc7", "--plug", "-n" ] diff --git a/tests/devices.d/ipmilan.cfg b/tests/devices.d/ipmilan.cfg new file mode 100644 index 000000000..7e3f6f67a --- /dev/null +++ b/tests/devices.d/ipmilan.cfg @@ -0,0 +1,13 @@ +name = "fence_ipmilan" +agent_type = "binmitm" +agent = "fence_ipmilan" + +[options] # options for fence-agent + # option = [ "value", "long-opt", "short-opt" ] + # option: name of the option which is used in fence-agent stdin + # short-opt: not required + login = [ "user", "--username", "-l" ] + passwd = [ "pass", "--password", "-p" ] + ipaddr = [ "fence_ipmilan.test", "--ip", "-a" ] + lanplus = [ None, "--lanplus", "-P"] + ipmitool_path = [ "./binmitm.py /usr/bin/ipmitool", "--ipmitool-path" ] diff --git a/tests/fence_tests_lib.py b/tests/fence_tests_lib.py new file mode 100644 index 000000000..7d9c562ff --- /dev/null +++ b/tests/fence_tests_lib.py @@ -0,0 +1,354 @@ +import sys +import subprocess +import shlex +import logging +import os +import getopt +from pipes import quote +from time import sleep + + +__all__ = [ + "get_mitm_replay_cmd", "get_agent_path", "prepare_command", + "run_agent", "get_basename", "METHODS", "ACTIONS_PATH", + "BINMITM_COUNTERFILE", "FENCING_LIB_PATH", "DEVICES_PATH", "MITM_LOGS_PATH", + "MITM_PROXY_PATH", "show_help", "get_options", "get_mitm_record_cmd", + "get_and_remove_arg" +] + + +METHODS = ["getopt", "longopt", "stdin"] # all available methods to test +FENCING_LIB_PATH = "../fence/agents/lib" # path to fencing libs +DEVICES_PATH = "./devices.d" # path to device directory +ACTIONS_PATH = "./actions.d" # path to actions directory +MITM_LOGS_PATH = "./data/mitm-logs" # path to mitm logs +MITM_PROXY_PATH = "../mitm/mitmproxy-0.1/build" # path to mitm_proxy servers +BINMITM_COUNTERFILE = "./.counterfile" # path to counter file for BINMITM +MITMPROXY_STARTUP_TIMEOUT = 1 + + +class LibException(Exception): + pass + + +# returns command for MITM_PROXY replay server +def get_mitm_replay_cmd(agent_config, log): + if "replay_server_type" not in agent_config: + raise LibException( + "Option 'replay_server_type' is not defined in device config. " + "It is required when agent_type = 'mitmproxy'" + ) + + script_path = os.path.join( + MITM_PROXY_PATH, + "scripts-2.7/mitmreplay_" + agent_config["replay_server_type"] + ) + + port = "" + if "ipport" in agent_config["options"]: + port = "-p " + agent_config["options"]["ipport"][0] + + cmd = "{script} -f {log} {port} {args}".format( + script=script_path, + log=log, + port=port, + args=agent_config.get("replay_server_args", "") + ) + + env = os.environ.copy() + env["PYTHONPATH"] = os.path.join(MITM_PROXY_PATH, "lib/") + + return cmd, env + + +def get_mitm_record_cmd(agent_config, log, local_port): + if "replay_server_type" not in agent_config: + raise LibException( + "Option 'replay_server_type' is not defined in device config. " + "It is required when agent_type = 'mitmproxy'" + ) + + script_path = os.path.join( + MITM_PROXY_PATH, + "scripts-2.7/mitmproxy_" + agent_config["replay_server_type"] + ) + + host = "" + if "ipport" in agent_config["options"]: + host = "-H " + agent_config["options"]["ipaddr"][0] + + port = "" + if "ipport" in agent_config["options"]: + port = "-P " + agent_config["options"]["ipport"][0] + + cmd = "{script} -o {log} -p {local_port} {host} {port} {a1} {a2}".format( + script=script_path, + log=log, + local_port=local_port, + host=host, + port=port, + a1=agent_config.get("record_server_args", ""), + a2=agent_config.get("replay_server_args", "") + ) + + env = os.environ.copy() + env["PYTHONPATH"] = os.path.join(MITM_PROXY_PATH, "lib/") + + return cmd, env + + +# returns path to fence agent +def get_agent_path(agent): + return os.path.join("../fence/agents/", agent[6:], agent) + + +# prepare agent command to run +def prepare_command(config, params="", method="getopt"): + env = {"PYTHONPATH": FENCING_LIB_PATH} + + final_command = "python " + + if "agent_path" in config: + final_command += config["agent_path"] + else: + final_command += get_agent_path(config["agent"]) + + if params: + final_command += " " + params + " " + + stdin_values = None + + for opt in config["options"]: + if not isinstance(config["options"][opt], list) or not len( + config["options"][opt]) >= 2: + raise LibException( + "Option '{0}' have to have at least value and longopt".format( + opt + ) + ) + + value = config["options"][opt][0] + has_value = value is not None + if opt == "action": + # ignore action as it is not part of fence device definition + continue + + if method == "stdin": + option = opt + if stdin_values is None: + stdin_values = "" + + stdin_values += option + stdin_values += "=" + (value if has_value else "1") + + stdin_values += "\n" + + elif method == "longopt": + option = config["options"][opt][1] + final_command += " " + option + + if has_value: + final_command += " " + quote(value) + + elif method == "getopt": + if len(config["options"][opt]) == (2 + 1): + option = config["options"][opt][2] + else: + option = config["options"][opt][1] + + final_command += " " + option + if has_value: + final_command += " " + quote(value) + + return final_command, stdin_values, env + + +def run_agent(command, stdin="", env_vars=None): + if env_vars is None: + env_vars = {} + env = os.environ.copy() + env.update(env_vars) + + logging.debug("Running: {cmd}".format(cmd=command)) + + if stdin: + logging.debug("STDIN: {0}".format(stdin)) + if env_vars: + logging.debug("ENV: {0}".format(str(env_vars))) + + process = subprocess.Popen( + shlex.split(command), + stdin=subprocess.PIPE, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + env=env + ) + + if stdin: + process.stdin.write(stdin) + + (pipe_stdout, pipe_stderr) = process.communicate() + + status = process.wait() + + process.stdout.close() + process.stderr.close() + process.stdin.close() + return status, pipe_stdout, pipe_stderr + + +def get_basename(path): + return os.path.splitext(os.path.basename(path))[0] + + +# show help +def show_help(avail_opt, description=None): + print "%s [options]" % os.path.basename(sys.argv[0]) + if description: + print description + print "Options:" + space = 30 + for o in avail_opt: + args = "-{short}, --{long}{val}".format( + short=avail_opt[o]["getopt"].strip(":"), + long=avail_opt[o]["longopt"], + val=(" " if avail_opt[o]["getopt"].endswith(":") else "") + ) + line = "\t{args}{spaces}{description}".format( + args=args, + spaces=( + ' ' * (space - len(args)) if space - len(args) > 0 else ' ' * 5 + ), + description=avail_opt[o]["description"]) + print line + + +# get options from command line parameters +def get_options(avail_opt): + opt = {} + for o in avail_opt.itervalues(): # set default values + if "default" in o: + opt["--" + o["longopt"]] = o["default"] + + if len(sys.argv) > 1: + os.putenv("LANG", "C") + os.putenv("LC_ALL", "C") + + getopt_string = "" + longopt_list = [] + for k in avail_opt: + getopt_string += avail_opt[k]["getopt"] + long_opt = avail_opt[k]["longopt"] + ( + "=" if avail_opt[k]["getopt"].endswith(":") else "" + ) + longopt_list.append(long_opt) + + try: + old_opt, _ = getopt.gnu_getopt( + sys.argv[1:], getopt_string, longopt_list + ) + except getopt.GetoptError as error: + logging.error("Parse error: " + str(error)) + show_help(avail_opt) + sys.exit(1) + + # Transform short getopt to long one + ##### + for o in dict(old_opt).keys(): + if o.startswith("--"): + for x in avail_opt.keys(): + if ( + "longopt" in avail_opt[x] and + "--" + avail_opt[x]["longopt"] == o + ): + if avail_opt[x]["getopt"].endswith(":"): + opt[o] = dict(old_opt)[o] + if "list" in avail_opt[x]: + opt[o] = opt[o].split(avail_opt[x]["list"]) + else: + opt[o] = True + else: + for x in avail_opt.keys(): + if ( + x in avail_opt and + "getopt" in avail_opt[x] and + "longopt" in avail_opt[x] and + ( + "-" + avail_opt[x]["getopt"] == o or + "-" + avail_opt[x]["getopt"].rstrip(":") == o + ) + ): + key = "--" + avail_opt[x]["longopt"] + if avail_opt[x]["getopt"].endswith(":"): + opt[key] = dict(old_opt)[o] + if "list" in avail_opt[x]: + opt[key] = opt[key].split(avail_opt[x]["list"]) + else: + opt[key] = True + return opt + + +def get_and_remove_arg(arg): + logging.debug("Getting arg: {0}".format(arg)) + if arg in sys.argv: + index = sys.argv.index(arg) + sys.argv.remove(arg) + if len(sys.argv) > index: + value = sys.argv[index] + sys.argv.remove(value) + logging.debug("{arg}: {val}".format(arg=arg, val=value)) + return value + return None + + +def start_mitm_server(cmd, env): + logging.debug("Executing: {cmd}".format(cmd=cmd)) + try: + # Try to start replay server + process = subprocess.Popen( + shlex.split(cmd), + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + env=env + ) + except OSError as e: + raise LibException( + "Unable to start replay server: {0}".format(str(e)) + ) + + # wait for replay server + sleep(MITMPROXY_STARTUP_TIMEOUT) + # check if replay server is running correctly + if process.poll() is not None: + pipe_stdout, pipe_stderr = process.communicate() + process.stdout.close() + process.stderr.close() + logging.debug( + "MITM server STDOUT:\n{out}".format(out=str(pipe_stdout)) + ) + logging.debug( + "MITM server STDERR:\n{err}".format(err=str(pipe_stderr)) + ) + raise LibException("MITM server is not running correctly.") + return process + + +def stop_mitm_server(process): + if process: + # if server is still alive after test, kill it + if process.poll() is None: + try: + # race condition, process can exit between checking and + # killing process + process.kill() + except Exception: + pass + pipe_stdout, pipe_stderr = process.communicate() + process.stdout.close() + process.stderr.close() + logging.debug( + "MITM server STDOUT:\n{out}".format(out=str(pipe_stdout)) + ) + logging.debug( + "MITM server STDERR:\n{err}".format(err=str(pipe_stderr)) + ) diff --git a/tests/prepare_tests.sh b/tests/prepare_tests.sh new file mode 100755 index 000000000..2ffe4df62 --- /dev/null +++ b/tests/prepare_tests.sh @@ -0,0 +1,3 @@ +#!/usr/bin/bash +cd .. +./autogen.sh && ./configure && make && cd mitm/mitmproxy-0.1/ && python setup.py build && echo "OK" diff --git a/tests/run_tests.py b/tests/run_tests.py new file mode 100755 index 000000000..1b29f2b06 --- /dev/null +++ b/tests/run_tests.py @@ -0,0 +1,393 @@ +#!/usr/bin/python -tt + +import sys +import logging +import os +import unittest +import re +import pprint +from configobj import ConfigObj + +import fence_tests_lib as ftl + +VERBOSE = not set(["-v", "--verbose"]).isdisjoint(sys.argv) +PARAM_FORCE = ftl.get_and_remove_arg("--param") +methods = ftl.get_and_remove_arg("--method") or ftl.get_and_remove_arg("-m") +METHODS_TO_TEST = methods.split(",") if methods else ftl.METHODS +LOCAL_PORT = ( + ftl.get_and_remove_arg("--port") or + ftl.get_and_remove_arg("-p") or + "4242" +) + + +# define tests which cannot be autodetected +# (device_config, action_config, log_file) +TESTS = [ +] + +# cli parameters +avail_opt = { + "verbose": { + "getopt": "v", + "longopt": "verbose", + "description": "Verbose mode" + }, + "help": { + "getopt": "h", + "longopt": "help", + "description": "Display help and exit" + }, + "device": { + "getopt": "d:", + "longopt": "device", + "list": ",", + "description": "List of devices to test (e.g.: apc,docker)", + "default": None + }, + "action": { + "getopt": "a:", + "longopt": "action", + "list": ",", + "description": "List of actions to test", + "default": None + }, + "method": { + "getopt": "m:", + "longopt": "method", + "list": ",", + "description": "List of input methods to test", + "default": ftl.METHODS + }, + "failfast": { + "getopt": "f", + "longopt": "failfast", + "description": "Stop after first failed test", + "default": False + }, + "show-tests": { + "getopt": "S", + "longopt": "show-tests", + "description": "Prints all found tests and exit", + "default": False + }, + "port": { + "getopt": "p:", + "longopt": "port", + "description": + "Local port for communication between agent and mitmproxy", + "default": "4242" + } +} + + +# TestCase class which adds posibility to add param into tests +class ParametrizedTestCase(unittest.TestCase): + """ + TestCase classes that want to be parametrized should + inherit from this class. + """ + + def __init__(self, method_name='runTest', param=None): + super(ParametrizedTestCase, self).__init__(method_name) + self.param = param + + @staticmethod + def parametrize(test_case_klass, param=None): + """ + Create a suite containing all tests taken from the given + subclass, passing them the parameter 'param'. + """ + test_loader = unittest.TestLoader() + test_names = test_loader.getTestCaseNames(test_case_klass) + suite = unittest.TestSuite() + for name in test_names: + suite.addTest(test_case_klass(name, param=param)) + return suite + + +# TestCase for testing of one agent +class FenceAgentTestCase(ParametrizedTestCase): + def __getattr__(self, key): + return None + + # prepare environment for running test with MITM_PROXY + def setUp_MITMPROXY(self): + if "ipport" in self.device_config["options"]: + self.device_config["options"]["ipport"][0] = LOCAL_PORT + + self.mitm_process = ftl.start_mitm_server( + *ftl.get_mitm_replay_cmd(self.device_config, self.action_log) + ) + + if "ipaddr" in self.device_config["options"]: + self.device_config["options"]["ipaddr"][0] = "localhost" + + def tearDown_MITMPROXY(self): + ftl.stop_mitm_server(self.mitm_process) + + def setUp_pycurl(self): + self.params = "--fencing_pycurl-log-in %s" % self.action_log + + def tearDown_pycurl(self): + pass + + def setUp_BINMITM(self): + cf = os.path.abspath(ftl.BINMITM_COUNTERFILE) + if os.path.exists(cf): + os.remove(cf) + if "BINMITM_OUTPUT" in os.environ: + del os.environ["BINMITM_OUTPUT"] + if "BINMITM_DEBUG" in os.environ: + del os.environ["BINMITM_DEBUG"] + self.env = { + "BINMITM_COUNTER_FILE": ftl.BINMITM_COUNTERFILE, + "BINMITM_INPUT": self.action_log + } + + def tearDown_BINMITM(self): + cf = os.path.abspath(ftl.BINMITM_COUNTERFILE) + if os.path.exists(cf): + os.remove(cf) + + def setUp(self): + self.device_cfg, self.action_cfg, self.action_log = self.param + self.device_config = ConfigObj(self.device_cfg, unrepr=True) + if PARAM_FORCE: + force_param, force_param_val = PARAM_FORCE.split("=", 1) + if force_param in self.device_config["options"]: + self.device_config["options"][force_param][0] = force_param_val + self.action_config = ConfigObj(self.action_cfg, unrepr=True) + self.type = self.device_config["agent_type"].lower() + self.params = "" + self.mitm_process = None + self.env = {} + agent_type = self.type + if agent_type == "mitmproxy": + self.setUp_MITMPROXY() + elif agent_type == "pycurl": + self.setUp_pycurl() + elif agent_type == "binmitm": + self.setUp_BINMITM() + + def tearDown(self): + agent_type = self.type + if agent_type == "mitmproxy": + self.tearDown_MITMPROXY() + elif agent_type == "pycurl": + self.tearDown_pycurl() + elif agent_type == "binmitm": + self.tearDown_BINMITM() + + @unittest.skipIf( + "getopt" not in METHODS_TO_TEST, "Not testing getopt method" + ) + def test_getopt(self): + self.agent_test("getopt") + + @unittest.skipIf( + "longopt" not in METHODS_TO_TEST, "Not testing longopt method" + ) + def test_longopt(self): + self.agent_test("longopt") + + @unittest.skipIf("stdin" not in METHODS_TO_TEST, "Not testing stdin method") + def test_stdin(self): + self.agent_test("stdin") + + def get_failure_message( + self, expected_status, status, stdout="", stderr="", longer=False + ): + msg = "Return code was {actual} (expected: {expected})".format( + actual=status, expected=expected_status + ) + if longer: + msg += "\nSTDOUT:\n{stdout}\nSTDERR:\n{stderr}\n".format( + stdout=stdout, + stderr=stderr + ) + return msg + + # run test of agent with specific method + def agent_test(self, method): + action_file = self.action_cfg + actions = self.action_config + for action in actions["actions"]: + self.assertTrue( + "command" in action, + "Action {action} need to have defined 'command'".format( + action=action_file + ) + ) + self.assertTrue( + "return_code" in action, + "Command '{command}' (in {file}) need to have 'return_code' " + "defined".format( + command=action["command"], file=action_file + ) + ) + + cmd, stdin, env = ftl.prepare_command( + self.device_config, self.params, method + ) + env.update(self.env) + + if method == "stdin": + if stdin is None: + stdin = "" + stdin += "action=" + action["command"] + elif method == "longopt": + cmd += " --action=" + action["command"] + elif method == "getopt": + cmd += " -o " + action["command"] + + status, stdout, stderr = ftl.run_agent(cmd, stdin, env) + + logging.debug("AGENT EXITCODE: {0}".format(status)) + logging.debug("AGENT STDOUT: {0}".format(stdout)) + logging.debug("AGENT STDERR: {0}".format(stderr)) + + self.assertTrue( + bool(re.search( + action["return_code"], str(status), re.IGNORECASE) + ), + self.get_failure_message( + action["return_code"], status, stdout, stderr, VERBOSE + ) + ) + + def shortDescription(self): + self.device_cfg, self.action_cfg, self.action_log = self.param + return self.get_test_identificator(True) + + def get_test_identificator(self, short=False): + if short: + if not self.short_test_identificator: + self.short_test_identificator = "{0} => {0}".format( + ftl.get_basename(self.device_cfg), + ftl.get_basename(self.action_cfg) + ) + return self.short_test_identificator + + if not self.test_identificator: + self.test_identificator =\ + "AGENT: {agent} ({config})\nACTION: {action}".format( + agent=self.device_config["name"], + config=self.device_cfg, + action=self.action_cfg + ) + return self.test_identificator + + +# method tries to find tests in directory tree +# returns list of (agent_cfg_path, action_cfg_path, log_path) +def find_tests(opt): + tests = [] + agents = [] + for f in os.listdir(ftl.DEVICES_PATH): + if ( + os.path.isfile(os.path.join(ftl.DEVICES_PATH, f)) and + f.endswith(".cfg") and + (not opt["--device"] or f[:-4] in opt["--device"]) + ): + agents.append(os.path.join(ftl.DEVICES_PATH, f)) + + actions = [] + for f in os.listdir(ftl.ACTIONS_PATH): + if ( + os.path.isfile(os.path.join(ftl.ACTIONS_PATH, f)) and + f.endswith(".cfg") and + (not opt["--action"] or f[:-4] in opt["--action"]) + ): + actions.append(f) + + for agent_cfg in agents: + logging.debug("Opening device config '%s'" % agent_cfg) + config = ConfigObj(agent_cfg, unrepr=True) + logs_path = os.path.join( + ftl.MITM_LOGS_PATH, config["agent"][6:] # remove prefix 'fence_' + ) + if "subdir" in config: + logs_path = os.path.join(logs_path, config["subdir"]) + if not os.path.exists(logs_path): + logging.info("Logs directory '{0}' not exists.".format(logs_path)) + continue + logs = [] + for f in os.listdir(logs_path): + if ( + os.path.isfile(os.path.join(logs_path, f)) and + f.endswith(".log") + ): + logs.append(f) + + for log in logs: + action = "%scfg" % log[:-3] # replace suffix 'log' with 'cfg' + if action in actions: + test = ( + agent_cfg, + os.path.join(ftl.ACTIONS_PATH, action), + os.path.join(logs_path, log) + ) + logging.debug("Found test: {0}".format(test)) + tests.append(test) + return tests + + +def main(): + if VERBOSE: + logging.getLogger().setLevel(logging.DEBUG) + else: + logging.getLogger().setLevel(logging.INFO) + + opt = ftl.get_options(avail_opt) + + if "--help" in opt: + ftl.show_help( + avail_opt, "This program can run MITM tests of fence-agents." + ) + sys.exit(0) + + valid_tests = find_tests(opt) + + if VERBOSE or opt["--show-tests"]: + pprint.pprint(valid_tests) + + if opt["--show-tests"]: + return + + for test in TESTS: + if ( + test not in valid_tests and + ( + opt["--device"] is None or + os.path.basename(test[0])[:-4] in opt["--device"] + ) and + ( + opt["--action"] is None or + os.path.basename(test[1])[:-4] in opt["--action"] + ) and + os.path.exists(test[0]) and + os.path.exists(test[1]) and + os.path.exists(test[2]) + ): + valid_tests.append(test) + + suite = unittest.TestSuite() + + for test in valid_tests: + # agent, action, log = test + suite.addTest( + ParametrizedTestCase.parametrize(FenceAgentTestCase, param=test) + ) + + try: + unittest.TextTestRunner( + verbosity=2, failfast=opt["--failfast"] + ).run(suite) + except ftl.LibException as e: + logging.error(str(e)) + sys.exit(1) + + +if __name__ == "__main__": + main()