Giter Site home page Giter Site logo

schnoddelbotz / amtc Goto Github PK

View Code? Open in Web Editor NEW
43.0 5.0 13.0 2.6 MB

Threaded Intel AMT/vPro mass management tool

License: MIT License

HTML 24.53% Shell 1.91% PHP 15.90% Makefile 8.70% C 13.77% JavaScript 23.22% CSS 2.29% Roff 1.33% TSQL 7.84% Rich Text Format 0.51%
vpro amt c php emberjs

amtc's Introduction

amtc Build Status SensioLabsInsight

amtc - Intel vPro AMT / WS-Management mass remote power management tool

NOTE!

amtc works fine and there are currently no known issues. Anyhow -- you may want to look into amtgo, which combines amtc's and amtc-web's functionality in a single, golang-based binary; Apache, PHP and cron no longer needed for amtc-web!

features

  • performs vital AMT operations (info, powerup, powerdown, reset...)
  • threaded, thus fast (queries 180 Core i5 PCs in a quarter of a second (using EOI and no TLS))
  • allows mass-powerups/downs/... using a custom delay
  • lightweight C application, only depends on libcurl, gnutls and pthreads
  • currently builds fine on linux and OSX (and windows via cygwin; unverified since 0.4.0)
  • allows quick and comfortable mass-power control via shell and...
  • comes with a EmberJS-based web interface called amtc-web, that depends on Slim and Idiorm and Paris to provide a JSON backend for these amtc-web features:
    • power state monitoring via AMT© including OS TCP port probing/detection
    • anachronous OOB power control using a database-driven job queue
    • power/OS-monitoring logging with [notyet:] graphing
    • management of master file data like rooms and hosts to control
    • setup (of atmc-web itself, i.e. providing database connection details etc.)
  • acts as a tool for flexible and robust scheduled remote power management (which is true for amtc itself and amtc-web; amtc-web just adds another layer of comfort regarding shell interaction with your many hosts).

usage

 amtc v0.8.5 - Intel AMT & WS-Man OOB mass management tool
                     https://github.com/schnoddelbotz/amtc
 usage
  amtc [-actions] [-options] host [host ...]

 actions
  -I(nfo)     query powerstate via AMT [default]
  -U(p)       powerup given host(s)
  -D(own)     powerdown
  -C(ycle)    powercycle
  -R(eset)    reset
  -X          select PXE as device for next boot (AMT 9.0+)
  -H          select HDD as device for next boot (AMT 9.0+)
  -S(hutdown) using AMT graceful shutdown (AMT 9.0+)
  -(re)B(oot) using AMT graceful reset    (AMT 9.0+)
  -L(ist)  valid wsman <classname>s for -E(numeration)
  -E(numerate)<classname>       enumerate/list settings
  -M(odify)   <setting>=<value> modify wsman settings
              where supported settings: webui,sol or ping
              and supported values    : on or off
 options
  -5          for AMT 5.0 hosts
  -d          for AMT 9.0+ hosts - use WS-Man/DASH
  -m(aximum)  number of parallel workers to use [40]
  -p(asswdfile) specify file containing AMT password
  -j(son)     produces JSON output of host states
  -q(uiet)    only report unsuccessful operations
  -r(DP)-scan probe TCP port 3389 for OS detection
  -s(SH)-scan probe TCP port 22   for OS detection
  -e(nforce)  rdp/ssh probes, regardless of AMT state
  -t(imeout)  in seconds, for amt and tcp scans [5]
  -g(nutls)   will use TLS and port 16993 [notls/16992]
  -c(acert)   specify TLS CA cert file [/etc/amt-ca.crt]
  -n(oVerify) will skip cert verification for TLS
  -v(erbose)  detailed progress, debug by using -vvv
  -w(ait)     in seconds / float, after each pc. one thread.

status

ever-pre-1.0. just for fun. against all odds. works for me... check the changelog.

You may want to give amtc-web a try -- just login with setup default credentials (admin/amtc). The demo page runs off a read-only sqlite database so you shouldn't be able to make any changes.

amtc 0.8.0 introduced the -E option, which serves for retreiving system configuration and asset management data. Currently, amtc will not parse those replies and just dump the raw SOAP reply. amtc-web currently offers no way yet to retreive/display those values.

Honestly, in some aspects, amtc [still] is a hack. The most obvious one is: amtc has no clue of SOAP. It dumbly replays control commands I once wiresharked (see the cmd_* and wsman_* files in src dir). Other tools available most likely do the right thing™ and use a real SOAP library like gSOAP. If you're hit by this hack, please file a bug of an amtc-run using -vvvv option -- thanks!

building, installation

See INSTALL.md.

license

