diff --git a/agents/modules_meshcmd_min/amt-ider.min.js b/agents/modules_meshcmd_min/amt-ider.min.js deleted file mode 100644 index fe99b6e2..00000000 --- a/agents/modules_meshcmd_min/amt-ider.min.js +++ /dev/null @@ -1 +0,0 @@ -module.exports=function CreateAmtRemoteIder(){var B={};B.protocol=3;B.bytesToAmt=0;B.bytesFromAmt=0;B.rx_timeout=30000;B.tx_timeout=0;B.heartbeat=20000;B.version=1;B.acc=null;B.inSequence=0;B.outSequence=0;B.iderinfo=null;B.enabled=false;B.iderStart=0;B.floppy=null;B.cdrom=null;B.floppyReady=false;B.cdromReady=false;B.sectorStats=null;B.debug=false;var z=new Buffer([0,38,49,128,0,0,0,0,5,30,16,169,8,32,2,0,3,195,0,0,0,0,0,0,0,0,0,0,40,0,0,0,0,0,0,0,2,208,0,0]);var s=new Buffer([0,92,36,128,0,0,0,0,1,10,0,1,0,0,0,0,2,0,0,0,3,22,0,160,0,0,0,0,0,18,2,0,0,0,0,0,0,0,160,0,0,0,5,30,16,169,8,32,2,0,3,195,0,0,0,0,0,0,0,0,0,0,40,0,0,0,0,0,0,0,2,208,0,0,8,10,0,0,0,0,0,0,0,0,0,0,11,6,0,0,0,17,36,49]);var x=new Buffer([0,38,36,128,0,0,0,0,5,30,4,176,2,18,2,0,0,80,0,0,0,0,0,0,0,0,0,0,40,0,0,0,0,0,0,0,2,208,0,0]);var r=new Buffer([0,92,36,128,0,0,0,0,1,10,0,1,0,0,0,0,2,0,0,0,3,22,0,160,0,0,0,0,0,18,2,0,0,0,0,0,0,0,160,0,0,0,5,30,4,176,2,18,2,0,0,80,0,0,0,0,0,0,0,0,0,0,40,0,0,0,0,0,0,0,2,208,0,0,8,10,0,0,0,0,0,0,0,0,0,0,11,6,0,0,0,17,36,49]);var t=new Buffer([0,18,1,128,0,0,0,0,26,10,0,0,0,0,0,0,0,0,0,0]);var u=new Buffer([0,18,1,128,0,0,0,0,29,10,0,0,0,0,0,0,0,0,0,0]);var v=new Buffer([0,32,1,128,0,0,0,0,42,24,0,0,0,0,32,0,0,0,0,0,0,128,0,0,0,0,0,0,0,0,0,0,0,0]);var q=new Buffer([0,40,1,128,0,0,0,0,1,6,0,255,0,0,0,0,42,24,0,0,0,0,2,0,0,0,0,0,0,128,0,0,0,0,0,0,0,0,0,0,0,0]);var i=new Buffer([0,0,0,40,0,0,0,8]);var j=new Buffer([0,0,3,4,0,8,1,0]);var h=new Buffer([0,1,3,4,0,0,0,2]);var m=new Buffer([0,2,3,4,0,0,0,0]);var l=new Buffer([0,3,3,4,41,0,0,2]);var k=new Buffer([0,16,1,8,0,0,8,0,0,1,0,0]);var o=new Buffer([0,30,3,0]);var n=new Buffer([1,0,3,0]);var p=new Buffer([1,5,3,0]);var y=new Buffer([0,18,36,128,0,0,0,0,1,10,0,1,0,0,0,0,2,0,0,0]);var A=new Buffer([0,18,49,128,0,0,0,0,1,10,0,1,0,0,0,0,2,0,0,0]);var w=new Buffer([0,14,1,128,0,0,0,0,1,6,0,255,0,0,0,0]);B.xxStateChange=function(E){if(B.debug){console.log("IDER-StateChange",E)}if(E==0){B.Stop()}if(E==3){B.Start()}};B.Start=function(){if(B.debug){console.log("IDER-Start");console.log(B.floppy,B.cdrom)}B.bytesToAmt=0;B.bytesFromAmt=0;B.inSequence=0;B.outSequence=0;e=[];B.SendCommand(64,Buffer.concat([ShortToStrX(B.rx_timeout),ShortToStrX(B.tx_timeout),ShortToStrX(B.heartbeat),IntToStrX(B.version)]));if(B.sectorStats){B.sectorStats(0,0,B.floppy?(B.floppy.size>>9):0);B.sectorStats(0,1,B.cdrom?(B.cdrom.size>>11):0)}};B.Stop=function(){if(B.debug){console.log("IDER-Stop")}B.parent.Stop()};B.ProcessData=function(E){B.bytesFromAmt+=E.length;if(B.acc==null){B.acc=E}else{B.acc=Buffer.concat(B.acc,E)}if(B.debug){console.log("IDER-ProcessData",B.acc.length,B.acc.toString("hex"))}while(B.acc!=null){var F=B.ProcessDataEx();if(F==0){return}if(B.inSequence!=ReadIntX(B.acc,4)){if(B.debug){console.log("ERROR: Out of sequence",B.inSequence,ReadIntX(B.acc,4))}B.Stop();return}B.inSequence++;if(F==B.acc.length){B.acc=null}else{B.acc=B.acc.slice(F)}}};B.SendCommand=function(F,H,G,I){if(H==null){H=new Buffer(0)}var E=((F>50)&&(G==true))?2:0;if(I){E+=1}var J=Buffer.concat([Buffer([F,0,0,E]),IntToStrX(B.outSequence++),H]);B.parent.xxSend(J);B.bytesToAmt+=J.length};B.SendCommandEndResponse=function(H,I,G,E,F){if(H){B.SendCommand(81,new Buffer([0,0,0,0,0,0,0,0,0,0,0,0,197,0,3,0,0,0,G,80,0,0,0]),true)}else{B.SendCommand(81,new Buffer([0,0,0,0,0,0,0,0,0,0,0,0,135,(I<<4),3,0,0,0,G,81,I,E,F]),true)}};B.SendDataToHost=function(G,E,F,H){var I=(H)?0:F.length;if(E==true){B.SendCommand(84,Buffer.concat([new Buffer([0,(F.length&255),(F.length>>8),0,H?180:181,0,2,0,(I&255),(I>>8),G,88,133,0,3,0,0,0,G,80,0,0,0,0,0,0]),F]),E,H)}else{B.SendCommand(84,Buffer.concat([new Buffer([0,(F.length&255),(F.length>>8),0,H?180:181,0,2,0,(I&255),(I>>8),G,88,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),F]),E,H)}};B.SendGetDataFromHost=function(F,E){B.SendCommand(82,new Buffer([0,(E&255),(E>>8),0,181,0,0,0,(E&255),(E>>8),F,88,0,0,0,0,0,0,0,0,0,0,0]),false)};B.SendDisableEnableFeatures=function(F,E){if(E==null){E=""}B.SendCommand(72,Buffer.concat([new Buffer([F]),E]))};B.ProcessDataEx=function(){if(B.acc.length<8){return 0}switch(B.acc[0]){case 65:if(B.acc.length<30){return 0}var I=B.acc[29];if(B.acc.length<(30+I)){return 0}B.iderinfo={};B.iderinfo.major=B.acc[8];B.iderinfo.minor=B.acc[9];B.iderinfo.fwmajor=B.acc[10];B.iderinfo.fwminor=B.acc[11];B.iderinfo.readbfr=ReadShortX(B.acc,16);B.iderinfo.writebfr=ReadShortX(B.acc,18);B.iderinfo.proto=B.acc[21];B.iderinfo.iana=ReadIntX(B.acc,25);if(B.debug){console.log(B.iderinfo)}if(B.iderinfo.proto!=0){if(B.debug){console.log("Unknown proto",B.iderinfo.proto)}B.Stop()}if(B.iderinfo.readbfr>8192){if(B.debug){console.log("Illegal read buffer size",B.iderinfo.readbfr)}B.Stop()}if(B.iderinfo.writebfr>8192){if(B.debug){console.log("Illegal write buffer size",B.iderinfo.writebfr)}B.Stop()}if(B.iderStart==0){B.SendDisableEnableFeatures(3,IntToStrX(1+8))}else{if(B.iderStart==1){B.SendDisableEnableFeatures(3,IntToStrX(1+16))}else{if(B.iderStart==2){B.SendDisableEnableFeatures(3,IntToStrX(1+24))}}}return 30+I;case 67:if(B.debug){console.log("CLOSE")}B.Stop();return 8;case 68:B.SendCommand(69);return 8;case 69:if(B.debug){console.log("PONG")}return 8;case 70:if(B.acc.length<9){return 0}var J=B.acc[8];if(d===null){B.SendCommand(71);if(B.debug){console.log("RESETOCCURED1",J)}}else{f=true;if(B.debug){console.log("RESETOCCURED2",J)}}return 9;case 73:if(B.acc.length<13){return 0}var K=B.acc[8];var L=ReadIntX(B.acc,9);if(B.debug){console.log("STATUS_DATA",K,L)}switch(K){case 1:if(L&1){if(B.iderStart==0){B.SendDisableEnableFeatures(3,IntToStrX(1+8))}else{if(B.iderStart==1){B.SendDisableEnableFeatures(3,IntToStrX(1+16))}else{if(B.iderStart==2){B.SendDisableEnableFeatures(3,IntToStrX(1+24))}}}}break;case 2:B.enabled=(L&2)?true:false;if(B.debug){console.log("IDER Status: "+B.enabled)}break;case 3:if(L!=1){if(B.debug){console.log("Register toggle failure")}}break}return 13;case 74:if(B.acc.length<11){return 0}if(B.debug){console.log("IDER: ABORT",B.acc[8])}return 11;case 75:return 8;case 80:if(B.acc.length<28){return 0}var F=(B.acc[14]&16)?176:160;var G=B.acc[14];var E=B.acc.slice(16,28);var H=B.acc[9];if(B.debug){console.log("SCSI_CMD",F,E.toString("hex"),H,G)}g(F,E,H,G);return 28;case 83:if(B.acc.length<14){return 0}var I=ReadShortX(B.acc,9);if(B.acc.length<(14+I)){return 0}if(B.debug){console.log("SCSI_WRITE, len = "+(14+I))}B.SendCommand(81,new Buffer([0,0,0,0,0,0,0,0,0,0,0,0,135,112,3,0,0,0,160,81,7,39,0]),true);return 14+I;default:if(B.debug){console.log("Unknown IDER command",B.acc[0])}B.Stop();break}return 0};function g(I,H,K,J){var N;var O;switch(H[0]){case 0:if(B.debug){console.log("SCSI: TEST_UNIT_READY",I)}switch(I){case 160:if(B.floppy==null){B.SendCommandEndResponse(1,2,I,58,0);return -1}if(B.floppyReady==false){B.floppyReady=true;B.SendCommandEndResponse(1,6,I,40,0);return -1}break;case 176:if(B.cdrom==null){B.SendCommandEndResponse(1,2,I,58,0);return -1}if(B.cdromReady==false){B.cdromReady=true;B.SendCommandEndResponse(1,6,I,40,0);return -1}break;default:if(B.debug){console.log("SCSI Internal error 3",I)}return -1}B.SendCommandEndResponse(1,0,I,0,0);break;case 8:N=((H[1]&31)<<16)+(H[2]<<8)+H[3];O=H[4];if(O==0){O=256}if(B.debug){console.log("SCSI: READ_6",I,N,O)}C(I,N,O,K);break;case 10:N=((H[1]&31)<<16)+(H[2]<<8)+H[3];O=H[4];if(O==0){O=256}if(B.debug){console.log("SCSI: WRITE_6",I,N,O)}B.SendCommandEndResponse(1,2,I,58,0);return -1;case 26:if(B.debug){console.log("SCSI: MODE_SENSE_6",I)}if((H[2]==63)&&(H[3]==0)){var E=0,F=0;switch(I){case 160:if(B.floppy==null){B.SendCommandEndResponse(1,2,I,58,0);return -1}E=0;F=128;break;case 176:if(B.cdrom==null){B.SendCommandEndResponse(1,2,I,58,0);return -1}E=5;F=128;break;default:if(B.debug){console.log("SCSI Internal error 6",I)}return -1}B.SendDataToHost(I,true,new Buffer([0,E,F,0]),K&1);return}B.SendCommandEndResponse(1,5,I,36,0);break;case 27:B.SendCommandEndResponse(1,0,I);break;case 30:if(B.debug){console.log("SCSI: ALLOW_MEDIUM_REMOVAL",I)}if((I==160)&&(B.floppy==null)){B.SendCommandEndResponse(1,2,I,58,0);return -1}if((I==176)&&(B.cdrom==null)){B.SendCommandEndResponse(1,2,I,58,0);return -1}B.SendCommandEndResponse(1,0,I,0,0);break;case 35:if(B.debug){console.log("SCSI: READ_FORMAT_CAPACITIES",I)}var G=ReadShort(H,7);var Q=0,V;var P=G/8;switch(I){case 160:if((B.floppy==null)||(B.floppy.size==0)){B.SendCommandEndResponse(0,5,I,36,0);return -1}V=(B.floppy.size>>9)-1;break;case 176:if((B.cdrom==null)||(B.cdrom.size==0)){B.SendCommandEndResponse(0,5,I,36,0);return -1}V=(B.cdrom.size>>11)-1;break;default:if(B.debug){console.log("SCSI Internal error 4",I)}return -1}B.SendDataToHost(I,true,Buffer.concat([IntToStr(8),new Buffer([0,0,11,64,2,0,2,0])]),K&1);break;case 37:if(B.debug){console.log("SCSI: READ_CAPACITY",I)}var O=0;switch(I){case 160:if((B.floppy==null)||(B.floppy.size==0)){B.SendCommandEndResponse(0,2,I,58,0);return -1}if(B.floppy!=null){O=(B.floppy.size>>9)-1}if(B.debug){console.log("DEV_FLOPPY",O)}break;case 176:if((B.cdrom==null)||(B.cdrom.size==0)){B.SendCommandEndResponse(0,2,I,58,0);return -1}if(B.cdrom!=null){O=(B.cdrom.size>>11)-1}if(B.debug){console.log("DEV_CDDVD",O)}break;default:if(B.debug){console.log("SCSI Internal error 4",I)}return -1}if(B.debug){console.log("SCSI: READ_CAPACITY2",I,J)}B.SendDataToHost(J,true,Buffer.concat([IntToStr(O),new Buffer([0,0,((I==176)?8:2),0])]),K&1);break;case 40:N=ReadInt(H,2);O=ReadShort(H,7);if(B.debug){console.log("SCSI: READ_10",I,N,O)}C(I,N,O,K);break;case 42:case 46:N=ReadInt(H,2);O=ReadShort(H,7);if(B.debug){console.log("SCSI: WRITE_10",I,N,O)}B.SendGetDataFromHost(I,512*O);break;case 67:var G=ReadShort(H,7);var R=H[1]&2;var M=H[2]&7;if(M==0){M=H[9]>>6}if(B.debug){console.log("SCSI: READ_TOC, dev="+I+", buflen="+G+", msf="+R+", format="+M)}switch(I){case 160:B.SendCommandEndResponse(1,5,I,32,0);return -1;case 176:break;default:if(B.debug){console.log("SCSI Internal error 9",I)}return -1}if(M==1){B.SendDataToHost(I,true,new Buffer([0,10,1,1,0,20,1,0,0,0,0,0]),K&1)}else{if(M==0){if(R){B.SendDataToHost(I,true,new Buffer([0,18,1,1,0,20,1,0,0,0,2,0,0,20,170,0,0,0,52,19]),K&1)}else{B.SendDataToHost(I,true,new Buffer([0,18,1,1,0,20,1,0,0,0,0,0,0,20,170,0,0,0,0,0]),K&1)}}}break;case 70:var W=(H[1]!=2);var L=ReadShort(H,2);var G=ReadShort(H,7);if(B.debug){console.log("SCSI: GET_CONFIGURATION",I,W,L,G)}if(G==0){B.SendDataToHost(I,true,Buffer.concat([IntToStr(60),IntToStr(8)]),K&1);return -1}var T=null;if(L==0){T=j}if((L==1)||(W&&(L<1))){T=h}if((L==2)||(W&&(L<2))){T=m}if((L==3)||(W&&(L<3))){T=l}if((L==16)||(W&&(L<16))){T=k}if((L==30)||(W&&(L<30))){T=o}if((L==256)||(W&&(L<256))){T=n}if((L==261)||(W&&(L<261))){T=p}if(T==null){T=Buffer.concat([IntToStr(8),IntToStr(4)])}else{T=Buffer.concat([IntToStr(8),IntToStr(T.length+4),T])}if(T.length>G){T=T.slice(0,G)}B.SendDataToHost(I,true,T,K&1);return -1;case 74:if(B.debug){console.log("SCSI: GET_EVENT_STATUS_NOTIFICATION",I,H[1],H[4],H[9])}if((H[1]!=1)&&(H[4]!=16)){if(B.debug){console.log("SCSI ERROR")}B.SendCommandEndResponse(1,5,I,38,1);break}var S=0;if((I==160)&&(B.floppy!=null)){S=2}else{if((I==176)&&(B.cdrom!=null)){S=2}}B.SendDataToHost(I,true,new Buffer([0,S,128,0]),K&1);break;case 76:B.SendCommand(81,Buffer.concat([IntToStrX(0),IntToStrX(0),IntToStrX(0),new Buffer([135,80,3,0,0,0,176,81,5,32,0])]),true);break;case 81:if(B.debug){console.log("SCSI READ_DISC_INFO",I)}B.SendCommandEndResponse(0,5,I,32,0);return -1;case 85:if(B.debug){console.log("SCSI ERROR: MODE_SELECT_10",I)}B.SendCommandEndResponse(1,5,I,32,0);return -1;case 90:if(B.debug){console.log("SCSI: MODE_SENSE_10",I,H[2]&63)}var G=ReadShort(H,7);var T=null;if(G==0){B.SendDataToHost(I,true,Buffer.concat([IntToStr(60),IntToStr(8)]),K&1);return -1}var U=0;if(I==160){if(B.floppy!=null){U=(B.floppy.size>>9)}}else{if(B.cdrom!=null){U=(B.cdrom.size>>11)}}switch(H[2]&63){case 1:if(I==160){T=(U<=2880)?y:A}else{T=w}break;case 5:if(I==160){T=(U<=2880)?x:z}break;case 63:if(I==160){T=(U<=2880)?r:s}else{T=q}break;case 26:if(I==176){T=t}break;case 29:if(I==176){T=u}break;case 42:if(I==176){T=v}break}if(T==null){B.SendCommandEndResponse(0,5,I,32,0)}else{B.SendDataToHost(I,true,T,K&1)}break;default:if(B.debug){console.log("IDER: Unknown SCSI command",H[0])}B.SendCommandEndResponse(0,5,I,32,0);return -1}return 0}function C(E,G,H,F){var I=null;var J=0;if(E==160){I=B.floppy;if(B.floppy!=null){J=(B.floppy.size>>9)}}if(E==176){I=B.cdrom;if(B.cdrom!=null){J=(B.cdrom.size>>11)}}if((H<0)||(G+H>J)){B.SendCommandEndResponse(1,5,E,33,0);return 0}if(H==0){B.SendCommandEndResponse(1,0,E,0,0);return 0}if(I!=null){if(B.sectorStats){B.sectorStats(1,(E==160)?0:1,J,G,H)}if(E==160){G<<=9;H<<=9}else{G<<=11;H<<=11}if(d!==null){e.push({media:I,dev:E,lba:G,len:H,fr:F})}else{d=I;a=E;b=G;c=H;D(F)}}}var e=[];var f=false;var d=null;var a;var b;var c;function D(E){var G=c,F=b;if(c>B.iderinfo.readbfr){G=B.iderinfo.readbfr}c-=G;b+=G;var I=new Buffer(G);fs.readSync(d.file,I,0,G,F);B.SendDataToHost(a,(c==0),I,E&1);if((c>0)&&(f==false)){D(E)}else{d=null;if(f){B.SendCommand(71);e=[];f=false}else{if(e.length>0){var H=e.shift();d=H.media;a=H.dev;b=H.lba;c=H.len;D(H.fr)}}}}return B};function ShortToStr(a){return new Buffer([(a>>8)&255,a&255])}function ShortToStrX(a){return new Buffer([a&255,(a>>8)&255])}function IntToStr(a){return new Buffer([(a>>24)&255,(a>>16)&255,(a>>8)&255,a&255])}function IntToStrX(a){return new Buffer([a&255,(a>>8)&255,(a>>16)&255,(a>>24)&255])}function ReadShort(b,a){return(b[a]<<8)+b[a+1]}function ReadShortX(b,a){return(b[a+1]<<8)+b[a]}function ReadInt(b,a){return(b[a]*16777216)+(b[a+1]<<16)+(b[a+2]<<8)+b[a+3]}function ReadSInt(b,a){return(b[a]<<24)+(b[a+1]<<16)+(b[a+2]<<8)+b[a+3]}function ReadIntX(b,a){return(b[a+3]*16777216)+(b[a+2]<<16)+(b[a+1]<<8)+b[a]}; \ No newline at end of file diff --git a/agents/modules_meshcmd_min/amt-lme.min.js b/agents/modules_meshcmd_min/amt-lme.min.js deleted file mode 100644 index b8254355..00000000 --- a/agents/modules_meshcmd_min/amt-lme.min.js +++ /dev/null @@ -1 +0,0 @@ -var MemoryStream=require("MemoryStream");var lme_id=0;var lme_port_offset=0;var xmlParser=require("amt-xml");var APF_DISCONNECT=1;var APF_SERVICE_REQUEST=5;var APF_SERVICE_ACCEPT=6;var APF_USERAUTH_REQUEST=50;var APF_USERAUTH_FAILURE=51;var APF_USERAUTH_SUCCESS=52;var APF_GLOBAL_REQUEST=80;var APF_REQUEST_SUCCESS=81;var APF_REQUEST_FAILURE=82;var APF_CHANNEL_OPEN=90;var APF_CHANNEL_OPEN_CONFIRMATION=91;var APF_CHANNEL_OPEN_FAILURE=92;var APF_CHANNEL_WINDOW_ADJUST=93;var APF_CHANNEL_DATA=94;var APF_CHANNEL_CLOSE=97;var APF_PROTOCOLVERSION=192;function lme_object(){this.ourId=++lme_id;this.amtId=-1;this.LME_CHANNEL_STATUS="LME_CS_FREE";this.txWindow=0;this.rxWindow=0;this.localPort=0;this.errorCount=0}function stream_bufferedWrite(){var a=require("events").inherits(this);this.buffer=[];this._readCheckImmediate=undefined;this._ObjectID="bufferedWriteStream";a.createEvent("close");a.createEvent("drain");a.createEvent("error");a.createEvent("finish");a.createEvent("pipe");a.createEvent("unpipe");a.createEvent("readable");this.isEmpty=function(){return(this.buffer.length==0)};this.isWaiting=function(){return(this._readCheckImmediate==undefined)};this.write=function(c){for(var b in arguments){if(typeof(arguments[b])=="function"){this.once("drain",arguments[b]);break}}var d=Buffer.alloc(c.length);c.copy(d);this.buffer.push({offset:0,data:d});this.emit("readable");return(this.buffer.length==0?true:false)};this.read=function(){var f=arguments.length==0?undefined:arguments[0];var b=0;var d=[];while((f==undefined||b0){var c=this.buffer[0].data.length-this.buffer[0].offset;var e=this.buffer[0].offset;if(c>(f-b)){d.push(this.buffer[0].data.slice(e,e+f-b));this.buffer[0].offset+=(f-b);b+=(f-b)}else{d.push(this.buffer[0].data.slice(e));b+=c;this.buffer.shift()}}this._readCheckImmediate=setImmediate(function(g){g._readCheckImmediate=undefined;if(g.buffer.length==0){g.emit("drain")}else{g.emit("readable")}},this);return(Buffer.concat(d))}}function lme_heci(c){var a=require("events").inherits(this);a.createEvent("error");a.createEvent("connect");a.createEvent("notify");a.createEvent("bind");if((c!=null)&&(c.debug==true)){lme_port_offset=-100}var b=require("heci");this.INITIAL_RXWINDOW_SIZE=4096;this._ObjectID="lme";this._LME=b.create();this._LME._binded={};this._LME.LMS=this;this._LME.on("error",function(d){this.LMS.emit("error",d)});this._LME.on("connect",function(){this.on("data",function(k){var l=k.readUInt8(0);switch(l){default:console.log("Unhandled LME Command "+l+", "+k.length+" byte(s).");break;case APF_SERVICE_REQUEST:var A=k.readUInt32BE(1);var z=k.slice(5,A+5);if(z=="pfwd@amt.intel.com"||z=="auth@amt.intel.com"){var G=Buffer.alloc(5+A);G.writeUInt8(6,0);G.writeUInt32BE(A,1);G.write(z.toString(),5);this.write(G)}else{}break;case APF_GLOBAL_REQUEST:var A=k.readUInt32BE(1);var z=k.slice(5,A+5).toString();switch(z){case"tcpip-forward":var w=k.readUInt32BE(A+6);var H=k.readUInt32BE(A+10+w);if(this[z]==undefined){this[z]={}}if(this[z][H]!=null){for(var t in this.sockets){var h=this.sockets[t];if(h.localPort==H){this.sockets[t].end();delete this.sockets[t]}}}if(this[z][H]==null){try{this[z][H]=require("net").createServer();this[z][H].HECI=this;if(lme_port_offset==0){this[z][H].listen({port:H,host:"127.0.0.1"})}else{this[z][H].listen({port:(H+lme_port_offset)})}this[z][H].on("connection",function(e){this.HECI.LMS.bindDuplexStream(e,e.remoteFamily,e.localPort-lme_port_offset)});this._binded[H]=true;this.LMS.emit("bind",this._binded)}catch(p){console.log(p,"Port "+H)}}var G=Buffer.alloc(5);G.writeUInt8(81,0);G.writeUInt32BE(H,1);this.write(G);break;case"cancel-tcpip-forward":var G=Buffer.alloc(1);G.writeUInt8(APF_REQUEST_SUCCESS,0);this.write(G);break;case"udp-send-to@amt.intel.com":var G=Buffer.alloc(1);G.writeUInt8(APF_REQUEST_FAILURE,0);this.write(G);break;default:break}break;case APF_CHANNEL_OPEN_CONFIRMATION:var J=k.readUInt32BE(1);var N=k.readUInt32BE(5);var O=k.readUInt32BE(9);if(this.sockets[J]!=undefined){this.sockets[J].lme.amtId=N;this.sockets[J].lme.rxWindow=O;this.sockets[J].lme.txWindow=O;this.sockets[J].lme.LME_CHANNEL_STATUS="LME_CS_CONNECTED";this.sockets[J].bufferedStream=new stream_bufferedWrite();this.sockets[J].bufferedStream.socket=this.sockets[J];this.sockets[J].bufferedStream.on("readable",function(){if(this.socket.lme.txWindow>0){var e=this.read(this.socket.lme.txWindow);var i=Buffer.alloc(9+e.length);i.writeUInt8(APF_CHANNEL_DATA,0);i.writeUInt32BE(this.socket.lme.amtId,1);i.writeUInt32BE(e.length,5);e.copy(i,9);this.socket.lme.txWindow-=e.length;this.socket.HECI.write(i)}});this.sockets[J].bufferedStream.on("drain",function(){this.socket.resume()});this.sockets[J].on("data",function(e){if(!this.bufferedStream.write(e)){this.pause()}});this.sockets[J].on("end",function(){var e=Buffer.alloc(5);e.writeUInt8(APF_CHANNEL_CLOSE,0);e.writeUInt32BE(this.lme.amtId,1);this.HECI.write(e)});this.sockets[J].resume()}break;case APF_PROTOCOLVERSION:var x=k.readUInt32BE(1);var y=k.readUInt32BE(5);var L=k.readUInt32BE(9);var G=Buffer.alloc(93);G.writeUInt8(192,0);G.writeUInt32BE(1,1);G.writeUInt32BE(0,5);G.writeUInt32BE(L,9);this.write(G);break;case APF_CHANNEL_WINDOW_ADJUST:var K=k.readUInt32BE(1);var g=k.readUInt32BE(5);if(this.sockets[K]!=undefined){this.sockets[K].lme.txWindow+=g;if(!this.sockets[K].bufferedStream.isEmpty()&&this.sockets[K].bufferedStream.isWaiting()){this.sockets[K].bufferedStream.emit("readable")}}else{console.log("Unknown Recipient ID/"+K+" for APF_CHANNEL_WINDOW_ADJUST")}break;case APF_CHANNEL_DATA:var K=k.readUInt32BE(1);var n=k.readUInt32BE(5);var m=k.slice(9,9+n);if((this.sockets!=null)&&(this.sockets[K]!=undefined)){this.sockets[K].pendingBytes.push(m.length);this.sockets[K].write(m,function(){var i=this.pendingBytes.shift();var e=Buffer.alloc(9);e.writeUInt8(APF_CHANNEL_WINDOW_ADJUST,0);e.writeUInt32BE(this.lme.amtId,1);e.writeUInt32BE(i,5);this.HECI.write(e)})}else{if((this.insockets!=null)&&(this.insockets[K]!=undefined)){var h=this.insockets[K];if(h.data==null){h.data=m.toString()}else{h.data+=m.toString()}h.rxWindow+=n;var s=parseHttp(h.data);if((s!=null)||(h.data.length>=8000)){var B=null;try{B=xmlParser.ParseWsman(s)}catch(o){}if(B!=null){this.LMS.emit("notify",B,h.options,_lmsNotifyToString(B),_lmsNotifyToCode(B))}var f=Buffer.alloc(5);f.writeUInt8(APF_CHANNEL_CLOSE,0);f.writeUInt32BE(d,1);this.write(f)}else{if(h.rxWindow>6000){var f=Buffer.alloc(9);f.writeUInt8(APF_CHANNEL_WINDOW_ADJUST,0);f.writeUInt32BE(h.amtId,1);f.writeUInt32BE(h.rxWindow,5);this.write(f);h.rxWindow=0}}}else{console.log("Unknown Recipient ID/"+K+" for APF_CHANNEL_DATA")}}break;case APF_CHANNEL_OPEN_FAILURE:var K=k.readUInt32BE(1);var M=k.readUInt32BE(5);if((this.sockets!=null)&&(this.sockets[K]!=undefined)){this.sockets[K].end();delete this.sockets[K]}else{if((this.insockets!=null)&&(this.insockets[K]!=undefined)){delete this.insockets[K]}else{console.log("Unknown Recipient ID/"+K+" for APF_CHANNEL_OPEN_FAILURE")}}break;case APF_CHANNEL_CLOSE:var K=k.readUInt32BE(1);if((this.sockets!=null)&&(this.sockets[K]!=undefined)){this.sockets[K].end();var d=this.sockets[K].lme.amtId;var f=Buffer.alloc(5);delete this.sockets[K];f.writeUInt8(APF_CHANNEL_CLOSE,0);f.writeUInt32BE(d,1);this.write(f)}else{if((this.insockets!=null)&&(this.insockets[K]!=undefined)){delete this.insockets[K]}else{console.log("Unknown Recipient ID/"+K+" for APF_CHANNEL_CLOSE")}}break;case APF_CHANNEL_OPEN:var A=k.readUInt32BE(1);var z=k.slice(5,A+5).toString();var j=k.readUInt32BE(A+5);var u=k.readUInt32BE(A+9);var r=k.readUInt32BE(A+17);var q=k.slice(A+21,A+21+r).toString();var I=k.readUInt32BE(A+21+r);var D=k.readUInt32BE(A+25+r);var C=k.slice(A+29+r,A+29+r+D).toString();var E=k.readUInt32BE(A+29+r+D);if(this.insockets==null){this.insockets={}}var F=++lme_id;var v=new lme_object();v.ourId=F;v.amtId=j;v.txWindow=u;v.rxWindow=0;v.options={target:q,targetPort:I,source:C,sourcePort:E};this.insockets[F]=v;var f=Buffer.alloc(17);f.writeUInt8(APF_CHANNEL_OPEN_CONFIRMATION,0);f.writeUInt32BE(j,1);f.writeUInt32BE(F,5);f.writeUInt32BE(4000,9);f.writeUInt32BE(4294967295,13);this.write(f);break}});this.LMS.emit("connect");this.resume()});this.bindDuplexStream=function(e,h,g){var j=e;j.pendingBytes=[];j.HECI=this._LME;j.LMS=this;j.lme=new lme_object();j.lme.Socket=j;j.localPort=g;var d=new MemoryStream();d.writeUInt8(90);d.writeUInt32BE(15);d.write("forwarded-tcpip");d.writeUInt32BE(j.lme.ourId);d.writeUInt32BE(this.INITIAL_RXWINDOW_SIZE);d.writeUInt32BE(4294967295);for(var f=0;f<2;++f){if(h=="IPv6"){d.writeUInt32BE(3);d.write("::1")}else{d.writeUInt32BE(9);d.write("127.0.0.1")}d.writeUInt32BE(g)}this._LME.write(d.buffer);if(this._LME.sockets==undefined){this._LME.sockets={}}this._LME.sockets[j.lme.ourId]=j;j.pause()};this._LME.connect(b.GUIDS.LME,{noPipeline:0})}function parseHttp(c){var d=c.indexOf("\r\n\r\n");if((d==-1)||(c.length<(d+2))){return null}var b=require("http-headers")(c.substring(0,d),true);var a=parseInt(b["content-length"]);if(c.length>=a+d+4){return c.substring(d+4,d+4+a)}return null}function _lmsNotifyToCode(c){if((c==null)||(c.Body==null)||(c.Body.MessageID==null)){return null}var b=c.Body.MessageID;try{b+="-"+c.Body.MessageArguments[0]}catch(a){}return b}function _lmsNotifyToString(c){if((c==null)||(c.Body==null)||(c.Body.MessageID==null)){return null}var b=c.Body.MessageID;try{b+="-"+c.Body.MessageArguments[0]}catch(a){}if(lmsEvents[b]){return lmsEvents[b]}return null}var lmsEvents={iAMT0001:"System Defense Policy %1s triggered.",iAMT0002:"Agent Presence Agent %1s not started.",iAMT0003:"Agent Presence Agent %1s stopped.",iAMT0004:"Agent Presence Agent %1s running.",iAMT0005:"Agent Presence Agent %1s expired.",iAMT0006:"Agent Presence Agent %1s suspended.",iAMT0007:"Host software attempt to disable AMT Network link detected.",iAMT0008:"Host software attempt to disable AMT Network link detected -- Host Network link blocked.",iAMT0009:"AMT clock or FLASH wear-out protection disabled.",iAMT0010:"Intel(R) AMT Network Interface %1s heuristics defense slow threshold trespassed.",iAMT0011:"Intel(R) AMT Network Interface %1s heuristics defense fast threshold trespassed.",iAMT0012:"Intel(R) AMT Network Interface %1s heuristics defense factory defined threshold trespassed.",iAMT0013:"Intel(R) AMT Network Interface %1s heuristics defense Encounter timeout expired.",iAMT0014:"General certificate error.",iAMT0015:"Certificate expired.",iAMT0016:"No trusted root certificate.",iAMT0017:"Not configured to work with server certificate.",iAMT0018:"Certificate revoked.",iAMT0019:"RSA exponent too large.",iAMT0020:"RSA modulus too large.",iAMT0021:"Unsupported digest.",iAMT0022:"Distinguished name too long.",iAMT0023:"Key usage missing.",iAMT0024:"General SSL handshake error.",iAMT0025:"General 802.1x error.",iAMT0026:"AMT Diagnostic AlertEAC error - General NAC error.",iAMT0027:"AMT Diagnostic AlertEAC error - attempt to get a NAC posture while AMT NAC is disabled.",iAMT0028:"AMT Diagnostic AlertEAC error - attempt to get a posture of an unsupported type.",iAMT0029:"Audit log storage is 50% full.",iAMT0030:"Audit log storage is 75% full.",iAMT0031:"Audit log storage is 85% full.",iAMT0032:"Audit log storage is 95% full.",iAMT0033:"Audit log storage is full.",iAMT0034:"Firmware Update Event - Partial.",iAMT0035:"Firmware Update Event - Failure.",iAMT0036:"Remote connectivity initiated.",iAMT0037:"ME Presence event.","iAMT0038-0":"AMT is being unprovisioned using BIOS command.","iAMT0038-1":"AMT is being unprovisioned using Local MEI command.","iAMT0038-2":"AMT is being unprovisioned using Local WS-MAN/SOAP command.","iAMT0038-3":"AMT is being unprovisioned using Remote WS-MAN/SOAP command.",iAMT0039:"HW Asset Error.",iAMT0050:"User Notification Alert - General Notification.","iAMT0050-16":"User Notification Alert - Circuit Breaker notification (CB Drop TX filter hit.).","iAMT0050-17":"User Notification Alert - Circuit Breaker notification (CB Rate Limit TX filter hit.).","iAMT0050-18":"User Notification Alert - Circuit Breaker notification (CB Drop RX filter hit.).","iAMT0050-19":"User Notification Alert - Circuit Breaker notification (CB Rate Limit RX filter hit.).","iAMT0050-32":"User Notification Alert - EAC notification.","iAMT0050-48":"User Notification Alert - Remote diagnostics - (Remote Redirection session started - SOL).","iAMT0050-49":"User Notification Alert - Remote diagnostics - (Remote Redirection session stopped - SOL).","iAMT0050-50":"User Notification Alert - Remote diagnostics. (Remote Redirection session started - IDE-R).","iAMT0050-51":"User Notification Alert - Remote diagnostics. (Remote Redirection session stopped - IDE-R).","iAMT0050-66":"User Notification Alert - WLAN notification (Host profile mismatch - Management Interface ignored).","iAMT0050-67":"User Notification Alert - WLAN notification (Management device overrides host radio).","iAMT0050-68":"User Notification Alert - WLAN notification (Host profile security mismatch).","iAMT0050-69":"User Notification Alert - WLAN notification (Management device relinquishes control over host Radio).",iAMT0051:"User Notification Alert - SecIo event.","iAMT0051-0":"User Notification Alert - SecIo event semaphore at host.","iAMT0051-1":"User Notification Alert - semaphore at ME.","iAMT0051-2":"User Notification Alert - SecIo event - semaphore timeout.",iAMT0052:"User Notification Alert - KVM session event.","iAMT0052-0":"User Notification Alert - KVM session requested.","iAMT0052-1":"User Notification Alert - KVM session started.","iAMT0052-2":"User Notification Alert - KVM session stopped.","iAMT0052-3":"User Notification Alert - KVM data channel.",iAMT0053:"User Notification Alert - RCS notification.","iAMT0053-50":"User Notification Alert - RCS notification (HW button pressed. Connection initiated automatically).","iAMT0053-52":"User Notification Alert - RCS notification (HW button pressed. Connection wasn't initiated automatically).","iAMT0053-53":"User Notification Alert - RCS notification (Contracts updated).",iAMT0054:"User Notification Alert - WLAN notification. Wireless Profile sync enablement state changed.",iAMT0055:"User Notification Alert - Provisioning state change notification.","iAMT0055-0":"User Notification Alert - Provisioning state change notification - Pre-configuration.","iAMT0055-1":"User Notification Alert - Provisioning state change notification - In configuration.","iAMT0055-2":"User Notification Alert - Provisioning state change notification - Post-configuration.","iAMT0055-3":"User Notification Alert - Provisioning state change notification - Unprovision process has started.",iAMT0056:"User Notification Alert - System Defense change notification.",iAMT0057:"User Notification Alert - Network State change notification.",iAMT0058:"User Notification Alert - Remote Access change notification.","iAMT0058-1":"User Notification Alert - Remote Access change notification - tunnel is closed.",iAMT0059:"User Notification Alert - KVM enabled event.","iAMT0059-0":"User Notification Alert - KVM enabled event - KVM disabled.","iAMT0059-1":"User Notification Alert - KVM enabled event - KVM enabled (both from MEBx and PTNI).",iAMT0060:"User Notification Alert - SecIO configuration event.",iAMT0061:"ME FW reset occurred.",iAMT0062:"User Notification Alert - IpSyncEnabled event.","iAMT0062-0":"User Notification Alert - IpSyncEnabled event - IpSync disabled.","iAMT0062-1":"User Notification Alert - IpSyncEnabled event - IpSync enabled.",iAMT0063:"User Notification Alert - HTTP Proxy sync enabled event.","iAMT0063-0":"User Notification Alert - HTTP Proxy sync enabled event - HTTP Proxy Sync disabled.","iAMT0063-1":"User Notification Alert - HTTP Proxy sync enabled event - HTTP Proxy Sync enabled.",iAMT0064:"User Notification Alert - User Consent event.","iAMT0064-1":"User Notification Alert - User Consent event - User Consent granted.","iAMT0064-2":"User Notification Alert - User Consent event - User Consent ended.","iAMT0067-0":"Graceful Remote Control Operation - Shutdown.","iAMT0067-1":"Graceful Remote Control Operation - Reset.","iAMT0067-2":"Graceful Remote Control Operation - Hibernate.","iAMT0068-0":"Link Protection Notification - No link protection.","iAMT0068-1":"Link Protection Notification - Passive link protection.","iAMT0068-2":"Link Protection Notification - High link protection.","iAMT0069-0":"Local Time Sync Enablement Notification - Local Time Sync Disabled.","iAMT0069-1":"Local Time Sync Enablement Notification - Local Time Sync Enabled.",iAMT0070:"Host Reset Triggered by WD Expiration Notification.",PLAT0004:"The chassis %1s was opened.",PLAT0005:"The chassis %1s was closed.",PLAT0006:"The drive bay %1s was opened.",PLAT0007:"The drive bay %1s was closed.",PLAT0008:"The I/O card area %1s was opened.",PLAT0009:"The I/O card area %1s was closed.",PLAT0010:"The processor area %1s was opened.",PLAT0011:"The processor area %1s was closed.",PLAT0012:"The LAN %1s has been disconnected.",PLAT0013:"The LAN %1s has been connected.",PLAT0016:"The permission to insert package %1s has been granted.",PLAT0017:"The permission to insert package %1s has been removed.",PLAT0018:"The fan card area %1s is open.",PLAT0019:"The fan card area %1s is closed.",PLAT0022:"The computer system %1s has detected a secure mode violation.",PLAT0024:"The computer system %1s has detected a pre-boot user password violation.",PLAT0026:"The computer system %1s has detected a pre-boot setup password violation.",PLAT0028:"The computer system %1s has detected a network boot password violation.",PLAT0030:"The computer system %1s has detected a password violation.",PLAT0032:"The management controller %1s has detected an out-of-band password violation.",PLAT0034:"The processor %1s has been added.",PLAT0035:"The processor %1s has been removed.",PLAT0036:"An over-temperature condition has been detected on the processor %1s.",PLAT0037:"An over-temperature condition has been removed on the processor %1s.",PLAT0038:"The processor %1s is operating in a degraded State.",PLAT0039:"The processor %1s is no longer operating in a degraded State.",PLAT0040:"The processor %1s has failed.",PLAT0042:"The processor %1s has failed.",PLAT0044:"The processor %1s has failed.",PLAT0046:"The processor %1s has failed.",PLAT0048:"The processor %1s has failed.",PLAT0060:"The processor %1s has been enabled.",PLAT0061:"The processor %1s has been disabled.",PLAT0062:"The processor %1s has a configuration mismatch.",PLAT0064:"A terminator has been detected on the processor %1s.",PLAT0084:"The Power Supply %1s has been added.",PLAT0085:"The Power Supply %1s has been removed.",PLAT0086:"The Power Supply %1s has failed.",PLAT0088:"Failure predicted on power supply %1s.",PLAT0096:"The input to power supply %1s has been lost or fallen out of range.",PLAT0098:"The power supply %1s is operating in an input state that is out of range.",PLAT0099:"The power supply %1s has returned to a normal input state.",PLAT0100:"The power supply %1s has lost input.",PLAT0104:"The power supply %1s has a configuration mismatch.",PLAT0106:"Power supply %1s has been disabled.",PLAT0107:"Power supply %1s has been enabled.",PLAT0108:"Power supply %1s has been power cycled.",PLAT0110:"Power supply %1s has encountered an error during power down.",PLAT0112:"Power supply %1s has lost power.",PLAT0114:"Soft power control has failed for power supply %1s.",PLAT0116:"Power supply %1s has failed.",PLAT0118:"Failure predicted on power supply %1s.",PLAT0120:"Memory subsystem failure.",PLAT0122:"DIMM missing.",PLAT0124:"Memory error detected & corrected for DIMM %1s.",PLAT0128:"Memory DIMM %1s added.",PLAT0129:"Memory DIMM %1s removed.",PLAT0130:"Memory DIMM %1s enabled.",PLAT0131:"Memory DIMM %1s disabled.",PLAT0134:"Memory parity error for DIMM %1s.",PLAT0136:"Memory scrub failure for DIMM %1s.",PLAT0138:"Memory uncorrectable error detected for DIMM %1s.",PLAT0140:"Memory sparing initiated for DIMM %1s.",PLAT0141:"Memory sparing concluded for DIMM %1s.",PLAT0142:"Memory DIMM %1s Throttled.",PLAT0144:"Memory logging limit reached for DIMM %1s.",PLAT0145:"Memory logging limit removed for DIMM %1s.",PLAT0146:"An over-temperature condition has been detected on the Memory DIMM %1s.",PLAT0147:"An over-temperature condition has been removed on the Memory DIMM %1s.",PLAT0162:"The drive %1s has been added.",PLAT0163:"The drive %1s has been removed.",PLAT0164:"The drive %1s has been disabled due to a detected fault.",PLAT0167:"The drive %1s has been enabled.",PLAT0168:"Failure predicted on drive %1s.",PLAT0170:"Hot spare enabled for %1s.",PLAT0171:"Hot spare disabled for %1s.",PLAT0172:"Consistency check has begun for %1s.",PLAT0173:"Consistency check completed for %1s.",PLAT0174:"Array %1s is in critical condition.",PLAT0176:"Array %1s has failed.",PLAT0177:"Array %1s has been restored.",PLAT0178:"Rebuild in progress for array %1s.",PLAT0179:"Rebuild completed for array %1s.",PLAT0180:"Rebuild Aborted for array %1s.",PLAT0184:"The system %1s encountered a POST error.",PLAT0186:"The system %1s encountered a firmware hang.",PLAT0188:"The system %1s encountered firmware progress.",PLAT0192:"The log %1s has been disabled.",PLAT0193:"The log %1s has been enabled.",PLAT0194:"The log %1s has been disabled.",PLAT0195:"The log %1s has been enabled.",PLAT0196:"The log %1s has been disabled.",PLAT0198:"The log %1s has been enabled.",PLAT0200:"The log %1s has been cleared.",PLAT0202:"The log %1s is full.",PLAT0203:"The log %1s is no longer full.",PLAT0204:"The log %1s is almost full.",PLAT0208:"The log %1s has a configuration error.",PLAT0210:"The system %1s has been reconfigured.",PLAT0212:"The system %1s has encountered an OEM system boot event.",PLAT0214:"The system %1s has encountered an unknown system hardware fault.",PLAT0216:"The system %1s has generated an auxiliary log entry.",PLAT0218:"The system %1s has executed a PEF action.",PLAT0220:"The system %1s has synchronized the system clock.",PLAT0222:"A diagnostic interrupt has occurred on system %1s.",PLAT0224:"A bus timeout has occurred on system %1s.",PLAT0226:"An I/O channel check NMI has occurred on system %1s.",PLAT0228:"A software NMI has occurred on system %1s.",PLAT0230:"System %1s has recovered from an NMI.",PLAT0232:"A PCI PERR has occurred on system %1s.",PLAT0234:"A PCI SERR has occurred on system %1s.",PLAT0236:"An EISA fail safe timeout occurred on system %1s.",PLAT0238:"A correctable bus error has occurred on system %1s.",PLAT0240:"An uncorrectable bus error has occurred on system %1s.",PLAT0242:"A fatal NMI error has occurred on system %1s.",PLAT0244:"A fatal bus error has occurred on system %1s.",PLAT0246:"A bus on system %1s is operating in a degraded state.",PLAT0247:"A bus on system %1s is no longer operating in a degraded state.",PLAT0248:"The power button %1s has been pressed.",PLAT0249:"The power button %1s has been released.",PLAT0250:"The sleep button %1s has been pressed.",PLAT0251:"The sleep button %1s has been released.",PLAT0252:"The reset button %1s has been pressed.",PLAT0253:"The reset button %1s has been released.",PLAT0254:"The latch to %1s has been opened.",PLAT0255:"The latch to %1s has been closed.",PLAT0256:"The service request %1s has been enabled.",PLAT0257:"The service request %1s has been completed.",PLAT0258:"Power control of system %1s has failed.",PLAT0262:"The network port %1s has been connected.",PLAT0263:"The network port %1s has been disconnected.",PLAT0266:"The connector %1s has encountered a configuration error.",PLAT0267:"The connector %1s configuration error has been repaired.",PLAT0272:"Power on for system %1s.",PLAT0274:"Power cycle hard requested for system %1s.",PLAT0276:"Power cycle soft requested for system %1s.",PLAT0278:"PXE boot requested for system %1s.",PLAT0280:"Diagnostics boot requested for system %1s.",PLAT0282:"System restart requested for system %1s.",PLAT0284:"System restart begun for system %1s.",PLAT0286:"No bootable media available for system %1s.",PLAT0288:"Non-bootable media selected for system %1s.",PLAT0290:"PXE server not found for system %1s.",PLAT0292:"User timeout on boot for system %1s.",PLAT0296:"System %1s boot from floppy initiated.",PLAT0298:"System %1s boot from local drive initiated.",PLAT0300:"System %1s boot from PXE on network port initiated.",PLAT0302:"System %1s boot diagnostics initiated.",PLAT0304:"System %1s boot from CD initiated.",PLAT0306:"System %1s boot from ROM initiated.",PLAT0312:"System %1s boot initiated.",PLAT0320:"Critical stop during OS load on system %1s.",PLAT0322:"Run-time critical stop on system %1s.",PLAT0324:"OS graceful stop on system %1s.",PLAT0326:"OS graceful shutdown begun on system %1s.",PLAT0327:"OS graceful shutdown completed on system %1s.",PLAT0328:"Agent not responding on system %1s.",PLAT0329:"Agent has begun responding on system %1s.",PLAT0330:"Fault in slot on system %1s.",PLAT0331:"Fault condition removed on system %1s.",PLAT0332:"Identifying slot on system %1s.",PLAT0333:"Identify stopped on slot for system %1s.",PLAT0334:"Package installed in slot for system %1s.",PLAT0336:"Slot empty system %1s.",PLAT0338:"Slot in system %1s is ready for installation.",PLAT0340:"Slot in system %1s is ready for removal.",PLAT0342:"Power is off on slot of system %1s.",PLAT0344:"Power is on for slot of system %1s.",PLAT0346:"Removal requested for slot of system %1s.",PLAT0348:"Interlock activated on slot of system %1s.",PLAT0349:"Interlock de-asserted on slot of system %1s.",PLAT0350:"Slot disabled on system %1s.",PLAT0351:"Slot enabled on system %1s.",PLAT0352:"Slot of system %1s holds spare.",PLAT0353:"Slot of system %1s no longer holds spare.",PLAT0354:"Computer system %1s enabled.",PLAT0356:"Computer system %1s is in sleep - light mode.",PLAT0358:"Computer system %1s is in hibernate.",PLAT0360:"Computer system %1s is in standby.",PLAT0362:"Computer system %1s is in soft off mode.",PLAT0364:"Computer system %1s is in hard off mode.",PLAT0366:"Computer system %1s is sleeping.",PLAT0368:"Watchdog timer expired for %1s.",PLAT0370:"Reboot of system initiated by watchdog %1s.",PLAT0372:"Powering off system initiated by watchdog %1s.",PLAT0374:"Power cycle of system initiated by watchdog %1s.",PLAT0376:"Watchdog timer interrupt occurred for %1s.",PLAT0378:"A page alert has been generated for system %1s.",PLAT0380:"A LAN alert has been generated for system %1s.",PLAT0382:"An event trap has been generated for system %1s.",PLAT0384:"An SNMP trap has been generated for system %1s.",PLAT0390:"%1s detected as present.",PLAT0392:"%1s detected as absent.",PLAT0394:"%1s has been disabled.",PLAT0395:"%1s has been enabled.",PLAT0396:"Heartbeat lost for LAN %1s.",PLAT0397:"Heartbeat detected for LAN %1s.",PLAT0398:"Sensor %1s is unavailable or degraded on management system.",PLAT0399:"Sensor %1s has returned to normal on management system.",PLAT0400:"Controller %1s is unavailable or degraded on management system.",PLAT0401:"Controller %1s has returned to normal on management system.",PLAT0402:"Management system %1s is off-line.",PLAT0404:"Management system %1s is disabled.",PLAT0405:"Management system %1s is enabled.",PLAT0406:"Sensor %1s has failed on management system.",PLAT0408:"FRU %1s has failed on management system.",PLAT0424:"The battery %1s is critically low.",PLAT0427:"The battery %1s is no longer critically low.",PLAT0430:"The battery %1s has been removed from unit.",PLAT0431:"The battery %1s has been added.",PLAT0432:"The battery %1s has failed.",PLAT0434:"Session audit is deactivated on system %1s.",PLAT0435:"Session audit is activated on system %1s.",PLAT0436:"A hardware change occurred on system %1s.",PLAT0438:"A firmware or software change occurred on system %1s.",PLAT0440:"A hardware incompatibility was detected on system %1s.",PLAT0442:"A firmware or software incompatibility was detected on system %1s.",PLAT0444:"Invalid or unsupported hardware was detected on system %1s.",PLAT0446:"Invalid or unsupported firmware or software was detected on system %1s.",PLAT0448:"A successful hardware change was detected on system %1s.",PLAT0450:"A successful software or firmware change was detected on system %1s.",PLAT0464:"FRU %1s not installed on system.",PLAT0465:"FRU %1s installed on system.",PLAT0466:"Activation requested for FRU %1s on system.",PLAT0467:"FRU %1s on system is active.",PLAT0468:"Activation in progress for FRU %1s on system.",PLAT0470:"Deactivation request for FRU %1s on system.",PLAT0471:'FRU %1s on system is in standby or "hot spare" state.',PLAT0472:"Deactivation in progress for FRU %1s on system.",PLAT0474:"Communication lost with FRU %1s on system.",PLAT0476:"Numeric sensor %1s going low (lower non-critical).",PLAT0478:"Numeric sensor %1s going high (lower non-critical).",PLAT0480:"Numeric sensor %1s going low (lower critical).",PLAT0482:"Numeric sensor %1s going high (lower critical).",PLAT0484:"Numeric sensor %1s going low (lower non-recoverable).",PLAT0486:"Numeric sensor %1s going high (lower non-critical).",PLAT0488:"Numeric sensor %1s going low (upper non-critical).",PLAT0490:"Numeric sensor %1s going high (upper non-critical).",PLAT0492:"Numeric sensor %1s going low (upper critical).",PLAT0494:"Numeric sensor %1s going high (upper critical).",PLAT0496:"Numeric sensor %1s going low (upper non-recoverable).",PLAT0498:"Numeric sensor %1s going high (upper non-recoverable).",PLAT0500:"Sensor %1s has transitioned to idle.",PLAT0502:"Sensor %1s has transitioned to active.",PLAT0504:"Sensor %1s has transitioned to busy.",PLAT0508:"Sensor %1s has asserted.",PLAT0509:"Sensor %1s has de-asserted.",PLAT0510:"Sensor %1s is asserting predictive failure.",PLAT0511:"Sensor %1s is de-asserting predictive failure.",PLAT0512:"Sensor %1s has indicated limit exceeded.",PLAT0513:"Sensor %1s has indicated limit no longer exceeded.",PLAT0514:"Sensor %1s has indicated performance met.",PLAT0516:"Sensor %1s has indicated performance lags.",PLAT0518:"Sensor %1s has transitioned to normal state.",PLAT0520:"Sensor %1s has transitioned from normal to non-critical state.",PLAT0522:"Sensor %1s has transitioned to critical from a less severe state.",PLAT0524:"Sensor %1s has transitioned to non-recoverable from a less severe state.",PLAT0526:"Sensor %1s has transitioned to non-critical from a more severe state.",PLAT0528:"Sensor %1s has transitioned to critical from a non-recoverable state.",PLAT0530:"Sensor %1s has transitioned to non-recoverable.",PLAT0532:"Sensor %1s indicates a monitor state.",PLAT0534:"Sensor %1s has an informational state.",PLAT0536:"Device %1s has been added.",PLAT0537:"Device %1s has been removed from unit.",PLAT0538:"Device %1s has been enabled.",PLAT0539:"Device %1s has been disabled.",PLAT0540:"Sensor %1s has indicated a running state.",PLAT0544:"Sensor %1s has indicated a power off state.",PLAT0546:"Sensor %1s has indicated an on-line state.",PLAT0548:"Sensor %1s has indicated an off-line state.",PLAT0550:"Sensor %1s has indicated an off-duty state.",PLAT0552:"Sensor %1s has indicated a degraded state.",PLAT0554:"Sensor %1s has indicated a power save state.",PLAT0556:"Sensor %1s has indicated an install error.",PLAT0558:"Redundancy %1s has been lost.",PLAT0560:"Redundancy %1s has been reduced.",PLAT0561:"Redundancy %1s has been restored.",PLAT0562:"%1s has transitioned to a D0 power state.",PLAT0564:"%1s has transitioned to a D1 power state.",PLAT0566:"%1s has transitioned to a D2 power state.",PLAT0568:"%1s has transitioned to a D3 power state.",PLAT0720:"The System %1s encountered firmware progress - memory initialization entry.",PLAT0721:"The System %1s encountered firmware progress - memory initialization exit.",PLAT0722:"The System %1s encountered firmware progress - hard drive initialization entry.",PLAT0723:"The System %1s encountered firmware progress - hard drive initialization exit.",PLAT0724:"The System %1s encountered firmware progress - user authentication.",PLAT0728:"The System %1s encountered firmware progress - USR resource configuration entry.",PLAT0729:"The System %1s encountered firmware progress - USR resource configuration exit.",PLAT0730:"The System %1s encountered firmware progress - PCI recource configuration entry.",PLAT0731:"The System %1s encountered firmware progress - PCI recource configuration exit.",PLAT0732:"The System %1s encountered firmware progress - Option ROM initialization entry.",PLAT0733:"The System %1s encountered firmware progress - Option ROM initialization entry exit.",PLAT0734:"The System %1s encountered firmware progress -video initialization entry entry.",PLAT0735:"The System %1s encountered firmware progress - video initialization entry exit.",PLAT0736:"The System %1s encountered firmware progress - cache initialization entry.",PLAT0737:"The System %1s encountered firmware progress - cache initialization exit.",PLAT0738:"The System %1s encountered firmware progress - keyboard controller initialization entry.",PLAT0739:"The System %1s encountered firmware progress - keyboard controller initialization exit.",PLAT0740:"The System %1s encountered firmware progress - motherboard initialization entry.",PLAT0741:"The System %1s encountered firmware progress - motherboard initialization exit.",PLAT0742:"The System %1s encountered firmware progress - floppy disk initialization entry.",PLAT0743:"The System %1s encountered firmware progress - floppy disk initialization exit.",PLAT0744:"The System %1s encountered firmware progress - keyboard test entry.",PLAT0745:"The System %1s encountered firmware progress - keyboard test exit.",PLAT0746:"The System %1s encountered firmware progress - pointing device test entry.",PLAT0747:"The System %1s encountered firmware progress - pointing device test exit.",PLAT0750:"The System %1s encountered firmware progress - dock enable entry.",PLAT0751:"The System %1s encountered firmware progress - dock enable exit.",PLAT0752:"The System %1s encountered firmware progress - dock disable entry.",PLAT0753:"The System %1s encountered firmware progress - dock disable exit.",PLAT0760:"The System %1s encountered firmware progress - start OS boot process.",PLAT0762:"The System %1s encountered firmware progress - call OS wake vector.",PLAT0764:"The System %1s encountered firmware progress - unrecoverable keyboard failure.",PLAT0766:"The System %1s encountered firmware progress - no video device detected.",PLAT0768:"The System %1s encountered firmware progress - SMART alert detected on drive.",PLAT0770:"The System %1s encountered firmware progress - unrecoverable boot device failure.",PLAT0789:"Corrupt BIOS detected.",PLAT0790:"The System %1s encountered PCI configuration failure.",PLAT0791:"The System %1s encountered a video subsystem failure.",PLAT0792:"The System %1s encountered a storage subsystem failure.",PLAT0793:"The System %1s encountered a USB subsystem failure.",PLAT0794:"The System %1s has detected no memory in the system.",PLAT0795:"The System %1s encountered a motherboard failure.",PLAT0796:"The System %1s encountered a memory Regulator Voltage Bad.",PLAT0797:"%1s PCI reset is not deasserting.",PLAT0798:"%1s Non-Motherboard Regulator Failure.",PLAT0799:"%1s Power Supply Cable failure.",PLAT0800:"%1s Motherboard regulator failure.",PLAT0801:"%1s System component compatibility mismatch."};module.exports=lme_heci; \ No newline at end of file diff --git a/agents/modules_meshcmd_min/amt-mei.min.js b/agents/modules_meshcmd_min/amt-mei.min.js deleted file mode 100644 index 840cb662..00000000 --- a/agents/modules_meshcmd_min/amt-mei.min.js +++ /dev/null @@ -1 +0,0 @@ -var Q=require("queue");function amt_heci(){var d=require("events").inherits(this);d.createEvent("error");var u=require("heci");var y=function(F){try{require("MeshAgent").SendCommand({action:"msg",type:"console",value:F})}catch(E){}};this._ObjectID="pthi";this._rq=new Q();this._setupPTHI=function b(){this._amt=u.create();this._amt.BiosVersionLen=65;this._amt.UnicodeStringLen=20;this._amt.Parent=this;this._amt.on("error",function F(H){if(this.Parent._rq.isEmpty()){this.Parent.emit("error",H)}else{var J=this.Parent._rq.deQueue();var I=J.optional;var G=J.func;I.unshift({Status:-1});G.apply(this.Parent,I);if(!this.Parent._rq.isEmpty()){this.connect(u.GUIDS.AMT,{noPipeline:1})}}});this._amt.on("connect",function E(){this.on("data",function G(I){var J=this.Parent.getCommand(I);var L=this.Parent._rq.deQueue();var K=L.optional;var H=L.func;K.unshift(J);H.apply(this.Parent,K);if(this.Parent._rq.isEmpty()){this.Parent._amt.disconnect();this.Parent._amt=null}else{this.write(this.Parent._rq.peekQueue().send)}});this.write(this.Parent._rq.peekQueue().send)})};function B(E){var F=E.indexOf("\0");if(F>=0){return E.substring(0,F)}else{return E}}this.getCommand=function g(E){var F=E.length==0?(this._rq.peekQueue().cmd|8388608):E.readUInt32LE(4);var G={IsResponse:(F&8388608)==8388608?true:false,Command:(F&8388607),Status:E.length!=0?E.readUInt32LE(12):-1,Data:E.length!=0?E.slice(16):null};return(G)};this.sendCommand=function x(){if(arguments.length<3||typeof(arguments[0])!="number"||typeof(arguments[1])!="object"||typeof(arguments[2])!="function"){throw ("invalid parameters")}var E=[];for(var G=3;G0){N.BiosVersion=N.BiosVersion.substring(0,N.BiosVersion.indexOf("\0"))}L.unshift(N)}else{L.unshift(null)}I.apply(this,L)},E,G)};function D(G,F){if((F==null)&&(typeof(F)!="number")){return null}if(G==null){G=""}var H="";for(var E=0;E0){J.unshift(I.Data.slice(2,2+K).toString())}else{J.unshift(null)}}else{J.unshift(null)}H.apply(this,J)},E,G)};this.getHashHandles=function k(E){var G=[];for(var F=1;F0){this.getCertHashEntry(G.shift(),this._getHashEntrySink,F,H,E,G)}else{H.unshift(E);F.apply(this,H)}};this.getLocalSystemAccount=function m(E){var G=[];for(var F=1;F>24)&255)+"."+((K>>16)&255)+"."+((K>>8)&255)+"."+(K&255);O.unshift(N);L.apply(this,O)}else{O.unshift(null);L.apply(this,O)}},E,J)};this.unprovision=function C(H,E){var I=[];for(var G=2;G=0){b.xxSend(String.fromCharCode(19,0,0,0,4)+IntToStrX(b.user.length+b.authuri.length+8)+String.fromCharCode(b.user.length)+b.user+String.fromCharCode(0,0)+String.fromCharCode(b.authuri.length)+b.authuri+String.fromCharCode(0,0,0,0))}else{if(d.indexOf(3)>=0){b.xxSend(String.fromCharCode(19,0,0,0,3)+IntToStrX(b.user.length+b.authuri.length+7)+String.fromCharCode(b.user.length)+b.user+String.fromCharCode(0,0)+String.fromCharCode(b.authuri.length)+b.authuri+String.fromCharCode(0,0,0))}else{if(d.indexOf(1)>=0){b.xxSend(String.fromCharCode(19,0,0,0,1)+IntToStrX(b.user.length+b.pass.length+2)+String.fromCharCode(b.user.length)+b.user+String.fromCharCode(b.pass.length)+b.pass)}else{b.Stop()}}}}else{if((g==3||g==4)&&y==1){var m=0;var w=e[m];var v=e.slice(m+1,m+1+w).toString();m+=(w+1);if(b.digestRealmMatch&&(b.digestRealmMatch!=v)){b.Stop();return}var r=e[m];var q=e.slice(m+1,m+1+r).toString();m+=(r+1);var u=0;var t=null;var k=b.xxRandomValueHex(32);var x="00000002";var p="";if(g==4){u=e[m];t=e.slice(m+1,m+1+u).toString();m+=(u+1);p=x+":"+k+":"+t+":"}var o=hex_md5(hex_md5(b.user+":"+v+":"+b.pass)+":"+q+":"+p+hex_md5("POST:"+b.authuri));var A=b.user.length+v.length+q.length+b.authuri.length+k.length+x.length+o.length+7;if(g==4){A+=(t.length+1)}var h=Buffer.concat([new Buffer([19,0,0,0,g]),new Buffer([A&255,(A>>8)&255,0,0]),new Buffer([b.user.length]),new Buffer(b.user),new Buffer([v.length]),new Buffer(v),new Buffer([q.length]),new Buffer(q),new Buffer([b.authuri.length]),new Buffer(b.authuri),new Buffer([k.length]),new Buffer(k),new Buffer([x.length]),new Buffer(x),new Buffer([o.length]),new Buffer(o)]);if(g==4){h=Buffer.concat([h,new Buffer([t.length]),new Buffer(t)])}b.xxSend(h)}else{if(y==0){if(b.protocol==1){}if(b.protocol==2){b.xxSend(new Buffer([64,0,0,0,0,0,0,0]))}if(b.protocol==3){b.connectstate=1;b.xxStateChange(3)}}else{b.Stop()}}}break;case 33:if(b.amtaccumulator.length<23){break}j=23;b.xxSend(String.fromCharCode(39,0,0,0)+ToIntStr(b.amtsequence++)+String.fromCharCode(0,0,27,0,0,0));if(b.protocol==1){b.amtkeepalivetimer=setInterval(b.xxSendAmtKeepAlive,2000)}b.connectstate=1;b.xxStateChange(3);break;case 41:if(b.amtaccumulator.length<10){break}j=10;break;case 42:if(b.amtaccumulator.length<10){break}var l=(10+((b.amtaccumulator[9]&255)<<8)+(b.amtaccumulator[8]&255));if(b.amtaccumulator.length8){b.m.ProcessData(b.amtaccumulator.substring(8))}j=b.amtaccumulator.length;break;default:console.log("Unknown Intel AMT command: "+b.amtaccumulator[0]+" acclen="+b.amtaccumulator.length);b.Stop();return}if(j==0){return}if(j==b.amtaccumulator.length){b.amtaccumulator=null}else{b.amtaccumulator=b.amtaccumulator.slice(j)}}};b.xxSend=function(d){if(c&&c.redirtrace){console.log("REDIR-SEND("+d.length+"): "+rstr2hex(d))}if(typeof d=="string"){b.socket.write(new Buffer(d,"binary"))}else{b.socket.write(d)}};b.Send=function(d){if(b.socket==null||b.connectstate!=1){return}if(b.protocol==1){b.xxSend(String.fromCharCode(40,0,0,0)+ToIntStr(b.amtsequence++)+ToShortStr(d.length)+d)}else{b.xxSend(d)}};b.xxSendAmtKeepAlive=function(){if(b.socket==null){return}b.xxSend(String.fromCharCode(43,0,0,0)+ToIntStr(b.amtsequence++))};b.xxRandomValueHex=function(f){var g=[],e=Math.floor(f/2);for(var d=0;d>8)&255),((a>>16)&255),((a>>24)&255))}function ToShortStr(a){return String.fromCharCode((a&255),((a>>8)&255))}function ShortToStr(a){return String.fromCharCode((a>>8)&255,a&255)}function ShortToStrX(a){return String.fromCharCode(a&255,(a>>8)&255)}function IntToStr(a){return String.fromCharCode((a>>24)&255,(a>>16)&255,(a>>8)&255,a&255)}function IntToStrX(a){return String.fromCharCode(a&255,(a>>8)&255,(a>>16)&255,(a>>24)&255)}var md5hasher=require("MD5Stream").create();function hex_md5(b){return md5hasher.syncHash(b).toString("hex").toLowerCase()}; \ No newline at end of file diff --git a/agents/modules_meshcmd_min/amt-scanner.min.js b/agents/modules_meshcmd_min/amt-scanner.min.js deleted file mode 100644 index 0de77528..00000000 --- a/agents/modules_meshcmd_min/amt-scanner.min.js +++ /dev/null @@ -1 +0,0 @@ -function AMTScanner(){var a=require("events").inherits(this);a.createEvent("found");this.dgram=require("dgram");this.buildRmcpPing=function(c){var b=Buffer.from("06000006000011BE80000000","hex");b[9]=c;return b};this.parseRmcpPacket=function(h,b,g,d){if(b==null||b.length<20){return}var f={};if(((b[12]==0)||(b[13]!=0)||(b[14]!=1)||(b[15]!=87))&&(b[21]&32)){f.servertag=b[9];f.minorVersion=b[18]&15;f.majorVersion=(b[18]>>4)&15;f.provisioningState=b[19]&3;var e=(b[16]*256)+b[17];var c=((b[19]&4)!=0)?true:false;f.openPorts=[e];f.address=g.address;if(c==true){f.openPorts=[16992,16993]}if(d!==undefined){d(h,f)}}};this.parseIPv4Range=function(f){if(f==undefined||f==null){return null}var g=f.split("-");if(g.length==2){return{min:this.parseIpv4Addr(g[0]),max:this.parseIpv4Addr(g[1])}}g=f.split("/");if(g.length==2){var c=this.parseIpv4Addr(g[0]),e=parseInt(g[1]),d=0;if(e<=16||e>32){return null}e=32-e;for(var b=0;b>24)&255)+"."+((b>>16)&255)+"."+((b>>8)&255)+"."+(b&255)};this.scan=function(e,h,b){var d=this.parseIPv4Range(e);var f=this.buildRmcpPing(0);var g=this.dgram.createSocket({type:"udp4"});g.parent=this;g.scanResults=[];g.on("error",function(j){console.log("Error:"+j)});g.on("message",function(j,k){if(k.size>4){this.parent.parseRmcpPacket(this,j,k,function(m,l){m.scanResults.push(l)})}});g.on("listening",function(){for(var j=d.min;j<=d.max;j++){g.send(f,623,g.parent.IPv4NumToStr(j))}});g.bind({address:"0.0.0.0",port:0,exclusive:true});var i=setTimeout(function c(){g.close();if(b){b(g.scanResults)}g.parent.emit("found",g.scanResults);delete g},h)}}module.exports=AMTScanner; \ No newline at end of file diff --git a/agents/modules_meshcmd_min/amt-script.min.js b/agents/modules_meshcmd_min/amt-script.min.js deleted file mode 100644 index 62a1a11e..00000000 --- a/agents/modules_meshcmd_min/amt-script.min.js +++ /dev/null @@ -1 +0,0 @@ -script_functionTable1=["nop","jump","set","print","dialog","getitem","substr","indexof","split","join","length","jsonparse","jsonstr","add","substract","parseint","wsbatchenum","wsput","wscreate","wsdelete","wsexec","scriptspeed","wssubscribe","wsunsubscribe","readchar","signwithdummyca"];script_functionTable2=["encodeuri","decodeuri","passwordcheck","atob","btoa","hex2str","str2hex","random","md5","maketoarray","readshort","readshortx","readint","readsint","readintx","shorttostr","shorttostrx","inttostr","inttostrx"];script_functionTableX2=[encodeURI,decodeURI,passwordcheck,atob,btoa,hex2rstr,rstr2hex,random,rstr_md5,MakeToArray,ReadShort,ReadShortX,ReadInt,ReadSInt,ReadIntX,ShortToStr,ShortToStrX,IntToStr,IntToStrX];function MakeToArray(a){if(!a||a==null||typeof a=="object"){return a}return[a]}function ReadShort(b,a){return(b[a]<<8)+b[a+1]}function ReadShortX(b,a){return(b[a+1]<<8)+b[a]}function ReadInt(b,a){return(b[a]*16777216)+(b[a+1]<<16)+(b[a+2]<<8)+b[a+3]}function ReadSInt(b,a){return(b[a]<<24)+(b[a+1]<<16)+(b[a+2]<<8)+b[a+3]}function ReadIntX(b,a){return(b[a+3]*16777216)+(b[a+2]<<16)+(b[a+1]<<8)+b[a]}function ShortToStr(a){return String.fromCharCode((a>>8)&255,a&255)}function ShortToStrX(a){return String.fromCharCode(a&255,(a>>8)&255)}function IntToStr(a){return String.fromCharCode((a>>24)&255,(a>>16)&255,(a>>8)&255,a&255)}function IntToStrX(a){return String.fromCharCode(a&255,(a>>8)&255,(a>>16)&255,(a>>24)&255)}function btoa(a){return Buffer.from(a).toString("base64")}function atob(b){var c=null;try{c=Buffer.from(b,"base64").toString()}catch(a){console.log(a)}return c}function passwordcheck(g){if(g.length<8){return false}var h=0,d=0,f=0,e=0;for(var b in g){var a=g.charCodeAt(b);if((a>64)&&(a<91)){h=1}else{if((a>96)&&(a<123)){d=1}else{if((a>47)&&(a<58)){f=1}else{e=1}}}}return((h+d+f+e)==4)}function hex2rstr(a){Buffer.from(a,"hex").toString()}function rstr2hex(a){Buffer.from(a).toString("hex")}function random(){return Math.floor(Math.random()*max)}function rstr_md5(a){return hex2rstr(hex_md5(a))}function getItem(b,c,d){for(var a in b){if(b[a][c]==d){return b[a]}}return null}var httpErrorTable={200:"OK",401:"Authentication Error",408:"Timeout Error",601:"WSMAN Parsing Error",602:"Unable to parse HTTP response header",603:"Unexpected HTTP enum response",604:"Unexpected HTTP pull response",998:"Invalid TLS certificate"};module.exports.setup=function(a,c){var b={startvars:c,onCompleted:null};if(a.length<6){console.error("Invalid script length");return null}if(ReadInt(a,0)!=612182341){console.error("Invalid binary script");return null}if(ReadShort(a,4)>1){console.error("Unsupported script version");return null}b.script=a.slice(6);b.reset=function(d){b.stop();b.ip=0;b.variables=c;b.state=1};b.start=function(d){b.stop();if(d==null){b.stepspeed=10}else{b.stepspeed=d}if(b.stepspeed>0){b.timer=setInterval(function(){b.step()},b.stepspeed)}};b.stop=function(){if(b.timer!=null){clearInterval(b.timer)}b.timer=null;b.stepspeed=0};b.getVar=function(d){if(d==undefined){return undefined}return b.getVarEx(d.split("."),b.variables)};b.getVarEx=function(f,g){try{if(f==undefined){return undefined}if(f.length==0){return g}return b.getVarEx(f.slice(1),g[f[0]])}catch(d){return null}};b.setVar=function(d,e){b.setVarEx(d.split("."),b.variables,e)};b.setVarEx=function(d,f,e){if(d.length==1){f[d[0]]=e}else{b.setVarEx(d.slice(1),f[d[0]],e)}};b.step=function(){if(b.state!=1){return}if(b.ip1){var r=l.split("{").pop().split("}").shift();l=l.replace("{"+r+"}",b.getVar(r))}}if(k==1){b.variables["__"+p]=decodeURI(l);l="__"+p}h.push(l)}if(k==2||k==3){b.variables["__"+p]=ReadSInt(l,0);h.push("__"+p)}g+=(2+f)}b.ip+=n;var j=[];for(var p=0;p<10;p++){j.push(b.getVar(h[p]))}var q;try{if(m<10000){switch(m){case 0:break;case 1:if(j[2]){if((j[2]=="<"&&j[1]="&&j[1]>=j[3])||(j[2]==">"&&j[1]>j[3])){b.ip=j[0]}}else{b.ip=j[0]}break;case 2:if(h[1]==undefined){delete b.variables[h[0]]}else{b.setVar(h[0],j[1])}break;case 3:var s=b.toString(j[0]);if(s.indexOf("INFO: ")==0){s=s.substring(6)}if(s.indexOf("SUCCESS: ")==0){s=s.substring(9)}if(b.onConsole){b.onConsole(s,b)}else{console.log(s)}break;case 4:b.state=2;b.dialog=true;setDialogMode(11,j[0],j[2],b.xxStepDialogOk,j[1],b);break;case 5:for(var p in j[1]){if(j[1][p][j[2]]==j[3]){q=p}}break;case 6:q=j[1].substr(j[2],j[3]);break;case 7:q=j[1].indexOf(j[2]);break;case 8:q=j[1].split(j[2]);break;case 9:q=j[1].join(j[2]);break;case 10:if(j[1]==null){q=0}else{q=j[1].length}break;case 11:q=JSON.parse(j[1]);break;case 12:q=JSON.stringify(j[1]);break;case 13:q=(j[1]+j[2]);break;case 14:q=(j[1]-j[2]);break;case 15:q=parseInt(j[1]);break;case 16:b.state=2;b.amtstack.BatchEnum(j[0],j[1],b.xxWsmanReturn,b);break;case 17:b.state=2;b.amtstack.Put(j[0],j[1],b.xxWsmanReturn,b);break;case 18:b.state=2;b.amtstack.Create(j[0],j[1],b.xxWsmanReturn,b);break;case 19:b.state=2;b.amtstack.Delete(j[0],j[1],b.xxWsmanReturn,b);break;case 20:b.state=2;b.amtstack.Exec(j[0],j[1],j[2],b.xxWsmanReturn,b,0,j[3]);break;case 21:b.stepspeed=j[0];if(b.timer!=null){clearInterval(b.timer);b.timer=setInterval(function(){b.step()},b.stepspeed)}break;case 22:b.state=2;b.amtstack.Subscribe(j[0],j[1],j[2],b.xxWsmanReturn,b,0,j[3],j[4],j[5],j[6]);break;case 23:b.state=2;b.amtstack.UnSubscribe(j[0],b.xxWsmanReturn,b,0,j[1]);break;case 24:console.log(j[1],j[2],j[1].charCodeAt(j[2]));q=j[1].charCodeAt(j[2]);break;case 25:break;default:b.state=9;console.error("Script Error, unknown command: "+m)}}else{if(m<20000){q=script_functionTableX2[m-10000](j[1],j[2],j[3],j[4],j[5],j[6])}else{}}if(q!=undefined){b.setVar(h[0],q)}}catch(o){if(typeof o=="object"){o=o.message}b.setVar("_exception",o)}}if(b.state==1&&b.ip>=b.script.length){b.state=0;b.stop();if(b.onCompleted){b.onCompleted()}}if(b.onStep){b.onStep(b)}return b};b.xxStepDialogOk=function(d){b.variables.DialogSelect=d;b.state=1;b.dialog=false;if(b.onStep){b.onStep(b)}};b.xxWsmanReturn=function(f,d,e,g){b.setVar(d,e);b.setVar("wsman_result",g);b.setVar("wsman_result_str",((httpErrorTable[g])?(httpErrorTable[g]):("Error #"+g)));b.state=1;if(b.onStep){b.onStep(b)}};b.toString=function(d){if(typeof d=="object"){return JSON.stringify(d)}return d};b.reset();return b};module.exports.compile=function(o,l){var n="",q=o.split("\n"),h={},k=[],s=[];for(var d in q){var p=q[d];if(p.startsWith("##SWAP ")){var u=p.split(" ");if(u.length==3){s[u[1]]=u[2]}}if(p[0]=="#"||p.length==0){continue}for(var u in s){p=p.split(u).join(s[u])}var f=p.match(/"[^"]*"|[^\s"]+/g);if(f.length==0){continue}if(p[0]==":"){h[f[0].toUpperCase()]=n.length;continue}var c=script_functionTable1.indexOf(f[0].toLowerCase());if(c==-1){c=script_functionTable2.indexOf(f[0].toLowerCase());if(c>=0){c+=10000}}if(c==-1){if(l){l("Unabled to compile, unknown command: "+f[0])}return""}var b=ShortToStr(f.length-1);for(var e in f){if(e==0){continue}if(f[e][0]==":"){k.push([f[e],n.length+b.length+7]);b+=ShortToStr(5)+String.fromCharCode(3)+IntToStr(4294967295)}else{var a=parseInt(f[e]);if(a==f[e]){b+=ShortToStr(5)+String.fromCharCode(2)+IntToStr(a)}else{if(f[e][0]=='"'&&f[e][f[e].length-1]=='"'){b+=ShortToStr(f[e].length-1)+String.fromCharCode(1)+f[e].substring(1,f[e].length-1)}else{b+=ShortToStr(f[e].length+1)+String.fromCharCode(0)+f[e]}}}}b=ShortToStr(c)+ShortToStr(b.length+4)+b;n+=b}for(d in k){var g=k[d][0].toUpperCase(),m=k[d][1],t=h[g];if(t==undefined){if(l){l("Unabled to compile, unknown label: "+g)}return""}n=n.substr(0,m)+IntToStr(t)+n.substr(m+4)}return IntToStr(612182341)+ShortToStr(1)+n};module.exports.decompile=function(g,q){var t="",s=6,m=0,n={};if(q>=0){s=q}else{if(g.length<6){return"# Invalid script length"}var p=ReadInt(g,0);var w=ReadShort(g,4);if(p!=612182341){return"# Invalid binary script: "+p}if(w!=1){return"# Invalid script version"}}while(s=0)){t+=":label"+(s-6)+"\n"}for(var k=0;k=10000)&&(h<10000)){t+=script_functionTable2[h-10000]+d+"\n"}}s+=j;if(q>=0){return t}}var u=t.split("\n");t="";for(var k in u){var o=u[k];if(o[0]!=":"){t+=o+"\n"}else{if(n[o]){t+=o+"\n"}}}return t}; \ No newline at end of file diff --git a/agents/modules_meshcmd_min/amt-wsman-duk.min.js b/agents/modules_meshcmd_min/amt-wsman-duk.min.js deleted file mode 100644 index d83115f4..00000000 --- a/agents/modules_meshcmd_min/amt-wsman-duk.min.js +++ /dev/null @@ -1 +0,0 @@ -function CreateWsmanComm(){var a={};a.PendingAjax=[];a.ActiveAjaxCount=0;a.MaxActiveAjaxCount=1;a.FailAllError=0;a.digest=null;a.RequestCount=0;if(arguments.length==1&&typeof(arguments[0]=="object")){a.host=arguments[0].host;a.port=arguments[0].port;a.authToken=arguments[0].authToken;a.tls=arguments[0].tls}else{a.host=arguments[0];a.port=arguments[1];a.user=arguments[2];a.pass=arguments[3];a.tls=arguments[4]}a.PerformAjax=function(d,c,f,e,g,b){if((a.ActiveAjaxCount==0||((a.ActiveAjaxCount=a.MaxActiveAjaxCount||a.PendingAjax.length==0){return}var b=a.PendingAjax.shift();a.PerformAjaxEx(b[0],b[1],b[2],b[3],b[4]);a.PerformNextAjax()};a.PerformAjaxEx=function(d,c,g,h,b){if(a.FailAllError!=0){if(a.FailAllError!=999){a.gotNextMessagesError({status:a.FailAllError},"error",null,[d,c,g])}return}if(!d){d=""}if(globalDebugFlags&1){console.log("SEND: "+d+"\r\n\r\n")}if(a.digest==null){if(a.authToken){a.digest=require("http-digest").create({authToken:a.authToken})}else{a.digest=require("http-digest").create(a.user,a.pass)}a.digest.http=require("http")}var f={protocol:(a.tls==1?"https:":"http:"),method:"POST",host:a.host,path:"/wsman",port:a.port,rejectUnauthorized:false,checkServerIdentity:function(i){console.log("checkServerIdentity",JSON.stringify(i))}};var e=a.digest.request(f);e.on("error",function(i){a.gotNextMessagesError({status:600},"error",null,[d,c,g])});e.on("response",function(i){if(globalDebugFlags&1){console.log("Response: "+i.statusCode)}if(i.statusCode!=200){if(globalDebugFlags&1){console.log("ERR:"+JSON.stringify(i))}a.gotNextMessagesError({status:i.statusCode},"error",null,[d,c,g])}else{i.acc="";i.on("data",function(j){this.acc+=j});i.on("end",function(){a.gotNextMessages(i.acc,"success",{status:i.statusCode},[d,c,g])})}});e.end(d);a.ActiveAjaxCount++;return e};a.pendingAjaxCall=[];a.gotNextMessages=function(c,e,d,b){a.ActiveAjaxCount--;if(a.FailAllError==999){return}if(globalDebugFlags&1){console.log("RECV: "+c+"\r\n\r\n")}if(a.FailAllError!=0){b[1](null,a.FailAllError,b[2]);return}if(d.status!=200){b[1](null,d.status,b[2]);return}b[1](c,200,b[2]);a.PerformNextAjax()};a.gotNextMessagesError=function(d,e,c,b){a.ActiveAjaxCount--;if(a.FailAllError==999){return}if(a.FailAllError!=0){b[1](null,a.FailAllError,b[2]);return}if(a.FailAllError!=999){b[1]({Header:{HttpError:d.status}},d.status,b[2])}a.PerformNextAjax()};a.CancelAllQueries=function(b){while(a.PendingAjax.length>0){var c=a.PendingAjax.shift();c[1](null,b,c[2])}};return a}module.exports=CreateWsmanComm; \ No newline at end of file diff --git a/agents/modules_meshcmd_min/amt-wsman.min.js b/agents/modules_meshcmd_min/amt-wsman.min.js deleted file mode 100644 index e8afb796..00000000 --- a/agents/modules_meshcmd_min/amt-wsman.min.js +++ /dev/null @@ -1 +0,0 @@ -function WsmanStackCreateService(){var p={_ObjectID:"WSMAN"};p.NextMessageId=1;p.Address="/wsman";p.xmlParser=require("amt-xml");if(arguments.length==1&&typeof(arguments[0]=="object")){var e=arguments[0].transport;if(e){p.comm=new e(arguments[0])}}else{var e=arguments[0];if(e){p.comm=new e(arguments[1],arguments[2],arguments[3],arguments[4],arguments[5],arguments[6])}}p.PerformAjax=function q(t,r,v,u,s){if(s==null){s=""}p.comm.PerformAjax('
"+t,function(w,x,y){if(x!=200){r(p,null,{Header:{HttpError:x}},x,y);return}var z=p.xmlParser.ParseWsman(w);if(!z||z==null){r(p,null,{Header:{HttpError:x}},601,y)}else{r(p,z.Header.ResourceURI,z,200,y)}},v,u)};p.CancelAllQueries=function d(r){p.comm.CancelAllQueries(r)};p.GetNameFromUrl=function(r){var s=r.lastIndexOf("/");return(s==-1)?r:r.substring(s+1)};p.ExecSubscribe=function n(z,t,C,r,B,y,A,w,D,x){var u="",v="",w="";if(D!=null&&x!=null){u='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#UsernameToken'+D+''+x+"";v=''}if(w!=null){w=""+w+""}if(t=="PushWithAck"){t="dmtf.org/wbem/wsman/1/wsman/PushWithAck"}else{if(t=="Push"){t="xmlsoap.org/ws/2004/08/eventing/DeliveryModes/Push"}}var s="http://schemas.xmlsoap.org/ws/2004/08/eventing/Subscribe"+p.Address+""+z+""+(p.NextMessageId++)+"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous"+c(A)+u+'
'+C+""+w+""+v+"";p.PerformAjax(s+"
",r,B,y,'xmlns:e="http://schemas.xmlsoap.org/ws/2004/08/eventing" xmlns:m="http://x.com"')};p.ExecUnSubscribe=function o(u,r,w,t,v){var s="http://schemas.xmlsoap.org/ws/2004/08/eventing/Unsubscribe"+p.Address+""+u+""+(p.NextMessageId++)+"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous"+c(v)+"";p.PerformAjax(s+"",r,w,t,'xmlns:e="http://schemas.xmlsoap.org/ws/2004/08/eventing"')};p.ExecPut=function m(v,u,r,x,t,w){var s="http://schemas.xmlsoap.org/ws/2004/09/transfer/Put"+p.Address+""+v+""+(p.NextMessageId++)+"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60.000S"+c(w)+""+b(v,u);p.PerformAjax(s+"",r,x,t)};p.ExecCreate=function f(x,w,r,z,v,y){var u=p.GetNameFromUrl(x);var s="http://schemas.xmlsoap.org/ws/2004/09/transfer/Create"+p.Address+""+x+""+(p.NextMessageId++)+"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60S"+c(y)+"';for(var t in w){s+=""+w[t]+""}p.PerformAjax(s+"",r,z,v)};p.ExecDelete=function g(v,u,r,w,t){var s="http://schemas.xmlsoap.org/ws/2004/09/transfer/Delete"+p.Address+""+v+""+(p.NextMessageId++)+"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60S"+c(u)+"";p.PerformAjax(s,r,w,t)};p.ExecGet=function i(t,r,u,s){p.PerformAjax("http://schemas.xmlsoap.org/ws/2004/09/transfer/Get"+p.Address+""+t+""+(p.NextMessageId++)+"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60S",r,u,s)};p.ExecMethod=function j(y,v,r,t,A,w,z){var s="";for(var u in r){if(r[u]!=null){if(Array.isArray(r[u])){for(var B in r[u]){s+=""+r[u][B]+""}}else{s+=""+r[u]+""}}}p.ExecMethodXml(y,v,s,t,A,w,z)};p.ExecMethodXml=function k(v,t,r,s,x,u,w){p.PerformAjax(v+"/"+t+""+p.Address+""+v+""+(p.NextMessageId++)+"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60S"+c(w)+"'+r+"",s,x,u)};p.ExecEnum=function h(t,r,u,s){p.PerformAjax("http://schemas.xmlsoap.org/ws/2004/09/enumeration/Enumerate"+p.Address+""+t+""+(p.NextMessageId++)+'http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60S',r,u,s)};p.ExecPull=function l(u,s,r,v,t){p.PerformAjax("http://schemas.xmlsoap.org/ws/2004/09/enumeration/Pull"+p.Address+""+u+""+(p.NextMessageId++)+'http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60S'+s+"99999999",r,v,t)};function b(w,u){if(!w||u==null){return""}var s=p.GetNameFromUrl(w);var v="';for(var t in u){if(!u.hasOwnProperty(t)||t.indexOf("__")===0||t.indexOf("@")===0){continue}if(u[t]==null||typeof u[t]==="function"){continue}if(typeof u[t]==="object"&&u[t]["ReferenceParameters"]){v+=""+u[t].Address+""+u[t]["ReferenceParameters"]["ResourceURI"]+"";var x=u[t]["ReferenceParameters"]["SelectorSet"]["Selector"];if(Array.isArray(x)){for(var r=0;r"+x[r]["Value"]+""}}else{v+=""+x.Value+""}v+=""}else{if(Array.isArray(u[t])){for(var r=0;r"+u[t][r].toString()+""}}else{v+=""+u[t].toString()+""}}}v+="";return v}function a(r){if(!r){return""}var t=" ";for(var s in r){if(!r.hasOwnProperty(s)||s.indexOf("@")!==0){continue}t+=s.substring(1)+'="'+r[s]+'" '}return t}function c(v){if((v==null)||(v=="null")){return""}if(typeof v=="string"){return v}if(v.InstanceID){return''+v.InstanceID+""}var t="";for(var s in v){if(!v.hasOwnProperty(s)){continue}t+='';if(v[s]["ReferenceParameters"]){t+="";t+=""+v[s]["Address"]+""+v[s]["ReferenceParameters"]["ResourceURI"]+"";var u=v[s]["ReferenceParameters"]["SelectorSet"]["Selector"];if(Array.isArray(u)){for(var r=0;r"+u[r]["Value"]+""}}else{t+=""+u.Value+""}t+=""}else{t+=v[s]}t+=""}t+="";return t}return p}module.exports=WsmanStackCreateService; \ No newline at end of file diff --git a/agents/modules_meshcmd_min/amt-xml.min.js b/agents/modules_meshcmd_min/amt-xml.min.js deleted file mode 100644 index 4b2308ed..00000000 --- a/agents/modules_meshcmd_min/amt-xml.min.js +++ /dev/null @@ -1 +0,0 @@ -try{Object.defineProperty(Array.prototype,"peek",{value:function(){return(this.length>0?this[this.length-1]:undefined)}})}catch(e){}module.exports.ParseWsman=function(j){try{if(!j.childNodes){j=_turnToXml(j)}var g={Header:{}},d=j.getElementsByTagName("Header")[0],h;if(!d){d=j.getElementsByTagName("a:Header")[0]}if(!d){return null}for(var f=0;f0){h=a.childNodes[0].localName;if(h.indexOf("_OUTPUT")==h.length-7){h=h.substring(0,h.length-7)}g.Header.Method=h;g.Body=_ParseWsmanRec(a.childNodes[0])}return g}catch(c){console.error("Unable to parse XML: "+j,c);return null}};function _ParseWsmanRec(g){var c,h={};for(var d=0;d0)){b={Value:c};for(var f=0;f';for(var c in d){if(!d.hasOwnProperty(c)||c.indexOf("__")===0||c.indexOf("@")===0){continue}if(d[c]==null||typeof d[c]==="function"){continue}if(typeof d[c]==="object"&&d[c]["ReferenceParameters"]){f+=""+d[c].Address+""+d[c]["ReferenceParameters"]["ResourceURI"]+"";var h=d[c]["ReferenceParameters"]["SelectorSet"]["Selector"];if(Array.isArray(h)){for(var a=0;a"+h[a]["Value"]+""}}else{f+=""+h.Value+""}f+=""}else{if(Array.isArray(d[c])){for(var a=0;a"+d[c][a].toString()+""}}else{f+=""+d[c].toString()+""}}}f+="";return f}function _treeBuilder(){this.tree=[];this.push=function(a){this.tree.push(a)};this.pop=function(){var a=this.tree.pop();if(this.tree.length>0){var b=this.tree.peek();b.childNodes.push(a);b.childElementCount=b.childNodes.length}return(a)};this.peek=function(){return(this.tree.peek())};this.addNamespace=function(g,d){this.tree.peek().nsTable[g]=d;if(this.tree.peek().attributes.length>0){for(var c=0;c=0;--a){if(this.tree[a].nsTable[b]!=null){return(this.tree[a].nsTable[b])}}return null}}function _turnToXml(a){if(a==null){return null}return({childNodes:[_turnToXmlRec(a)],getElementsByTagName:_getElementsByTagName,getChildElementsByTagName:_getChildElementsByTagName,getElementsByTagNameNS:_getElementsByTagNameNS})}function _getElementsByTagNameNS(b,a){var c=[];_xmlTraverseAllRec(this.childNodes,function(d){if(d.localName==a&&(d.namespace==b||b=="*")){c.push(d)}});return c}function _getElementsByTagName(a){var b=[];_xmlTraverseAllRec(this.childNodes,function(c){if(c.localName==a){b.push(c)}});return b}function _getChildElementsByTagName(a){var c=[];if(this.childNodes!=null){for(var b in this.childNodes){if(this.childNodes[b].localName==a){c.push(this.childNodes[b])}}}return(c)}function _getChildElementsByTagNameNS(c,a){var d=[];if(this.childNodes!=null){for(var b in this.childNodes){if(this.childNodes[b].localName==a&&(c=="*"||this.childNodes[b].namespace==c)){d.push(this.childNodes[b])}}}return(d)}function _xmlTraverseAllRec(c,a){for(var b in c){a(c[b]);if(c[b].childNodes){_xmlTraverseAllRec(c[b].childNodes,a)}}}function _turnToXmlRec(w){try{if(w==null){return null}var m=new _treeBuilder(),r=null,z=w.split("<"),u=[],h=null,g=null;for(var o in z){var A=z[o].split(">"),B=A[0].split(" "),l=B[0];if((l.length>0)&&(l[0]!="?")){if(l[0]!="/"){var a=[],s,t=l.split(" ")[0].split(":"),s=(t.length>1)?t[1]:t[0];Object.defineProperty(a,"get",{value:function(){if(arguments.length==1){for(var i in this){if(this[i].name==arguments[0]){return(this[i])}}}else{if(arguments.length==2){for(var i in this){if(this[i].name==arguments[1]&&(arguments[0]=="*"||this[i].namespace==arguments[0])){return(this[i])}}}else{throw ("attributes.get(): Invalid number of parameters")}}}});m.push({name:l,localName:s,getChildElementsByTagName:_getChildElementsByTagName,getElementsByTagNameNS:_getElementsByTagNameNS,getChildElementsByTagNameNS:_getChildElementsByTagNameNS,attributes:a,childNodes:[],nsTable:{}});if(B.length>0){var v=false;for(var p in B){if(B[p]=="/"){m.peek().namespace=m.peek().name==m.peek().localName?m.getNamespace("*"):m.getNamespace(m.peek().name.substring(0,m.peek().name.indexOf(":")));m.peek().textContent="";r=m.pop();v=true;break}var q=B[p].indexOf("=");if(q>0){var b=B[p].substring(0,q);var d=B[p].substring(q+2,B[p].length-1);var c=m.getNamespace("*");if(b=="xmlns"){m.addNamespace("*",d);c=d}else{if(b.startsWith("xmlns:")){m.addNamespace(b.substring(6),d)}else{var f=b.split(":");if(f.length==2){b=f[1];c=m.getNamespace(f[0])}}}var y={name:b,value:d};if(c!=null){y.namespace=c}m.peek().attributes.push(y)}}if(v){continue}}m.peek().namespace=m.peek().name==m.peek().localName?m.getNamespace("*"):m.getNamespace(m.peek().name.substring(0,m.peek().name.indexOf(":")));if(A[1]){m.peek().textContent=A[1]}}else{r=m.pop()}}}}catch(n){return null}return r}; \ No newline at end of file diff --git a/agents/modules_meshcmd_min/amt.min.js b/agents/modules_meshcmd_min/amt.min.js deleted file mode 100644 index 6984729b..00000000 --- a/agents/modules_meshcmd_min/amt.min.js +++ /dev/null @@ -1 +0,0 @@ -function AmtStackCreateService(R){var J=new Object();J._ObjectID="AMT";J.wsman=R;J.pfx=["http://intel.com/wbem/wscim/1/amt-schema/1/","http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/","http://intel.com/wbem/wscim/1/ips-schema/1/"];J.PendingEnums=[];J.PendingBatchOperations=0;J.ActiveEnumsCount=0;J.MaxActiveEnumsCount=1;J.onProcessChanged=null;var n=0;var m=0;J.GetPendingActions=function(){return(J.PendingEnums.length*2)+(J.ActiveEnumsCount)+J.wsman.comm.PendingAjax.length+J.wsman.comm.ActiveAjaxCount+J.PendingBatchOperations};function r(){var S=J.GetPendingActions();if(n=J.MaxActiveEnumsCount||J.PendingEnums.length==0){return}var T=J.PendingEnums.shift();J.Enum(T[0],T[1],T[2]);d(0)}J.BatchEnum=function(S,V,T,X,U,W){J.PendingBatchOperations+=(V.length*2);b(S,x(V),T,X,{},U,W);r()};function x(S){return JSON.parse(JSON.stringify(S))}function b(S,X,T,aa,Z,U,Y){J.PendingBatchOperations-=2;var W=X.shift(),V=J.Enum;if(W[0]=="*"){V=J.Get;W=W.substring(1)}V(W,function(ad,ab,ac,ae,af){af[2][ab]={response:(ac==null?null:ac.Body),responses:ac,status:ae};if(af[1].length==0||ae==401||(U!=true&&ae!=200&&ae!=400)){J.PendingBatchOperations-=(X.length*2);r();T.call(J,J,S,af[2],ae,aa)}else{r();b(S,X,T,aa,af[2],Y)}},[S,X,Z],Y);r()}J.BatchGet=function(S,U,T,W,V){h({name:S,names:U,callback:T,current:0,responses:{},tag:W,pri:V});r()};function h(S){if(S.names.length<=S.current){S.callback.call(J,J,S.name,S.responses,200,S.tag)}else{J.wsman.ExecGet(J.CompleteName(S.names[S.current]),function(V,U,T,W){g(S,T,W)},S.pri);S.current++}r()}function g(S,T,U){if(T==null||U!=200){S.callback.call(J,J,S.name,null,U,S.tag)}else{S.responses[T.Header.Method]=T;h(S)}}J.CompleteName=function(S){if(S.indexOf("AMT_")==0){return J.pfx[0]+S}if(S.indexOf("CIM_")==0){return J.pfx[1]+S}if(S.indexOf("IPS_")==0){return J.pfx[2]+S}};J.CompleteExecResponse=function(S){if(S&&S!=null&&S.Body&&(S.Body.ReturnValue!=undefined)){S.Body.ReturnValueStr=J.AmtStatusToStr(S.Body.ReturnValue)}return S};J.RequestPowerStateChange=function(T,S){J.CIM_PowerManagementService_RequestPowerStateChange(T,'
http://schemas.xmlsoap.org/ws/2004/08/addressing
http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ComputerSystemCIM_ComputerSystemManagedSystem',null,null,S)};J.SetBootConfigRole=function(T,S){J.CIM_BootService_SetBootConfigRole('
http://schemas.xmlsoap.org/ws/2004/08/addressing
http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_BootConfigSettingIntel(r) AMT: Boot Configuration 0',T,S)};J.CancelAllQueries=function(S){J.wsman.CancelAllQueries(S)};J.AMT_AgentPresenceWatchdog_RegisterAgent=function(S,V,T,U){J.Exec("AMT_AgentPresenceWatchdog","RegisterAgent",{},S,V,T,U)};J.AMT_AgentPresenceWatchdog_AssertPresence=function(V,S,W,T,U){J.Exec("AMT_AgentPresenceWatchdog","AssertPresence",{SequenceNumber:V},S,W,T,U)};J.AMT_AgentPresenceWatchdog_AssertShutdown=function(V,S,W,T,U){J.Exec("AMT_AgentPresenceWatchdog","AssertShutdown",{SequenceNumber:V},S,W,T,U)};J.AMT_AgentPresenceWatchdog_AddAction=function(X,W,V,T,S,U,aa,Y,Z){J.Exec("AMT_AgentPresenceWatchdog","AddAction",{OldState:X,NewState:W,EventOnTransition:V,ActionSd:T,ActionEac:S},U,aa,Y,Z)};J.AMT_AgentPresenceWatchdog_DeleteAllActions=function(S,V,T,U){J.Exec("AMT_AgentPresenceWatchdog","DeleteAllActions",{},S,V,T,U)};J.AMT_AgentPresenceWatchdogAction_GetActionEac=function(S){J.Exec("AMT_AgentPresenceWatchdogAction","GetActionEac",{},S)};J.AMT_AgentPresenceWatchdogVA_RegisterAgent=function(S){J.Exec("AMT_AgentPresenceWatchdogVA","RegisterAgent",{},S)};J.AMT_AgentPresenceWatchdogVA_AssertPresence=function(T,S){J.Exec("AMT_AgentPresenceWatchdogVA","AssertPresence",{SequenceNumber:T},S)};J.AMT_AgentPresenceWatchdogVA_AssertShutdown=function(T,S){J.Exec("AMT_AgentPresenceWatchdogVA","AssertShutdown",{SequenceNumber:T},S)};J.AMT_AgentPresenceWatchdogVA_AddAction=function(X,W,V,T,S,U){J.Exec("AMT_AgentPresenceWatchdogVA","AddAction",{OldState:X,NewState:W,EventOnTransition:V,ActionSd:T,ActionEac:S},U)};J.AMT_AgentPresenceWatchdogVA_DeleteAllActions=function(S,T){J.Exec("AMT_AgentPresenceWatchdogVA","DeleteAllActions",{_method_dummy:S},T)};J.AMT_AlarmClockService_AddAlarm=function s(S,T){var V=S.InstanceID;var X=S.ElementName;var Y=S.StartTime.Datetime;var W=S.Interval?S.Interval.Datetime:undefined;var U=S.DeleteOnCompletion;var Z=''+V+""+X+''+Y+""+((W!=undefined)?(''+W+""):"")+""+U+"";J.wsman.ExecMethodXml(J.CompleteName("AMT_AlarmClockService"),"AddAlarm",Z,T)};J.AMT_AuditLog_ClearLog=function(S){J.Exec("AMT_AuditLog","ClearLog",{},S)};J.AMT_AuditLog_RequestStateChange=function(T,U,S){J.Exec("AMT_AuditLog","RequestStateChange",{RequestedState:T,TimeoutPeriod:U},S)};J.AMT_AuditLog_ReadRecords=function(T,S,U){J.Exec("AMT_AuditLog","ReadRecords",{StartIndex:T},S,U)};J.AMT_AuditLog_SetAuditLock=function(V,T,U,S){J.Exec("AMT_AuditLog","SetAuditLock",{LockTimeoutInSeconds:V,Flag:T,Handle:U},S)};J.AMT_AuditLog_ExportAuditLogSignature=function(T,S){J.Exec("AMT_AuditLog","ExportAuditLogSignature",{SigningMechanism:T},S)};J.AMT_AuditLog_SetSigningKeyMaterial=function(W,V,U,T,S){J.Exec("AMT_AuditLog","SetSigningKeyMaterial",{SigningMechanismType:W,SigningKey:V,LengthOfCertificates:U,Certificates:T},S)};J.AMT_AuditPolicyRule_SetAuditPolicy=function(U,S,V,W,T){J.Exec("AMT_AuditPolicyRule","SetAuditPolicy",{Enable:U,AuditedAppID:S,EventID:V,PolicyType:W},T)};J.AMT_AuditPolicyRule_SetAuditPolicyBulk=function(U,S,V,W,T){J.Exec("AMT_AuditPolicyRule","SetAuditPolicyBulk",{Enable:U,AuditedAppID:S,EventID:V,PolicyType:W},T)};J.AMT_AuthorizationService_AddUserAclEntryEx=function(V,U,W,S,X,T){J.Exec("AMT_AuthorizationService","AddUserAclEntryEx",{DigestUsername:V,DigestPassword:U,KerberosUserSid:W,AccessPermission:S,Realms:X},T)};J.AMT_AuthorizationService_EnumerateUserAclEntries=function(T,S){J.Exec("AMT_AuthorizationService","EnumerateUserAclEntries",{StartIndex:T},S)};J.AMT_AuthorizationService_GetUserAclEntryEx=function(T,S,U){J.Exec("AMT_AuthorizationService","GetUserAclEntryEx",{Handle:T},S,U)};J.AMT_AuthorizationService_UpdateUserAclEntryEx=function(W,V,U,X,S,Y,T){J.Exec("AMT_AuthorizationService","UpdateUserAclEntryEx",{Handle:W,DigestUsername:V,DigestPassword:U,KerberosUserSid:X,AccessPermission:S,Realms:Y},T)};J.AMT_AuthorizationService_RemoveUserAclEntry=function(T,S){J.Exec("AMT_AuthorizationService","RemoveUserAclEntry",{Handle:T},S)};J.AMT_AuthorizationService_SetAdminAclEntryEx=function(U,T,S){J.Exec("AMT_AuthorizationService","SetAdminAclEntryEx",{Username:U,DigestPassword:T},S)};J.AMT_AuthorizationService_GetAdminAclEntry=function(S){J.Exec("AMT_AuthorizationService","GetAdminAclEntry",{},S)};J.AMT_AuthorizationService_GetAdminAclEntryStatus=function(S){J.Exec("AMT_AuthorizationService","GetAdminAclEntryStatus",{},S)};J.AMT_AuthorizationService_GetAdminNetAclEntryStatus=function(S){J.Exec("AMT_AuthorizationService","GetAdminNetAclEntryStatus",{},S)};J.AMT_AuthorizationService_SetAclEnabledState=function(U,T,S,V){J.Exec("AMT_AuthorizationService","SetAclEnabledState",{Handle:U,Enabled:T},S,V)};J.AMT_AuthorizationService_GetAclEnabledState=function(T,S,U){J.Exec("AMT_AuthorizationService","GetAclEnabledState",{Handle:T},S,U)};J.AMT_EndpointAccessControlService_RequestStateChange=function(T,U,S){J.Exec("AMT_EndpointAccessControlService","RequestStateChange",{RequestedState:T,TimeoutPeriod:U},S)};J.AMT_EndpointAccessControlService_GetPosture=function(T,S){J.Exec("AMT_EndpointAccessControlService","GetPosture",{PostureType:T},S)};J.AMT_EndpointAccessControlService_GetPostureHash=function(T,S){J.Exec("AMT_EndpointAccessControlService","GetPostureHash",{PostureType:T},S)};J.AMT_EndpointAccessControlService_UpdatePostureState=function(T,S){J.Exec("AMT_EndpointAccessControlService","UpdatePostureState",{UpdateType:T},S)};J.AMT_EndpointAccessControlService_GetEacOptions=function(S){J.Exec("AMT_EndpointAccessControlService","GetEacOptions",{},S)};J.AMT_EndpointAccessControlService_SetEacOptions=function(T,U,S){J.Exec("AMT_EndpointAccessControlService","SetEacOptions",{EacVendors:T,PostureHashAlgorithm:U},S)};J.AMT_EnvironmentDetectionSettingData_SetSystemDefensePolicy=function(T,S){J.Exec("AMT_EnvironmentDetectionSettingData","SetSystemDefensePolicy",{Policy:T},S)};J.AMT_EnvironmentDetectionSettingData_EnableVpnRouting=function(T,S){J.Exec("AMT_EnvironmentDetectionSettingData","EnableVpnRouting",{Enable:T},S)};J.AMT_EthernetPortSettings_SetLinkPreference=function(T,U,S){J.Exec("AMT_EthernetPortSettings","SetLinkPreference",{LinkPreference:T,Timeout:U},S)};J.AMT_HeuristicPacketFilterStatistics_ResetSelectedStats=function(T,S){J.Exec("AMT_HeuristicPacketFilterStatistics","ResetSelectedStats",{SelectedStatistics:T},S)};J.AMT_KerberosSettingData_GetCredentialCacheState=function(S){J.Exec("AMT_KerberosSettingData","GetCredentialCacheState",{},S)};J.AMT_KerberosSettingData_SetCredentialCacheState=function(T,S){J.Exec("AMT_KerberosSettingData","SetCredentialCacheState",{Enable:T},S)};J.AMT_MessageLog_CancelIteration=function(T,S){J.Exec("AMT_MessageLog","CancelIteration",{IterationIdentifier:T},S)};J.AMT_MessageLog_RequestStateChange=function(T,U,S){J.Exec("AMT_MessageLog","RequestStateChange",{RequestedState:T,TimeoutPeriod:U},S)};J.AMT_MessageLog_ClearLog=function(S){J.Exec("AMT_MessageLog","ClearLog",{},S)};J.AMT_MessageLog_GetRecords=function(T,U,S,V){J.Exec("AMT_MessageLog","GetRecords",{IterationIdentifier:T,MaxReadRecords:U},S,V)};J.AMT_MessageLog_GetRecord=function(T,U,S){J.Exec("AMT_MessageLog","GetRecord",{IterationIdentifier:T,PositionToNext:U},S)};J.AMT_MessageLog_PositionAtRecord=function(T,U,V,S){J.Exec("AMT_MessageLog","PositionAtRecord",{IterationIdentifier:T,MoveAbsolute:U,RecordNumber:V},S)};J.AMT_MessageLog_PositionToFirstRecord=function(S,T){J.Exec("AMT_MessageLog","PositionToFirstRecord",{},S,T)};J.AMT_MessageLog_FreezeLog=function(T,S){J.Exec("AMT_MessageLog","FreezeLog",{Freeze:T},S)};J.AMT_PublicKeyManagementService_AddCRL=function(U,T,S){J.Exec("AMT_PublicKeyManagementService","AddCRL",{Url:U,SerialNumbers:T},S)};J.AMT_PublicKeyManagementService_ResetCRLList=function(S,T){J.Exec("AMT_PublicKeyManagementService","ResetCRLList",{_method_dummy:S},T)};J.AMT_PublicKeyManagementService_AddCertificate=function(T,S,U){J.Exec("AMT_PublicKeyManagementService","AddCertificate",{CertificateBlob:T},S,U)};J.AMT_PublicKeyManagementService_AddTrustedRootCertificate=function(T,S){J.Exec("AMT_PublicKeyManagementService","AddTrustedRootCertificate",{CertificateBlob:T},S)};J.AMT_PublicKeyManagementService_AddKey=function(T,S){J.Exec("AMT_PublicKeyManagementService","AddKey",{KeyBlob:T},S)};J.AMT_PublicKeyManagementService_GeneratePKCS10Request=function(U,T,V,S){J.Exec("AMT_PublicKeyManagementService","GeneratePKCS10Request",{KeyPair:U,DNName:T,Usage:V},S)};J.AMT_PublicKeyManagementService_GeneratePKCS10RequestEx=function(T,V,U,S){J.Exec("AMT_PublicKeyManagementService","GeneratePKCS10RequestEx",{KeyPair:T,SigningAlgorithm:V,NullSignedCertificateRequest:U},S)};J.AMT_PublicKeyManagementService_GenerateKeyPair=function(T,U,S){J.Exec("AMT_PublicKeyManagementService","GenerateKeyPair",{KeyAlgorithm:T,KeyLength:U},S)};J.AMT_RedirectionService_RequestStateChange=function(T,S){J.Exec("AMT_RedirectionService","RequestStateChange",{RequestedState:T},S)};J.AMT_RedirectionService_TerminateSession=function(T,S){J.Exec("AMT_RedirectionService","TerminateSession",{SessionType:T},S)};J.AMT_RemoteAccessService_AddMpServer=function(S,X,Z,T,V,aa,Y,W,U){J.Exec("AMT_RemoteAccessService","AddMpServer",{AccessInfo:S,InfoFormat:X,Port:Z,AuthMethod:T,Certificate:V,Username:aa,Password:Y,CN:W},U)};J.AMT_RemoteAccessService_AddRemoteAccessPolicyRule=function(V,W,T,U,S){J.Exec("AMT_RemoteAccessService","AddRemoteAccessPolicyRule",{Trigger:V,TunnelLifeTime:W,ExtendedData:T,MpServer:U},S)};J.AMT_RemoteAccessService_CloseRemoteAccessConnection=function(S,T){J.Exec("AMT_RemoteAccessService","CloseRemoteAccessConnection",{_method_dummy:S},T)};J.AMT_SetupAndConfigurationService_CommitChanges=function(S,T,U){J.Exec("AMT_SetupAndConfigurationService","CommitChanges",{_method_dummy:S},T,U)};J.AMT_SetupAndConfigurationService_Unprovision=function(T,S){J.Exec("AMT_SetupAndConfigurationService","Unprovision",{ProvisioningMode:T},S)};J.AMT_SetupAndConfigurationService_PartialUnprovision=function(S,T){J.Exec("AMT_SetupAndConfigurationService","PartialUnprovision",{_method_dummy:S},T)};J.AMT_SetupAndConfigurationService_ResetFlashWearOutProtection=function(S,T){J.Exec("AMT_SetupAndConfigurationService","ResetFlashWearOutProtection",{_method_dummy:S},T)};J.AMT_SetupAndConfigurationService_ExtendProvisioningPeriod=function(T,S){J.Exec("AMT_SetupAndConfigurationService","ExtendProvisioningPeriod",{Duration:T},S)};J.AMT_SetupAndConfigurationService_SetMEBxPassword=function(T,S){J.Exec("AMT_SetupAndConfigurationService","SetMEBxPassword",{Password:T},S)};J.AMT_SetupAndConfigurationService_SetTLSPSK=function(T,U,S){J.Exec("AMT_SetupAndConfigurationService","SetTLSPSK",{PID:T,PPS:U},S)};J.AMT_SetupAndConfigurationService_GetProvisioningAuditRecord=function(S){J.Exec("AMT_SetupAndConfigurationService","GetProvisioningAuditRecord",{},S)};J.AMT_SetupAndConfigurationService_GetUuid=function(S){J.Exec("AMT_SetupAndConfigurationService","GetUuid",{},S)};J.AMT_SetupAndConfigurationService_GetUnprovisionBlockingComponents=function(S){J.Exec("AMT_SetupAndConfigurationService","GetUnprovisionBlockingComponents",{},S)};J.AMT_SetupAndConfigurationService_GetProvisioningAuditRecordV2=function(S){J.Exec("AMT_SetupAndConfigurationService","GetProvisioningAuditRecordV2",{},S)};J.AMT_SystemDefensePolicy_GetTimeout=function(S){J.Exec("AMT_SystemDefensePolicy","GetTimeout",{},S)};J.AMT_SystemDefensePolicy_SetTimeout=function(T,S){J.Exec("AMT_SystemDefensePolicy","SetTimeout",{Timeout:T},S)};J.AMT_SystemDefensePolicy_UpdateStatistics=function(T,V,S,X,U,W){J.Exec("AMT_SystemDefensePolicy","UpdateStatistics",{NetworkInterface:T,ResetOnRead:V},S,X,U,W)};J.AMT_SystemPowerScheme_SetPowerScheme=function(S,T,U){J.Exec("AMT_SystemPowerScheme","SetPowerScheme",{},S,U,0,{InstanceID:T})};J.AMT_TimeSynchronizationService_GetLowAccuracyTimeSynch=function(S,T){J.Exec("AMT_TimeSynchronizationService","GetLowAccuracyTimeSynch",{},S,T)};J.AMT_TimeSynchronizationService_SetHighAccuracyTimeSynch=function(T,V,W,S,U){J.Exec("AMT_TimeSynchronizationService","SetHighAccuracyTimeSynch",{Ta0:T,Tm1:V,Tm2:W},S,U)};J.AMT_TLSCredentialContext_Create=function t(T,U,S,V){J.Create("AMT_TLSCredentialContext",{ElementInContext:T,ElementProvidingContext:U},S,V)};J.AMT_UserInitiatedConnectionService_RequestStateChange=function(T,U,S){J.Exec("AMT_UserInitiatedConnectionService","RequestStateChange",{RequestedState:T,TimeoutPeriod:U},S)};J.AMT_WebUIService_RequestStateChange=function(T,V,S,U){J.Exec("AMT_WebUIService","RequestStateChange",{RequestedState:T,TimeoutPeriod:V},S,U)};J.AMT_WiFiPortConfigurationService_AddWiFiSettings=function(W,X,V,U,S,T){J.ExecWithXml("AMT_WiFiPortConfigurationService","AddWiFiSettings",{WiFiEndpoint:W,WiFiEndpointSettingsInput:X,IEEE8021xSettingsInput:V,ClientCredential:U,CACredential:S},T)};J.AMT_WiFiPortConfigurationService_UpdateWiFiSettings=function(W,X,V,U,S,T){J.ExecWithXml("AMT_WiFiPortConfigurationService","UpdateWiFiSettings",{WiFiEndpointSettings:W,WiFiEndpointSettingsInput:X,IEEE8021xSettingsInput:V,ClientCredential:U,CACredential:S},T)};J.AMT_WiFiPortConfigurationService_DeleteAllITProfiles=function(S,T){J.Exec("AMT_WiFiPortConfigurationService","DeleteAllITProfiles",{_method_dummy:S},T)};J.AMT_WiFiPortConfigurationService_DeleteAllUserProfiles=function(S,T){J.Exec("AMT_WiFiPortConfigurationService","DeleteAllUserProfiles",{_method_dummy:S},T)};J.CIM_Account_RequestStateChange=function(T,U,S){J.Exec("CIM_Account","RequestStateChange",{RequestedState:T,TimeoutPeriod:U},S)};J.CIM_AccountManagementService_CreateAccount=function(U,S,T){J.Exec("CIM_AccountManagementService","CreateAccount",{System:U,AccountTemplate:S},T)};J.CIM_BootConfigSetting_ChangeBootOrder=function(T,S){J.Exec("CIM_BootConfigSetting","ChangeBootOrder",{Source:T},S)};J.CIM_BootService_SetBootConfigRole=function(S,U,T){J.Exec("CIM_BootService","SetBootConfigRole",{BootConfigSetting:S,Role:U},T,0,1)};J.CIM_Card_ConnectorPower=function(T,U,S){J.Exec("CIM_Card","ConnectorPower",{Connector:T,PoweredOn:U},S)};J.CIM_Card_IsCompatible=function(T,S){J.Exec("CIM_Card","IsCompatible",{ElementToCheck:T},S)};J.CIM_Chassis_IsCompatible=function(T,S){J.Exec("CIM_Chassis","IsCompatible",{ElementToCheck:T},S)};J.CIM_Fan_SetSpeed=function(T,S){J.Exec("CIM_Fan","SetSpeed",{DesiredSpeed:T},S)};J.CIM_KVMRedirectionSAP_RequestStateChange=function(T,U,S){J.Exec("CIM_KVMRedirectionSAP","RequestStateChange",{RequestedState:T},S)};J.CIM_MediaAccessDevice_LockMedia=function(T,S){J.Exec("CIM_MediaAccessDevice","LockMedia",{Lock:T},S)};J.CIM_MediaAccessDevice_SetPowerState=function(T,U,S){J.Exec("CIM_MediaAccessDevice","SetPowerState",{PowerState:T,Time:U},S)};J.CIM_MediaAccessDevice_Reset=function(S){J.Exec("CIM_MediaAccessDevice","Reset",{},S)};J.CIM_MediaAccessDevice_EnableDevice=function(T,S){J.Exec("CIM_MediaAccessDevice","EnableDevice",{Enabled:T},S)};J.CIM_MediaAccessDevice_OnlineDevice=function(T,S){J.Exec("CIM_MediaAccessDevice","OnlineDevice",{Online:T},S)};J.CIM_MediaAccessDevice_QuiesceDevice=function(T,S){J.Exec("CIM_MediaAccessDevice","QuiesceDevice",{Quiesce:T},S)};J.CIM_MediaAccessDevice_SaveProperties=function(S){J.Exec("CIM_MediaAccessDevice","SaveProperties",{},S)};J.CIM_MediaAccessDevice_RestoreProperties=function(S){J.Exec("CIM_MediaAccessDevice","RestoreProperties",{},S)};J.CIM_MediaAccessDevice_RequestStateChange=function(T,U,S){J.Exec("CIM_MediaAccessDevice","RequestStateChange",{RequestedState:T,TimeoutPeriod:U},S)};J.CIM_PhysicalFrame_IsCompatible=function(T,S){J.Exec("CIM_PhysicalFrame","IsCompatible",{ElementToCheck:T},S)};J.CIM_PhysicalPackage_IsCompatible=function(T,S){J.Exec("CIM_PhysicalPackage","IsCompatible",{ElementToCheck:T},S)};J.CIM_PowerManagementService_RequestPowerStateChange=function(U,T,V,W,S){J.Exec("CIM_PowerManagementService","RequestPowerStateChange",{PowerState:U,ManagedElement:T,Time:V,TimeoutPeriod:W},S,0,1)};J.CIM_PowerSupply_SetPowerState=function(T,U,S){J.Exec("CIM_PowerSupply","SetPowerState",{PowerState:T,Time:U},S)};J.CIM_PowerSupply_Reset=function(S){J.Exec("CIM_PowerSupply","Reset",{},S)};J.CIM_PowerSupply_EnableDevice=function(T,S){J.Exec("CIM_PowerSupply","EnableDevice",{Enabled:T},S)};J.CIM_PowerSupply_OnlineDevice=function(T,S){J.Exec("CIM_PowerSupply","OnlineDevice",{Online:T},S)};J.CIM_PowerSupply_QuiesceDevice=function(T,S){J.Exec("CIM_PowerSupply","QuiesceDevice",{Quiesce:T},S)};J.CIM_PowerSupply_SaveProperties=function(S){J.Exec("CIM_PowerSupply","SaveProperties",{},S)};J.CIM_PowerSupply_RestoreProperties=function(S){J.Exec("CIM_PowerSupply","RestoreProperties",{},S)};J.CIM_PowerSupply_RequestStateChange=function(T,U,S){J.Exec("CIM_PowerSupply","RequestStateChange",{RequestedState:T,TimeoutPeriod:U},S)};J.CIM_Processor_SetPowerState=function(T,U,S){J.Exec("CIM_Processor","SetPowerState",{PowerState:T,Time:U},S)};J.CIM_Processor_Reset=function(S){J.Exec("CIM_Processor","Reset",{},S)};J.CIM_Processor_EnableDevice=function(T,S){J.Exec("CIM_Processor","EnableDevice",{Enabled:T},S)};J.CIM_Processor_OnlineDevice=function(T,S){J.Exec("CIM_Processor","OnlineDevice",{Online:T},S)};J.CIM_Processor_QuiesceDevice=function(T,S){J.Exec("CIM_Processor","QuiesceDevice",{Quiesce:T},S)};J.CIM_Processor_SaveProperties=function(S){J.Exec("CIM_Processor","SaveProperties",{},S)};J.CIM_Processor_RestoreProperties=function(S){J.Exec("CIM_Processor","RestoreProperties",{},S)};J.CIM_Processor_RequestStateChange=function(T,U,S){J.Exec("CIM_Processor","RequestStateChange",{RequestedState:T,TimeoutPeriod:U},S)};J.CIM_RecordLog_ClearLog=function(S){J.Exec("CIM_RecordLog","ClearLog",{},S)};J.CIM_RecordLog_RequestStateChange=function(T,U,S){J.Exec("CIM_RecordLog","RequestStateChange",{RequestedState:T,TimeoutPeriod:U},S)};J.CIM_RedirectionService_RequestStateChange=function(T,U,S){J.Exec("CIM_RedirectionService","RequestStateChange",{RequestedState:T,TimeoutPeriod:U},S)};J.CIM_Sensor_SetPowerState=function(T,U,S){J.Exec("CIM_Sensor","SetPowerState",{PowerState:T,Time:U},S)};J.CIM_Sensor_Reset=function(S){J.Exec("CIM_Sensor","Reset",{},S)};J.CIM_Sensor_EnableDevice=function(T,S){J.Exec("CIM_Sensor","EnableDevice",{Enabled:T},S)};J.CIM_Sensor_OnlineDevice=function(T,S){J.Exec("CIM_Sensor","OnlineDevice",{Online:T},S)};J.CIM_Sensor_QuiesceDevice=function(T,S){J.Exec("CIM_Sensor","QuiesceDevice",{Quiesce:T},S)};J.CIM_Sensor_SaveProperties=function(S){J.Exec("CIM_Sensor","SaveProperties",{},S)};J.CIM_Sensor_RestoreProperties=function(S){J.Exec("CIM_Sensor","RestoreProperties",{},S)};J.CIM_Sensor_RequestStateChange=function(T,U,S){J.Exec("CIM_Sensor","RequestStateChange",{RequestedState:T,TimeoutPeriod:U},S)};J.CIM_StatisticalData_ResetSelectedStats=function(T,S){J.Exec("CIM_StatisticalData","ResetSelectedStats",{SelectedStatistics:T},S)};J.CIM_Watchdog_KeepAlive=function(S){J.Exec("CIM_Watchdog","KeepAlive",{},S)};J.CIM_Watchdog_SetPowerState=function(T,U,S){J.Exec("CIM_Watchdog","SetPowerState",{PowerState:T,Time:U},S)};J.CIM_Watchdog_Reset=function(S){J.Exec("CIM_Watchdog","Reset",{},S)};J.CIM_Watchdog_EnableDevice=function(T,S){J.Exec("CIM_Watchdog","EnableDevice",{Enabled:T},S)};J.CIM_Watchdog_OnlineDevice=function(T,S){J.Exec("CIM_Watchdog","OnlineDevice",{Online:T},S)};J.CIM_Watchdog_QuiesceDevice=function(T,S){J.Exec("CIM_Watchdog","QuiesceDevice",{Quiesce:T},S)};J.CIM_Watchdog_SaveProperties=function(S){J.Exec("CIM_Watchdog","SaveProperties",{},S)};J.CIM_Watchdog_RestoreProperties=function(S){J.Exec("CIM_Watchdog","RestoreProperties",{},S)};J.CIM_Watchdog_RequestStateChange=function(T,U,S){J.Exec("CIM_Watchdog","RequestStateChange",{RequestedState:T,TimeoutPeriod:U},S)};J.CIM_WiFiPort_SetPowerState=function(T,U,S){J.Exec("CIM_WiFiPort","SetPowerState",{PowerState:T,Time:U},S)};J.CIM_WiFiPort_Reset=function(S){J.Exec("CIM_WiFiPort","Reset",{},S)};J.CIM_WiFiPort_EnableDevice=function(T,S){J.Exec("CIM_WiFiPort","EnableDevice",{Enabled:T},S)};J.CIM_WiFiPort_OnlineDevice=function(T,S){J.Exec("CIM_WiFiPort","OnlineDevice",{Online:T},S)};J.CIM_WiFiPort_QuiesceDevice=function(T,S){J.Exec("CIM_WiFiPort","QuiesceDevice",{Quiesce:T},S)};J.CIM_WiFiPort_SaveProperties=function(S){J.Exec("CIM_WiFiPort","SaveProperties",{},S)};J.CIM_WiFiPort_RestoreProperties=function(S){J.Exec("CIM_WiFiPort","RestoreProperties",{},S)};J.CIM_WiFiPort_RequestStateChange=function(T,U,S){J.Exec("CIM_WiFiPort","RequestStateChange",{RequestedState:T,TimeoutPeriod:U},S)};J.IPS_HostBasedSetupService_Setup=function(W,X,V,T,Y,U,S){J.Exec("IPS_HostBasedSetupService","Setup",{NetAdminPassEncryptionType:W,NetworkAdminPassword:X,McNonce:V,Certificate:T,SigningAlgorithm:Y,DigitalSignature:U},S)};J.IPS_HostBasedSetupService_AddNextCertInChain=function(V,T,U,S){J.Exec("IPS_HostBasedSetupService","AddNextCertInChain",{NextCertificate:V,IsLeafCertificate:T,IsRootCertificate:U},S)};J.IPS_HostBasedSetupService_AdminSetup=function(V,W,U,X,T,S){J.Exec("IPS_HostBasedSetupService","AdminSetup",{NetAdminPassEncryptionType:V,NetworkAdminPassword:W,McNonce:U,SigningAlgorithm:X,DigitalSignature:T},S)};J.IPS_HostBasedSetupService_UpgradeClientToAdmin=function(U,V,T,S){J.Exec("IPS_HostBasedSetupService","UpgradeClientToAdmin",{McNonce:U,SigningAlgorithm:V,DigitalSignature:T},S)};J.IPS_HostBasedSetupService_DisableClientControlMode=function(S,T){J.Exec("IPS_HostBasedSetupService","DisableClientControlMode",{_method_dummy:S},T)};J.IPS_KVMRedirectionSettingData_TerminateSession=function(S){J.Exec("IPS_KVMRedirectionSettingData","TerminateSession",{},S)};J.IPS_KVMRedirectionSettingData_DataChannelRead=function(S){J.Exec("IPS_KVMRedirectionSettingData","DataChannelRead",{},S)};J.IPS_KVMRedirectionSettingData_DataChannelWrite=function(T,S){J.Exec("IPS_KVMRedirectionSettingData","DataChannelWrite",{DataMessage:T},S)};J.IPS_OptInService_StartOptIn=function(S){J.Exec("IPS_OptInService","StartOptIn",{},S)};J.IPS_OptInService_CancelOptIn=function(S){J.Exec("IPS_OptInService","CancelOptIn",{},S)};J.IPS_OptInService_SendOptInCode=function(T,S){J.Exec("IPS_OptInService","SendOptInCode",{OptInCode:T},S)};J.IPS_OptInService_StartService=function(S){J.Exec("IPS_OptInService","StartService",{},S)};J.IPS_OptInService_StopService=function(S){J.Exec("IPS_OptInService","StopService",{},S)};J.IPS_OptInService_RequestStateChange=function(T,U,S){J.Exec("IPS_OptInService","RequestStateChange",{RequestedState:T,TimeoutPeriod:U},S)};J.IPS_ProvisioningRecordLog_RequestStateChange=function(T,U,S){J.Exec("IPS_ProvisioningRecordLog","RequestStateChange",{RequestedState:T,TimeoutPeriod:U},S)};J.IPS_ProvisioningRecordLog_ClearLog=function(S,T){J.Exec("IPS_ProvisioningRecordLog","ClearLog",{_method_dummy:S},T)};J.IPS_SecIOService_RequestStateChange=function(T,U,S){J.Exec("IPS_SecIOService","RequestStateChange",{RequestedState:T,TimeoutPeriod:U},S)};J.AmtStatusToStr=function(S){if(J.AmtStatusCodes[S]){return J.AmtStatusCodes[S]}else{return"UNKNOWN_ERROR"}};J.AmtStatusCodes={0:"SUCCESS",1:"INTERNAL_ERROR",2:"NOT_READY",3:"INVALID_PT_MODE",4:"INVALID_MESSAGE_LENGTH",5:"TABLE_FINGERPRINT_NOT_AVAILABLE",6:"INTEGRITY_CHECK_FAILED",7:"UNSUPPORTED_ISVS_VERSION",8:"APPLICATION_NOT_REGISTERED",9:"INVALID_REGISTRATION_DATA",10:"APPLICATION_DOES_NOT_EXIST",11:"NOT_ENOUGH_STORAGE",12:"INVALID_NAME",13:"BLOCK_DOES_NOT_EXIST",14:"INVALID_BYTE_OFFSET",15:"INVALID_BYTE_COUNT",16:"NOT_PERMITTED",17:"NOT_OWNER",18:"BLOCK_LOCKED_BY_OTHER",19:"BLOCK_NOT_LOCKED",20:"INVALID_GROUP_PERMISSIONS",21:"GROUP_DOES_NOT_EXIST",22:"INVALID_MEMBER_COUNT",23:"MAX_LIMIT_REACHED",24:"INVALID_AUTH_TYPE",25:"AUTHENTICATION_FAILED",26:"INVALID_DHCP_MODE",27:"INVALID_IP_ADDRESS",28:"INVALID_DOMAIN_NAME",29:"UNSUPPORTED_VERSION",30:"REQUEST_UNEXPECTED",31:"INVALID_TABLE_TYPE",32:"INVALID_PROVISIONING_STATE",33:"UNSUPPORTED_OBJECT",34:"INVALID_TIME",35:"INVALID_INDEX",36:"INVALID_PARAMETER",37:"INVALID_NETMASK",38:"FLASH_WRITE_LIMIT_EXCEEDED",39:"INVALID_IMAGE_LENGTH",40:"INVALID_IMAGE_SIGNATURE",41:"PROPOSE_ANOTHER_VERSION",42:"INVALID_PID_FORMAT",43:"INVALID_PPS_FORMAT",44:"BIST_COMMAND_BLOCKED",45:"CONNECTION_FAILED",46:"CONNECTION_TOO_MANY",47:"RNG_GENERATION_IN_PROGRESS",48:"RNG_NOT_READY",49:"CERTIFICATE_NOT_READY",1024:"DISABLED_BY_POLICY",2048:"NETWORK_IF_ERROR_BASE",2049:"UNSUPPORTED_OEM_NUMBER",2050:"UNSUPPORTED_BOOT_OPTION",2051:"INVALID_COMMAND",2052:"INVALID_SPECIAL_COMMAND",2053:"INVALID_HANDLE",2054:"INVALID_PASSWORD",2055:"INVALID_REALM",2056:"STORAGE_ACL_ENTRY_IN_USE",2057:"DATA_MISSING",2058:"DUPLICATE",2059:"EVENTLOG_FROZEN",2060:"PKI_MISSING_KEYS",2061:"PKI_GENERATING_KEYS",2062:"INVALID_KEY",2063:"INVALID_CERT",2064:"CERT_KEY_NOT_MATCH",2065:"MAX_KERB_DOMAIN_REACHED",2066:"UNSUPPORTED",2067:"INVALID_PRIORITY",2068:"NOT_FOUND",2069:"INVALID_CREDENTIALS",2070:"INVALID_PASSPHRASE",2072:"NO_ASSOCIATION",2075:"AUDIT_FAIL",2076:"BLOCKING_COMPONENT",2081:"USER_CONSENT_REQUIRED",4096:"APP_INTERNAL_ERROR",4097:"NOT_INITIALIZED",4098:"LIB_VERSION_UNSUPPORTED",4099:"INVALID_PARAM",4100:"RESOURCES",4101:"HARDWARE_ACCESS_ERROR",4102:"REQUESTOR_NOT_REGISTERED",4103:"NETWORK_ERROR",4104:"PARAM_BUFFER_TOO_SHORT",4105:"COM_NOT_INITIALIZED_IN_THREAD",4106:"URL_REQUIRED"};J.GetMessageLog=function(S,T){J.AMT_MessageLog_PositionToFirstRecord(k,[S,T,[]])};function k(U,S,T,V,W){if(V!=200||T.Body.ReturnValue!="0"){W[0](J,null,W[2],V);return}J.AMT_MessageLog_GetRecords(T.Body.IterationIdentifier,390,l,W)}function l(Z,W,Y,aa,ac){if(aa!=200||Y.Body.ReturnValue!="0"){ac[0](J,null,ac[2],aa);return}var U,V,ae,T,S=ac[2],ab=new Date(),ad,X=Y.Body.RecordArray;if(typeof X==="string"){Y.Body.RecordArray=[Y.Body.RecordArray]}for(U in X){T=Buffer.from(X[U],"base64");if(T!=null){ad=M(T,0);if((ad>0)&&(ad<4294967295)){ae={DeviceAddress:T[4],EventSensorType:T[5],EventType:T[6],EventOffset:T[7],EventSourceType:T[8],EventSeverity:T[9],SensorNumber:T[10],Entity:T[11],EntityInstance:T[12],EventData:[],Time:new Date((ad+(ab.getTimezoneOffset()*60))*1000)};for(V=13;V<21;V++){ae.EventData.push(T[V])}ae.EntityStr=o[ae.Entity];ae.Desc=j(ae.EventSensorType,ae.EventOffset,ae.EventData,ae.Entity);if(!ae.EntityStr){ae.EntityStr="Unknown"}S.push(ae)}}}if(Y.Body.NoMoreRecords!=true){J.AMT_MessageLog_GetRecords(Y.Body.IterationIdentifier,390,l,[ac[0],S,ac[2]])}else{ac[0](J,S,ac[2])}}var f="Platform firmware (e.g. BIOS)|SMI handler|ISV system management software|Alert ASIC|IPMI|BIOS vendor|System board set vendor|System integrator|Third party add-in|OSV|NIC|System management card".split("|");var p="Unspecified.|No system memory is physically installed in the system.|No usable system memory, all installed memory has experienced an unrecoverable failure.|Unrecoverable hard-disk/ATAPI/IDE device failure.|Unrecoverable system-board failure.|Unrecoverable diskette subsystem failure.|Unrecoverable hard-disk controller failure.|Unrecoverable PS/2 or USB keyboard failure.|Removable boot media not found.|Unrecoverable video controller failure.|No video device detected.|Firmware (BIOS) ROM corruption detected.|CPU voltage mismatch (processors that share same supply have mismatched voltage requirements)|CPU speed matching failure".split("|");var q="Unspecified.|Memory initialization.|Starting hard-disk initialization and test|Secondary processor(s) initialization|User authentication|User-initiated system setup|USB resource configuration|PCI resource configuration|Option ROM initialization|Video initialization|Cache initialization|SM Bus initialization|Keyboard controller initialization|Embedded controller/management controller initialization|Docking station attachment|Enabling docking station|Docking station ejection|Disabling docking station|Calling operating system wake-up vector|Starting operating system boot process|Baseboard or motherboard initialization|reserved|Floppy initialization|Keyboard test|Pointing device test|Primary processor initialization".split("|");var o="Unspecified|Other|Unknown|Processor|Disk|Peripheral|System management module|System board|Memory module|Processor module|Power supply|Add in card|Front panel board|Back panel board|Power system board|Drive backplane|System internal expansion board|Other system board|Processor board|Power unit|Power module|Power management board|Chassis back panel board|System chassis|Sub chassis|Other chassis board|Disk drive bay|Peripheral bay|Device bay|Fan cooling|Cooling unit|Cable interconnect|Memory device|System management software|BIOS|Intel(r) ME|System bus|Group|Intel(r) ME|External environment|Battery|Processing blade|Connectivity switch|Processor/memory module|I/O module|Processor I/O module|Management controller firmware|IPMI channel|PCI bus|PCI express bus|SCSI bus|SATA/SAS bus|Processor front side bus".split("|");J.RealmNames="||Redirection|PT Administration|Hardware Asset|Remote Control|Storage|Event Manager|Storage Admin|Agent Presence Local|Agent Presence Remote|Circuit Breaker|Network Time|General Information|Firmware Update|EIT|LocalUN|Endpoint Access Control|Endpoint Access Control Admin|Event Log Reader|Audit Log|ACL Realm|||Local System".split("|");J.WatchdogCurrentStates={1:"Not Started",2:"Stopped",4:"Running",8:"Expired",16:"Suspended"};function j(V,U,T,S){if(V==15){if(T[0]==235){return"Invalid Data"}if(U==0){return p[T[1]]}return q[T[1]]}if(V==18&&T[0]==170){return"Agent watchdog "+char2hex(T[4])+char2hex(T[3])+char2hex(T[2])+char2hex(T[1])+"-"+char2hex(T[6])+char2hex(T[5])+"-... changed to "+J.WatchdogCurrentStates[T[7]]}if(V==6){return"Authentication failed "+(T[1]+(T[2]<<8))+" times. The system may be under attack."}if(V==30){return"No bootable media"}if(V==32){return"Operating system lockup or power interrupt"}if(V==35){return"System boot failure"}if(V==37){return"System firmware started (at least one CPU is properly executing)."}return"Unknown Sensor Type #"+V}var a={16:"Security Admin",17:"RCO",18:"Redirection Manager",19:"Firmware Update Manager",20:"Security Audit Log",21:"Network Time",22:"Network Administration",23:"Storage Administration",24:"Event Manager",25:"Circuit Breaker Manager",26:"Agent Presence Manager",27:"Wireless Configuration",28:"EAC",29:"KVM",30:"User Opt-In Events",32:"Screen Blanking",33:"Watchdog Events",1600:"Provisioning Started",1601:"Provisioning Completed",1602:"ACL Entry Added",1603:"ACL Entry Modified",1604:"ACL Entry Removed",1605:"ACL Access with Invalid Credentials",1606:"ACL Entry State",1607:"TLS State Changed",1608:"TLS Server Certificate Set",1609:"TLS Server Certificate Remove",1610:"TLS Trusted Root Certificate Added",1611:"TLS Trusted Root Certificate Removed",1612:"TLS Preshared Key Set",1613:"Kerberos Settings Modified",1614:"Kerberos Master Key Modified",1615:"Flash Wear out Counters Reset",1616:"Power Package Modified",1617:"Set Realm Authentication Mode",1618:"Upgrade Client to Admin Control Mode",1619:"Unprovisioning Started",1700:"Performed Power Up",1701:"Performed Power Down",1702:"Performed Power Cycle",1703:"Performed Reset",1704:"Set Boot Options",1800:"IDER Session Opened",1801:"IDER Session Closed",1802:"IDER Enabled",1803:"IDER Disabled",1804:"SoL Session Opened",1805:"SoL Session Closed",1806:"SoL Enabled",1807:"SoL Disabled",1808:"KVM Session Started",1809:"KVM Session Ended",1810:"KVM Enabled",1811:"KVM Disabled",1812:"VNC Password Failed 3 Times",1900:"Firmware Updated",1901:"Firmware Update Failed",2000:"Security Audit Log Cleared",2001:"Security Audit Policy Modified",2002:"Security Audit Log Disabled",2003:"Security Audit Log Enabled",2004:"Security Audit Log Exported",2005:"Security Audit Log Recovered",2100:"Intel(R) ME Time Set",2200:"TCPIP Parameters Set",2201:"Host Name Set",2202:"Domain Name Set",2203:"VLAN Parameters Set",2204:"Link Policy Set",2205:"IPv6 Parameters Set",2300:"Global Storage Attributes Set",2301:"Storage EACL Modified",2302:"Storage FPACL Modified",2303:"Storage Write Operation",2400:"Alert Subscribed",2401:"Alert Unsubscribed",2402:"Event Log Cleared",2403:"Event Log Frozen",2500:"CB Filter Added",2501:"CB Filter Removed",2502:"CB Policy Added",2503:"CB Policy Removed",2504:"CB Default Policy Set",2505:"CB Heuristics Option Set",2506:"CB Heuristics State Cleared",2600:"Agent Watchdog Added",2601:"Agent Watchdog Removed",2602:"Agent Watchdog Action Set",2700:"Wireless Profile Added",2701:"Wireless Profile Removed",2702:"Wireless Profile Updated",2800:"EAC Posture Signer SET",2801:"EAC Enabled",2802:"EAC Disabled",2803:"EAC Posture State",2804:"EAC Set Options",2900:"KVM Opt-in Enabled",2901:"KVM Opt-in Disabled",2902:"KVM Password Changed",2903:"KVM Consent Succeeded",2904:"KVM Consent Failed",3000:"Opt-In Policy Change",3001:"Send Consent Code Event",3002:"Start Opt-In Blocked Event"};J.GetAuditLogExtendedDataStr=function(T,S){if((T==1602||T==1604)&&S[0]==0){return w(S).splice(2,2+S[1]).toString()}if(T==1603){if(S[1]==0){return w(S).splice(3).toString()}return null}if(T==1605){return["Invalid ME access","Invalid MEBx access"][S[0]]}if(T==1606){var U=["Disabled","Enabled"][S[0]];if(S[1]==0){U+=", "+S[3]}return U}if(T==1607){return"Remote "+["NoAuth","ServerAuth","MutualAuth"][S[0]]+", Local "+["NoAuth","ServerAuth","MutualAuth"][S[1]]}if(T==1617){return J.RealmNames[L(S,0)]+", "+["NoAuth","Auth","Disabled"][S[4]]}if(T==1619){return["BIOS","MEBx","Local MEI","Local WSMAN","Remote WSAMN"][S[0]]}if(T==1900){return"From "+N(S,0)+"."+N(S,2)+"."+N(S,4)+"."+N(S,6)+" to "+N(S,8)+"."+N(S,10)+"."+N(S,12)+"."+N(S,14)}if(T==2100){var V=new Date();V.setTime(L(S,0)*1000+(new Date().getTimezoneOffset()*60000));return V.toLocaleString()}if(T==3000){return"From "+["None","KVM","All"][S[0]]+" to "+["None","KVM","All"][S[1]]}if(T==3001){return["Success","Failed 3 times"][S[0]]}return null};J.GetAuditLog=function(S){J.AMT_AuditLog_ReadRecords(1,i,[S,[]])};function I(S){if(!S||S==null||typeof S=="object"){return S}return[S]}function N(T,S){return(T[S]<<8)+T[S+1]}function L(T,S){return(T[S]*16777216)+(T[S+1]<<16)+(T[S+2]<<8)+T[S+3]}function M(T,S){return(T[S+3]*16777216)+(T[S+2]<<16)+(T[S+1]<<8)+T[S]}function v(S){return Buffer.from(S).toString("base64")}function u(T){var U=null;try{U=Buffer.from(T,"base64").toString()}catch(S){console.log(S)}return U}function w(S){var U=[];for(var T in S){U.push(S[T])}return U}function i(ab,W,aa,ac,ae){if(ac!=200){ae[0](J,[],ac);return}var Y,V,S,ah,Z=ae[1],ad=new Date(),af;if(aa.Body.RecordsReturned>0){aa.Body.EventRecords=I(aa.Body.EventRecords);for(V in aa.Body.EventRecords){S=null;try{S=Buffer.from(aa.Body.EventRecords[V],"base64")}catch(T){console.log(T+" "+aa.Body.EventRecords[V])}ah={AuditAppID:N(S,0),EventID:N(S,2),InitiatorType:S[4]};ah.AuditApp=a[ah.AuditAppID];ah.Event=a[(ah.AuditAppID*100)+ah.EventID];if(!ah.Event){ah.Event="#"+ah.EventID}if(ah.InitiatorType==0){var ag=S[5];ah.Initiator=S.slice(6,6+ag).toString();Y=6+ag}if(ah.InitiatorType==1){ah.KerberosUserInDomain=L(S,5);var ag=S[9];ah.Initiator=G(S.slice(10,10+ag));Y=10+ag}if(ah.InitiatorType==2){ah.Initiator="Local";Y=5}if(ah.InitiatorType==3){ah.Initiator="KVM Default Port";Y=5}af=L(S,Y);ah.Time=new Date((af+(ad.getTimezoneOffset()*60))*1000);Y+=4;ah.MCLocationType=S[Y++];var X=S[Y++];ah.NetAddress=S.slice(Y,Y+X).toString();Y+=X;var U=S[Y++];ah.Ex=S.slice(Y,Y+U);ah.ExStr=J.GetAuditLogExtendedDataStr((ah.AuditAppID*100)+ah.EventID,ah.Ex);Z.push(ah)}}if(aa.Body.TotalRecordCount>Z.length){J.AMT_AuditLog_ReadRecords(Z.length+1,i,[ae[0],Z])}else{ae[0](J,Z,ac)}}function C(U){if(U===undefined||U===null){return null}var V="";for(var T in U){var S=U[T];if(!S){continue}if(S.__parameterType==="reference"){V+=O(T,S)}else{V+=H(T,S)}}return V}function H(V,U){if(U===undefined||U===null){return null}var T=!!U.__namespace;var Z=T?"";for(var X in U){if(!U.hasOwnProperty(X)||X.indexOf("__")===0){continue}if(typeof U[X]==="function"||Array.isArray(U[X])){continue}if(typeof U[X]==="object"){console.error("only convert one level down...")}else{Y+=Z+X+">"+U[X].toString()+S+X+">"}}Y+="";return Y}function O(T,S){if(S===undefined||S===null){return null}var U="/wsman"+S.__resourceUri+"";for(var V in S){if(!S.hasOwnProperty(V)||V.indexOf("__")===0){continue}if(typeof S[V]==="function"||typeof S[V]==="object"||Array.isArray(S[V])){continue}U+=''+S[V].toString()+""}U+="";return U}function G(U){var T="S-"+U.charCodeAt(0)+"-"+U.charCodeAt(7);for(var S=2;S<(U.length/4);S++){T+="-"+M(U,S*4)}return T}function F(V){if(!V||V==null){return null}var U=V.split("-");if(U.length<4||(U[0]!="s"&&U[0]!="S")){return null}for(var S=1;S0?this[this.length-1]:undefined)}})}catch(e){}try{Object.defineProperty(String.prototype,"replaceAll",{value:function replaceAll(b,a){return(this.split(b).join(a))}})}catch(e){}var RSMB=1381190978;var memoryLocation={1:"Other",2:"Unknown",3:"System Board",4:"ISA",5:"EISA",6:"PCI",7:"MCA",8:"PCMCIA",9:"Proprietary",10:"NuBus",160:"PC-98/C20",161:"PC-98/C24",162:"PC-98/E",163:"PC-98/LB"};var wakeReason=["Reserved","Other","Unknown","APM Timer","Modem Ring","LAN","Power Switch","PCI","AC Power"];function zeroLeftPad(c,b){if((b==null)&&(typeof(b)!="number")){return null}if(c==null){c=""}var d="";for(var a=0;a1){var r=v[1].split("\x0A\x0A")[0].split("\x0A");var s=[];for(var t in r){var u=r[t].trim().replaceAll(" ","").replaceAll("\x09","");if(!(u[0]=='"')){s.push(u)}}p.write(Buffer.from(s.join(""),"hex"));p.write(Buffer.from("00","hex"))}else{p.write(Buffer.from("0000","hex"))}}var q=p.buffer;q.ms=p;return(q)}}this._parse=function b(o){var n={};var m;var l=0;var o;var s=0;while(o&&l0){var n=l[4].pop();var o=n[20]&64;var s=n[20]&7;if(o){var m={_ObjectID:"SMBiosTables.processorInfo"};m.Processor=q[n[1]];m.MaxSpeed=n.readUInt16LE(16)+" Mhz";if(n[31]){m.Cores=n[31]}if(n[33]){m.Threads=n[33]}m.Populated=1;m.Status=t[s];m.Socket=n._strings[n[0]-1];m.Manufacturer=n._strings[n[3]-1];m.Version=n._strings[n[12]-1];r.push(m)}}return(r)};this.memoryInfo=function f(k){if(!k){throw ("no data")}var n={_ObjectID:"SMBiosTables.memoryInfo"};if(k[16]){var l=k[16].peek();n.location=memoryLocation[l[0]];if((n.maxCapacityKb=l.readUInt32LE(3))==2147483648){n.maxCapacityKb="A really big number"}}return(n)};this.systemInfo=function i(k){if(!k){throw ("no data")}var l={_ObjectID:"SMBiosTables.systemInfo"};if(k[1]){var m=k[1].peek();var n=m.slice(4,20);l.uuid=[zeroLeftPad(n.readUInt32LE(0).toString(16),8),zeroLeftPad(n.readUInt16LE(4).toString(16),4),zeroLeftPad(n.readUInt16LE(6).toString(16),4),zeroLeftPad(n.readUInt16BE(8).toString(16),4),zeroLeftPad(n.slice(10).toString("hex").toLowerCase(),12)].join("-");l.wakeReason=wakeReason[m[20]]}return(l)};this.systemSlots=function j(k){if(!k){throw ("no data")}var l=[];if(k[9]){while(k[9].length>0){var m=k[9].pop();l.push({name:m._strings[m[0]-1]})}}return(l)};this.amtInfo=function c(l){if(!l){throw ("no data")}var n={AMT:false};if(l[130]&&l[130].peek().slice(0,4).toString()=="$AMT"){var k=l[130].peek();n.AMT=k[4]?true:false;if(n.AMT){n.enabled=k[5]?true:false;n.storageRedirection=k[6]?true:false;n.serialOverLan=k[7]?true:false;n.kvm=k[14]?true:false;if(l[131].peek()&&l[131].peek().slice(52,56).toString()=="vPro"){var o=l[131].peek();if(o[0]&4){n.TXT=(o[0]&8)?true:false}if(o[0]&16){n.VMX=(o[0]&32)?true:false}n.MEBX=o.readUInt16LE(4).toString()+"."+o.readUInt16LE(6).toString()+"."+o.readUInt16LE(8).toString()+"."+o.readUInt16LE(10).toString();var m=o.slice(20,32);n.ManagementEngine=m.readUInt16LE(6).toString()+"."+m.readUInt16LE(4).toString()+"."+m.readUInt16LE(10).toString()+"."+m.readUInt16LE(8).toString()}}}return(n)};this.smTableTypes={0:"BIOS information",1:"System information",2:"Baseboard (or Module) information",4:"Processor information",5:"memory controller information",6:"Memory module information",7:"Cache information",8:"Port connector information",9:"System slots",10:"On board devices information",11:"OEM strings",12:"System configuration options",13:"BIOS language information",14:"Group associations",15:"System event log",16:"Physical memory array",17:"Memory device",18:"32bit memory error information",19:"Memory array mapped address",20:"Memory device mapped address",21:"Built-in pointing device",22:"Portable battery",23:"System reset",24:"Hardware security",25:"System power controls",26:"Voltage probe",27:"Cooling device",28:"Temperature probe",29:"Electrical current probe",30:"Out-of-band remote access",31:"Boot integrity services (BIS) entry point",32:"System boot information",33:"64bit memory error information",34:"Management device",35:"Management device component",36:"Management device threshold data",37:"Memory channel",38:"IPMI device information",39:"System power supply",40:"Additional information",41:"Onboard devices extended information",42:"Management controller host interface",126:"Inactive",127:"End-of-table"}}module.exports=new SMBiosTables(); \ No newline at end of file diff --git a/agents/modules_meshcmd_min/sysinfo.min.js b/agents/modules_meshcmd_min/sysinfo.min.js deleted file mode 100644 index 9230bd6b..00000000 --- a/agents/modules_meshcmd_min/sysinfo.min.js +++ /dev/null @@ -1 +0,0 @@ -var PDH_FMT_LONG=256;var PDH_FMT_DOUBLE=512;var promise=require("promise");if(process.platform=="win32"){var GM=require("_GenericMarshal");GM.kernel32=GM.CreateNativeProxy("kernel32.dll");GM.kernel32.CreateMethod("GlobalMemoryStatusEx");GM.pdh=GM.CreateNativeProxy("pdh.dll");GM.pdh.CreateMethod("PdhAddEnglishCounterA");GM.pdh.CreateMethod("PdhCloseQuery");GM.pdh.CreateMethod("PdhCollectQueryData");GM.pdh.CreateMethod("PdhGetFormattedCounterValue");GM.pdh.CreateMethod("PdhGetFormattedCounterArrayA");GM.pdh.CreateMethod("PdhOpenQueryA");GM.pdh.CreateMethod("PdhRemoveCounter")}function windows_cpuUtilization(){var b=new promise(function(d,c){this._res=d;this._rej=c});b.counter=GM.CreateVariable(16);b.cpu=GM.CreatePointer();b.cpuTotal=GM.CreatePointer();var a=0;if((a=GM.pdh.PdhOpenQueryA(0,0,b.cpu).Val)!=0){b._rej(a);return}if((a=GM.pdh.PdhAddEnglishCounterA(b.cpu.Deref(),GM.CreateVariable("\\Processor(*)\\% Processor Time"),0,b.cpuTotal).Val)!=0){b._rej(a);return}if((a=GM.pdh.PdhCollectQueryData(b.cpu.Deref()).Val!=0)){b._rej(a);return}b._timeout=setTimeout(function(k){var m={cpus:[]};var d=GM.CreateVariable(4);var j=GM.CreateVariable(4);var c,l,h;var f;if((f=GM.pdh.PdhCollectQueryData(k.cpu.Deref()).Val!=0)){k._rej(f);return}if((f=GM.pdh.PdhGetFormattedCounterArrayA(k.cpuTotal.Deref(),PDH_FMT_DOUBLE,d,j,0).Val)==-2147481646){c=GM.CreateVariable(d.toBuffer().readUInt32LE())}else{k._rej(f);return}if((f=GM.pdh.PdhGetFormattedCounterArrayA(k.cpuTotal.Deref(),PDH_FMT_DOUBLE,d,j,c).Val)!=0){k._rej(f);return}for(var g=0;g0){var f=c[0].split(":")[1];var a=f.split(",");var e=parseFloat(a[0].split("%")[0].trim())+parseFloat(a[1].split("%")[0].trim());d._res({total:e,cpus:[]})}else{d._rej("parse error")}return(d)}function macos_memUtilization(){var d={};var e=new promise(function(h,g){this._res=h;this._rej=g});var b=require("child_process").execFile("/bin/sh",["sh"]);b.stdout.str="";b.stdout.on("data",function(g){this.str+=g.toString()});b.stdin.write('top -l 1 | grep -E "^Phys"\nexit\n');b.waitExit();var c=b.stdout.str.split("\n");if(c[0].length>0){var f=c[0].split(":")[1];var a=f.split(",");d.MemTotal=parseInt(a[0].trim().split(" ")[0]);d.MemFree=parseInt(a[1].trim().split(" ")[0]);d.percentFree=((d.MemFree/d.MemTotal)*100).toFixed(2);d.percentConsumed=(((d.MemTotal-d.MemFree)/d.MemTotal)*100).toFixed(2);return(d)}else{throw ("Parse Error")}}switch(process.platform){case"linux":module.exports={cpuUtilization:linux_cpuUtilization,memUtilization:linux_memUtilization};break;case"win32":module.exports={cpuUtilization:windows_cpuUtilization,memUtilization:windows_memUtilization};break;case"darwin":module.exports={cpuUtilization:macos_cpuUtilization,memUtilization:macos_memUtilization};break}; \ No newline at end of file diff --git a/agents/modules_meshcmd_min/user-sessions.min.js b/agents/modules_meshcmd_min/user-sessions.min.js deleted file mode 100644 index a059a1fc..00000000 --- a/agents/modules_meshcmd_min/user-sessions.min.js +++ /dev/null @@ -1 +0,0 @@ -var NOTIFY_FOR_THIS_SESSION=0;var NOTIFY_FOR_ALL_SESSIONS=1;var WM_WTSSESSION_CHANGE=689;var WM_POWERBROADCAST=536;var PBT_POWERSETTINGCHANGE=32787;var PBT_APMSUSPEND=4;var PBT_APMRESUMESUSPEND=7;var PBT_APMRESUMEAUTOMATIC=18;var PBT_APMPOWERSTATUSCHANGE=10;var WTS_CONSOLE_CONNECT=(1);var WTS_CONSOLE_DISCONNECT=(2);var WTS_REMOTE_CONNECT=(3);var WTS_REMOTE_DISCONNECT=(4);var WTS_SESSION_LOGON=(5);var WTS_SESSION_LOGOFF=(6);var WTS_SESSION_LOCK=(7);var WTS_SESSION_UNLOCK=(8);var WTS_SESSION_REMOTE_CONTROL=(9);var WTS_SESSION_CREATE=(10);var WTS_SESSION_TERMINATE=(11);var GUID_ACDC_POWER_SOURCE;var GUID_BATTERY_PERCENTAGE_REMAINING;var GUID_CONSOLE_DISPLAY_STATE;function UserSessions(){this._ObjectID="user-sessions";require("events").EventEmitter.call(this,true).createEvent("changed").createEvent("locked").createEvent("unlocked");this.enumerateUsers=function h(){var s=require("promise");var r=new s(function(t,p){this.__resolver=t;this.__rejector=p});r.__handler=function o(p){r.__resolver(p)};try{this.Current(r.__handler)}catch(q){r.__rejector(q)}r.parent=this;return(r)};if(process.platform=="win32"){this._serviceHooked=false;this._marshal=require("_GenericMarshal");this._kernel32=this._marshal.CreateNativeProxy("Kernel32.dll");this._kernel32.CreateMethod("GetLastError");try{this._wts=this._marshal.CreateNativeProxy("Wtsapi32.dll");this._wts.CreateMethod("WTSEnumerateSessionsA");this._wts.CreateMethod("WTSQuerySessionInformationA");this._wts.CreateMethod("WTSRegisterSessionNotification");this._wts.CreateMethod("WTSUnRegisterSessionNotification");this._wts.CreateMethod("WTSFreeMemory")}catch(i){}this._advapi=this._marshal.CreateNativeProxy("Advapi32.dll");this._advapi.CreateMethod("AllocateAndInitializeSid");this._advapi.CreateMethod("CheckTokenMembership");this._advapi.CreateMethod("FreeSid");this._user32=this._marshal.CreateNativeProxy("user32.dll");this._user32.CreateMethod({method:"RegisterPowerSettingNotification",threadDispatch:1});this._user32.CreateMethod("UnregisterPowerSettingNotification");this._rpcrt=this._marshal.CreateNativeProxy("Rpcrt4.dll");this._rpcrt.CreateMethod("UuidFromStringA");this._rpcrt.StringToUUID=function n(o){var p=n.us._marshal.CreateVariable(16);if(n.us._rpcrt.UuidFromStringA(n.us._marshal.CreateVariable(o),p).Val==0){return(p)}else{throw ("Could not convert string to UUID")}};this._rpcrt.StringToUUID.us=this;GUID_ACDC_POWER_SOURCE=this._rpcrt.StringToUUID("5d3e9a59-e9D5-4b00-a6bd-ff34ff516548");GUID_BATTERY_PERCENTAGE_REMAINING=this._rpcrt.StringToUUID("a7ad8041-b45a-4cae-87a3-eecbb468a9e1");GUID_CONSOLE_DISPLAY_STATE=this._rpcrt.StringToUUID("6fe69556-704a-47a0-8f24-c28d936fda47");this.SessionStates=["Active","Connected","ConnectQuery","Shadow","Disconnected","Idle","Listening","Reset","Down","Init"];this.InfoClass={WTSInitialProgram:0,WTSApplicationName:1,WTSWorkingDirectory:2,WTSOEMId:3,WTSSessionId:4,WTSUserName:5,WTSWinStationName:6,WTSDomainName:7,WTSConnectState:8,WTSClientBuildNumber:9,WTSClientName:10,WTSClientDirectory:11,WTSClientProductId:12,WTSClientHardwareId:13,WTSClientAddress:14,WTSClientDisplay:15,WTSClientProtocolType:16,WTSIdleTime:17,WTSLogonTime:18,WTSIncomingBytes:19,WTSOutgoingBytes:20,WTSIncomingFrames:21,WTSOutgoingFrames:22,WTSClientInfo:23,WTSSessionInfo:24,WTSSessionInfoEx:25,WTSConfigInfo:26,WTSValidationInfo:27,WTSSessionAddressV4:28,WTSIsRemoteSession:29};this.isRoot=function k(){var r=this._marshal.CreateVariable(6);r.toBuffer().writeInt8(5,5);var p=this._marshal.CreatePointer();var o=false;if(this._advapi.AllocateAndInitializeSid(r,2,32,544,0,0,0,0,0,0,p).Val!=0){var q=this._marshal.CreateInteger();if(this._advapi.CheckTokenMembership(0,p.Deref(),q).Val!=0){if(q.toBuffer().readUInt32LE()!=0){o=true}}this._advapi.FreeSid(p.Deref())}return o};this.getSessionAttribute=function j(s,o){var p=this._marshal.CreatePointer();var q=this._marshal.CreateVariable(4);if(this._wts.WTSQuerySessionInformationA(0,s,o,p,q).Val==0){throw ("Error calling WTSQuerySessionInformation: "+this._kernel32.GetLastError.Val)}var r=p.Deref().String;this._wts.WTSFreeMemory(p.Deref());return(r)};this.Current=function f(o){var u={};var t=this._marshal.CreatePointer();var p=this._marshal.CreateVariable(4);if(this._wts.WTSEnumerateSessionsA(0,0,1,t,p).Val==0){throw ("Error calling WTSEnumerateSessionsA: "+this._kernel32.GetLastError().Val)}for(var q=0;q= 0) {printf \"%s:%s\\n\", $1, $3}' /etc/passwd\nexit\n");o.waitExit();var p=o.stdout.str.split("\n");var r={},s;for(var q in p){s=p[q].split(":");if(s[0]){r[s[0]]=s[1]}}return(r)};this._uids=function c(){var o=require("child_process").execFile("/bin/sh",["sh"]);o.stdout.str="";o.stdout.on("data",function(t){this.str+=t.toString()});o.stdin.write("awk -F: '($3 >= 0) {printf \"%s:%s\\n\", $1, $3}' /etc/passwd\nexit\n");o.waitExit();var p=o.stdout.str.split("\n");var r={},s;for(var q in p){s=p[q].split(":");if(s[0]){r[s[1]]=s[0]}}return(r)};this.Self=function m(){var q=require("promise");var o=new q(function(r,p){this.__resolver=r;this.__rejector=p;this.__child=require("child_process").execFile("/usr/bin/id",["id","-u"]);this.__child.promise=this;this.__child.stdout._txt="";this.__child.stdout.on("data",function(s){this._txt+=s.toString()});this.__child.on("exit",function(s){try{parseInt(this.stdout._txt)}catch(t){this.promise.__rejector("invalid uid");return}var u=parseInt(this.stdout._txt);this.promise.__resolver(u)})});return(o)};this.Current=function f(o){var p={};p._ObjectID="UserSession";Object.defineProperty(p,"_callback",{value:o});Object.defineProperty(p,"_child",{value:require("child_process").execFile("/usr/bin/last",["last","-f","/var/run/utmp"])});p._child.Parent=p;p._child._txt="";p._child.on("exit",function(q){var u=this._txt.split("\n");var A=[];var D={};for(var t in u){if(u[t]){var B=getTokens(u[t]);var z={Username:B[0],SessionId:B[1]};if(B[3].includes("still logged in")){z.State="Active"}else{z.LastActive=B[3]}A.push(z)}}A.pop();var C={};var y=[];for(var t in A){if(A[t].Username!="reboot"){D[A[t].SessionId]=A[t];if(C[A[t].Username]==null){C[A[t].Username]=-1}}}try{require("promise")}catch(r){Object.defineProperty(D,"Active",{value:showActiveOnly(D)});if(this.Parent._callback){this.Parent._callback.call(this.Parent,D)}return}var x=require("promise");for(var v in C){var w=new x(function(E,s){this.__username=v;this.__resolver=E;this.__rejector=s;this.__child=require("child_process").execFile("/usr/bin/id",["id","-u",v]);this.__child.promise=this;this.__child.stdout._txt="";this.__child.stdout.on("data",function(F){this._txt+=F.toString()});this.__child.on("exit",function(F){try{parseInt(this.stdout._txt)}catch(G){this.promise.__rejector("invalid uid");return}var H=parseInt(this.stdout._txt);this.promise.__resolver(H)})});y.push(w)}x.all(y).then(function(E){var F={};for(var s in E){F[E[s].__username]=E[s]._internal.completedArgs[0]}for(var s in D){D[s].uid=F[D[s].Username]}Object.defineProperty(D,"Active",{value:showActiveOnly(D)});if(p._callback){p._callback.call(p,D)}},function(s){Object.defineProperty(D,"Active",{value:showActiveOnly(D)});if(p._callback){p._callback.call(p,D)}})});p._child.stdout.Parent=p._child;p._child.stdout.on("data",function(q){this.Parent._txt+=q.toString()});return(p)};this._recheckLoggedInUsers=function a(){this.enumerateUsers().then(function(o){if(o.Active.length>0){if(this.parent._linux_lock_watcher!=null&&this.parent._linux_lock_watcher.uid!=o.Active[0].uid){delete this.parent._linux_lock_watcher}this.parent._linux_lock_watcher=new g(process.env.XDG_CURRENT_DESKTOP=="Unity"?"com.ubuntu.Upstart0_6":"org.gnome.ScreenSaver",o.Active[0].uid);this.parent._linux_lock_watcher.user_session=this.parent;this.parent._linux_lock_watcher.on("signal",function(r){var q=this.user_session.enumerateUsers();q.signalData=r.data[0];q.then(function(p){switch(this.signalData){case true:case"desktop-lock":this.parent.emit("locked",p.Active[0]);break;case false:case"desktop-unlock":this.parent.emit("unlocked",p.Active[0]);break}})})}else{if(this.parent._linux_lock_watcher!=null){delete this.parent._linux_lock_watcher}}})};this.on("changed",this._recheckLoggedInUsers);this._recheckLoggedInUsers()}else{if(process.platform=="darwin"){this._users=function(){var o=require("child_process").execFile("/usr/bin/dscl",["dscl",".","list","/Users","UniqueID"]);o.stdout.str="";o.stdout.on("data",function(t){this.str+=t.toString()});o.stdin.write("exit\n");o.waitExit();var q=o.stdout.str.split("\n");var r,p;var s={};for(p=0;p0;++r){if(!u[s[r].split(" ")[0]]){try{u[s[r].split(" ")[0]]={Username:s[r].split(" ")[0],State:s[r].split("still logged in").length>1?"Active":"Inactive",uid:t.uid[s[r].split(" ")[0]]}}catch(q){}}else{if(u[s[r].split(" ")[0]].State!="Active"&&s[r].split("still logged in").length>1){u[s[r].split(" ")[0]].State="Active"}}}Object.defineProperty(u,"Active",{value:showActiveOnly(u)});if(o){o.call(this,u)}}}}}if(process.platform=="linux"||process.platform=="darwin"){this._self=function b(){var o=require("child_process").execFile("/usr/bin/id",["id","-u"]);o.stdout.str="";o.stdout.on("data",function(p){this.str+=p.toString()});o.waitExit();return(parseInt(o.stdout.str))};this.isRoot=function k(){return(this._self()==0)};this.consoleUid=function e(){var o=process.platform=="darwin"?"console":((process.env.DISPLAY)?process.env.DISPLAY:":0");var p=require("child_process").execFile("/bin/sh",["sh"]);p.stdout.str="";p.stdout.on("data",function(u){this.str+=u.toString()});p.stdin.write("who\nexit\n");p.waitExit();var s=p.stdout.str.split("\n");var t,q,r;for(q in s){t=s[q].split(" ");for(r=1;r0){return(parseInt(this._users()[t[0]]))}}}throw ("nobody logged into console")}}}function showActiveOnly(c){var b=[];var e={};var f=[];var d;for(var a in c){if(c[a].State=="Active"){b.push(c[a]);d=(c[a].Domain?(c[a].Domain+"\\"):"")+c[a].Username;if(!e[d]){e[d]=d}}}for(var a in e){f.push(a)}Object.defineProperty(b,"usernames",{value:f});return(b)}function getTokens(d){var a=[];var b;a.push(d.substring(0,(b=d.indexOf(" "))));while(d[++b]==" "){}a.push(d.substring(b,(b=d.substring(b).indexOf(" ")+b)));while(d[++b]==" "){}a.push(d.substring(b,(b=d.substring(b).indexOf(" ")+b)));while(d[++b]==" "){}var c=d.substring(b).trim();a.push(c);return(a)}module.exports=new UserSessions(); \ No newline at end of file diff --git a/agents/modules_meshcore_min/amt-lme.min.js b/agents/modules_meshcore_min/amt-lme.min.js deleted file mode 100644 index b8254355..00000000 --- a/agents/modules_meshcore_min/amt-lme.min.js +++ /dev/null @@ -1 +0,0 @@ -var MemoryStream=require("MemoryStream");var lme_id=0;var lme_port_offset=0;var xmlParser=require("amt-xml");var APF_DISCONNECT=1;var APF_SERVICE_REQUEST=5;var APF_SERVICE_ACCEPT=6;var APF_USERAUTH_REQUEST=50;var APF_USERAUTH_FAILURE=51;var APF_USERAUTH_SUCCESS=52;var APF_GLOBAL_REQUEST=80;var APF_REQUEST_SUCCESS=81;var APF_REQUEST_FAILURE=82;var APF_CHANNEL_OPEN=90;var APF_CHANNEL_OPEN_CONFIRMATION=91;var APF_CHANNEL_OPEN_FAILURE=92;var APF_CHANNEL_WINDOW_ADJUST=93;var APF_CHANNEL_DATA=94;var APF_CHANNEL_CLOSE=97;var APF_PROTOCOLVERSION=192;function lme_object(){this.ourId=++lme_id;this.amtId=-1;this.LME_CHANNEL_STATUS="LME_CS_FREE";this.txWindow=0;this.rxWindow=0;this.localPort=0;this.errorCount=0}function stream_bufferedWrite(){var a=require("events").inherits(this);this.buffer=[];this._readCheckImmediate=undefined;this._ObjectID="bufferedWriteStream";a.createEvent("close");a.createEvent("drain");a.createEvent("error");a.createEvent("finish");a.createEvent("pipe");a.createEvent("unpipe");a.createEvent("readable");this.isEmpty=function(){return(this.buffer.length==0)};this.isWaiting=function(){return(this._readCheckImmediate==undefined)};this.write=function(c){for(var b in arguments){if(typeof(arguments[b])=="function"){this.once("drain",arguments[b]);break}}var d=Buffer.alloc(c.length);c.copy(d);this.buffer.push({offset:0,data:d});this.emit("readable");return(this.buffer.length==0?true:false)};this.read=function(){var f=arguments.length==0?undefined:arguments[0];var b=0;var d=[];while((f==undefined||b0){var c=this.buffer[0].data.length-this.buffer[0].offset;var e=this.buffer[0].offset;if(c>(f-b)){d.push(this.buffer[0].data.slice(e,e+f-b));this.buffer[0].offset+=(f-b);b+=(f-b)}else{d.push(this.buffer[0].data.slice(e));b+=c;this.buffer.shift()}}this._readCheckImmediate=setImmediate(function(g){g._readCheckImmediate=undefined;if(g.buffer.length==0){g.emit("drain")}else{g.emit("readable")}},this);return(Buffer.concat(d))}}function lme_heci(c){var a=require("events").inherits(this);a.createEvent("error");a.createEvent("connect");a.createEvent("notify");a.createEvent("bind");if((c!=null)&&(c.debug==true)){lme_port_offset=-100}var b=require("heci");this.INITIAL_RXWINDOW_SIZE=4096;this._ObjectID="lme";this._LME=b.create();this._LME._binded={};this._LME.LMS=this;this._LME.on("error",function(d){this.LMS.emit("error",d)});this._LME.on("connect",function(){this.on("data",function(k){var l=k.readUInt8(0);switch(l){default:console.log("Unhandled LME Command "+l+", "+k.length+" byte(s).");break;case APF_SERVICE_REQUEST:var A=k.readUInt32BE(1);var z=k.slice(5,A+5);if(z=="pfwd@amt.intel.com"||z=="auth@amt.intel.com"){var G=Buffer.alloc(5+A);G.writeUInt8(6,0);G.writeUInt32BE(A,1);G.write(z.toString(),5);this.write(G)}else{}break;case APF_GLOBAL_REQUEST:var A=k.readUInt32BE(1);var z=k.slice(5,A+5).toString();switch(z){case"tcpip-forward":var w=k.readUInt32BE(A+6);var H=k.readUInt32BE(A+10+w);if(this[z]==undefined){this[z]={}}if(this[z][H]!=null){for(var t in this.sockets){var h=this.sockets[t];if(h.localPort==H){this.sockets[t].end();delete this.sockets[t]}}}if(this[z][H]==null){try{this[z][H]=require("net").createServer();this[z][H].HECI=this;if(lme_port_offset==0){this[z][H].listen({port:H,host:"127.0.0.1"})}else{this[z][H].listen({port:(H+lme_port_offset)})}this[z][H].on("connection",function(e){this.HECI.LMS.bindDuplexStream(e,e.remoteFamily,e.localPort-lme_port_offset)});this._binded[H]=true;this.LMS.emit("bind",this._binded)}catch(p){console.log(p,"Port "+H)}}var G=Buffer.alloc(5);G.writeUInt8(81,0);G.writeUInt32BE(H,1);this.write(G);break;case"cancel-tcpip-forward":var G=Buffer.alloc(1);G.writeUInt8(APF_REQUEST_SUCCESS,0);this.write(G);break;case"udp-send-to@amt.intel.com":var G=Buffer.alloc(1);G.writeUInt8(APF_REQUEST_FAILURE,0);this.write(G);break;default:break}break;case APF_CHANNEL_OPEN_CONFIRMATION:var J=k.readUInt32BE(1);var N=k.readUInt32BE(5);var O=k.readUInt32BE(9);if(this.sockets[J]!=undefined){this.sockets[J].lme.amtId=N;this.sockets[J].lme.rxWindow=O;this.sockets[J].lme.txWindow=O;this.sockets[J].lme.LME_CHANNEL_STATUS="LME_CS_CONNECTED";this.sockets[J].bufferedStream=new stream_bufferedWrite();this.sockets[J].bufferedStream.socket=this.sockets[J];this.sockets[J].bufferedStream.on("readable",function(){if(this.socket.lme.txWindow>0){var e=this.read(this.socket.lme.txWindow);var i=Buffer.alloc(9+e.length);i.writeUInt8(APF_CHANNEL_DATA,0);i.writeUInt32BE(this.socket.lme.amtId,1);i.writeUInt32BE(e.length,5);e.copy(i,9);this.socket.lme.txWindow-=e.length;this.socket.HECI.write(i)}});this.sockets[J].bufferedStream.on("drain",function(){this.socket.resume()});this.sockets[J].on("data",function(e){if(!this.bufferedStream.write(e)){this.pause()}});this.sockets[J].on("end",function(){var e=Buffer.alloc(5);e.writeUInt8(APF_CHANNEL_CLOSE,0);e.writeUInt32BE(this.lme.amtId,1);this.HECI.write(e)});this.sockets[J].resume()}break;case APF_PROTOCOLVERSION:var x=k.readUInt32BE(1);var y=k.readUInt32BE(5);var L=k.readUInt32BE(9);var G=Buffer.alloc(93);G.writeUInt8(192,0);G.writeUInt32BE(1,1);G.writeUInt32BE(0,5);G.writeUInt32BE(L,9);this.write(G);break;case APF_CHANNEL_WINDOW_ADJUST:var K=k.readUInt32BE(1);var g=k.readUInt32BE(5);if(this.sockets[K]!=undefined){this.sockets[K].lme.txWindow+=g;if(!this.sockets[K].bufferedStream.isEmpty()&&this.sockets[K].bufferedStream.isWaiting()){this.sockets[K].bufferedStream.emit("readable")}}else{console.log("Unknown Recipient ID/"+K+" for APF_CHANNEL_WINDOW_ADJUST")}break;case APF_CHANNEL_DATA:var K=k.readUInt32BE(1);var n=k.readUInt32BE(5);var m=k.slice(9,9+n);if((this.sockets!=null)&&(this.sockets[K]!=undefined)){this.sockets[K].pendingBytes.push(m.length);this.sockets[K].write(m,function(){var i=this.pendingBytes.shift();var e=Buffer.alloc(9);e.writeUInt8(APF_CHANNEL_WINDOW_ADJUST,0);e.writeUInt32BE(this.lme.amtId,1);e.writeUInt32BE(i,5);this.HECI.write(e)})}else{if((this.insockets!=null)&&(this.insockets[K]!=undefined)){var h=this.insockets[K];if(h.data==null){h.data=m.toString()}else{h.data+=m.toString()}h.rxWindow+=n;var s=parseHttp(h.data);if((s!=null)||(h.data.length>=8000)){var B=null;try{B=xmlParser.ParseWsman(s)}catch(o){}if(B!=null){this.LMS.emit("notify",B,h.options,_lmsNotifyToString(B),_lmsNotifyToCode(B))}var f=Buffer.alloc(5);f.writeUInt8(APF_CHANNEL_CLOSE,0);f.writeUInt32BE(d,1);this.write(f)}else{if(h.rxWindow>6000){var f=Buffer.alloc(9);f.writeUInt8(APF_CHANNEL_WINDOW_ADJUST,0);f.writeUInt32BE(h.amtId,1);f.writeUInt32BE(h.rxWindow,5);this.write(f);h.rxWindow=0}}}else{console.log("Unknown Recipient ID/"+K+" for APF_CHANNEL_DATA")}}break;case APF_CHANNEL_OPEN_FAILURE:var K=k.readUInt32BE(1);var M=k.readUInt32BE(5);if((this.sockets!=null)&&(this.sockets[K]!=undefined)){this.sockets[K].end();delete this.sockets[K]}else{if((this.insockets!=null)&&(this.insockets[K]!=undefined)){delete this.insockets[K]}else{console.log("Unknown Recipient ID/"+K+" for APF_CHANNEL_OPEN_FAILURE")}}break;case APF_CHANNEL_CLOSE:var K=k.readUInt32BE(1);if((this.sockets!=null)&&(this.sockets[K]!=undefined)){this.sockets[K].end();var d=this.sockets[K].lme.amtId;var f=Buffer.alloc(5);delete this.sockets[K];f.writeUInt8(APF_CHANNEL_CLOSE,0);f.writeUInt32BE(d,1);this.write(f)}else{if((this.insockets!=null)&&(this.insockets[K]!=undefined)){delete this.insockets[K]}else{console.log("Unknown Recipient ID/"+K+" for APF_CHANNEL_CLOSE")}}break;case APF_CHANNEL_OPEN:var A=k.readUInt32BE(1);var z=k.slice(5,A+5).toString();var j=k.readUInt32BE(A+5);var u=k.readUInt32BE(A+9);var r=k.readUInt32BE(A+17);var q=k.slice(A+21,A+21+r).toString();var I=k.readUInt32BE(A+21+r);var D=k.readUInt32BE(A+25+r);var C=k.slice(A+29+r,A+29+r+D).toString();var E=k.readUInt32BE(A+29+r+D);if(this.insockets==null){this.insockets={}}var F=++lme_id;var v=new lme_object();v.ourId=F;v.amtId=j;v.txWindow=u;v.rxWindow=0;v.options={target:q,targetPort:I,source:C,sourcePort:E};this.insockets[F]=v;var f=Buffer.alloc(17);f.writeUInt8(APF_CHANNEL_OPEN_CONFIRMATION,0);f.writeUInt32BE(j,1);f.writeUInt32BE(F,5);f.writeUInt32BE(4000,9);f.writeUInt32BE(4294967295,13);this.write(f);break}});this.LMS.emit("connect");this.resume()});this.bindDuplexStream=function(e,h,g){var j=e;j.pendingBytes=[];j.HECI=this._LME;j.LMS=this;j.lme=new lme_object();j.lme.Socket=j;j.localPort=g;var d=new MemoryStream();d.writeUInt8(90);d.writeUInt32BE(15);d.write("forwarded-tcpip");d.writeUInt32BE(j.lme.ourId);d.writeUInt32BE(this.INITIAL_RXWINDOW_SIZE);d.writeUInt32BE(4294967295);for(var f=0;f<2;++f){if(h=="IPv6"){d.writeUInt32BE(3);d.write("::1")}else{d.writeUInt32BE(9);d.write("127.0.0.1")}d.writeUInt32BE(g)}this._LME.write(d.buffer);if(this._LME.sockets==undefined){this._LME.sockets={}}this._LME.sockets[j.lme.ourId]=j;j.pause()};this._LME.connect(b.GUIDS.LME,{noPipeline:0})}function parseHttp(c){var d=c.indexOf("\r\n\r\n");if((d==-1)||(c.length<(d+2))){return null}var b=require("http-headers")(c.substring(0,d),true);var a=parseInt(b["content-length"]);if(c.length>=a+d+4){return c.substring(d+4,d+4+a)}return null}function _lmsNotifyToCode(c){if((c==null)||(c.Body==null)||(c.Body.MessageID==null)){return null}var b=c.Body.MessageID;try{b+="-"+c.Body.MessageArguments[0]}catch(a){}return b}function _lmsNotifyToString(c){if((c==null)||(c.Body==null)||(c.Body.MessageID==null)){return null}var b=c.Body.MessageID;try{b+="-"+c.Body.MessageArguments[0]}catch(a){}if(lmsEvents[b]){return lmsEvents[b]}return null}var lmsEvents={iAMT0001:"System Defense Policy %1s triggered.",iAMT0002:"Agent Presence Agent %1s not started.",iAMT0003:"Agent Presence Agent %1s stopped.",iAMT0004:"Agent Presence Agent %1s running.",iAMT0005:"Agent Presence Agent %1s expired.",iAMT0006:"Agent Presence Agent %1s suspended.",iAMT0007:"Host software attempt to disable AMT Network link detected.",iAMT0008:"Host software attempt to disable AMT Network link detected -- Host Network link blocked.",iAMT0009:"AMT clock or FLASH wear-out protection disabled.",iAMT0010:"Intel(R) AMT Network Interface %1s heuristics defense slow threshold trespassed.",iAMT0011:"Intel(R) AMT Network Interface %1s heuristics defense fast threshold trespassed.",iAMT0012:"Intel(R) AMT Network Interface %1s heuristics defense factory defined threshold trespassed.",iAMT0013:"Intel(R) AMT Network Interface %1s heuristics defense Encounter timeout expired.",iAMT0014:"General certificate error.",iAMT0015:"Certificate expired.",iAMT0016:"No trusted root certificate.",iAMT0017:"Not configured to work with server certificate.",iAMT0018:"Certificate revoked.",iAMT0019:"RSA exponent too large.",iAMT0020:"RSA modulus too large.",iAMT0021:"Unsupported digest.",iAMT0022:"Distinguished name too long.",iAMT0023:"Key usage missing.",iAMT0024:"General SSL handshake error.",iAMT0025:"General 802.1x error.",iAMT0026:"AMT Diagnostic AlertEAC error - General NAC error.",iAMT0027:"AMT Diagnostic AlertEAC error - attempt to get a NAC posture while AMT NAC is disabled.",iAMT0028:"AMT Diagnostic AlertEAC error - attempt to get a posture of an unsupported type.",iAMT0029:"Audit log storage is 50% full.",iAMT0030:"Audit log storage is 75% full.",iAMT0031:"Audit log storage is 85% full.",iAMT0032:"Audit log storage is 95% full.",iAMT0033:"Audit log storage is full.",iAMT0034:"Firmware Update Event - Partial.",iAMT0035:"Firmware Update Event - Failure.",iAMT0036:"Remote connectivity initiated.",iAMT0037:"ME Presence event.","iAMT0038-0":"AMT is being unprovisioned using BIOS command.","iAMT0038-1":"AMT is being unprovisioned using Local MEI command.","iAMT0038-2":"AMT is being unprovisioned using Local WS-MAN/SOAP command.","iAMT0038-3":"AMT is being unprovisioned using Remote WS-MAN/SOAP command.",iAMT0039:"HW Asset Error.",iAMT0050:"User Notification Alert - General Notification.","iAMT0050-16":"User Notification Alert - Circuit Breaker notification (CB Drop TX filter hit.).","iAMT0050-17":"User Notification Alert - Circuit Breaker notification (CB Rate Limit TX filter hit.).","iAMT0050-18":"User Notification Alert - Circuit Breaker notification (CB Drop RX filter hit.).","iAMT0050-19":"User Notification Alert - Circuit Breaker notification (CB Rate Limit RX filter hit.).","iAMT0050-32":"User Notification Alert - EAC notification.","iAMT0050-48":"User Notification Alert - Remote diagnostics - (Remote Redirection session started - SOL).","iAMT0050-49":"User Notification Alert - Remote diagnostics - (Remote Redirection session stopped - SOL).","iAMT0050-50":"User Notification Alert - Remote diagnostics. (Remote Redirection session started - IDE-R).","iAMT0050-51":"User Notification Alert - Remote diagnostics. (Remote Redirection session stopped - IDE-R).","iAMT0050-66":"User Notification Alert - WLAN notification (Host profile mismatch - Management Interface ignored).","iAMT0050-67":"User Notification Alert - WLAN notification (Management device overrides host radio).","iAMT0050-68":"User Notification Alert - WLAN notification (Host profile security mismatch).","iAMT0050-69":"User Notification Alert - WLAN notification (Management device relinquishes control over host Radio).",iAMT0051:"User Notification Alert - SecIo event.","iAMT0051-0":"User Notification Alert - SecIo event semaphore at host.","iAMT0051-1":"User Notification Alert - semaphore at ME.","iAMT0051-2":"User Notification Alert - SecIo event - semaphore timeout.",iAMT0052:"User Notification Alert - KVM session event.","iAMT0052-0":"User Notification Alert - KVM session requested.","iAMT0052-1":"User Notification Alert - KVM session started.","iAMT0052-2":"User Notification Alert - KVM session stopped.","iAMT0052-3":"User Notification Alert - KVM data channel.",iAMT0053:"User Notification Alert - RCS notification.","iAMT0053-50":"User Notification Alert - RCS notification (HW button pressed. Connection initiated automatically).","iAMT0053-52":"User Notification Alert - RCS notification (HW button pressed. Connection wasn't initiated automatically).","iAMT0053-53":"User Notification Alert - RCS notification (Contracts updated).",iAMT0054:"User Notification Alert - WLAN notification. Wireless Profile sync enablement state changed.",iAMT0055:"User Notification Alert - Provisioning state change notification.","iAMT0055-0":"User Notification Alert - Provisioning state change notification - Pre-configuration.","iAMT0055-1":"User Notification Alert - Provisioning state change notification - In configuration.","iAMT0055-2":"User Notification Alert - Provisioning state change notification - Post-configuration.","iAMT0055-3":"User Notification Alert - Provisioning state change notification - Unprovision process has started.",iAMT0056:"User Notification Alert - System Defense change notification.",iAMT0057:"User Notification Alert - Network State change notification.",iAMT0058:"User Notification Alert - Remote Access change notification.","iAMT0058-1":"User Notification Alert - Remote Access change notification - tunnel is closed.",iAMT0059:"User Notification Alert - KVM enabled event.","iAMT0059-0":"User Notification Alert - KVM enabled event - KVM disabled.","iAMT0059-1":"User Notification Alert - KVM enabled event - KVM enabled (both from MEBx and PTNI).",iAMT0060:"User Notification Alert - SecIO configuration event.",iAMT0061:"ME FW reset occurred.",iAMT0062:"User Notification Alert - IpSyncEnabled event.","iAMT0062-0":"User Notification Alert - IpSyncEnabled event - IpSync disabled.","iAMT0062-1":"User Notification Alert - IpSyncEnabled event - IpSync enabled.",iAMT0063:"User Notification Alert - HTTP Proxy sync enabled event.","iAMT0063-0":"User Notification Alert - HTTP Proxy sync enabled event - HTTP Proxy Sync disabled.","iAMT0063-1":"User Notification Alert - HTTP Proxy sync enabled event - HTTP Proxy Sync enabled.",iAMT0064:"User Notification Alert - User Consent event.","iAMT0064-1":"User Notification Alert - User Consent event - User Consent granted.","iAMT0064-2":"User Notification Alert - User Consent event - User Consent ended.","iAMT0067-0":"Graceful Remote Control Operation - Shutdown.","iAMT0067-1":"Graceful Remote Control Operation - Reset.","iAMT0067-2":"Graceful Remote Control Operation - Hibernate.","iAMT0068-0":"Link Protection Notification - No link protection.","iAMT0068-1":"Link Protection Notification - Passive link protection.","iAMT0068-2":"Link Protection Notification - High link protection.","iAMT0069-0":"Local Time Sync Enablement Notification - Local Time Sync Disabled.","iAMT0069-1":"Local Time Sync Enablement Notification - Local Time Sync Enabled.",iAMT0070:"Host Reset Triggered by WD Expiration Notification.",PLAT0004:"The chassis %1s was opened.",PLAT0005:"The chassis %1s was closed.",PLAT0006:"The drive bay %1s was opened.",PLAT0007:"The drive bay %1s was closed.",PLAT0008:"The I/O card area %1s was opened.",PLAT0009:"The I/O card area %1s was closed.",PLAT0010:"The processor area %1s was opened.",PLAT0011:"The processor area %1s was closed.",PLAT0012:"The LAN %1s has been disconnected.",PLAT0013:"The LAN %1s has been connected.",PLAT0016:"The permission to insert package %1s has been granted.",PLAT0017:"The permission to insert package %1s has been removed.",PLAT0018:"The fan card area %1s is open.",PLAT0019:"The fan card area %1s is closed.",PLAT0022:"The computer system %1s has detected a secure mode violation.",PLAT0024:"The computer system %1s has detected a pre-boot user password violation.",PLAT0026:"The computer system %1s has detected a pre-boot setup password violation.",PLAT0028:"The computer system %1s has detected a network boot password violation.",PLAT0030:"The computer system %1s has detected a password violation.",PLAT0032:"The management controller %1s has detected an out-of-band password violation.",PLAT0034:"The processor %1s has been added.",PLAT0035:"The processor %1s has been removed.",PLAT0036:"An over-temperature condition has been detected on the processor %1s.",PLAT0037:"An over-temperature condition has been removed on the processor %1s.",PLAT0038:"The processor %1s is operating in a degraded State.",PLAT0039:"The processor %1s is no longer operating in a degraded State.",PLAT0040:"The processor %1s has failed.",PLAT0042:"The processor %1s has failed.",PLAT0044:"The processor %1s has failed.",PLAT0046:"The processor %1s has failed.",PLAT0048:"The processor %1s has failed.",PLAT0060:"The processor %1s has been enabled.",PLAT0061:"The processor %1s has been disabled.",PLAT0062:"The processor %1s has a configuration mismatch.",PLAT0064:"A terminator has been detected on the processor %1s.",PLAT0084:"The Power Supply %1s has been added.",PLAT0085:"The Power Supply %1s has been removed.",PLAT0086:"The Power Supply %1s has failed.",PLAT0088:"Failure predicted on power supply %1s.",PLAT0096:"The input to power supply %1s has been lost or fallen out of range.",PLAT0098:"The power supply %1s is operating in an input state that is out of range.",PLAT0099:"The power supply %1s has returned to a normal input state.",PLAT0100:"The power supply %1s has lost input.",PLAT0104:"The power supply %1s has a configuration mismatch.",PLAT0106:"Power supply %1s has been disabled.",PLAT0107:"Power supply %1s has been enabled.",PLAT0108:"Power supply %1s has been power cycled.",PLAT0110:"Power supply %1s has encountered an error during power down.",PLAT0112:"Power supply %1s has lost power.",PLAT0114:"Soft power control has failed for power supply %1s.",PLAT0116:"Power supply %1s has failed.",PLAT0118:"Failure predicted on power supply %1s.",PLAT0120:"Memory subsystem failure.",PLAT0122:"DIMM missing.",PLAT0124:"Memory error detected & corrected for DIMM %1s.",PLAT0128:"Memory DIMM %1s added.",PLAT0129:"Memory DIMM %1s removed.",PLAT0130:"Memory DIMM %1s enabled.",PLAT0131:"Memory DIMM %1s disabled.",PLAT0134:"Memory parity error for DIMM %1s.",PLAT0136:"Memory scrub failure for DIMM %1s.",PLAT0138:"Memory uncorrectable error detected for DIMM %1s.",PLAT0140:"Memory sparing initiated for DIMM %1s.",PLAT0141:"Memory sparing concluded for DIMM %1s.",PLAT0142:"Memory DIMM %1s Throttled.",PLAT0144:"Memory logging limit reached for DIMM %1s.",PLAT0145:"Memory logging limit removed for DIMM %1s.",PLAT0146:"An over-temperature condition has been detected on the Memory DIMM %1s.",PLAT0147:"An over-temperature condition has been removed on the Memory DIMM %1s.",PLAT0162:"The drive %1s has been added.",PLAT0163:"The drive %1s has been removed.",PLAT0164:"The drive %1s has been disabled due to a detected fault.",PLAT0167:"The drive %1s has been enabled.",PLAT0168:"Failure predicted on drive %1s.",PLAT0170:"Hot spare enabled for %1s.",PLAT0171:"Hot spare disabled for %1s.",PLAT0172:"Consistency check has begun for %1s.",PLAT0173:"Consistency check completed for %1s.",PLAT0174:"Array %1s is in critical condition.",PLAT0176:"Array %1s has failed.",PLAT0177:"Array %1s has been restored.",PLAT0178:"Rebuild in progress for array %1s.",PLAT0179:"Rebuild completed for array %1s.",PLAT0180:"Rebuild Aborted for array %1s.",PLAT0184:"The system %1s encountered a POST error.",PLAT0186:"The system %1s encountered a firmware hang.",PLAT0188:"The system %1s encountered firmware progress.",PLAT0192:"The log %1s has been disabled.",PLAT0193:"The log %1s has been enabled.",PLAT0194:"The log %1s has been disabled.",PLAT0195:"The log %1s has been enabled.",PLAT0196:"The log %1s has been disabled.",PLAT0198:"The log %1s has been enabled.",PLAT0200:"The log %1s has been cleared.",PLAT0202:"The log %1s is full.",PLAT0203:"The log %1s is no longer full.",PLAT0204:"The log %1s is almost full.",PLAT0208:"The log %1s has a configuration error.",PLAT0210:"The system %1s has been reconfigured.",PLAT0212:"The system %1s has encountered an OEM system boot event.",PLAT0214:"The system %1s has encountered an unknown system hardware fault.",PLAT0216:"The system %1s has generated an auxiliary log entry.",PLAT0218:"The system %1s has executed a PEF action.",PLAT0220:"The system %1s has synchronized the system clock.",PLAT0222:"A diagnostic interrupt has occurred on system %1s.",PLAT0224:"A bus timeout has occurred on system %1s.",PLAT0226:"An I/O channel check NMI has occurred on system %1s.",PLAT0228:"A software NMI has occurred on system %1s.",PLAT0230:"System %1s has recovered from an NMI.",PLAT0232:"A PCI PERR has occurred on system %1s.",PLAT0234:"A PCI SERR has occurred on system %1s.",PLAT0236:"An EISA fail safe timeout occurred on system %1s.",PLAT0238:"A correctable bus error has occurred on system %1s.",PLAT0240:"An uncorrectable bus error has occurred on system %1s.",PLAT0242:"A fatal NMI error has occurred on system %1s.",PLAT0244:"A fatal bus error has occurred on system %1s.",PLAT0246:"A bus on system %1s is operating in a degraded state.",PLAT0247:"A bus on system %1s is no longer operating in a degraded state.",PLAT0248:"The power button %1s has been pressed.",PLAT0249:"The power button %1s has been released.",PLAT0250:"The sleep button %1s has been pressed.",PLAT0251:"The sleep button %1s has been released.",PLAT0252:"The reset button %1s has been pressed.",PLAT0253:"The reset button %1s has been released.",PLAT0254:"The latch to %1s has been opened.",PLAT0255:"The latch to %1s has been closed.",PLAT0256:"The service request %1s has been enabled.",PLAT0257:"The service request %1s has been completed.",PLAT0258:"Power control of system %1s has failed.",PLAT0262:"The network port %1s has been connected.",PLAT0263:"The network port %1s has been disconnected.",PLAT0266:"The connector %1s has encountered a configuration error.",PLAT0267:"The connector %1s configuration error has been repaired.",PLAT0272:"Power on for system %1s.",PLAT0274:"Power cycle hard requested for system %1s.",PLAT0276:"Power cycle soft requested for system %1s.",PLAT0278:"PXE boot requested for system %1s.",PLAT0280:"Diagnostics boot requested for system %1s.",PLAT0282:"System restart requested for system %1s.",PLAT0284:"System restart begun for system %1s.",PLAT0286:"No bootable media available for system %1s.",PLAT0288:"Non-bootable media selected for system %1s.",PLAT0290:"PXE server not found for system %1s.",PLAT0292:"User timeout on boot for system %1s.",PLAT0296:"System %1s boot from floppy initiated.",PLAT0298:"System %1s boot from local drive initiated.",PLAT0300:"System %1s boot from PXE on network port initiated.",PLAT0302:"System %1s boot diagnostics initiated.",PLAT0304:"System %1s boot from CD initiated.",PLAT0306:"System %1s boot from ROM initiated.",PLAT0312:"System %1s boot initiated.",PLAT0320:"Critical stop during OS load on system %1s.",PLAT0322:"Run-time critical stop on system %1s.",PLAT0324:"OS graceful stop on system %1s.",PLAT0326:"OS graceful shutdown begun on system %1s.",PLAT0327:"OS graceful shutdown completed on system %1s.",PLAT0328:"Agent not responding on system %1s.",PLAT0329:"Agent has begun responding on system %1s.",PLAT0330:"Fault in slot on system %1s.",PLAT0331:"Fault condition removed on system %1s.",PLAT0332:"Identifying slot on system %1s.",PLAT0333:"Identify stopped on slot for system %1s.",PLAT0334:"Package installed in slot for system %1s.",PLAT0336:"Slot empty system %1s.",PLAT0338:"Slot in system %1s is ready for installation.",PLAT0340:"Slot in system %1s is ready for removal.",PLAT0342:"Power is off on slot of system %1s.",PLAT0344:"Power is on for slot of system %1s.",PLAT0346:"Removal requested for slot of system %1s.",PLAT0348:"Interlock activated on slot of system %1s.",PLAT0349:"Interlock de-asserted on slot of system %1s.",PLAT0350:"Slot disabled on system %1s.",PLAT0351:"Slot enabled on system %1s.",PLAT0352:"Slot of system %1s holds spare.",PLAT0353:"Slot of system %1s no longer holds spare.",PLAT0354:"Computer system %1s enabled.",PLAT0356:"Computer system %1s is in sleep - light mode.",PLAT0358:"Computer system %1s is in hibernate.",PLAT0360:"Computer system %1s is in standby.",PLAT0362:"Computer system %1s is in soft off mode.",PLAT0364:"Computer system %1s is in hard off mode.",PLAT0366:"Computer system %1s is sleeping.",PLAT0368:"Watchdog timer expired for %1s.",PLAT0370:"Reboot of system initiated by watchdog %1s.",PLAT0372:"Powering off system initiated by watchdog %1s.",PLAT0374:"Power cycle of system initiated by watchdog %1s.",PLAT0376:"Watchdog timer interrupt occurred for %1s.",PLAT0378:"A page alert has been generated for system %1s.",PLAT0380:"A LAN alert has been generated for system %1s.",PLAT0382:"An event trap has been generated for system %1s.",PLAT0384:"An SNMP trap has been generated for system %1s.",PLAT0390:"%1s detected as present.",PLAT0392:"%1s detected as absent.",PLAT0394:"%1s has been disabled.",PLAT0395:"%1s has been enabled.",PLAT0396:"Heartbeat lost for LAN %1s.",PLAT0397:"Heartbeat detected for LAN %1s.",PLAT0398:"Sensor %1s is unavailable or degraded on management system.",PLAT0399:"Sensor %1s has returned to normal on management system.",PLAT0400:"Controller %1s is unavailable or degraded on management system.",PLAT0401:"Controller %1s has returned to normal on management system.",PLAT0402:"Management system %1s is off-line.",PLAT0404:"Management system %1s is disabled.",PLAT0405:"Management system %1s is enabled.",PLAT0406:"Sensor %1s has failed on management system.",PLAT0408:"FRU %1s has failed on management system.",PLAT0424:"The battery %1s is critically low.",PLAT0427:"The battery %1s is no longer critically low.",PLAT0430:"The battery %1s has been removed from unit.",PLAT0431:"The battery %1s has been added.",PLAT0432:"The battery %1s has failed.",PLAT0434:"Session audit is deactivated on system %1s.",PLAT0435:"Session audit is activated on system %1s.",PLAT0436:"A hardware change occurred on system %1s.",PLAT0438:"A firmware or software change occurred on system %1s.",PLAT0440:"A hardware incompatibility was detected on system %1s.",PLAT0442:"A firmware or software incompatibility was detected on system %1s.",PLAT0444:"Invalid or unsupported hardware was detected on system %1s.",PLAT0446:"Invalid or unsupported firmware or software was detected on system %1s.",PLAT0448:"A successful hardware change was detected on system %1s.",PLAT0450:"A successful software or firmware change was detected on system %1s.",PLAT0464:"FRU %1s not installed on system.",PLAT0465:"FRU %1s installed on system.",PLAT0466:"Activation requested for FRU %1s on system.",PLAT0467:"FRU %1s on system is active.",PLAT0468:"Activation in progress for FRU %1s on system.",PLAT0470:"Deactivation request for FRU %1s on system.",PLAT0471:'FRU %1s on system is in standby or "hot spare" state.',PLAT0472:"Deactivation in progress for FRU %1s on system.",PLAT0474:"Communication lost with FRU %1s on system.",PLAT0476:"Numeric sensor %1s going low (lower non-critical).",PLAT0478:"Numeric sensor %1s going high (lower non-critical).",PLAT0480:"Numeric sensor %1s going low (lower critical).",PLAT0482:"Numeric sensor %1s going high (lower critical).",PLAT0484:"Numeric sensor %1s going low (lower non-recoverable).",PLAT0486:"Numeric sensor %1s going high (lower non-critical).",PLAT0488:"Numeric sensor %1s going low (upper non-critical).",PLAT0490:"Numeric sensor %1s going high (upper non-critical).",PLAT0492:"Numeric sensor %1s going low (upper critical).",PLAT0494:"Numeric sensor %1s going high (upper critical).",PLAT0496:"Numeric sensor %1s going low (upper non-recoverable).",PLAT0498:"Numeric sensor %1s going high (upper non-recoverable).",PLAT0500:"Sensor %1s has transitioned to idle.",PLAT0502:"Sensor %1s has transitioned to active.",PLAT0504:"Sensor %1s has transitioned to busy.",PLAT0508:"Sensor %1s has asserted.",PLAT0509:"Sensor %1s has de-asserted.",PLAT0510:"Sensor %1s is asserting predictive failure.",PLAT0511:"Sensor %1s is de-asserting predictive failure.",PLAT0512:"Sensor %1s has indicated limit exceeded.",PLAT0513:"Sensor %1s has indicated limit no longer exceeded.",PLAT0514:"Sensor %1s has indicated performance met.",PLAT0516:"Sensor %1s has indicated performance lags.",PLAT0518:"Sensor %1s has transitioned to normal state.",PLAT0520:"Sensor %1s has transitioned from normal to non-critical state.",PLAT0522:"Sensor %1s has transitioned to critical from a less severe state.",PLAT0524:"Sensor %1s has transitioned to non-recoverable from a less severe state.",PLAT0526:"Sensor %1s has transitioned to non-critical from a more severe state.",PLAT0528:"Sensor %1s has transitioned to critical from a non-recoverable state.",PLAT0530:"Sensor %1s has transitioned to non-recoverable.",PLAT0532:"Sensor %1s indicates a monitor state.",PLAT0534:"Sensor %1s has an informational state.",PLAT0536:"Device %1s has been added.",PLAT0537:"Device %1s has been removed from unit.",PLAT0538:"Device %1s has been enabled.",PLAT0539:"Device %1s has been disabled.",PLAT0540:"Sensor %1s has indicated a running state.",PLAT0544:"Sensor %1s has indicated a power off state.",PLAT0546:"Sensor %1s has indicated an on-line state.",PLAT0548:"Sensor %1s has indicated an off-line state.",PLAT0550:"Sensor %1s has indicated an off-duty state.",PLAT0552:"Sensor %1s has indicated a degraded state.",PLAT0554:"Sensor %1s has indicated a power save state.",PLAT0556:"Sensor %1s has indicated an install error.",PLAT0558:"Redundancy %1s has been lost.",PLAT0560:"Redundancy %1s has been reduced.",PLAT0561:"Redundancy %1s has been restored.",PLAT0562:"%1s has transitioned to a D0 power state.",PLAT0564:"%1s has transitioned to a D1 power state.",PLAT0566:"%1s has transitioned to a D2 power state.",PLAT0568:"%1s has transitioned to a D3 power state.",PLAT0720:"The System %1s encountered firmware progress - memory initialization entry.",PLAT0721:"The System %1s encountered firmware progress - memory initialization exit.",PLAT0722:"The System %1s encountered firmware progress - hard drive initialization entry.",PLAT0723:"The System %1s encountered firmware progress - hard drive initialization exit.",PLAT0724:"The System %1s encountered firmware progress - user authentication.",PLAT0728:"The System %1s encountered firmware progress - USR resource configuration entry.",PLAT0729:"The System %1s encountered firmware progress - USR resource configuration exit.",PLAT0730:"The System %1s encountered firmware progress - PCI recource configuration entry.",PLAT0731:"The System %1s encountered firmware progress - PCI recource configuration exit.",PLAT0732:"The System %1s encountered firmware progress - Option ROM initialization entry.",PLAT0733:"The System %1s encountered firmware progress - Option ROM initialization entry exit.",PLAT0734:"The System %1s encountered firmware progress -video initialization entry entry.",PLAT0735:"The System %1s encountered firmware progress - video initialization entry exit.",PLAT0736:"The System %1s encountered firmware progress - cache initialization entry.",PLAT0737:"The System %1s encountered firmware progress - cache initialization exit.",PLAT0738:"The System %1s encountered firmware progress - keyboard controller initialization entry.",PLAT0739:"The System %1s encountered firmware progress - keyboard controller initialization exit.",PLAT0740:"The System %1s encountered firmware progress - motherboard initialization entry.",PLAT0741:"The System %1s encountered firmware progress - motherboard initialization exit.",PLAT0742:"The System %1s encountered firmware progress - floppy disk initialization entry.",PLAT0743:"The System %1s encountered firmware progress - floppy disk initialization exit.",PLAT0744:"The System %1s encountered firmware progress - keyboard test entry.",PLAT0745:"The System %1s encountered firmware progress - keyboard test exit.",PLAT0746:"The System %1s encountered firmware progress - pointing device test entry.",PLAT0747:"The System %1s encountered firmware progress - pointing device test exit.",PLAT0750:"The System %1s encountered firmware progress - dock enable entry.",PLAT0751:"The System %1s encountered firmware progress - dock enable exit.",PLAT0752:"The System %1s encountered firmware progress - dock disable entry.",PLAT0753:"The System %1s encountered firmware progress - dock disable exit.",PLAT0760:"The System %1s encountered firmware progress - start OS boot process.",PLAT0762:"The System %1s encountered firmware progress - call OS wake vector.",PLAT0764:"The System %1s encountered firmware progress - unrecoverable keyboard failure.",PLAT0766:"The System %1s encountered firmware progress - no video device detected.",PLAT0768:"The System %1s encountered firmware progress - SMART alert detected on drive.",PLAT0770:"The System %1s encountered firmware progress - unrecoverable boot device failure.",PLAT0789:"Corrupt BIOS detected.",PLAT0790:"The System %1s encountered PCI configuration failure.",PLAT0791:"The System %1s encountered a video subsystem failure.",PLAT0792:"The System %1s encountered a storage subsystem failure.",PLAT0793:"The System %1s encountered a USB subsystem failure.",PLAT0794:"The System %1s has detected no memory in the system.",PLAT0795:"The System %1s encountered a motherboard failure.",PLAT0796:"The System %1s encountered a memory Regulator Voltage Bad.",PLAT0797:"%1s PCI reset is not deasserting.",PLAT0798:"%1s Non-Motherboard Regulator Failure.",PLAT0799:"%1s Power Supply Cable failure.",PLAT0800:"%1s Motherboard regulator failure.",PLAT0801:"%1s System component compatibility mismatch."};module.exports=lme_heci; \ No newline at end of file diff --git a/agents/modules_meshcore_min/amt-manage.min.js b/agents/modules_meshcore_min/amt-manage.min.js deleted file mode 100644 index 38efb662..00000000 --- a/agents/modules_meshcore_min/amt-manage.min.js +++ /dev/null @@ -1 +0,0 @@ -function AmtManager(d,q,v){var M=function(T){d.SendCommand({action:"msg",type:"console",value:T})};var r=function(T){if(v){M("amt-manager: "+T+"
")}};var h=null,i=0;var f=null,g=0;var e=null;var H=null;var G=null;var k=null;var F=this;var E;var O=null;F.state=0;F.lmsstate=0;F.onStateChange=null;F.setDebug=function(T){v=T};F.setPolicy=function(U,T){if(T||(JSON.stringify(k)!=JSON.stringify(U))){k=U;if(m==null){m=setTimeout(F.applyPolicy,8000)}}};var L=0;F.reset=function(){++L;h=null,i=0,f=null,g=0,F.state=0,F.lmsstate=0;try{var T=require("amt-mei");h=new T();h.on("error",function(V){r("MEI error");h=null;i=-1;F.state=-1;if(F.onStateChange!=null){F.onStateChange(i)}});h.getVersion(function(V){if(V==null){i=-1;F.state=-1;if(F.onStateChange!=null){F.onStateChange(i)}if(L<10){setTimeout(F.reset,10000)}}else{e=V;i=2;F.state=2;L=0;if(F.onStateChange!=null){F.onStateChange(i)}F.lmsreset()}})}catch(U){r("MEI exception: "+U);h=null;i=-1;F.state=-1}};var j=null;F.getAmtInfo=function(U){if((h==null)||(i<2)){if(U!=null){U(null)}return}try{j={Flags:0};h.getProtocolVersion(function(V){if(V!=null){j.MeiVersion=V}});h.getVersion(function(V){if(V){j.Versions={};for(var W in V.Versions){j.Versions[V.Versions[W].Description]=V.Versions[W].Version}}});h.getProvisioningMode(function(V){if(V){j.ProvisioningMode=V.mode}});h.getProvisioningState(function(V){if(V){j.ProvisioningState=V.state}});h.getEHBCState(function(V){if((V!=null)&&(V.EHBC==true)){j.Flags+=1}});h.getControlMode(function(V){if(V!=null){if(V.controlMode==1){j.Flags+=2}if(V.controlMode==2){j.Flags+=4}}});h.getLanInterfaceSettings(0,function(V){if(V){j.net0=V}});h.getLanInterfaceSettings(1,function(V){if(V){j.net1=V}});h.getUuid(function(V){if((V!=null)&&(V.uuid!=null)){j.UUID=V.uuid}});h.getDnsSuffix(function(V){if(V!=null){j.DNS=V}if(U!=null){U(j)}})}catch(T){if(U!=null){U(null)}return}};var t=function(W){if((W==null)||(W.Body==null)||(W.Body.MessageID==null)||(W.Body.MessageArguments==null)){return null}var T=W.Body.MessageID,U=W.Body.MessageArguments[0],V=null;switch(T){case"iAMT0050":if(U=="48"){V="Intel® AMT Serial-over-LAN connected"}else{if(U=="49"){V="Intel® AMT Serial-over-LAN disconnected"}}break;case"iAMT0052":if(U=="1"){V="Intel® AMT KVM connected"}else{if(U=="2"){V="Intel® AMT KVM disconnected"}}break;default:break}if(V!=null){d.SendCommand({action:"msg",type:"notify",value:V,tag:"general",amtMessage:T})}};F.lmsreset=function(){F.lmsstate=0;try{var U=require("amt-lme");g=1;F.lmsstate=1;f=new U();f.on("error",function(V){g=0;F.lmsstate=0;f=null;r("LMS error: "+V);N(1)});f.on("connect",function(){g=2;F.lmsstate=2;r("LMS connected");N(2)});f.on("notify",function(W,X,Y,V){if(V=="iAMT0052-3"){y()}else{t(W)}})}catch(T){g=-1;F.lmsstate=-1;f=null}};var N=function(T){if((h==null)||(i<2)||(e==null)){return}h.getLocalSystemAccount(function(aa){if(aa==null){return}var Y=require("amt-wsman-duk");var Z=require("amt-wsman");var U=require("amt");H=new Z(Y,"127.0.0.1",16992,aa.user,aa.pass,false);G=new U(H);i=3;F.state=3;if(F.onStateChange!=null){F.onStateChange(i)}if(m==null){F.applyPolicy()}var V=null;try{for(var X in e.Versions){if(e.Versions[X].Description=="AMT"){V=parseInt(e.Versions[X].Version.split(".")[0])}}}catch(W){}if((V!=null)&&(V>=12)){y("skip");F.kvmTempTimer=setInterval(function(){y()},2000);A(JSON.stringify({action:"restart",ver:1}))}})};var y=function(T){G.IPS_KVMRedirectionSettingData_DataChannelRead(F.kvmDataGetResponse,T)};var x=function(W,U,V,X,Y){if((Y!="skip")&&(X==200)&&(V.Body.ReturnValue==0)){var Z=null;try{Z=Buffer.from(V.Body.DataMessage,"base64").toString()}catch(T){return}if(Z!=null){F.kvmProcessData(V.Body.RealmsBitmap,V.Body.MessageId,Z)}}};var Q=null;var z=function(W,V,Y){var T=null;try{T=JSON.parse(Y)}catch(U){}if((T!=null)&&(T.action)){if(T.action=="present"){A(JSON.stringify({action:"present",ver:1,platform:process.platform}))}if(T.action=="offer"){Q={};var X=require("ILibWebRTC");Q.webrtc=X.createConnection();Q.webrtc.on("connected",function(){});Q.webrtc.on("disconnected",function(){F.webRtcCleanUp()});Q.webrtc.on("dataChannel",function(Z){Q.rtcchannel=Z;Q.kvm=mesh.getRemoteDesktopStream();Q.kvm.pipe(Q.rtcchannel,{dataTypeSkip:1,end:false});Q.rtcchannel.on("end",function(){F.webRtcCleanUp()});Q.rtcchannel.on("data",function(aa){F.kvmCtrlData(this,aa)});Q.rtcchannel.pipe(Q.kvm,{dataTypeSkip:1,end:false})});A(JSON.stringify({action:"answer",ver:1,sdp:Q.webrtc.setOffer(T.sdp)}))}}};var w=function(U,W){if(W.length>0&&W.charCodeAt(0)!=123){if(F.fileupload!=null){W=Buffer.from(W,"base64");var ac=W.readUInt32BE(0);if((ac==16777216)||(ac==16777217)){fs.writeSync(F.fileupload.fp,W.slice(4));U.write({action:"upload",sub:"ack",reqid:F.fileupload.reqid});if(ac==16777217){fs.closeSync(F.fileupload.fp);F.fileupload=null}}}return}r("KVM Ctrl Data: "+W);try{W=JSON.parse(W)}catch(Z){r("Invalid JSON: "+W);return}if((W.path!=null)&&(process.platform!="win32")&&(W.path[0]!="/")){W.path="/"+W.path}switch(W.action){case"ping":U.write({action:"pong"});break;case"lock":if(process.platform=="win32"){var V=require("child_process");V.execFile(process.env.windir+"\\system32\\cmd.exe",["/c","RunDll32.exe user32.dll,LockWorkStation"],{type:1})}break;case"ls":var af=getDirectoryInfo(W.path);if(W.reqid!=undefined){af.reqid=W.reqid}U.write(af);break;case"mkdir":fs.mkdirSync(W.path);break;case"rm":for(var ad in W.delfiles){var ab=I.join(W.path,W.delfiles[ad]);try{fs.unlinkSync(ab)}catch(Y){r(Y)}}break;case"rename":try{fs.renameSync(I.join(W.path,W.oldname),I.join(W.path,W.newname))}catch(Y){r(Y)}break;case"download":var ah=0;if(W.sub=="start"){if(F.filedownload!=null){U.write({action:"download",sub:"cancel",id:F.filedownload.id});delete F.filedownload}F.filedownload={id:W.id,path:W.path,ptr:0};try{F.filedownload.f=fs.openSync(F.filedownload.path,"rbN")}catch(Y){U.write({action:"download",sub:"cancel",id:F.filedownload.id});delete F.filedownload}if(F.filedownload){U.write({action:"download",sub:"start",id:W.id})}}else{if((F.filedownload!=null)&&(W.id==F.filedownload.id)){if(W.sub=="startack"){ah=8}else{if(W.sub=="stop"){delete F.filedownload}else{if(W.sub=="ack"){ah=1}}}}}while(ah>0){ah--;var T=Buffer.alloc(4096);var ae=fs.readSync(F.filedownload.f,T,4,4092,null);F.filedownload.ptr+=ae;if(ae<4092){T.writeInt32BE(16777217,0);fs.closeSync(F.filedownload.f);delete F.filedownload;ah=0}else{T.writeInt32BE(16777216,0)}U.write(T.slice(0,ae+4).toString("base64"))}break;case"upload":if(W.sub=="start"){if(F.fileupload!=null){fs.closeSync(F.fileupload.fp)}if(!W.path||!W.name){break}F.fileupload={reqid:W.reqid};var aa=I.join(W.path,W.name);try{F.fileupload.fp=fs.openSync(aa,"wbN")}catch(Y){}if(F.fileupload.fp){U.write({action:"upload",sub:"start",reqid:F.fileupload.reqid})}else{F.fileupload=null;U.write({action:"upload",sub:"error",reqid:F.fileupload.reqid})}}else{if(W.sub=="cancel"){if(F.fileupload!=null){fs.closeSync(F.fileupload.fp);F.fileupload=null}}}break;case"copy":for(var ad in W.names){var ag=I.join(W.scpath,W.names[ad]),X=I.join(W.dspath,W.names[ad]);if(ag!=X){try{fs.copyFileSync(ag,X)}catch(Y){}}}break;case"move":for(var ad in W.names){var ag=I.join(W.scpath,W.names[ad]),X=I.join(W.dspath,W.names[ad]);if(ag!=X){try{fs.copyFileSync(ag,X);fs.unlinkSync(ag)}catch(Y){}}}break;default:r("Invalid KVM command: "+W);break}};var P=function(){r("webRtcCleanUp");if(Q==null){return}if(Q.rtcchannel){try{Q.rtcchannel.close()}catch(T){}try{Q.rtcchannel.removeAllListeners("data")}catch(T){}try{Q.rtcchannel.removeAllListeners("end")}catch(T){}delete Q.rtcchannel}if(Q.webrtc){try{Q.webrtc.close()}catch(T){}try{Q.webrtc.removeAllListeners("connected")}catch(T){}try{Q.webrtc.removeAllListeners("disconnected")}catch(T){}try{Q.webrtc.removeAllListeners("dataChannel")}catch(T){}delete Q.webrtc}if(Q.kvm){try{Q.kvm.end()}catch(T){}delete Q.kvm}Q=null};var A=function(T){G.IPS_KVMRedirectionSettingData_DataChannelWrite(Buffer.from(T).toString("base64"),function(){})};var s=function(T,U){if(fs.existsSync(T)){if(U==true){fs.readdirSync(F.path.join(T,"*")).forEach(function(W,X){var V=F.path.join(T,W);if(fs.statSync(V).isDirectory()){s(V,true)}else{fs.unlinkSync(V)}})}fs.unlinkSync(T)}};var I={join:function(){var V=[];for(var T in arguments){var U=arguments[T];if(U!=null){while(U.endsWith("/")||U.endsWith("\\")){U=U.substring(0,U.length-1)}if(T!=0){while(U.startsWith("/")||U.startsWith("\\")){U=U.substring(1)}}V.push(U)}}if(V.length==0){return"/"}return V.join("/")}};function D(T){return require("MD5Stream").create().syncHash(T).toString("hex")}F.deactivateCCM=function(){h.unprovision(1,function(T){if(T==0){r("Success deactivating Intel AMT CCM.");d.SendCommand({action:"coreinfo",intelamt:{state:0,flags:0}});m=setTimeout(F.applyPolicy,8000)}else{r("Intel AMT CCM deactivation error: "+T)}})};F.getTrustedHashes=function(T,U){if(O!=null){T(U)}O=[];h.getHashHandles(function(W){var V=W.length;for(var X=0;X";l.AMT_RemoteAccessService_AddRemoteAccessPolicyRule(2,0,"AAAAAAAAAAo=",[U],null,function(Y,W,X,Z){if(Z!=200){r("Add AddRemoteAccessPolicyRule Error "+Z)}else{o(T)}})}function o(T){var V=[];if((k.ciraserver!=null)&&(k.ciraserver.home!=null)){V=k.ciraserver.home}var U=T.AMT_EnvironmentDetectionSettingData.response;U.DetectionStrings=C(U.DetectionStrings);if(p(U.DetectionStrings,V)==false){U.DetectionStrings=V;l.Put("AMT_EnvironmentDetectionSettingData",U,function(Y,W,X,Z){if(Z!=200){r("Put AMT_EnvironmentDetectionSettingData Error "+Z)}},0,1)}}function p(T,U){if(T==U){return true}if(T==null){T=[]}if(U==null){U=[]}if(T.length!=U.length){return false}for(var V in T){if(U.indexOf(T[V])==-1){return false}}return true}function C(T){if(!T||T==null||typeof T=="object"){return T}return[T]}}module.exports=AmtManager; \ No newline at end of file diff --git a/agents/modules_meshcore_min/amt-mei.min.js b/agents/modules_meshcore_min/amt-mei.min.js deleted file mode 100644 index 840cb662..00000000 --- a/agents/modules_meshcore_min/amt-mei.min.js +++ /dev/null @@ -1 +0,0 @@ -var Q=require("queue");function amt_heci(){var d=require("events").inherits(this);d.createEvent("error");var u=require("heci");var y=function(F){try{require("MeshAgent").SendCommand({action:"msg",type:"console",value:F})}catch(E){}};this._ObjectID="pthi";this._rq=new Q();this._setupPTHI=function b(){this._amt=u.create();this._amt.BiosVersionLen=65;this._amt.UnicodeStringLen=20;this._amt.Parent=this;this._amt.on("error",function F(H){if(this.Parent._rq.isEmpty()){this.Parent.emit("error",H)}else{var J=this.Parent._rq.deQueue();var I=J.optional;var G=J.func;I.unshift({Status:-1});G.apply(this.Parent,I);if(!this.Parent._rq.isEmpty()){this.connect(u.GUIDS.AMT,{noPipeline:1})}}});this._amt.on("connect",function E(){this.on("data",function G(I){var J=this.Parent.getCommand(I);var L=this.Parent._rq.deQueue();var K=L.optional;var H=L.func;K.unshift(J);H.apply(this.Parent,K);if(this.Parent._rq.isEmpty()){this.Parent._amt.disconnect();this.Parent._amt=null}else{this.write(this.Parent._rq.peekQueue().send)}});this.write(this.Parent._rq.peekQueue().send)})};function B(E){var F=E.indexOf("\0");if(F>=0){return E.substring(0,F)}else{return E}}this.getCommand=function g(E){var F=E.length==0?(this._rq.peekQueue().cmd|8388608):E.readUInt32LE(4);var G={IsResponse:(F&8388608)==8388608?true:false,Command:(F&8388607),Status:E.length!=0?E.readUInt32LE(12):-1,Data:E.length!=0?E.slice(16):null};return(G)};this.sendCommand=function x(){if(arguments.length<3||typeof(arguments[0])!="number"||typeof(arguments[1])!="object"||typeof(arguments[2])!="function"){throw ("invalid parameters")}var E=[];for(var G=3;G0){N.BiosVersion=N.BiosVersion.substring(0,N.BiosVersion.indexOf("\0"))}L.unshift(N)}else{L.unshift(null)}I.apply(this,L)},E,G)};function D(G,F){if((F==null)&&(typeof(F)!="number")){return null}if(G==null){G=""}var H="";for(var E=0;E0){J.unshift(I.Data.slice(2,2+K).toString())}else{J.unshift(null)}}else{J.unshift(null)}H.apply(this,J)},E,G)};this.getHashHandles=function k(E){var G=[];for(var F=1;F0){this.getCertHashEntry(G.shift(),this._getHashEntrySink,F,H,E,G)}else{H.unshift(E);F.apply(this,H)}};this.getLocalSystemAccount=function m(E){var G=[];for(var F=1;F>24)&255)+"."+((K>>16)&255)+"."+((K>>8)&255)+"."+(K&255);O.unshift(N);L.apply(this,O)}else{O.unshift(null);L.apply(this,O)}},E,J)};this.unprovision=function C(H,E){var I=[];for(var G=2;G>4)&15;f.provisioningState=b[19]&3;var e=(b[16]*256)+b[17];var c=((b[19]&4)!=0)?true:false;f.openPorts=[e];f.address=g.address;if(c==true){f.openPorts=[16992,16993]}if(d!==undefined){d(h,f)}}};this.parseIPv4Range=function(f){if(f==undefined||f==null){return null}var g=f.split("-");if(g.length==2){return{min:this.parseIpv4Addr(g[0]),max:this.parseIpv4Addr(g[1])}}g=f.split("/");if(g.length==2){var c=this.parseIpv4Addr(g[0]),e=parseInt(g[1]),d=0;if(e<=16||e>32){return null}e=32-e;for(var b=0;b>24)&255)+"."+((b>>16)&255)+"."+((b>>8)&255)+"."+(b&255)};this.scan=function(e,h,b){var d=this.parseIPv4Range(e);var f=this.buildRmcpPing(0);var g=this.dgram.createSocket({type:"udp4"});g.parent=this;g.scanResults=[];g.on("error",function(j){console.log("Error:"+j)});g.on("message",function(j,k){if(k.size>4){this.parent.parseRmcpPacket(this,j,k,function(m,l){m.scanResults.push(l)})}});g.on("listening",function(){for(var j=d.min;j<=d.max;j++){g.send(f,623,g.parent.IPv4NumToStr(j))}});g.bind({address:"0.0.0.0",port:0,exclusive:true});var i=setTimeout(function c(){g.close();if(b){b(g.scanResults)}g.parent.emit("found",g.scanResults);delete g},h)}}module.exports=AMTScanner; \ No newline at end of file diff --git a/agents/modules_meshcore_min/amt-wsman-duk.min.js b/agents/modules_meshcore_min/amt-wsman-duk.min.js deleted file mode 100644 index b12434af..00000000 --- a/agents/modules_meshcore_min/amt-wsman-duk.min.js +++ /dev/null @@ -1 +0,0 @@ -function CreateWsmanComm(){var a={};a.PendingAjax=[];a.ActiveAjaxCount=0;a.MaxActiveAjaxCount=1;a.FailAllError=0;a.digest=null;a.RequestCount=0;if(arguments.length==1&&typeof(arguments[0]=="object")){a.host=arguments[0].host;a.port=arguments[0].port;a.authToken=arguments[0].authToken;a.tls=arguments[0].tls}else{a.host=arguments[0];a.port=arguments[1];a.user=arguments[2];a.pass=arguments[3];a.tls=arguments[4]}a.PerformAjax=function(d,c,f,e,g,b){if((a.ActiveAjaxCount==0||((a.ActiveAjaxCount=a.MaxActiveAjaxCount||a.PendingAjax.length==0){return}var b=a.PendingAjax.shift();a.PerformAjaxEx(b[0],b[1],b[2],b[3],b[4]);a.PerformNextAjax()};a.PerformAjaxEx=function(d,c,g,h,b){if(a.FailAllError!=0){if(a.FailAllError!=999){a.gotNextMessagesError({status:a.FailAllError},"error",null,[d,c,g])}return}if(!d){d=""}if(a.digest==null){if(a.authToken){a.digest=require("http-digest").create({authToken:a.authToken})}else{a.digest=require("http-digest").create(a.user,a.pass)}a.digest.http=require("http")}var f={protocol:(a.tls==1?"https:":"http:"),method:"POST",host:a.host,path:"/wsman",port:a.port,rejectUnauthorized:false,checkServerIdentity:function(i){console.log("checkServerIdentity",JSON.stringify(i))}};var e=a.digest.request(f);e.on("error",function(i){a.gotNextMessagesError({status:600},"error",null,[d,c,g])});e.on("response",function(i){if(i.statusCode!=200){a.gotNextMessagesError({status:i.statusCode},"error",null,[d,c,g])}else{i.acc="";i.on("data",function(j){this.acc+=j});i.on("end",function(){a.gotNextMessages(i.acc,"success",{status:i.statusCode},[d,c,g])})}});e.end(d);a.ActiveAjaxCount++;return e};a.pendingAjaxCall=[];a.gotNextMessages=function(c,e,d,b){a.ActiveAjaxCount--;if(a.FailAllError==999){return}if(a.FailAllError!=0){b[1](null,a.FailAllError,b[2]);return}if(d.status!=200){b[1](null,d.status,b[2]);return}b[1](c,200,b[2]);a.PerformNextAjax()};a.gotNextMessagesError=function(d,e,c,b){a.ActiveAjaxCount--;if(a.FailAllError==999){return}if(a.FailAllError!=0){b[1](null,a.FailAllError,b[2]);return}if(a.FailAllError!=999){b[1]({Header:{HttpError:d.status}},d.status,b[2])}a.PerformNextAjax()};a.CancelAllQueries=function(b){while(a.PendingAjax.length>0){var c=a.PendingAjax.shift();c[1](null,b,c[2])}};return a}module.exports=CreateWsmanComm; \ No newline at end of file diff --git a/agents/modules_meshcore_min/amt-wsman.min.js b/agents/modules_meshcore_min/amt-wsman.min.js deleted file mode 100644 index e8afb796..00000000 --- a/agents/modules_meshcore_min/amt-wsman.min.js +++ /dev/null @@ -1 +0,0 @@ -function WsmanStackCreateService(){var p={_ObjectID:"WSMAN"};p.NextMessageId=1;p.Address="/wsman";p.xmlParser=require("amt-xml");if(arguments.length==1&&typeof(arguments[0]=="object")){var e=arguments[0].transport;if(e){p.comm=new e(arguments[0])}}else{var e=arguments[0];if(e){p.comm=new e(arguments[1],arguments[2],arguments[3],arguments[4],arguments[5],arguments[6])}}p.PerformAjax=function q(t,r,v,u,s){if(s==null){s=""}p.comm.PerformAjax('
"+t,function(w,x,y){if(x!=200){r(p,null,{Header:{HttpError:x}},x,y);return}var z=p.xmlParser.ParseWsman(w);if(!z||z==null){r(p,null,{Header:{HttpError:x}},601,y)}else{r(p,z.Header.ResourceURI,z,200,y)}},v,u)};p.CancelAllQueries=function d(r){p.comm.CancelAllQueries(r)};p.GetNameFromUrl=function(r){var s=r.lastIndexOf("/");return(s==-1)?r:r.substring(s+1)};p.ExecSubscribe=function n(z,t,C,r,B,y,A,w,D,x){var u="",v="",w="";if(D!=null&&x!=null){u='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#UsernameToken'+D+''+x+"";v=''}if(w!=null){w=""+w+""}if(t=="PushWithAck"){t="dmtf.org/wbem/wsman/1/wsman/PushWithAck"}else{if(t=="Push"){t="xmlsoap.org/ws/2004/08/eventing/DeliveryModes/Push"}}var s="http://schemas.xmlsoap.org/ws/2004/08/eventing/Subscribe"+p.Address+""+z+""+(p.NextMessageId++)+"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous"+c(A)+u+'
'+C+""+w+""+v+"";p.PerformAjax(s+"
",r,B,y,'xmlns:e="http://schemas.xmlsoap.org/ws/2004/08/eventing" xmlns:m="http://x.com"')};p.ExecUnSubscribe=function o(u,r,w,t,v){var s="http://schemas.xmlsoap.org/ws/2004/08/eventing/Unsubscribe"+p.Address+""+u+""+(p.NextMessageId++)+"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous"+c(v)+"";p.PerformAjax(s+"",r,w,t,'xmlns:e="http://schemas.xmlsoap.org/ws/2004/08/eventing"')};p.ExecPut=function m(v,u,r,x,t,w){var s="http://schemas.xmlsoap.org/ws/2004/09/transfer/Put"+p.Address+""+v+""+(p.NextMessageId++)+"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60.000S"+c(w)+""+b(v,u);p.PerformAjax(s+"",r,x,t)};p.ExecCreate=function f(x,w,r,z,v,y){var u=p.GetNameFromUrl(x);var s="http://schemas.xmlsoap.org/ws/2004/09/transfer/Create"+p.Address+""+x+""+(p.NextMessageId++)+"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60S"+c(y)+"';for(var t in w){s+=""+w[t]+""}p.PerformAjax(s+"",r,z,v)};p.ExecDelete=function g(v,u,r,w,t){var s="http://schemas.xmlsoap.org/ws/2004/09/transfer/Delete"+p.Address+""+v+""+(p.NextMessageId++)+"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60S"+c(u)+"";p.PerformAjax(s,r,w,t)};p.ExecGet=function i(t,r,u,s){p.PerformAjax("http://schemas.xmlsoap.org/ws/2004/09/transfer/Get"+p.Address+""+t+""+(p.NextMessageId++)+"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60S",r,u,s)};p.ExecMethod=function j(y,v,r,t,A,w,z){var s="";for(var u in r){if(r[u]!=null){if(Array.isArray(r[u])){for(var B in r[u]){s+=""+r[u][B]+""}}else{s+=""+r[u]+""}}}p.ExecMethodXml(y,v,s,t,A,w,z)};p.ExecMethodXml=function k(v,t,r,s,x,u,w){p.PerformAjax(v+"/"+t+""+p.Address+""+v+""+(p.NextMessageId++)+"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60S"+c(w)+"'+r+"",s,x,u)};p.ExecEnum=function h(t,r,u,s){p.PerformAjax("http://schemas.xmlsoap.org/ws/2004/09/enumeration/Enumerate"+p.Address+""+t+""+(p.NextMessageId++)+'http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60S',r,u,s)};p.ExecPull=function l(u,s,r,v,t){p.PerformAjax("http://schemas.xmlsoap.org/ws/2004/09/enumeration/Pull"+p.Address+""+u+""+(p.NextMessageId++)+'http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60S'+s+"99999999",r,v,t)};function b(w,u){if(!w||u==null){return""}var s=p.GetNameFromUrl(w);var v="';for(var t in u){if(!u.hasOwnProperty(t)||t.indexOf("__")===0||t.indexOf("@")===0){continue}if(u[t]==null||typeof u[t]==="function"){continue}if(typeof u[t]==="object"&&u[t]["ReferenceParameters"]){v+=""+u[t].Address+""+u[t]["ReferenceParameters"]["ResourceURI"]+"";var x=u[t]["ReferenceParameters"]["SelectorSet"]["Selector"];if(Array.isArray(x)){for(var r=0;r"+x[r]["Value"]+""}}else{v+=""+x.Value+""}v+=""}else{if(Array.isArray(u[t])){for(var r=0;r"+u[t][r].toString()+""}}else{v+=""+u[t].toString()+""}}}v+="";return v}function a(r){if(!r){return""}var t=" ";for(var s in r){if(!r.hasOwnProperty(s)||s.indexOf("@")!==0){continue}t+=s.substring(1)+'="'+r[s]+'" '}return t}function c(v){if((v==null)||(v=="null")){return""}if(typeof v=="string"){return v}if(v.InstanceID){return''+v.InstanceID+""}var t="";for(var s in v){if(!v.hasOwnProperty(s)){continue}t+='';if(v[s]["ReferenceParameters"]){t+="";t+=""+v[s]["Address"]+""+v[s]["ReferenceParameters"]["ResourceURI"]+"";var u=v[s]["ReferenceParameters"]["SelectorSet"]["Selector"];if(Array.isArray(u)){for(var r=0;r"+u[r]["Value"]+""}}else{t+=""+u.Value+""}t+=""}else{t+=v[s]}t+=""}t+="";return t}return p}module.exports=WsmanStackCreateService; \ No newline at end of file diff --git a/agents/modules_meshcore_min/amt-xml.min.js b/agents/modules_meshcore_min/amt-xml.min.js deleted file mode 100644 index 4b2308ed..00000000 --- a/agents/modules_meshcore_min/amt-xml.min.js +++ /dev/null @@ -1 +0,0 @@ -try{Object.defineProperty(Array.prototype,"peek",{value:function(){return(this.length>0?this[this.length-1]:undefined)}})}catch(e){}module.exports.ParseWsman=function(j){try{if(!j.childNodes){j=_turnToXml(j)}var g={Header:{}},d=j.getElementsByTagName("Header")[0],h;if(!d){d=j.getElementsByTagName("a:Header")[0]}if(!d){return null}for(var f=0;f0){h=a.childNodes[0].localName;if(h.indexOf("_OUTPUT")==h.length-7){h=h.substring(0,h.length-7)}g.Header.Method=h;g.Body=_ParseWsmanRec(a.childNodes[0])}return g}catch(c){console.error("Unable to parse XML: "+j,c);return null}};function _ParseWsmanRec(g){var c,h={};for(var d=0;d0)){b={Value:c};for(var f=0;f';for(var c in d){if(!d.hasOwnProperty(c)||c.indexOf("__")===0||c.indexOf("@")===0){continue}if(d[c]==null||typeof d[c]==="function"){continue}if(typeof d[c]==="object"&&d[c]["ReferenceParameters"]){f+=""+d[c].Address+""+d[c]["ReferenceParameters"]["ResourceURI"]+"";var h=d[c]["ReferenceParameters"]["SelectorSet"]["Selector"];if(Array.isArray(h)){for(var a=0;a"+h[a]["Value"]+""}}else{f+=""+h.Value+""}f+=""}else{if(Array.isArray(d[c])){for(var a=0;a"+d[c][a].toString()+""}}else{f+=""+d[c].toString()+""}}}f+="";return f}function _treeBuilder(){this.tree=[];this.push=function(a){this.tree.push(a)};this.pop=function(){var a=this.tree.pop();if(this.tree.length>0){var b=this.tree.peek();b.childNodes.push(a);b.childElementCount=b.childNodes.length}return(a)};this.peek=function(){return(this.tree.peek())};this.addNamespace=function(g,d){this.tree.peek().nsTable[g]=d;if(this.tree.peek().attributes.length>0){for(var c=0;c=0;--a){if(this.tree[a].nsTable[b]!=null){return(this.tree[a].nsTable[b])}}return null}}function _turnToXml(a){if(a==null){return null}return({childNodes:[_turnToXmlRec(a)],getElementsByTagName:_getElementsByTagName,getChildElementsByTagName:_getChildElementsByTagName,getElementsByTagNameNS:_getElementsByTagNameNS})}function _getElementsByTagNameNS(b,a){var c=[];_xmlTraverseAllRec(this.childNodes,function(d){if(d.localName==a&&(d.namespace==b||b=="*")){c.push(d)}});return c}function _getElementsByTagName(a){var b=[];_xmlTraverseAllRec(this.childNodes,function(c){if(c.localName==a){b.push(c)}});return b}function _getChildElementsByTagName(a){var c=[];if(this.childNodes!=null){for(var b in this.childNodes){if(this.childNodes[b].localName==a){c.push(this.childNodes[b])}}}return(c)}function _getChildElementsByTagNameNS(c,a){var d=[];if(this.childNodes!=null){for(var b in this.childNodes){if(this.childNodes[b].localName==a&&(c=="*"||this.childNodes[b].namespace==c)){d.push(this.childNodes[b])}}}return(d)}function _xmlTraverseAllRec(c,a){for(var b in c){a(c[b]);if(c[b].childNodes){_xmlTraverseAllRec(c[b].childNodes,a)}}}function _turnToXmlRec(w){try{if(w==null){return null}var m=new _treeBuilder(),r=null,z=w.split("<"),u=[],h=null,g=null;for(var o in z){var A=z[o].split(">"),B=A[0].split(" "),l=B[0];if((l.length>0)&&(l[0]!="?")){if(l[0]!="/"){var a=[],s,t=l.split(" ")[0].split(":"),s=(t.length>1)?t[1]:t[0];Object.defineProperty(a,"get",{value:function(){if(arguments.length==1){for(var i in this){if(this[i].name==arguments[0]){return(this[i])}}}else{if(arguments.length==2){for(var i in this){if(this[i].name==arguments[1]&&(arguments[0]=="*"||this[i].namespace==arguments[0])){return(this[i])}}}else{throw ("attributes.get(): Invalid number of parameters")}}}});m.push({name:l,localName:s,getChildElementsByTagName:_getChildElementsByTagName,getElementsByTagNameNS:_getElementsByTagNameNS,getChildElementsByTagNameNS:_getChildElementsByTagNameNS,attributes:a,childNodes:[],nsTable:{}});if(B.length>0){var v=false;for(var p in B){if(B[p]=="/"){m.peek().namespace=m.peek().name==m.peek().localName?m.getNamespace("*"):m.getNamespace(m.peek().name.substring(0,m.peek().name.indexOf(":")));m.peek().textContent="";r=m.pop();v=true;break}var q=B[p].indexOf("=");if(q>0){var b=B[p].substring(0,q);var d=B[p].substring(q+2,B[p].length-1);var c=m.getNamespace("*");if(b=="xmlns"){m.addNamespace("*",d);c=d}else{if(b.startsWith("xmlns:")){m.addNamespace(b.substring(6),d)}else{var f=b.split(":");if(f.length==2){b=f[1];c=m.getNamespace(f[0])}}}var y={name:b,value:d};if(c!=null){y.namespace=c}m.peek().attributes.push(y)}}if(v){continue}}m.peek().namespace=m.peek().name==m.peek().localName?m.getNamespace("*"):m.getNamespace(m.peek().name.substring(0,m.peek().name.indexOf(":")));if(A[1]){m.peek().textContent=A[1]}}else{r=m.pop()}}}}catch(n){return null}return r}; \ No newline at end of file diff --git a/agents/modules_meshcore_min/amt.min.js b/agents/modules_meshcore_min/amt.min.js deleted file mode 100644 index 6984729b..00000000 --- a/agents/modules_meshcore_min/amt.min.js +++ /dev/null @@ -1 +0,0 @@ -function AmtStackCreateService(R){var J=new Object();J._ObjectID="AMT";J.wsman=R;J.pfx=["http://intel.com/wbem/wscim/1/amt-schema/1/","http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/","http://intel.com/wbem/wscim/1/ips-schema/1/"];J.PendingEnums=[];J.PendingBatchOperations=0;J.ActiveEnumsCount=0;J.MaxActiveEnumsCount=1;J.onProcessChanged=null;var n=0;var m=0;J.GetPendingActions=function(){return(J.PendingEnums.length*2)+(J.ActiveEnumsCount)+J.wsman.comm.PendingAjax.length+J.wsman.comm.ActiveAjaxCount+J.PendingBatchOperations};function r(){var S=J.GetPendingActions();if(n=J.MaxActiveEnumsCount||J.PendingEnums.length==0){return}var T=J.PendingEnums.shift();J.Enum(T[0],T[1],T[2]);d(0)}J.BatchEnum=function(S,V,T,X,U,W){J.PendingBatchOperations+=(V.length*2);b(S,x(V),T,X,{},U,W);r()};function x(S){return JSON.parse(JSON.stringify(S))}function b(S,X,T,aa,Z,U,Y){J.PendingBatchOperations-=2;var W=X.shift(),V=J.Enum;if(W[0]=="*"){V=J.Get;W=W.substring(1)}V(W,function(ad,ab,ac,ae,af){af[2][ab]={response:(ac==null?null:ac.Body),responses:ac,status:ae};if(af[1].length==0||ae==401||(U!=true&&ae!=200&&ae!=400)){J.PendingBatchOperations-=(X.length*2);r();T.call(J,J,S,af[2],ae,aa)}else{r();b(S,X,T,aa,af[2],Y)}},[S,X,Z],Y);r()}J.BatchGet=function(S,U,T,W,V){h({name:S,names:U,callback:T,current:0,responses:{},tag:W,pri:V});r()};function h(S){if(S.names.length<=S.current){S.callback.call(J,J,S.name,S.responses,200,S.tag)}else{J.wsman.ExecGet(J.CompleteName(S.names[S.current]),function(V,U,T,W){g(S,T,W)},S.pri);S.current++}r()}function g(S,T,U){if(T==null||U!=200){S.callback.call(J,J,S.name,null,U,S.tag)}else{S.responses[T.Header.Method]=T;h(S)}}J.CompleteName=function(S){if(S.indexOf("AMT_")==0){return J.pfx[0]+S}if(S.indexOf("CIM_")==0){return J.pfx[1]+S}if(S.indexOf("IPS_")==0){return J.pfx[2]+S}};J.CompleteExecResponse=function(S){if(S&&S!=null&&S.Body&&(S.Body.ReturnValue!=undefined)){S.Body.ReturnValueStr=J.AmtStatusToStr(S.Body.ReturnValue)}return S};J.RequestPowerStateChange=function(T,S){J.CIM_PowerManagementService_RequestPowerStateChange(T,'
http://schemas.xmlsoap.org/ws/2004/08/addressing
http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ComputerSystemCIM_ComputerSystemManagedSystem',null,null,S)};J.SetBootConfigRole=function(T,S){J.CIM_BootService_SetBootConfigRole('
http://schemas.xmlsoap.org/ws/2004/08/addressing
http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_BootConfigSettingIntel(r) AMT: Boot Configuration 0',T,S)};J.CancelAllQueries=function(S){J.wsman.CancelAllQueries(S)};J.AMT_AgentPresenceWatchdog_RegisterAgent=function(S,V,T,U){J.Exec("AMT_AgentPresenceWatchdog","RegisterAgent",{},S,V,T,U)};J.AMT_AgentPresenceWatchdog_AssertPresence=function(V,S,W,T,U){J.Exec("AMT_AgentPresenceWatchdog","AssertPresence",{SequenceNumber:V},S,W,T,U)};J.AMT_AgentPresenceWatchdog_AssertShutdown=function(V,S,W,T,U){J.Exec("AMT_AgentPresenceWatchdog","AssertShutdown",{SequenceNumber:V},S,W,T,U)};J.AMT_AgentPresenceWatchdog_AddAction=function(X,W,V,T,S,U,aa,Y,Z){J.Exec("AMT_AgentPresenceWatchdog","AddAction",{OldState:X,NewState:W,EventOnTransition:V,ActionSd:T,ActionEac:S},U,aa,Y,Z)};J.AMT_AgentPresenceWatchdog_DeleteAllActions=function(S,V,T,U){J.Exec("AMT_AgentPresenceWatchdog","DeleteAllActions",{},S,V,T,U)};J.AMT_AgentPresenceWatchdogAction_GetActionEac=function(S){J.Exec("AMT_AgentPresenceWatchdogAction","GetActionEac",{},S)};J.AMT_AgentPresenceWatchdogVA_RegisterAgent=function(S){J.Exec("AMT_AgentPresenceWatchdogVA","RegisterAgent",{},S)};J.AMT_AgentPresenceWatchdogVA_AssertPresence=function(T,S){J.Exec("AMT_AgentPresenceWatchdogVA","AssertPresence",{SequenceNumber:T},S)};J.AMT_AgentPresenceWatchdogVA_AssertShutdown=function(T,S){J.Exec("AMT_AgentPresenceWatchdogVA","AssertShutdown",{SequenceNumber:T},S)};J.AMT_AgentPresenceWatchdogVA_AddAction=function(X,W,V,T,S,U){J.Exec("AMT_AgentPresenceWatchdogVA","AddAction",{OldState:X,NewState:W,EventOnTransition:V,ActionSd:T,ActionEac:S},U)};J.AMT_AgentPresenceWatchdogVA_DeleteAllActions=function(S,T){J.Exec("AMT_AgentPresenceWatchdogVA","DeleteAllActions",{_method_dummy:S},T)};J.AMT_AlarmClockService_AddAlarm=function s(S,T){var V=S.InstanceID;var X=S.ElementName;var Y=S.StartTime.Datetime;var W=S.Interval?S.Interval.Datetime:undefined;var U=S.DeleteOnCompletion;var Z=''+V+""+X+''+Y+""+((W!=undefined)?(''+W+""):"")+""+U+"";J.wsman.ExecMethodXml(J.CompleteName("AMT_AlarmClockService"),"AddAlarm",Z,T)};J.AMT_AuditLog_ClearLog=function(S){J.Exec("AMT_AuditLog","ClearLog",{},S)};J.AMT_AuditLog_RequestStateChange=function(T,U,S){J.Exec("AMT_AuditLog","RequestStateChange",{RequestedState:T,TimeoutPeriod:U},S)};J.AMT_AuditLog_ReadRecords=function(T,S,U){J.Exec("AMT_AuditLog","ReadRecords",{StartIndex:T},S,U)};J.AMT_AuditLog_SetAuditLock=function(V,T,U,S){J.Exec("AMT_AuditLog","SetAuditLock",{LockTimeoutInSeconds:V,Flag:T,Handle:U},S)};J.AMT_AuditLog_ExportAuditLogSignature=function(T,S){J.Exec("AMT_AuditLog","ExportAuditLogSignature",{SigningMechanism:T},S)};J.AMT_AuditLog_SetSigningKeyMaterial=function(W,V,U,T,S){J.Exec("AMT_AuditLog","SetSigningKeyMaterial",{SigningMechanismType:W,SigningKey:V,LengthOfCertificates:U,Certificates:T},S)};J.AMT_AuditPolicyRule_SetAuditPolicy=function(U,S,V,W,T){J.Exec("AMT_AuditPolicyRule","SetAuditPolicy",{Enable:U,AuditedAppID:S,EventID:V,PolicyType:W},T)};J.AMT_AuditPolicyRule_SetAuditPolicyBulk=function(U,S,V,W,T){J.Exec("AMT_AuditPolicyRule","SetAuditPolicyBulk",{Enable:U,AuditedAppID:S,EventID:V,PolicyType:W},T)};J.AMT_AuthorizationService_AddUserAclEntryEx=function(V,U,W,S,X,T){J.Exec("AMT_AuthorizationService","AddUserAclEntryEx",{DigestUsername:V,DigestPassword:U,KerberosUserSid:W,AccessPermission:S,Realms:X},T)};J.AMT_AuthorizationService_EnumerateUserAclEntries=function(T,S){J.Exec("AMT_AuthorizationService","EnumerateUserAclEntries",{StartIndex:T},S)};J.AMT_AuthorizationService_GetUserAclEntryEx=function(T,S,U){J.Exec("AMT_AuthorizationService","GetUserAclEntryEx",{Handle:T},S,U)};J.AMT_AuthorizationService_UpdateUserAclEntryEx=function(W,V,U,X,S,Y,T){J.Exec("AMT_AuthorizationService","UpdateUserAclEntryEx",{Handle:W,DigestUsername:V,DigestPassword:U,KerberosUserSid:X,AccessPermission:S,Realms:Y},T)};J.AMT_AuthorizationService_RemoveUserAclEntry=function(T,S){J.Exec("AMT_AuthorizationService","RemoveUserAclEntry",{Handle:T},S)};J.AMT_AuthorizationService_SetAdminAclEntryEx=function(U,T,S){J.Exec("AMT_AuthorizationService","SetAdminAclEntryEx",{Username:U,DigestPassword:T},S)};J.AMT_AuthorizationService_GetAdminAclEntry=function(S){J.Exec("AMT_AuthorizationService","GetAdminAclEntry",{},S)};J.AMT_AuthorizationService_GetAdminAclEntryStatus=function(S){J.Exec("AMT_AuthorizationService","GetAdminAclEntryStatus",{},S)};J.AMT_AuthorizationService_GetAdminNetAclEntryStatus=function(S){J.Exec("AMT_AuthorizationService","GetAdminNetAclEntryStatus",{},S)};J.AMT_AuthorizationService_SetAclEnabledState=function(U,T,S,V){J.Exec("AMT_AuthorizationService","SetAclEnabledState",{Handle:U,Enabled:T},S,V)};J.AMT_AuthorizationService_GetAclEnabledState=function(T,S,U){J.Exec("AMT_AuthorizationService","GetAclEnabledState",{Handle:T},S,U)};J.AMT_EndpointAccessControlService_RequestStateChange=function(T,U,S){J.Exec("AMT_EndpointAccessControlService","RequestStateChange",{RequestedState:T,TimeoutPeriod:U},S)};J.AMT_EndpointAccessControlService_GetPosture=function(T,S){J.Exec("AMT_EndpointAccessControlService","GetPosture",{PostureType:T},S)};J.AMT_EndpointAccessControlService_GetPostureHash=function(T,S){J.Exec("AMT_EndpointAccessControlService","GetPostureHash",{PostureType:T},S)};J.AMT_EndpointAccessControlService_UpdatePostureState=function(T,S){J.Exec("AMT_EndpointAccessControlService","UpdatePostureState",{UpdateType:T},S)};J.AMT_EndpointAccessControlService_GetEacOptions=function(S){J.Exec("AMT_EndpointAccessControlService","GetEacOptions",{},S)};J.AMT_EndpointAccessControlService_SetEacOptions=function(T,U,S){J.Exec("AMT_EndpointAccessControlService","SetEacOptions",{EacVendors:T,PostureHashAlgorithm:U},S)};J.AMT_EnvironmentDetectionSettingData_SetSystemDefensePolicy=function(T,S){J.Exec("AMT_EnvironmentDetectionSettingData","SetSystemDefensePolicy",{Policy:T},S)};J.AMT_EnvironmentDetectionSettingData_EnableVpnRouting=function(T,S){J.Exec("AMT_EnvironmentDetectionSettingData","EnableVpnRouting",{Enable:T},S)};J.AMT_EthernetPortSettings_SetLinkPreference=function(T,U,S){J.Exec("AMT_EthernetPortSettings","SetLinkPreference",{LinkPreference:T,Timeout:U},S)};J.AMT_HeuristicPacketFilterStatistics_ResetSelectedStats=function(T,S){J.Exec("AMT_HeuristicPacketFilterStatistics","ResetSelectedStats",{SelectedStatistics:T},S)};J.AMT_KerberosSettingData_GetCredentialCacheState=function(S){J.Exec("AMT_KerberosSettingData","GetCredentialCacheState",{},S)};J.AMT_KerberosSettingData_SetCredentialCacheState=function(T,S){J.Exec("AMT_KerberosSettingData","SetCredentialCacheState",{Enable:T},S)};J.AMT_MessageLog_CancelIteration=function(T,S){J.Exec("AMT_MessageLog","CancelIteration",{IterationIdentifier:T},S)};J.AMT_MessageLog_RequestStateChange=function(T,U,S){J.Exec("AMT_MessageLog","RequestStateChange",{RequestedState:T,TimeoutPeriod:U},S)};J.AMT_MessageLog_ClearLog=function(S){J.Exec("AMT_MessageLog","ClearLog",{},S)};J.AMT_MessageLog_GetRecords=function(T,U,S,V){J.Exec("AMT_MessageLog","GetRecords",{IterationIdentifier:T,MaxReadRecords:U},S,V)};J.AMT_MessageLog_GetRecord=function(T,U,S){J.Exec("AMT_MessageLog","GetRecord",{IterationIdentifier:T,PositionToNext:U},S)};J.AMT_MessageLog_PositionAtRecord=function(T,U,V,S){J.Exec("AMT_MessageLog","PositionAtRecord",{IterationIdentifier:T,MoveAbsolute:U,RecordNumber:V},S)};J.AMT_MessageLog_PositionToFirstRecord=function(S,T){J.Exec("AMT_MessageLog","PositionToFirstRecord",{},S,T)};J.AMT_MessageLog_FreezeLog=function(T,S){J.Exec("AMT_MessageLog","FreezeLog",{Freeze:T},S)};J.AMT_PublicKeyManagementService_AddCRL=function(U,T,S){J.Exec("AMT_PublicKeyManagementService","AddCRL",{Url:U,SerialNumbers:T},S)};J.AMT_PublicKeyManagementService_ResetCRLList=function(S,T){J.Exec("AMT_PublicKeyManagementService","ResetCRLList",{_method_dummy:S},T)};J.AMT_PublicKeyManagementService_AddCertificate=function(T,S,U){J.Exec("AMT_PublicKeyManagementService","AddCertificate",{CertificateBlob:T},S,U)};J.AMT_PublicKeyManagementService_AddTrustedRootCertificate=function(T,S){J.Exec("AMT_PublicKeyManagementService","AddTrustedRootCertificate",{CertificateBlob:T},S)};J.AMT_PublicKeyManagementService_AddKey=function(T,S){J.Exec("AMT_PublicKeyManagementService","AddKey",{KeyBlob:T},S)};J.AMT_PublicKeyManagementService_GeneratePKCS10Request=function(U,T,V,S){J.Exec("AMT_PublicKeyManagementService","GeneratePKCS10Request",{KeyPair:U,DNName:T,Usage:V},S)};J.AMT_PublicKeyManagementService_GeneratePKCS10RequestEx=function(T,V,U,S){J.Exec("AMT_PublicKeyManagementService","GeneratePKCS10RequestEx",{KeyPair:T,SigningAlgorithm:V,NullSignedCertificateRequest:U},S)};J.AMT_PublicKeyManagementService_GenerateKeyPair=function(T,U,S){J.Exec("AMT_PublicKeyManagementService","GenerateKeyPair",{KeyAlgorithm:T,KeyLength:U},S)};J.AMT_RedirectionService_RequestStateChange=function(T,S){J.Exec("AMT_RedirectionService","RequestStateChange",{RequestedState:T},S)};J.AMT_RedirectionService_TerminateSession=function(T,S){J.Exec("AMT_RedirectionService","TerminateSession",{SessionType:T},S)};J.AMT_RemoteAccessService_AddMpServer=function(S,X,Z,T,V,aa,Y,W,U){J.Exec("AMT_RemoteAccessService","AddMpServer",{AccessInfo:S,InfoFormat:X,Port:Z,AuthMethod:T,Certificate:V,Username:aa,Password:Y,CN:W},U)};J.AMT_RemoteAccessService_AddRemoteAccessPolicyRule=function(V,W,T,U,S){J.Exec("AMT_RemoteAccessService","AddRemoteAccessPolicyRule",{Trigger:V,TunnelLifeTime:W,ExtendedData:T,MpServer:U},S)};J.AMT_RemoteAccessService_CloseRemoteAccessConnection=function(S,T){J.Exec("AMT_RemoteAccessService","CloseRemoteAccessConnection",{_method_dummy:S},T)};J.AMT_SetupAndConfigurationService_CommitChanges=function(S,T,U){J.Exec("AMT_SetupAndConfigurationService","CommitChanges",{_method_dummy:S},T,U)};J.AMT_SetupAndConfigurationService_Unprovision=function(T,S){J.Exec("AMT_SetupAndConfigurationService","Unprovision",{ProvisioningMode:T},S)};J.AMT_SetupAndConfigurationService_PartialUnprovision=function(S,T){J.Exec("AMT_SetupAndConfigurationService","PartialUnprovision",{_method_dummy:S},T)};J.AMT_SetupAndConfigurationService_ResetFlashWearOutProtection=function(S,T){J.Exec("AMT_SetupAndConfigurationService","ResetFlashWearOutProtection",{_method_dummy:S},T)};J.AMT_SetupAndConfigurationService_ExtendProvisioningPeriod=function(T,S){J.Exec("AMT_SetupAndConfigurationService","ExtendProvisioningPeriod",{Duration:T},S)};J.AMT_SetupAndConfigurationService_SetMEBxPassword=function(T,S){J.Exec("AMT_SetupAndConfigurationService","SetMEBxPassword",{Password:T},S)};J.AMT_SetupAndConfigurationService_SetTLSPSK=function(T,U,S){J.Exec("AMT_SetupAndConfigurationService","SetTLSPSK",{PID:T,PPS:U},S)};J.AMT_SetupAndConfigurationService_GetProvisioningAuditRecord=function(S){J.Exec("AMT_SetupAndConfigurationService","GetProvisioningAuditRecord",{},S)};J.AMT_SetupAndConfigurationService_GetUuid=function(S){J.Exec("AMT_SetupAndConfigurationService","GetUuid",{},S)};J.AMT_SetupAndConfigurationService_GetUnprovisionBlockingComponents=function(S){J.Exec("AMT_SetupAndConfigurationService","GetUnprovisionBlockingComponents",{},S)};J.AMT_SetupAndConfigurationService_GetProvisioningAuditRecordV2=function(S){J.Exec("AMT_SetupAndConfigurationService","GetProvisioningAuditRecordV2",{},S)};J.AMT_SystemDefensePolicy_GetTimeout=function(S){J.Exec("AMT_SystemDefensePolicy","GetTimeout",{},S)};J.AMT_SystemDefensePolicy_SetTimeout=function(T,S){J.Exec("AMT_SystemDefensePolicy","SetTimeout",{Timeout:T},S)};J.AMT_SystemDefensePolicy_UpdateStatistics=function(T,V,S,X,U,W){J.Exec("AMT_SystemDefensePolicy","UpdateStatistics",{NetworkInterface:T,ResetOnRead:V},S,X,U,W)};J.AMT_SystemPowerScheme_SetPowerScheme=function(S,T,U){J.Exec("AMT_SystemPowerScheme","SetPowerScheme",{},S,U,0,{InstanceID:T})};J.AMT_TimeSynchronizationService_GetLowAccuracyTimeSynch=function(S,T){J.Exec("AMT_TimeSynchronizationService","GetLowAccuracyTimeSynch",{},S,T)};J.AMT_TimeSynchronizationService_SetHighAccuracyTimeSynch=function(T,V,W,S,U){J.Exec("AMT_TimeSynchronizationService","SetHighAccuracyTimeSynch",{Ta0:T,Tm1:V,Tm2:W},S,U)};J.AMT_TLSCredentialContext_Create=function t(T,U,S,V){J.Create("AMT_TLSCredentialContext",{ElementInContext:T,ElementProvidingContext:U},S,V)};J.AMT_UserInitiatedConnectionService_RequestStateChange=function(T,U,S){J.Exec("AMT_UserInitiatedConnectionService","RequestStateChange",{RequestedState:T,TimeoutPeriod:U},S)};J.AMT_WebUIService_RequestStateChange=function(T,V,S,U){J.Exec("AMT_WebUIService","RequestStateChange",{RequestedState:T,TimeoutPeriod:V},S,U)};J.AMT_WiFiPortConfigurationService_AddWiFiSettings=function(W,X,V,U,S,T){J.ExecWithXml("AMT_WiFiPortConfigurationService","AddWiFiSettings",{WiFiEndpoint:W,WiFiEndpointSettingsInput:X,IEEE8021xSettingsInput:V,ClientCredential:U,CACredential:S},T)};J.AMT_WiFiPortConfigurationService_UpdateWiFiSettings=function(W,X,V,U,S,T){J.ExecWithXml("AMT_WiFiPortConfigurationService","UpdateWiFiSettings",{WiFiEndpointSettings:W,WiFiEndpointSettingsInput:X,IEEE8021xSettingsInput:V,ClientCredential:U,CACredential:S},T)};J.AMT_WiFiPortConfigurationService_DeleteAllITProfiles=function(S,T){J.Exec("AMT_WiFiPortConfigurationService","DeleteAllITProfiles",{_method_dummy:S},T)};J.AMT_WiFiPortConfigurationService_DeleteAllUserProfiles=function(S,T){J.Exec("AMT_WiFiPortConfigurationService","DeleteAllUserProfiles",{_method_dummy:S},T)};J.CIM_Account_RequestStateChange=function(T,U,S){J.Exec("CIM_Account","RequestStateChange",{RequestedState:T,TimeoutPeriod:U},S)};J.CIM_AccountManagementService_CreateAccount=function(U,S,T){J.Exec("CIM_AccountManagementService","CreateAccount",{System:U,AccountTemplate:S},T)};J.CIM_BootConfigSetting_ChangeBootOrder=function(T,S){J.Exec("CIM_BootConfigSetting","ChangeBootOrder",{Source:T},S)};J.CIM_BootService_SetBootConfigRole=function(S,U,T){J.Exec("CIM_BootService","SetBootConfigRole",{BootConfigSetting:S,Role:U},T,0,1)};J.CIM_Card_ConnectorPower=function(T,U,S){J.Exec("CIM_Card","ConnectorPower",{Connector:T,PoweredOn:U},S)};J.CIM_Card_IsCompatible=function(T,S){J.Exec("CIM_Card","IsCompatible",{ElementToCheck:T},S)};J.CIM_Chassis_IsCompatible=function(T,S){J.Exec("CIM_Chassis","IsCompatible",{ElementToCheck:T},S)};J.CIM_Fan_SetSpeed=function(T,S){J.Exec("CIM_Fan","SetSpeed",{DesiredSpeed:T},S)};J.CIM_KVMRedirectionSAP_RequestStateChange=function(T,U,S){J.Exec("CIM_KVMRedirectionSAP","RequestStateChange",{RequestedState:T},S)};J.CIM_MediaAccessDevice_LockMedia=function(T,S){J.Exec("CIM_MediaAccessDevice","LockMedia",{Lock:T},S)};J.CIM_MediaAccessDevice_SetPowerState=function(T,U,S){J.Exec("CIM_MediaAccessDevice","SetPowerState",{PowerState:T,Time:U},S)};J.CIM_MediaAccessDevice_Reset=function(S){J.Exec("CIM_MediaAccessDevice","Reset",{},S)};J.CIM_MediaAccessDevice_EnableDevice=function(T,S){J.Exec("CIM_MediaAccessDevice","EnableDevice",{Enabled:T},S)};J.CIM_MediaAccessDevice_OnlineDevice=function(T,S){J.Exec("CIM_MediaAccessDevice","OnlineDevice",{Online:T},S)};J.CIM_MediaAccessDevice_QuiesceDevice=function(T,S){J.Exec("CIM_MediaAccessDevice","QuiesceDevice",{Quiesce:T},S)};J.CIM_MediaAccessDevice_SaveProperties=function(S){J.Exec("CIM_MediaAccessDevice","SaveProperties",{},S)};J.CIM_MediaAccessDevice_RestoreProperties=function(S){J.Exec("CIM_MediaAccessDevice","RestoreProperties",{},S)};J.CIM_MediaAccessDevice_RequestStateChange=function(T,U,S){J.Exec("CIM_MediaAccessDevice","RequestStateChange",{RequestedState:T,TimeoutPeriod:U},S)};J.CIM_PhysicalFrame_IsCompatible=function(T,S){J.Exec("CIM_PhysicalFrame","IsCompatible",{ElementToCheck:T},S)};J.CIM_PhysicalPackage_IsCompatible=function(T,S){J.Exec("CIM_PhysicalPackage","IsCompatible",{ElementToCheck:T},S)};J.CIM_PowerManagementService_RequestPowerStateChange=function(U,T,V,W,S){J.Exec("CIM_PowerManagementService","RequestPowerStateChange",{PowerState:U,ManagedElement:T,Time:V,TimeoutPeriod:W},S,0,1)};J.CIM_PowerSupply_SetPowerState=function(T,U,S){J.Exec("CIM_PowerSupply","SetPowerState",{PowerState:T,Time:U},S)};J.CIM_PowerSupply_Reset=function(S){J.Exec("CIM_PowerSupply","Reset",{},S)};J.CIM_PowerSupply_EnableDevice=function(T,S){J.Exec("CIM_PowerSupply","EnableDevice",{Enabled:T},S)};J.CIM_PowerSupply_OnlineDevice=function(T,S){J.Exec("CIM_PowerSupply","OnlineDevice",{Online:T},S)};J.CIM_PowerSupply_QuiesceDevice=function(T,S){J.Exec("CIM_PowerSupply","QuiesceDevice",{Quiesce:T},S)};J.CIM_PowerSupply_SaveProperties=function(S){J.Exec("CIM_PowerSupply","SaveProperties",{},S)};J.CIM_PowerSupply_RestoreProperties=function(S){J.Exec("CIM_PowerSupply","RestoreProperties",{},S)};J.CIM_PowerSupply_RequestStateChange=function(T,U,S){J.Exec("CIM_PowerSupply","RequestStateChange",{RequestedState:T,TimeoutPeriod:U},S)};J.CIM_Processor_SetPowerState=function(T,U,S){J.Exec("CIM_Processor","SetPowerState",{PowerState:T,Time:U},S)};J.CIM_Processor_Reset=function(S){J.Exec("CIM_Processor","Reset",{},S)};J.CIM_Processor_EnableDevice=function(T,S){J.Exec("CIM_Processor","EnableDevice",{Enabled:T},S)};J.CIM_Processor_OnlineDevice=function(T,S){J.Exec("CIM_Processor","OnlineDevice",{Online:T},S)};J.CIM_Processor_QuiesceDevice=function(T,S){J.Exec("CIM_Processor","QuiesceDevice",{Quiesce:T},S)};J.CIM_Processor_SaveProperties=function(S){J.Exec("CIM_Processor","SaveProperties",{},S)};J.CIM_Processor_RestoreProperties=function(S){J.Exec("CIM_Processor","RestoreProperties",{},S)};J.CIM_Processor_RequestStateChange=function(T,U,S){J.Exec("CIM_Processor","RequestStateChange",{RequestedState:T,TimeoutPeriod:U},S)};J.CIM_RecordLog_ClearLog=function(S){J.Exec("CIM_RecordLog","ClearLog",{},S)};J.CIM_RecordLog_RequestStateChange=function(T,U,S){J.Exec("CIM_RecordLog","RequestStateChange",{RequestedState:T,TimeoutPeriod:U},S)};J.CIM_RedirectionService_RequestStateChange=function(T,U,S){J.Exec("CIM_RedirectionService","RequestStateChange",{RequestedState:T,TimeoutPeriod:U},S)};J.CIM_Sensor_SetPowerState=function(T,U,S){J.Exec("CIM_Sensor","SetPowerState",{PowerState:T,Time:U},S)};J.CIM_Sensor_Reset=function(S){J.Exec("CIM_Sensor","Reset",{},S)};J.CIM_Sensor_EnableDevice=function(T,S){J.Exec("CIM_Sensor","EnableDevice",{Enabled:T},S)};J.CIM_Sensor_OnlineDevice=function(T,S){J.Exec("CIM_Sensor","OnlineDevice",{Online:T},S)};J.CIM_Sensor_QuiesceDevice=function(T,S){J.Exec("CIM_Sensor","QuiesceDevice",{Quiesce:T},S)};J.CIM_Sensor_SaveProperties=function(S){J.Exec("CIM_Sensor","SaveProperties",{},S)};J.CIM_Sensor_RestoreProperties=function(S){J.Exec("CIM_Sensor","RestoreProperties",{},S)};J.CIM_Sensor_RequestStateChange=function(T,U,S){J.Exec("CIM_Sensor","RequestStateChange",{RequestedState:T,TimeoutPeriod:U},S)};J.CIM_StatisticalData_ResetSelectedStats=function(T,S){J.Exec("CIM_StatisticalData","ResetSelectedStats",{SelectedStatistics:T},S)};J.CIM_Watchdog_KeepAlive=function(S){J.Exec("CIM_Watchdog","KeepAlive",{},S)};J.CIM_Watchdog_SetPowerState=function(T,U,S){J.Exec("CIM_Watchdog","SetPowerState",{PowerState:T,Time:U},S)};J.CIM_Watchdog_Reset=function(S){J.Exec("CIM_Watchdog","Reset",{},S)};J.CIM_Watchdog_EnableDevice=function(T,S){J.Exec("CIM_Watchdog","EnableDevice",{Enabled:T},S)};J.CIM_Watchdog_OnlineDevice=function(T,S){J.Exec("CIM_Watchdog","OnlineDevice",{Online:T},S)};J.CIM_Watchdog_QuiesceDevice=function(T,S){J.Exec("CIM_Watchdog","QuiesceDevice",{Quiesce:T},S)};J.CIM_Watchdog_SaveProperties=function(S){J.Exec("CIM_Watchdog","SaveProperties",{},S)};J.CIM_Watchdog_RestoreProperties=function(S){J.Exec("CIM_Watchdog","RestoreProperties",{},S)};J.CIM_Watchdog_RequestStateChange=function(T,U,S){J.Exec("CIM_Watchdog","RequestStateChange",{RequestedState:T,TimeoutPeriod:U},S)};J.CIM_WiFiPort_SetPowerState=function(T,U,S){J.Exec("CIM_WiFiPort","SetPowerState",{PowerState:T,Time:U},S)};J.CIM_WiFiPort_Reset=function(S){J.Exec("CIM_WiFiPort","Reset",{},S)};J.CIM_WiFiPort_EnableDevice=function(T,S){J.Exec("CIM_WiFiPort","EnableDevice",{Enabled:T},S)};J.CIM_WiFiPort_OnlineDevice=function(T,S){J.Exec("CIM_WiFiPort","OnlineDevice",{Online:T},S)};J.CIM_WiFiPort_QuiesceDevice=function(T,S){J.Exec("CIM_WiFiPort","QuiesceDevice",{Quiesce:T},S)};J.CIM_WiFiPort_SaveProperties=function(S){J.Exec("CIM_WiFiPort","SaveProperties",{},S)};J.CIM_WiFiPort_RestoreProperties=function(S){J.Exec("CIM_WiFiPort","RestoreProperties",{},S)};J.CIM_WiFiPort_RequestStateChange=function(T,U,S){J.Exec("CIM_WiFiPort","RequestStateChange",{RequestedState:T,TimeoutPeriod:U},S)};J.IPS_HostBasedSetupService_Setup=function(W,X,V,T,Y,U,S){J.Exec("IPS_HostBasedSetupService","Setup",{NetAdminPassEncryptionType:W,NetworkAdminPassword:X,McNonce:V,Certificate:T,SigningAlgorithm:Y,DigitalSignature:U},S)};J.IPS_HostBasedSetupService_AddNextCertInChain=function(V,T,U,S){J.Exec("IPS_HostBasedSetupService","AddNextCertInChain",{NextCertificate:V,IsLeafCertificate:T,IsRootCertificate:U},S)};J.IPS_HostBasedSetupService_AdminSetup=function(V,W,U,X,T,S){J.Exec("IPS_HostBasedSetupService","AdminSetup",{NetAdminPassEncryptionType:V,NetworkAdminPassword:W,McNonce:U,SigningAlgorithm:X,DigitalSignature:T},S)};J.IPS_HostBasedSetupService_UpgradeClientToAdmin=function(U,V,T,S){J.Exec("IPS_HostBasedSetupService","UpgradeClientToAdmin",{McNonce:U,SigningAlgorithm:V,DigitalSignature:T},S)};J.IPS_HostBasedSetupService_DisableClientControlMode=function(S,T){J.Exec("IPS_HostBasedSetupService","DisableClientControlMode",{_method_dummy:S},T)};J.IPS_KVMRedirectionSettingData_TerminateSession=function(S){J.Exec("IPS_KVMRedirectionSettingData","TerminateSession",{},S)};J.IPS_KVMRedirectionSettingData_DataChannelRead=function(S){J.Exec("IPS_KVMRedirectionSettingData","DataChannelRead",{},S)};J.IPS_KVMRedirectionSettingData_DataChannelWrite=function(T,S){J.Exec("IPS_KVMRedirectionSettingData","DataChannelWrite",{DataMessage:T},S)};J.IPS_OptInService_StartOptIn=function(S){J.Exec("IPS_OptInService","StartOptIn",{},S)};J.IPS_OptInService_CancelOptIn=function(S){J.Exec("IPS_OptInService","CancelOptIn",{},S)};J.IPS_OptInService_SendOptInCode=function(T,S){J.Exec("IPS_OptInService","SendOptInCode",{OptInCode:T},S)};J.IPS_OptInService_StartService=function(S){J.Exec("IPS_OptInService","StartService",{},S)};J.IPS_OptInService_StopService=function(S){J.Exec("IPS_OptInService","StopService",{},S)};J.IPS_OptInService_RequestStateChange=function(T,U,S){J.Exec("IPS_OptInService","RequestStateChange",{RequestedState:T,TimeoutPeriod:U},S)};J.IPS_ProvisioningRecordLog_RequestStateChange=function(T,U,S){J.Exec("IPS_ProvisioningRecordLog","RequestStateChange",{RequestedState:T,TimeoutPeriod:U},S)};J.IPS_ProvisioningRecordLog_ClearLog=function(S,T){J.Exec("IPS_ProvisioningRecordLog","ClearLog",{_method_dummy:S},T)};J.IPS_SecIOService_RequestStateChange=function(T,U,S){J.Exec("IPS_SecIOService","RequestStateChange",{RequestedState:T,TimeoutPeriod:U},S)};J.AmtStatusToStr=function(S){if(J.AmtStatusCodes[S]){return J.AmtStatusCodes[S]}else{return"UNKNOWN_ERROR"}};J.AmtStatusCodes={0:"SUCCESS",1:"INTERNAL_ERROR",2:"NOT_READY",3:"INVALID_PT_MODE",4:"INVALID_MESSAGE_LENGTH",5:"TABLE_FINGERPRINT_NOT_AVAILABLE",6:"INTEGRITY_CHECK_FAILED",7:"UNSUPPORTED_ISVS_VERSION",8:"APPLICATION_NOT_REGISTERED",9:"INVALID_REGISTRATION_DATA",10:"APPLICATION_DOES_NOT_EXIST",11:"NOT_ENOUGH_STORAGE",12:"INVALID_NAME",13:"BLOCK_DOES_NOT_EXIST",14:"INVALID_BYTE_OFFSET",15:"INVALID_BYTE_COUNT",16:"NOT_PERMITTED",17:"NOT_OWNER",18:"BLOCK_LOCKED_BY_OTHER",19:"BLOCK_NOT_LOCKED",20:"INVALID_GROUP_PERMISSIONS",21:"GROUP_DOES_NOT_EXIST",22:"INVALID_MEMBER_COUNT",23:"MAX_LIMIT_REACHED",24:"INVALID_AUTH_TYPE",25:"AUTHENTICATION_FAILED",26:"INVALID_DHCP_MODE",27:"INVALID_IP_ADDRESS",28:"INVALID_DOMAIN_NAME",29:"UNSUPPORTED_VERSION",30:"REQUEST_UNEXPECTED",31:"INVALID_TABLE_TYPE",32:"INVALID_PROVISIONING_STATE",33:"UNSUPPORTED_OBJECT",34:"INVALID_TIME",35:"INVALID_INDEX",36:"INVALID_PARAMETER",37:"INVALID_NETMASK",38:"FLASH_WRITE_LIMIT_EXCEEDED",39:"INVALID_IMAGE_LENGTH",40:"INVALID_IMAGE_SIGNATURE",41:"PROPOSE_ANOTHER_VERSION",42:"INVALID_PID_FORMAT",43:"INVALID_PPS_FORMAT",44:"BIST_COMMAND_BLOCKED",45:"CONNECTION_FAILED",46:"CONNECTION_TOO_MANY",47:"RNG_GENERATION_IN_PROGRESS",48:"RNG_NOT_READY",49:"CERTIFICATE_NOT_READY",1024:"DISABLED_BY_POLICY",2048:"NETWORK_IF_ERROR_BASE",2049:"UNSUPPORTED_OEM_NUMBER",2050:"UNSUPPORTED_BOOT_OPTION",2051:"INVALID_COMMAND",2052:"INVALID_SPECIAL_COMMAND",2053:"INVALID_HANDLE",2054:"INVALID_PASSWORD",2055:"INVALID_REALM",2056:"STORAGE_ACL_ENTRY_IN_USE",2057:"DATA_MISSING",2058:"DUPLICATE",2059:"EVENTLOG_FROZEN",2060:"PKI_MISSING_KEYS",2061:"PKI_GENERATING_KEYS",2062:"INVALID_KEY",2063:"INVALID_CERT",2064:"CERT_KEY_NOT_MATCH",2065:"MAX_KERB_DOMAIN_REACHED",2066:"UNSUPPORTED",2067:"INVALID_PRIORITY",2068:"NOT_FOUND",2069:"INVALID_CREDENTIALS",2070:"INVALID_PASSPHRASE",2072:"NO_ASSOCIATION",2075:"AUDIT_FAIL",2076:"BLOCKING_COMPONENT",2081:"USER_CONSENT_REQUIRED",4096:"APP_INTERNAL_ERROR",4097:"NOT_INITIALIZED",4098:"LIB_VERSION_UNSUPPORTED",4099:"INVALID_PARAM",4100:"RESOURCES",4101:"HARDWARE_ACCESS_ERROR",4102:"REQUESTOR_NOT_REGISTERED",4103:"NETWORK_ERROR",4104:"PARAM_BUFFER_TOO_SHORT",4105:"COM_NOT_INITIALIZED_IN_THREAD",4106:"URL_REQUIRED"};J.GetMessageLog=function(S,T){J.AMT_MessageLog_PositionToFirstRecord(k,[S,T,[]])};function k(U,S,T,V,W){if(V!=200||T.Body.ReturnValue!="0"){W[0](J,null,W[2],V);return}J.AMT_MessageLog_GetRecords(T.Body.IterationIdentifier,390,l,W)}function l(Z,W,Y,aa,ac){if(aa!=200||Y.Body.ReturnValue!="0"){ac[0](J,null,ac[2],aa);return}var U,V,ae,T,S=ac[2],ab=new Date(),ad,X=Y.Body.RecordArray;if(typeof X==="string"){Y.Body.RecordArray=[Y.Body.RecordArray]}for(U in X){T=Buffer.from(X[U],"base64");if(T!=null){ad=M(T,0);if((ad>0)&&(ad<4294967295)){ae={DeviceAddress:T[4],EventSensorType:T[5],EventType:T[6],EventOffset:T[7],EventSourceType:T[8],EventSeverity:T[9],SensorNumber:T[10],Entity:T[11],EntityInstance:T[12],EventData:[],Time:new Date((ad+(ab.getTimezoneOffset()*60))*1000)};for(V=13;V<21;V++){ae.EventData.push(T[V])}ae.EntityStr=o[ae.Entity];ae.Desc=j(ae.EventSensorType,ae.EventOffset,ae.EventData,ae.Entity);if(!ae.EntityStr){ae.EntityStr="Unknown"}S.push(ae)}}}if(Y.Body.NoMoreRecords!=true){J.AMT_MessageLog_GetRecords(Y.Body.IterationIdentifier,390,l,[ac[0],S,ac[2]])}else{ac[0](J,S,ac[2])}}var f="Platform firmware (e.g. BIOS)|SMI handler|ISV system management software|Alert ASIC|IPMI|BIOS vendor|System board set vendor|System integrator|Third party add-in|OSV|NIC|System management card".split("|");var p="Unspecified.|No system memory is physically installed in the system.|No usable system memory, all installed memory has experienced an unrecoverable failure.|Unrecoverable hard-disk/ATAPI/IDE device failure.|Unrecoverable system-board failure.|Unrecoverable diskette subsystem failure.|Unrecoverable hard-disk controller failure.|Unrecoverable PS/2 or USB keyboard failure.|Removable boot media not found.|Unrecoverable video controller failure.|No video device detected.|Firmware (BIOS) ROM corruption detected.|CPU voltage mismatch (processors that share same supply have mismatched voltage requirements)|CPU speed matching failure".split("|");var q="Unspecified.|Memory initialization.|Starting hard-disk initialization and test|Secondary processor(s) initialization|User authentication|User-initiated system setup|USB resource configuration|PCI resource configuration|Option ROM initialization|Video initialization|Cache initialization|SM Bus initialization|Keyboard controller initialization|Embedded controller/management controller initialization|Docking station attachment|Enabling docking station|Docking station ejection|Disabling docking station|Calling operating system wake-up vector|Starting operating system boot process|Baseboard or motherboard initialization|reserved|Floppy initialization|Keyboard test|Pointing device test|Primary processor initialization".split("|");var o="Unspecified|Other|Unknown|Processor|Disk|Peripheral|System management module|System board|Memory module|Processor module|Power supply|Add in card|Front panel board|Back panel board|Power system board|Drive backplane|System internal expansion board|Other system board|Processor board|Power unit|Power module|Power management board|Chassis back panel board|System chassis|Sub chassis|Other chassis board|Disk drive bay|Peripheral bay|Device bay|Fan cooling|Cooling unit|Cable interconnect|Memory device|System management software|BIOS|Intel(r) ME|System bus|Group|Intel(r) ME|External environment|Battery|Processing blade|Connectivity switch|Processor/memory module|I/O module|Processor I/O module|Management controller firmware|IPMI channel|PCI bus|PCI express bus|SCSI bus|SATA/SAS bus|Processor front side bus".split("|");J.RealmNames="||Redirection|PT Administration|Hardware Asset|Remote Control|Storage|Event Manager|Storage Admin|Agent Presence Local|Agent Presence Remote|Circuit Breaker|Network Time|General Information|Firmware Update|EIT|LocalUN|Endpoint Access Control|Endpoint Access Control Admin|Event Log Reader|Audit Log|ACL Realm|||Local System".split("|");J.WatchdogCurrentStates={1:"Not Started",2:"Stopped",4:"Running",8:"Expired",16:"Suspended"};function j(V,U,T,S){if(V==15){if(T[0]==235){return"Invalid Data"}if(U==0){return p[T[1]]}return q[T[1]]}if(V==18&&T[0]==170){return"Agent watchdog "+char2hex(T[4])+char2hex(T[3])+char2hex(T[2])+char2hex(T[1])+"-"+char2hex(T[6])+char2hex(T[5])+"-... changed to "+J.WatchdogCurrentStates[T[7]]}if(V==6){return"Authentication failed "+(T[1]+(T[2]<<8))+" times. The system may be under attack."}if(V==30){return"No bootable media"}if(V==32){return"Operating system lockup or power interrupt"}if(V==35){return"System boot failure"}if(V==37){return"System firmware started (at least one CPU is properly executing)."}return"Unknown Sensor Type #"+V}var a={16:"Security Admin",17:"RCO",18:"Redirection Manager",19:"Firmware Update Manager",20:"Security Audit Log",21:"Network Time",22:"Network Administration",23:"Storage Administration",24:"Event Manager",25:"Circuit Breaker Manager",26:"Agent Presence Manager",27:"Wireless Configuration",28:"EAC",29:"KVM",30:"User Opt-In Events",32:"Screen Blanking",33:"Watchdog Events",1600:"Provisioning Started",1601:"Provisioning Completed",1602:"ACL Entry Added",1603:"ACL Entry Modified",1604:"ACL Entry Removed",1605:"ACL Access with Invalid Credentials",1606:"ACL Entry State",1607:"TLS State Changed",1608:"TLS Server Certificate Set",1609:"TLS Server Certificate Remove",1610:"TLS Trusted Root Certificate Added",1611:"TLS Trusted Root Certificate Removed",1612:"TLS Preshared Key Set",1613:"Kerberos Settings Modified",1614:"Kerberos Master Key Modified",1615:"Flash Wear out Counters Reset",1616:"Power Package Modified",1617:"Set Realm Authentication Mode",1618:"Upgrade Client to Admin Control Mode",1619:"Unprovisioning Started",1700:"Performed Power Up",1701:"Performed Power Down",1702:"Performed Power Cycle",1703:"Performed Reset",1704:"Set Boot Options",1800:"IDER Session Opened",1801:"IDER Session Closed",1802:"IDER Enabled",1803:"IDER Disabled",1804:"SoL Session Opened",1805:"SoL Session Closed",1806:"SoL Enabled",1807:"SoL Disabled",1808:"KVM Session Started",1809:"KVM Session Ended",1810:"KVM Enabled",1811:"KVM Disabled",1812:"VNC Password Failed 3 Times",1900:"Firmware Updated",1901:"Firmware Update Failed",2000:"Security Audit Log Cleared",2001:"Security Audit Policy Modified",2002:"Security Audit Log Disabled",2003:"Security Audit Log Enabled",2004:"Security Audit Log Exported",2005:"Security Audit Log Recovered",2100:"Intel(R) ME Time Set",2200:"TCPIP Parameters Set",2201:"Host Name Set",2202:"Domain Name Set",2203:"VLAN Parameters Set",2204:"Link Policy Set",2205:"IPv6 Parameters Set",2300:"Global Storage Attributes Set",2301:"Storage EACL Modified",2302:"Storage FPACL Modified",2303:"Storage Write Operation",2400:"Alert Subscribed",2401:"Alert Unsubscribed",2402:"Event Log Cleared",2403:"Event Log Frozen",2500:"CB Filter Added",2501:"CB Filter Removed",2502:"CB Policy Added",2503:"CB Policy Removed",2504:"CB Default Policy Set",2505:"CB Heuristics Option Set",2506:"CB Heuristics State Cleared",2600:"Agent Watchdog Added",2601:"Agent Watchdog Removed",2602:"Agent Watchdog Action Set",2700:"Wireless Profile Added",2701:"Wireless Profile Removed",2702:"Wireless Profile Updated",2800:"EAC Posture Signer SET",2801:"EAC Enabled",2802:"EAC Disabled",2803:"EAC Posture State",2804:"EAC Set Options",2900:"KVM Opt-in Enabled",2901:"KVM Opt-in Disabled",2902:"KVM Password Changed",2903:"KVM Consent Succeeded",2904:"KVM Consent Failed",3000:"Opt-In Policy Change",3001:"Send Consent Code Event",3002:"Start Opt-In Blocked Event"};J.GetAuditLogExtendedDataStr=function(T,S){if((T==1602||T==1604)&&S[0]==0){return w(S).splice(2,2+S[1]).toString()}if(T==1603){if(S[1]==0){return w(S).splice(3).toString()}return null}if(T==1605){return["Invalid ME access","Invalid MEBx access"][S[0]]}if(T==1606){var U=["Disabled","Enabled"][S[0]];if(S[1]==0){U+=", "+S[3]}return U}if(T==1607){return"Remote "+["NoAuth","ServerAuth","MutualAuth"][S[0]]+", Local "+["NoAuth","ServerAuth","MutualAuth"][S[1]]}if(T==1617){return J.RealmNames[L(S,0)]+", "+["NoAuth","Auth","Disabled"][S[4]]}if(T==1619){return["BIOS","MEBx","Local MEI","Local WSMAN","Remote WSAMN"][S[0]]}if(T==1900){return"From "+N(S,0)+"."+N(S,2)+"."+N(S,4)+"."+N(S,6)+" to "+N(S,8)+"."+N(S,10)+"."+N(S,12)+"."+N(S,14)}if(T==2100){var V=new Date();V.setTime(L(S,0)*1000+(new Date().getTimezoneOffset()*60000));return V.toLocaleString()}if(T==3000){return"From "+["None","KVM","All"][S[0]]+" to "+["None","KVM","All"][S[1]]}if(T==3001){return["Success","Failed 3 times"][S[0]]}return null};J.GetAuditLog=function(S){J.AMT_AuditLog_ReadRecords(1,i,[S,[]])};function I(S){if(!S||S==null||typeof S=="object"){return S}return[S]}function N(T,S){return(T[S]<<8)+T[S+1]}function L(T,S){return(T[S]*16777216)+(T[S+1]<<16)+(T[S+2]<<8)+T[S+3]}function M(T,S){return(T[S+3]*16777216)+(T[S+2]<<16)+(T[S+1]<<8)+T[S]}function v(S){return Buffer.from(S).toString("base64")}function u(T){var U=null;try{U=Buffer.from(T,"base64").toString()}catch(S){console.log(S)}return U}function w(S){var U=[];for(var T in S){U.push(S[T])}return U}function i(ab,W,aa,ac,ae){if(ac!=200){ae[0](J,[],ac);return}var Y,V,S,ah,Z=ae[1],ad=new Date(),af;if(aa.Body.RecordsReturned>0){aa.Body.EventRecords=I(aa.Body.EventRecords);for(V in aa.Body.EventRecords){S=null;try{S=Buffer.from(aa.Body.EventRecords[V],"base64")}catch(T){console.log(T+" "+aa.Body.EventRecords[V])}ah={AuditAppID:N(S,0),EventID:N(S,2),InitiatorType:S[4]};ah.AuditApp=a[ah.AuditAppID];ah.Event=a[(ah.AuditAppID*100)+ah.EventID];if(!ah.Event){ah.Event="#"+ah.EventID}if(ah.InitiatorType==0){var ag=S[5];ah.Initiator=S.slice(6,6+ag).toString();Y=6+ag}if(ah.InitiatorType==1){ah.KerberosUserInDomain=L(S,5);var ag=S[9];ah.Initiator=G(S.slice(10,10+ag));Y=10+ag}if(ah.InitiatorType==2){ah.Initiator="Local";Y=5}if(ah.InitiatorType==3){ah.Initiator="KVM Default Port";Y=5}af=L(S,Y);ah.Time=new Date((af+(ad.getTimezoneOffset()*60))*1000);Y+=4;ah.MCLocationType=S[Y++];var X=S[Y++];ah.NetAddress=S.slice(Y,Y+X).toString();Y+=X;var U=S[Y++];ah.Ex=S.slice(Y,Y+U);ah.ExStr=J.GetAuditLogExtendedDataStr((ah.AuditAppID*100)+ah.EventID,ah.Ex);Z.push(ah)}}if(aa.Body.TotalRecordCount>Z.length){J.AMT_AuditLog_ReadRecords(Z.length+1,i,[ae[0],Z])}else{ae[0](J,Z,ac)}}function C(U){if(U===undefined||U===null){return null}var V="";for(var T in U){var S=U[T];if(!S){continue}if(S.__parameterType==="reference"){V+=O(T,S)}else{V+=H(T,S)}}return V}function H(V,U){if(U===undefined||U===null){return null}var T=!!U.__namespace;var Z=T?"";for(var X in U){if(!U.hasOwnProperty(X)||X.indexOf("__")===0){continue}if(typeof U[X]==="function"||Array.isArray(U[X])){continue}if(typeof U[X]==="object"){console.error("only convert one level down...")}else{Y+=Z+X+">"+U[X].toString()+S+X+">"}}Y+="";return Y}function O(T,S){if(S===undefined||S===null){return null}var U="/wsman"+S.__resourceUri+"";for(var V in S){if(!S.hasOwnProperty(V)||V.indexOf("__")===0){continue}if(typeof S[V]==="function"||typeof S[V]==="object"||Array.isArray(S[V])){continue}U+=''+S[V].toString()+""}U+="";return U}function G(U){var T="S-"+U.charCodeAt(0)+"-"+U.charCodeAt(7);for(var S=2;S<(U.length/4);S++){T+="-"+M(U,S*4)}return T}function F(V){if(!V||V==null){return null}var U=V.split("-");if(U.length<4||(U[0]!="s"&&U[0]!="S")){return null}for(var S=1;S>24)&255,(J>>16)&255,(J>>8)&255,J&255)}function m(J){var L="",K=(""+J).match(/../g),M;while(M=K.shift()){L+=String.fromCharCode("0x"+M)}return L}function h(J){return(J+256).toString(16).substr(-2).toUpperCase()}function w(K){var L="",J;for(J=0;J0){o.forwardClient.tag.accumulator=o.forwardClient.tag.accumulator.slice(O)}if(o.cirastate==i.FAILED){k("APF: in a failed state, destroying socket.");o.forwardClient.ws.end()}}while(O>0)}catch(N){k(N)}});o.forwardClient.ws.on("error",function(M){k("APF: Connection error, ending connecting.");if(o.timer!=null){clearInterval(o.timer);o.timer=null}});o.state=i.INITIAL;F(o.forwardClient.ws,o.args.clientuuid);G(o.forwardClient.ws,"auth@amt.intel.com")};function l(J){return J.substring(6,8)+J.substring(4,6)+J.substring(2,4)+J.substring(0,2)+"-"+J.substring(10,12)+J.substring(8,10)+"-"+J.substring(14,16)+J.substring(12,14)+"-"+J.substring(16,20)+"-"+J.substring(20)}function I(K){K=K.replace(/-/g,"");var J=K.substring(6,8)+K.substring(4,6)+K.substring(2,4)+K.substring(0,2);J+=K.substring(10,12)+K.substring(8,10)+K.substring(14,16)+K.substring(12,14)+K.substring(16,20)+K.substring(20);return J}function f(K){var L="";for(var J=0;J=i.AUTH_SERVICE_REQUEST_SENT){H(U.ws,o.args.mpsuser,o.args.mpspass)}}else{if(S=="pfwd@amt.intel.com"){if(o.cirastate>=i.PFWD_SERVICE_REQUEST_SENT){C(U.ws,o.args.clientname,s[o.pfwd_idx++])}}}return 5+T;case d.REQUEST_SUCCESS:if(O>=5){var Q=u(M,1);k("APF: Request to port forward "+Q+" successful.");if(o.pfwd_idx=0){o.downlinks[P.sender_chan]=o.net.createConnection({host:o.args.clientaddress,port:P.target_port},function(){z(U.ws,P)});o.downlinks[P.sender_chan].on("data",function(V){y(U.ws,P.sender_chan,V.length,V)});o.downlinks[P.sender_chan].on("error",function(V){k("Downlink connection error: "+V)});o.downlinks[P.sender_chan].on("end",function(){if(o.downlinks[P.sender_chan]){try{k("Socket ends.");x(U.ws,P.sender_chan);setTimeout(function(){delete o.downlinks[P.sender_chan]},100)}catch(V){k("Downlink connection exception: "+V)}}})}else{A(U.ws,P)}return P.len;case d.CHANNEL_OPEN_CONFIRMATION:k("APF: CHANNEL_OPEN_CONFIRMATION");return 17;case d.CHANNEL_CLOSE:var R=u(M,1);k("APF: CHANNEL_CLOSE: "+R);x(U.ws,R);try{o.downlinks[R].end();delete o.downlinks[R]}catch(N){}return 5;case d.CHANNEL_DATA:k("APF: CHANNEL_DATA: "+JSON.stringify(w(M)));var R=u(M,1);var K=u(M,5);var J=M.substring(9,9+K);if(o.downlinks[R]){try{o.downlinks[R].write(J,"binary",function(){k("Write completed.");B(U.ws,R,K)})}catch(N){k("Cannot forward data to downlink socket.")}}return 9+K;case d.CHANNEL_WINDOW_ADJUST:k("APF: CHANNEL_WINDOW_ADJUST ");return 9;default:k("CMD: "+L+" is not implemented.");o.cirastate=i.FAILED;return 0}}function r(L){var N={len:0,cmd:d.CHANNEL_OPEN,chan_type:"",sender_chan:0,window_size:0,target_address:"",target_port:0,origin_address:"",origin_port:0,};var K=u(L,1);N.chan_type=L.substring(5,5+K);N.sender_chan=u(L,5+K);N.window_size=u(L,9+K);var J=u(L,17+K);N.target_address=L.substring(21+K,21+K+J);N.target_port=u(L,21+K+J);var M=u(L,25+K+J);N.origin_address=L.substring(29+K+J,29+K+J+M);N.origin_port=u(L,29+K+J+M);N.len=33+K+J+M;return N}function A(L,J){var K=String.fromCharCode(d.CHANNEL_OPEN_FAILURE)+n(J.sender_chan)+n(2)+n(0)+n(0);L.write(K);k("APF: Send ChannelOpenFailure")}function z(L,J){var K=String.fromCharCode(d.CHANNEL_OPEN_CONFIRMATION)+n(J.sender_chan)+n(J.sender_chan)+n(J.window_size)+n(4294967295);L.write(K);k("APF: Send ChannelOpenConfirmation")}function B(M,J,L){var K=String.fromCharCode(d.CHANNEL_WINDOW_ADJUST)+n(J)+n(L);M.write(K);k("APF: Send ChannelWindowAdjust: "+w(K))}function y(N,K,M,L){var J=String.fromCharCode(d.CHANNEL_DATA)+n(K)+n(M)+L;N.write(J);k("APF: Send ChannelData: "+w(J))}function x(L,K){var J=String.fromCharCode(d.CHANNEL_CLOSE)+n(K);L.write(J);k("APF: Send ChannelClose ")}o.connect=function(){if(o.forwardClient!=null){try{o.forwardClient.ws.end()}catch(J){k(J)}}o.cirastate=i.INITIAL;o.pfwd_idx=0;var K=o.http.parseUri(o.args.mpsurl);K.rejectUnauthorized=0;o.forwardClient=o.http.request(K);o.forwardClient.upgrade=o.onSecureConnect;o.forwardClient.end()};o.disconnect=function(){try{o.forwardClient.ws.end()}catch(J){k(J)}};return o}module.exports=CreateAPFClient; \ No newline at end of file diff --git a/agents/modules_meshcore_min/identifiers.min.js b/agents/modules_meshcore_min/identifiers.min.js deleted file mode 100644 index b2f733af..00000000 --- a/agents/modules_meshcore_min/identifiers.min.js +++ /dev/null @@ -1 +0,0 @@ -function trimIdentifiers(b){for(var a in b){if(!b[a]||b[a]=="None"||b[a]==""){delete b[a]}}}function linux_identifiers(){var c={};var d={};var e={};if(!require("fs").existsSync("/sys/class/dmi/id")){throw ("this platform does not have DMI statistics")}var a=require("fs").readdirSync("/sys/class/dmi/id");for(var b in a){if(require("fs").statSync("/sys/class/dmi/id/"+a[b]).isFile()){d[a[b]]=require("fs").readFileSync("/sys/class/dmi/id/"+a[b]).toString().trim();if(d[a[b]]=="None"){delete d[a[b]]}}}c.bios_date=d.bios_date;c.bios_vendor=d.bios_vendor;c.bios_version=d.bios_version;c.board_name=d.board_name;c.board_serial=d.board_serial;c.board_vendor=d.board_vendor;c.board_version=d.board_version;c.product_uuid=d.product_uuid;e.identifiers=c;e.linux=d;trimIdentifiers(e.identifiers);return(e)}function windows_wmic_results(h){var e=h.trim().split("\r\n");var c=e[0].split(",");var a,b,d;var j;var g=[];for(a=1;a0?this[this.length-1]:undefined)}})}catch(e){}try{Object.defineProperty(String.prototype,"replaceAll",{value:function replaceAll(b,a){return(this.split(b).join(a))}})}catch(e){}var RSMB=1381190978;var memoryLocation={1:"Other",2:"Unknown",3:"System Board",4:"ISA",5:"EISA",6:"PCI",7:"MCA",8:"PCMCIA",9:"Proprietary",10:"NuBus",160:"PC-98/C20",161:"PC-98/C24",162:"PC-98/E",163:"PC-98/LB"};var wakeReason=["Reserved","Other","Unknown","APM Timer","Modem Ring","LAN","Power Switch","PCI","AC Power"];function zeroLeftPad(c,b){if((b==null)&&(typeof(b)!="number")){return null}if(c==null){c=""}var d="";for(var a=0;a1){var r=v[1].split("\x0A\x0A")[0].split("\x0A");var s=[];for(var t in r){var u=r[t].trim().replaceAll(" ","").replaceAll("\x09","");if(!(u[0]=='"')){s.push(u)}}p.write(Buffer.from(s.join(""),"hex"));p.write(Buffer.from("00","hex"))}else{p.write(Buffer.from("0000","hex"))}}var q=p.buffer;q.ms=p;return(q)}}this._parse=function b(o){var n={};var m;var l=0;var o;var s=0;while(o&&l0){var n=l[4].pop();var o=n[20]&64;var s=n[20]&7;if(o){var m={_ObjectID:"SMBiosTables.processorInfo"};m.Processor=q[n[1]];m.MaxSpeed=n.readUInt16LE(16)+" Mhz";if(n[31]){m.Cores=n[31]}if(n[33]){m.Threads=n[33]}m.Populated=1;m.Status=t[s];m.Socket=n._strings[n[0]-1];m.Manufacturer=n._strings[n[3]-1];m.Version=n._strings[n[12]-1];r.push(m)}}return(r)};this.memoryInfo=function f(k){if(!k){throw ("no data")}var n={_ObjectID:"SMBiosTables.memoryInfo"};if(k[16]){var l=k[16].peek();n.location=memoryLocation[l[0]];if((n.maxCapacityKb=l.readUInt32LE(3))==2147483648){n.maxCapacityKb="A really big number"}}return(n)};this.systemInfo=function i(k){if(!k){throw ("no data")}var l={_ObjectID:"SMBiosTables.systemInfo"};if(k[1]){var m=k[1].peek();var n=m.slice(4,20);l.uuid=[zeroLeftPad(n.readUInt32LE(0).toString(16),8),zeroLeftPad(n.readUInt16LE(4).toString(16),4),zeroLeftPad(n.readUInt16LE(6).toString(16),4),zeroLeftPad(n.readUInt16BE(8).toString(16),4),zeroLeftPad(n.slice(10).toString("hex").toLowerCase(),12)].join("-");l.wakeReason=wakeReason[m[20]]}return(l)};this.systemSlots=function j(k){if(!k){throw ("no data")}var l=[];if(k[9]){while(k[9].length>0){var m=k[9].pop();l.push({name:m._strings[m[0]-1]})}}return(l)};this.amtInfo=function c(l){if(!l){throw ("no data")}var n={AMT:false};if(l[130]&&l[130].peek().slice(0,4).toString()=="$AMT"){var k=l[130].peek();n.AMT=k[4]?true:false;if(n.AMT){n.enabled=k[5]?true:false;n.storageRedirection=k[6]?true:false;n.serialOverLan=k[7]?true:false;n.kvm=k[14]?true:false;if(l[131].peek()&&l[131].peek().slice(52,56).toString()=="vPro"){var o=l[131].peek();if(o[0]&4){n.TXT=(o[0]&8)?true:false}if(o[0]&16){n.VMX=(o[0]&32)?true:false}n.MEBX=o.readUInt16LE(4).toString()+"."+o.readUInt16LE(6).toString()+"."+o.readUInt16LE(8).toString()+"."+o.readUInt16LE(10).toString();var m=o.slice(20,32);n.ManagementEngine=m.readUInt16LE(6).toString()+"."+m.readUInt16LE(4).toString()+"."+m.readUInt16LE(10).toString()+"."+m.readUInt16LE(8).toString()}}}return(n)};this.smTableTypes={0:"BIOS information",1:"System information",2:"Baseboard (or Module) information",4:"Processor information",5:"memory controller information",6:"Memory module information",7:"Cache information",8:"Port connector information",9:"System slots",10:"On board devices information",11:"OEM strings",12:"System configuration options",13:"BIOS language information",14:"Group associations",15:"System event log",16:"Physical memory array",17:"Memory device",18:"32bit memory error information",19:"Memory array mapped address",20:"Memory device mapped address",21:"Built-in pointing device",22:"Portable battery",23:"System reset",24:"Hardware security",25:"System power controls",26:"Voltage probe",27:"Cooling device",28:"Temperature probe",29:"Electrical current probe",30:"Out-of-band remote access",31:"Boot integrity services (BIS) entry point",32:"System boot information",33:"64bit memory error information",34:"Management device",35:"Management device component",36:"Management device threshold data",37:"Memory channel",38:"IPMI device information",39:"System power supply",40:"Additional information",41:"Onboard devices extended information",42:"Management controller host interface",126:"Inactive",127:"End-of-table"}}module.exports=new SMBiosTables(); \ No newline at end of file diff --git a/agents/modules_meshcore_min/sysinfo.min.js b/agents/modules_meshcore_min/sysinfo.min.js deleted file mode 100644 index 4c87bd93..00000000 --- a/agents/modules_meshcore_min/sysinfo.min.js +++ /dev/null @@ -1 +0,0 @@ -var PDH_FMT_LONG=256;var PDH_FMT_DOUBLE=512;var promise=require("promise");if(process.platform=="win32"){var GM=require("_GenericMarshal");GM.kernel32=GM.CreateNativeProxy("kernel32.dll");GM.kernel32.CreateMethod("GlobalMemoryStatusEx");GM.pdh=GM.CreateNativeProxy("pdh.dll");GM.pdh.CreateMethod("PdhAddEnglishCounterA");GM.pdh.CreateMethod("PdhCloseQuery");GM.pdh.CreateMethod("PdhCollectQueryData");GM.pdh.CreateMethod("PdhGetFormattedCounterValue");GM.pdh.CreateMethod("PdhGetFormattedCounterArrayA");GM.pdh.CreateMethod("PdhOpenQueryA");GM.pdh.CreateMethod("PdhRemoveCounter")}function windows_cpuUtilization(){var b=new promise(function(d,c){this._res=d;this._rej=c});b.counter=GM.CreateVariable(16);b.cpu=GM.CreatePointer();b.cpuTotal=GM.CreatePointer();var a=0;if((a=GM.pdh.PdhOpenQueryA(0,0,b.cpu).Val)!=0){b._rej(a);return}if((a=GM.pdh.PdhAddEnglishCounterA(b.cpu.Deref(),GM.CreateVariable("\\Processor(*)\\% Processor Time"),0,b.cpuTotal).Val)!=0){b._rej(a);return}if((a=GM.pdh.PdhCollectQueryData(b.cpu.Deref()).Val!=0)){b._rej(a);return}b._timeout=setTimeout(function(k){var m={cpus:[]};var d=GM.CreateVariable(4);var j=GM.CreateVariable(4);var c,l,h;var f;if((f=GM.pdh.PdhCollectQueryData(k.cpu.Deref()).Val!=0)){k._rej(f);return}if((f=GM.pdh.PdhGetFormattedCounterArrayA(k.cpuTotal.Deref(),PDH_FMT_DOUBLE,d,j,0).Val)==-2147481646){c=GM.CreateVariable(d.toBuffer().readUInt32LE())}else{k._rej(f);return}if((f=GM.pdh.PdhGetFormattedCounterArrayA(k.cpuTotal.Deref(),PDH_FMT_DOUBLE,d,j,c).Val)!=0){k._rej(f);return}for(var g=0;g0){var f=c[0].split(":")[1];var a=f.split(",");var e=parseFloat(a[0].split("%")[0].trim())+parseFloat(a[1].split("%")[0].trim());d._res({total:e,cpus:[]})}else{d._rej("parse error")}return(d)}function macos_memUtilization(){var d={};var e=new promise(function(h,g){this._res=h;this._rej=g});var b=require("child_process").execFile("/bin/sh",["sh"]);b.stdout.str="";b.stdout.on("data",function(g){this.str+=g.toString()});b.stdin.write('top -l 1 | grep -E "^Phys"\nexit\n');b.waitExit();var c=b.stdout.str.split("\n");if(c[0].length>0){var f=c[0].split(":")[1];var a=f.split(",");d.MemTotal=parseInt(a[0].trim().split(" ")[0]);d.MemFree=parseInt(a[1].trim().split(" ")[0]);d.percentFree=((d.MemFree/d.MemTotal)*100);d.percentConsumed=(((d.MemTotal-d.MemFree)/d.MemTotal)*100);return(d)}else{throw ("Parse Error")}}switch(process.platform){case"linux":module.exports={cpuUtilization:linux_cpuUtilization,memUtilization:linux_memUtilization};break;case"win32":module.exports={cpuUtilization:windows_cpuUtilization,memUtilization:windows_memUtilization};break;case"darwin":module.exports={cpuUtilization:macos_cpuUtilization,memUtilization:macos_memUtilization};break}; \ No newline at end of file diff --git a/agents/modules_meshcore_min/wifi-scanner-windows.min.js b/agents/modules_meshcore_min/wifi-scanner-windows.min.js deleted file mode 100644 index 752e15ac..00000000 --- a/agents/modules_meshcore_min/wifi-scanner-windows.min.js +++ /dev/null @@ -1 +0,0 @@ -function _Scan(){var f=this.Marshal.CreatePointer();this.Native.WlanEnumInterfaces(this.Handle,0,f);var a=f.Deref().Deref(0,4).toBuffer().readUInt32LE(0);var d=f.Deref().Deref(8,532);var c=d.Deref(16,512).AnsiString;var e;switch(d.Deref(528,4).toBuffer().readUInt32LE(0)){case 0:e="NOT READY";break;case 1:e="CONNECTED";break;case 2:e="AD-HOC";break;case 3:e="DISCONNECTING";break;case 4:e="DISCONNECTED";break;case 5:e="ASSOCIATING";break;case 6:e="DISCOVERING";break;case 7:e="AUTHENTICATING";break;default:e="UNKNOWN";break}var b=d.Deref(0,16);if(this.Native.WlanScan(this.Handle,b,0,0,0).Val==0){return(true)}else{return(false)}}function AccessPoint(d,a,c,b){this.ssid=d;this.bssid=a;this.rssi=c;this.lq=b}AccessPoint.prototype.toString=function(){return(this.ssid+" ["+this.bssid+"]: "+this.lq)};function OnNotify(g){var h=g.Deref(0,4).toBuffer().readUInt32LE(0);var f=g.Deref(4,4).toBuffer().readUInt32LE(0);var c=g.Deref(8,16);if((h&8)&&(f==7)){var a=this.Parent.Marshal.CreatePointer();var k=this.Parent.Native.GetBSSList(this.Parent.Handle,c,0,3,0,0,a).Val;if(k==0){var n=a.Deref().Deref(0,4).toBuffer().readUInt32LE(0);var j=a.Deref().Deref(4,4).toBuffer().readUInt32LE(0);for(i=0;i"){g=""}}if(j.startsWith("Signal level=")){f=j.slice(13,j.length-4)}else{if(j.startsWith("Quality=")){f=j.slice(8,10);var k=j.slice(11,13)}}}this.parent.parent.emit("accessPoint",new AccessPoint(g,e,f))}})}}}}}module.exports=WiFiScanner; \ No newline at end of file diff --git a/agents/modules_meshcore_min/win-console.min.js b/agents/modules_meshcore_min/win-console.min.js deleted file mode 100644 index e2197744..00000000 --- a/agents/modules_meshcore_min/win-console.min.js +++ /dev/null @@ -1 +0,0 @@ -var TrayIconFlags={NIF_MESSAGE:1,NIF_ICON:2,NIF_TIP:4,NIF_STATE:8,NIF_INFO:16,NIF_GUID:32,NIF_REALTIME:64,NIF_SHOWTIP:128,NIM_ADD:0,NIM_MODIFY:1,NIM_DELETE:2,NIM_SETFOCUS:3,NIM_SETVERSION:4};var NOTIFYICON_VERSION_4=4;var MessageTypes={WM_APP:32768,WM_USER:1024};function WindowsConsole(){if(process.platform=="win32"){this._ObjectID="win-console";this._Marshal=require("_GenericMarshal");this._kernel32=this._Marshal.CreateNativeProxy("kernel32.dll");this._user32=this._Marshal.CreateNativeProxy("user32.dll");this._kernel32.CreateMethod("GetConsoleWindow");this._kernel32.CreateMethod("GetCurrentThread");this._user32.CreateMethod("ShowWindow");this._user32.CreateMethod("LoadImageA");this._user32.CreateMethod({method:"GetMessageA",threadDispatch:1});this._shell32=this._Marshal.CreateNativeProxy("Shell32.dll");this._shell32.CreateMethod("Shell_NotifyIconA");this._handle=this._kernel32.GetConsoleWindow();this.minimize=function(){this._user32.ShowWindow(this._handle,6)};this.restore=function(){this._user32.ShowWindow(this._handle,9)};this.hide=function(){this._user32.ShowWindow(this._handle,0)};this.show=function(){this._user32.ShowWindow(this._handle,5)};this._loadicon=function(c){var b=this._user32.LoadImageA(0,this._Marshal.CreateVariable(c),1,0,0,16|32768|64);return(b)};this.SetTrayIcon=function a(h){var b=this._Marshal.CreateVariable(this._Marshal.PointerSize==4?508:528);b.toBuffer().writeUInt32LE(b._size,0);var n=TrayIconFlags.NIF_TIP|TrayIconFlags.NIF_MESSAGE;h.filter=MessageTypes.WM_APP+1;b.Deref(this._Marshal.PointerSize==4?16:24,4).toBuffer().writeUInt32LE(h.filter);if(!h.noBalloon){n|=TrayIconFlags.NIF_INFO}if(h.icon){n|=TrayIconFlags.NIF_ICON;var c=b.Deref(this._Marshal.PointerSize==4?20:32,this._Marshal.PointerSize);h.icon.pointerBuffer().copy(c.toBuffer())}b.Deref(this._Marshal.PointerSize*2,4).toBuffer().writeUInt32LE(1);b.Deref(this._Marshal.PointerSize==4?12:20,4).toBuffer().writeUInt32LE(n);b.Deref(this._Marshal.PointerSize==4?416:432,4).toBuffer().writeUInt32LE(NOTIFYICON_VERSION_4);var m=b.Deref(this._Marshal.PointerSize==4?24:40,128);var k=b.Deref(this._Marshal.PointerSize==4?160:176,256);var l=b.Deref(this._Marshal.PointerSize==4?420:436,64);if(h.szTip){Buffer.from(h.szTip).copy(m.toBuffer())}if(h.szInfo){Buffer.from(h.szInfo).copy(k.toBuffer())}if(h.szInfoTitle){Buffer.from(h.szInfoTitle).copy(l.toBuffer())}var d=require("win-message-pump");retVal={_ObjectID:"WindowsConsole.TrayIcon",MessagePump:new d(h)};var j=require("events").inherits(retVal);j.createEvent("ToastClicked");j.createEvent("IconHover");j.createEvent("ToastDismissed");retVal.Options=h;retVal.MessagePump.TrayIcon=retVal;retVal.MessagePump.NotifyData=b;retVal.MessagePump.WindowsConsole=this;retVal.MessagePump.on("exit",function e(o){console.log("Pump Exited");if(this.TrayIcon){this.TrayIcon.remove()}});retVal.MessagePump.on("hwnd",function f(o){h.hwnd=o;o.pointerBuffer().copy(this.NotifyData.Deref(this.WindowsConsole._Marshal.PointerSize,this.WindowsConsole._Marshal.PointerSize).toBuffer());if(this.WindowsConsole._shell32.Shell_NotifyIconA(TrayIconFlags.NIM_ADD,this.NotifyData).Val==0){}});retVal.MessagePump.on("message",function g(p){if(p.message==this.TrayIcon.Options.filter){var o=false;if(p.wparam==1&&p.lparam==1029){this.TrayIcon.emit("ToastClicked");o=true}if(p.wparam==1&&p.lparam==512){this.TrayIcon.emit("IconHover");o=true}if(this.TrayIcon.Options.balloonOnly&&p.wparam==1&&(p.lparam==1028||p.lparam==1029)){this.TrayIcon.emit("ToastDismissed");this.TrayIcon.remove();o=true}}});retVal.remove=function i(){this.MessagePump.WindowsConsole._shell32.Shell_NotifyIconA(TrayIconFlags.NIM_DELETE,this.MessagePump.NotifyData);this.MessagePump.stop();delete this.MessagePump.TrayIcon;delete this.MessagePump};return(retVal)}}}module.exports=new WindowsConsole(); \ No newline at end of file diff --git a/agents/modules_meshcore_min/win-info.min.js b/agents/modules_meshcore_min/win-info.min.js deleted file mode 100644 index ef3c8e5f..00000000 --- a/agents/modules_meshcore_min/win-info.min.js +++ /dev/null @@ -1 +0,0 @@ -var promise=require("promise");function qfe(){var a=require("child_process").execFile(process.env.windir+"\\System32\\wbem\\wmic.exe",["wmic","qfe","list","full","/FORMAT:CSV"]);a.stdout.str="";a.stdout.on("data",function(i){this.str+=i.toString()});a.stderr.str="";a.stderr.on("data",function(i){this.str+=i.toString()});a.waitExit();var e=a.stdout.str.trim().split("\r\n");var d=e[0].split(",");var b,c;var h;var g=[];for(b=1;b0){n=this.chunk.shift();this.terminal._WriteBuffer(n);n.flush()}})}else{this.terminal._WriteBuffer(l);m()}return(true)},"final":function(l){var m=this.terminal._stop();m.__flush=l;m.then(function(){this.__flush()})}});this._stream.terminal=this;this._stream._promise=new promise(function(m,l){this._res=m;this._rej=l});this._stream._promise.terminal=this;this._stream.prependOnceListener("end",function(){this.terminal._stream=null});return(this._stream)};this.Start=function d(h,g){return(this.StartEx(h,g,process.env.windir+"\\System32\\cmd.exe"))};this.StartPowerShell=function f(h,g){if(require("os").arch()=="x64"){return(this.StartEx(h,g,process.env.windir+"\\SysWow64\\WindowsPowerShell\\v1.0\\powershell.exe"))}else{return(this.StartEx(h,g,process.env.windir+"\\System32\\WindowsPowerShell\\v1.0\\powershell.exe"))}};this._stop=function(){if(this.stopping){return(this.stopping)}this._ConsoleWinEventProc.removeAllListeners("GlobalCallback");this.stopping=new promise(function(i,h){this._res=i;this._rej=h});var g=this._kernel32.GetThreadId(this._user32.SetWinEventHook.async.thread()).Val;this._user32.PostThreadMessageA(g,WM_QUIT,0,0);this._stream.emit("end");return(this.stopping)};this._hookThread=function(){var i=new promise(function(k,j){this._res=k;this._rej=j});i.userArgs=[];for(var g in arguments){i.userArgs.push(arguments[g])}i.terminal=this;this._ConsoleWinEventProc=GM.GetGenericGlobalCallback(7);this._ConsoleWinEventProc.terminal=this;var h=this._user32.SetWinEventHook.async(EVENT_CONSOLE_CARET,EVENT_CONSOLE_END_APPLICATION,0,this._ConsoleWinEventProc,0,0,WINEVENT_OUTOFCONTEXT|WINEVENT_SKIPOWNPROCESS);h.ready=i;h.terminal=this;h.then(function(j){if(j.Val==0){this.ready._rej("Error calling SetWinEventHook")}else{this.terminal.hwinEventHook=j;this.ready._res();this.terminal._GetMessage()}});this._ConsoleWinEventProc.on("GlobalCallback",function(l,k,m,p,n,o,r){if(!this.terminal.hwinEventHook||this.terminal.hwinEventHook.Val!=l.Val){return}var j=null;switch(k.Val){case EVENT_CONSOLE_CARET:break;case EVENT_CONSOLE_UPDATE_REGION:if(!this.terminal.connected){this.terminal.connected=true;this.terminal._stream._promise._res()}if(this.terminal._scrollTimer==null){j=this.terminal._GetScreenBuffer(LOWORD(p.Val),HIWORD(p.Val),LOWORD(n.Val),HIWORD(n.Val));this.terminal._SendDataBuffer(j)}break;case EVENT_CONSOLE_UPDATE_SIMPLE:var q={data:[Buffer.alloc(1,LOWORD(n.Val))],attributes:[HIWORD(n.Val)],width:1,height:1,x:LOWORD(p.Val),y:HIWORD(p.Val)};this.terminal._SendDataBuffer(q);break;case EVENT_CONSOLE_UPDATE_SCROLL:this.terminal._SendScroll(p.Val,n.Val);break;case EVENT_CONSOLE_LAYOUT:break;case EVENT_CONSOLE_START_APPLICATION:break;case EVENT_CONSOLE_END_APPLICATION:if(p.Val==this.terminal._hProcessID){this.terminal._hProcess=null;this.terminal._stop().then(function(){console.log("STOPPED")})}break;default:console.log("Unknown event: "+k.Val);break}});return(i)};this._GetMessage=function(){if(this._user32.abort){console.log("aborting loop");return}this._user32.GetMessageA.async(this._user32.SetWinEventHook.async,MSG,0,0,0).then(function(g){if(g.Val!=0){if(g.Val==-1){}else{this.nativeProxy._user32.TranslateMessage.async(this.nativeProxy.user32.SetWinEventHook.async,MSG).then(function(){this.nativeProxy._user32.DispatchMessageA.async(this.nativeProxy.user32.SetWinEventHook.async,MSG).then(function(){this.nativeProxy.terminal._GetMessage()},console.log)},console.log)}}else{this.nativeProxy.UnhookWinEvent.async(this.nativeProxy.terminal._user32.SetWinEventHook.async,this.nativeProxy.terminal.hwinEventHook).then(function(){if(this.nativeProxy.terminal._hProcess==null){return}this.nativeProxy.terminal.stopping._res();if(this.nativeProxy.terminal._kernel32.TerminateProcess(this.nativeProxy.terminal._hProcess,1067).Val==0){var h=this.nativeProxy.terminal._kernel32.GetLastError().Val;console.log("Unable to kill Terminal Process, error: "+h)}this.nativeProxy.terminal.stopping=null},function(h){console.log("REJECTED_UnhookWinEvent: "+h)})}},function(g){console.log("REJECTED_GETMessage: "+g)})};this._WriteBuffer=function(g){for(var h=0;hm;++k){this._stream.push(Buffer.from("\r\n"))}var g=this._GetScreenBuffer(0,0,n-1,m-1);this._SendDataBuffer(g);this._scrollTimer=setTimeout(function(q,p,o){var i=q._GetScreenBuffer(0,0,p-1,o-1);q._SendDataBuffer(i);q._scrollTimer=null},250,this,n,m)};this.StartCommand=function e(g){if(this._kernel32.CreateProcessA(GM.CreateVariable(g),0,0,0,1,CREATE_NEW_PROCESS_GROUP,0,0,si,pi).Val==0){console.log("Error Spawning CMD");return}this._kernel32.CloseHandle(pi.Deref(GM.PointerSize,GM.PointerSize).Deref());this._hProcess=pi.Deref(0,GM.PointerSize).Deref();this._hProcessID=pi.Deref(GM.PointerSize==4?8:16,4).toBuffer().readUInt32LE()}}function LOWORD(a){return(a&65535)}function HIWORD(a){return((a>>16)&65535)}function GetEsc(b,a){return(Buffer.from("\x1B["+a.join(";")+b))}function MeshConsole(a){require("MeshAgent").SendCommand({action:"msg",type:"console",value:JSON.stringify(a)})}function TranslateLine(r,s,f,a){var m,l,e,q,j,c,n,k,d,p,h,b,g=[],o=[GetEsc("H",[s,r])];if(typeof a=="number"){a=[a]}for(m=0;m>2);d=(a[m]&112)>>4;d=((d&1)<<2)+(d&2)+((d&4)>>2);p=(a[m]&16384);h=(a[m]&8)>>3;b=(a[m]&128);if(p!=q){if(p!=0){g.push(7)}else{g.push(0);l=7;e=0;j=0;c=0}q=p}if(k!=l){g.push(k+30);l=k}if(d!=e){g.push(d+40);e=d}if(h!=j){g.push(2-h);j=h}if(b!=c){if(b==0){g.push(e+40)}else{g.push(e+100);c=b}}if(g.length>0){o.push(GetEsc("m",g));g=[]}n=a[m]}o.push(Buffer.from(String.fromCharCode(f[m])))}return Buffer.concat(o)}module.exports=new windows_terminal(); \ No newline at end of file diff --git a/agents/modules_meshcore_min/win-virtual-terminal.min.js b/agents/modules_meshcore_min/win-virtual-terminal.min.js deleted file mode 100644 index ccf58575..00000000 --- a/agents/modules_meshcore_min/win-virtual-terminal.min.js +++ /dev/null @@ -1 +0,0 @@ -var PROC_THREAD_ATTRIBUTE_PSEUDOCONSOLE=131094;var EXTENDED_STARTUPINFO_PRESENT=524288;var HEAP_ZERO_MEMORY=8;var duplex=require("stream").Duplex;function vt(){this._ObjectID="win-virtual-terminal";Object.defineProperty(this,"supported",{value:(function(){var f=require("_GenericMarshal");var g=f.CreateNativeProxy("kernel32.dll");try{g.CreateMethod("CreatePseudoConsole")}catch(d){return(false)}return(true)})()});this.Create=function a(k,o,i){if(!this.supported){throw ("This build of Windows does not have support for PseudoConsoles")}if(!o){o=80}if(!i){i=25}var h=require("_GenericMarshal");var j=h.CreateNativeProxy("kernel32.dll");j.CreateMethod("CreatePipe");j.CreateMethod("CreateProcessW");j.CreateMethod("CreatePseudoConsole");j.CreateMethod("GetProcessHeap");j.CreateMethod("HeapAlloc");j.CreateMethod("InitializeProcThreadAttributeList");j.CreateMethod("UpdateProcThreadAttribute");j.CreateMethod("WriteFile");j.CreateMethod("ReadFile");j.CreateMethod("TerminateProcess");var m={_h:h.CreatePointer(),_consoleInput:h.CreatePointer(),_consoleOutput:h.CreatePointer(),_input:h.CreatePointer(),_output:h.CreatePointer(),k32:j};var f=h.CreateVariable(8);var e;var l=h.CreateVariable(h.PointerSize==4?16:24);if(j.CreatePipe(m._consoleInput,m._input,0,0).Val==0){console.log("PIPE/FAIL")}if(j.CreatePipe(m._output,m._consoleOutput,0,0).Val==0){console.log("PIPE/FAIL")}if(j.CreatePseudoConsole((i<<16)|o,m._consoleInput.Deref(),m._consoleOutput.Deref(),0,m._h).Val!=0){throw ("Error calling CreatePseudoConsole()")}j.InitializeProcThreadAttributeList(0,1,0,f);e=h.CreateVariable(f.toBuffer().readUInt32LE());var n=h.CreateVariable(h.PointerSize==8?112:72);n.toBuffer().writeUInt32LE(h.PointerSize==8?112:72,0);e.pointerBuffer().copy(n.Deref(h.PointerSize==8?104:68,h.PointerSize).toBuffer());if(j.InitializeProcThreadAttributeList(e,1,0,f).Val!=0){if(j.UpdateProcThreadAttribute(e,0,PROC_THREAD_ATTRIBUTE_PSEUDOCONSOLE,m._h.Deref(),h.PointerSize,0,0).Val!=0){if(j.CreateProcessW(0,h.CreateVariable(k,{wide:true}),0,0,1,EXTENDED_STARTUPINFO_PRESENT,0,0,n,l).Val!=0){m._startupinfoex=n;m._process=l.Deref(0);m._pid=l.Deref(h.PointerSize==4?8:16,4).toBuffer().readUInt32LE();var g=new duplex({write:function(p,q){var r=require("_GenericMarshal").CreateVariable(4);this.terminal.k32.WriteFile(this.terminal._input.Deref(),require("_GenericMarshal").CreateVariable(p),p.length,r,0);q();return(true)},"final":function(p){if(this.terminal._process){this.terminal.k32.TerminateProcess(this.terminal._process,0);this.terminal._process=null;this.terminal.k32.ReadFile.async.abort()}p()}});m._waiter=require("DescriptorEvents").addDescriptor(l.Deref(0));m._waiter.ds=g;m._waiter.on("signaled",function(){this.ds.push(null)});g.terminal=m;g._rpbuf=h.CreateVariable(4096);g._rpbufRead=h.CreateVariable(4);g.__read=function d(){this._rp=this.terminal.k32.ReadFile.async(this.terminal._output.Deref(),this._rpbuf,this._rpbuf._size,this._rpbufRead,0);this._rp.then(function(){var p=this.parent._rpbufRead.toBuffer().readUInt32LE();this.parent.push(this.parent._rpbuf.toBuffer().slice(0,p));this.parent.__read()});this._rp.parent=this};g.__read();return(g)}else{console.log("FAILED!")}}}throw ("Internal Error")};this.PowerShellCapable=function(){if(require("os").arch()=="x64"){return(require("fs").existsSync(process.env.windir+"\\SysWow64\\WindowsPowerShell\\v1.0\\powershell.exe"))}else{return(require("fs").existsSync(process.env.windir+"\\System32\\WindowsPowerShell\\v1.0\\powershell.exe"))}};this.Start=function b(e,d){return(this.Create(process.env.windir+"\\System32\\cmd.exe",e,d))};this.StartPowerShell=function c(e,d){if(require("os").arch()=="x64"){return(this.Create(process.env.windir+"\\SysWow64\\WindowsPowerShell\\v1.0\\powershell.exe",e,d))}else{return(this.Create(process.env.windir+"\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",e,d))}}}if(process.platform=="win32"){module.exports=new vt()}; \ No newline at end of file