This project is published under the MIT license. It heavily relies on bundled 3rd party OSS components that are listed in the in-app 'about' page of amtc-web; their individual license texts have been bundled into LICENSES-3rd-party.txt. That file is also distributed with any release of amtc.

alternatives

  • amtgo implements functionality of amtc and amtc-web in a single binary. Maybe give it a try first!
  • amttool: Without amttool, there would be no amtc. Thanks! amttool is implemented in perl and intended for interactive, verbose single-host operation. amtc is implemented in C, and by using threads optimized for quick, succinct (non-)interactive mass-operation.
  • amttool_tng: The next generation. Even more config stuff.
  • vTul: A windows powershell based GUI. Again, completely different story.
  • for DASH-only use, the best choice for windows CLI scenarios is most likely AMD's dashcli. Find MS SCCM plugins there, too.
  • bootstrap your own using the intel AMT SDK
  • OpenWSMAN: Correct SOAP implementation, rich feature set.

amtc's People

Contributors

ferenc- avatar roeme avatar schnoddelbotz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

amtc's Issues

Correctly deleting hosts and OUs

amtc-web lacks the ability to cleanly delete hosts and rooms.
Even worse, deleting and re-creating a room with same hostnames will currently lead to broken monitoring.

boot device selection support

It has been on the usage screen for long, but I never found time to actually include it: amtc -Ub pxe foobar.example.com should power up that host, letting it boot off PXE - even if BIOS defaults to HDD. Current work-around here is to manage clients' pxelinux.cfg files.
As a follow-up, amtc-web's scheduler/GUI should support selecting the boot device.

HTTP:401 on MIPS

MIPS

CPU: MIPS 74Kc V4.12
OS: OpenWrt 14.07
libcurl: 7.38.0

amtc --args -I 192.168.1.171 -vvv -p amt_password.txt

> POST /RemoteControlService HTTP/1.1
User-Agent: amtc (libcurl)
Host: 192.168.1.171:16992
Accept: */*
SOAPAction: "http://schemas.intel.com/platform/client/RemoteControl/2004/01#GetSystemPowerState"
Content-Type: text/xml; charset=utf-8
Content-Length: 484

< HTTP/1.1 401 Unauthorized
< WWW-Authenticate: Digest realm="Digest:10DF0000000000000000000000000000", nonce="+S5HDg4iAACIkRUMJoai5Xyxlc9qWHgc",stale="false",qop="auth"
< Content-Type: text/html
< Server: Intel(R) Active Management Technology 8.0.3
< Content-Length: 689
< Connection: close
< 
-INFO  192.168.1.171 AMT:0016 HTTP:401 No error
singleClient( 2004649264=0689b|http401): tr decreased to   0 by http://192.168.1.171:16992/RemoteControlService
INFO 192.168.1.171   OS:noscan  AMT:16 HTTP:401 No error
(gdb) i loc
hostid = 0
host = 0x419e54 <hostlist>
curl = 0x44c948
res = CURLE_OK
http_code = 401
headers = 0x439910
chunk = {
  memory = 0x45fc70 "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" >\n<html><head><link rel=stylesheet href=styles.css>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\n<title>Intel&reg;"..., 
  size = 689
}
amt_result = -1
os_port = 1
enumCtx = '\000' <repeats 8191 times>
enumTxt = '\000' <repeats 8116 times>, "w\301\337x", '\000' <repeats 16 times>, "w\377\360\000\000\000\000\000w\331\004\350w\331M\350\000\000\000\000\000\000\000\000w\301\345\060w\372\200@\000\000\001\aw\370\201+\000\
000\000\375\000\000\000<\000 \000\000w\372\203X"                                                                                                                                                                         umsg = "w\301\337\310w\376$(w\370\201+", '\000' <repeats 20 times>, "w\377\360\000\000\000\000\000w\301\345\060w\371kD\000\000\000\000w\301\341\000w\301\341\000\000\000\000\000w\301\340\060w\376f\b", '\000' <repeats 1
6 times>, "w\301\340H\000\000\000\fw\337\323\240"                                                                                                                                                                        umsgp = 0x0
(gdb) 

x86_64

libcurl: 7.22.0

* About to connect() to 192.168.1.171 port 16992 (#0)
*   Trying 192.168.1.171... * connected
* Server auth using Digest with user 'admin'
> POST /RemoteControlService HTTP/1.1
User-Agent: amtc (libcurl)
Host: 192.168.1.171:16992
Accept: */*
SOAPAction: "http://schemas.intel.com/platform/client/RemoteControl/2004/01#GetSystemPowerState"
Content-Type: text/xml; charset=utf-8
Content-Length: 0

< HTTP/1.1 401 Unauthorized
< WWW-Authenticate: Digest realm="Digest:10DF0000000000000000000000000000", nonce="HaVJDg8jAAAbbBnP4dmsu0VfBD+wD5YR",stale="false",qop="auth"
< Content-Type: text/html
< Server: Intel(R) Active Management Technology 8.0.3
< Content-Length: 689
< Connection: close
< 
* Closing connection #0
* Issue another request to this URL: 'http://192.168.1.171:16992/RemoteControlService'
* About to connect() to 192.168.1.171 port 16992 (#0)
*   Trying 192.168.1.171... * connected
* Server auth using Digest with user 'admin'
> POST /RemoteControlService HTTP/1.1
Authorization: Digest username="admin", realm="Digest:10DF0000000000000000000000000000", nonce="HaVJDg8jAAAbbBnP4dmsu0VfBD+wD5YR", uri="/RemoteControlService", cnonce="MDA3ODY0", nc=00000001, qop="auth", response="fd2aa92a172bfd7fbc7d0204be8ee23c"
User-Agent: amtc (libcurl)
Host: 192.168.1.171:16992
Accept: */*
SOAPAction: "http://schemas.intel.com/platform/client/RemoteControl/2004/01#GetSystemPowerState"
Content-Type: text/xml; charset=utf-8
Content-Length: 484

* upload completely sent off: 484out of 484 bytes
< HTTP/1.1 200 OK
< Date: Tue, 4 Nov 2014 20:01:17 GMT
< Server: Intel(R) Active Management Technology 8.0.3
< Content-Type: text/xml
< Transfer-Encoding: chunked
< 
* Connection #0 to host 192.168.1.171 left intact
body (size: 386 b) received: '<?xml version="1.0" encoding="UTF-8"?><a:Envelope xmlns:a="http://schemas.xmlsoap.org/soap/envelope/" xmlns:b="http://schemas.intel.com/platform/client/RemoteControl/2004/01" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><a:Body><b:GetSystemPowerStateResponse><b:Status>0</b:Status><b:SystemPowerState>0</b:SystemPowerState></b:GetSystemPowerStateResponse></a:Body></a:Envelope>'
-INFO  192.168.1.171 AMT:0000 HTTP:200 OK S0 (on)
singleClient( -914118912=0386b|http200): tr decreased to   0 by http://192.168.1.171:16992/RemoteControlService
* Closing connection #0
INFO 192.168.1.171   OS:noscan  AMT:00 HTTP:200 OK S0 (on)
(gdb) i loc
hostid = 0
host = 0x610d60 <hostlist>
curl = 0x7ffff00008e0
res = CURLE_OK
http_code = 200
headers = 0x7ffff001b8a0
chunk = {
  memory = 0x7ffff001cf10 "<?xml version=\"1.0\" encoding=\"UTF-8\"?><a:Envelope xmlns:a=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:b=\"http://schemas.intel.com/platform/client/RemoteControl/2004/01\" xmlns:xsi=\"http://www.w3."..., 
  size = 386
}
amt_result = -1
os_port = 1
enumCtx = '\000' <repeats 7672 times>"\344, P\336\367\377\177\000\000\000\000\000\000\000\000\000\000\003\000\000\000\000\000\000\000\030\000\000\000\000\000\000\000pf\374\367\377\177\000\000\227\201B\250\000\000\000\000\342V\336\367\377\177\000\000\027\000\000\000\000\000\000\000@=\264\364\377\177\000\000\377\377\377\377\000\000\000\000\200\031]\367\377\177\000\000\020=\264\364\377\177\000\000\200,]\367\377\177\000\000\340\206]\367\377\177", '\000' <repeats 19 times>, "j\374\367\377\177\000\000\000\320\374\367\377\177\000\000\237\036\226\367\377\177\000\000\340\370]\367\377\177\000\000\070\000\226\367\377\177\000\000\000\000\000\000\005\000\000\000\304\003\000\000\001", '\000' <repeats 11 times>"\200, \256\377\367\377\177\000\000\200=\264\364\377\177\000\000\000j\374\367\377\177\000\000\227\201B\250\000\000\000\000\250=\264\364\377\177\000\000(\253\377\367\377\177\000\000cZ\336\367\377\177", '\000' <repeats 11 times>, "j\374\367\377\177\000\000\005", '\000' <repeats 15 times>, "\001\000\000\000\000\000\000\000"...
enumTxt = '\000' <repeats 8191 times>
umsg = '\000' <repeats 99 times>
umsgp = 0x0

Observation so-far

It appears even on x86_64 the first request results in 401 but then it automagically issues a new request which eventually result in 200, but on MIPS that doesn't happen.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.