yolkbot 1.3.3 → 1.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,7 +5,7 @@ ${a}: ${c}`).join("")+`\r
5
5
  \r
6
6
  `))){if(!Q.includes("101 Switching Protocols")){this.$emit("error",new Error("WebSocket handshake failed")),this.close();return}this.readyState=L.OPEN,this.$emit("open");let c=a.slice(a.indexOf(`\r
7
7
  \r
8
- `)+4);c.length>0&&this.$readFrame(c),this.$socket.on("data",r=>this.$readFrame(r)),this.$socket.on("close",()=>this.$emit("close")),this.$socket.on("error",r=>this.$emit("error",r))}})}catch(i){console.error(i),this.$emit("error",i),this.close()}}$readFrame(A){let t=0;for(;t<A.length;){if(t+2>A.length)return;let e=A[t++],i=e&15,I=(e&64)!==0,g=A[t++],o=(g&128)!==0,n=g&127;if(n===126){if(t+2>A.length)return;n=A.readUInt16BE(t),t+=2}else if(n===127){if(t+8>A.length)return;n=Number(A.readBigUInt64BE(t)),t+=8}let C;if(o){if(t+4>A.length)return;C=A.slice(t,t+4),t+=4}if(t+n>A.length)return;let Q=A.slice(t,t+n);if(t+=n,o&&C&&(Q=Buffer.from(Q.map((a,c)=>a^C[c%4]))),(i===1||i===2)&&this.$connectionHeaders["sec-websocket-extensions"].includes("permessage-deflate")&&I)yt.inflateRaw(Q,(a,c)=>{if(a)return this.$emit("error",a);if(i===1)this.$emit("message",{data:c.toString()});else{let r;this.binaryType==="arraybuffer"?r=c.buffer.slice(c.byteOffset,c.byteOffset+c.byteLength):r=c,this.$emit("message",{data:r})}});else if(i===1)this.$emit("message",{data:Q.toString()});else if(i===2){let a;this.binaryType==="arraybuffer"?a=Q.buffer.slice(Q.byteOffset,Q.byteOffset+Q.byteLength):a=Q,this.$emit("message",{data:a})}else if(i===8){let a,c;Q.length>=2&&(a=Q.readUInt16BE(0),c=Q.slice(2).toString()),this.$emit("close",{code:a,reason:c}),this.readyState===WebSocket.CLOSING?(this.$socket.end(),this.readyState=WebSocket.CLOSED):this.close(a,c)}else i===9?(this.pong(Q),this.$emit("ping",{data:Q})):i===10&&this.$emit("pong",{data:Q})}}ping(A=""){if(this.readyState!==L.OPEN)throw new Error("WebSocket not open");let t=Buffer.from(A),e=Buffer.alloc(2);e[0]=137,e[1]=t.length|128;let i=W.randomBytes(4),I=Buffer.from(t.map((g,o)=>g^i[o%4]));this.$socket.write(Buffer.concat([e,i,I]))}pong(A=""){if(this.readyState!==L.OPEN)throw new Error("WebSocket not open");let t=Buffer.from(A),e=Buffer.alloc(2);e[0]=138,e[1]=t.length|128;let i=W.randomBytes(4),I=Buffer.from(t.map((g,o)=>g^i[o%4]));this.$socket.write(Buffer.concat([e,i,I]))}send(A){if(this.readyState!==1)throw new Error("WebSocket not open");let t=Buffer.from(A),e=typeof A=="string",i=e?1:2,I=this.$perMessageDeflate&&e,g=j((o,n=!1)=>{let C=Buffer.alloc(2);C[0]=128|(n?64:0)|i,o.length<126?C[1]=o.length|128:o.length<65536?(C=Buffer.alloc(4),C[0]=128|(n?64:0)|i,C[1]=254,C.writeUInt16BE(o.length,2)):(C=Buffer.alloc(10),C[0]=128|(n?64:0)|i,C[1]=255,C.writeBigUInt64BE(BigInt(o.length),2));let Q=W.randomBytes(4),a=Buffer.from(o.map((c,r)=>c^Q[r%4]));this.$socket.write(Buffer.concat([C,Q,a]))},"sendFrame");I?yt.deflateRaw(t,(o,n)=>{if(o){this.$emit("error",o);return}g(n,!0)}):g(t,!1)}close(A,t){if(this.readyState!==L.CLOSING&&(this.readyState=L.CLOSING,this.$socket)){let e;A?(e=Buffer.alloc(2+(t?Buffer.byteLength(t):0)),e.writeUInt16BE(A,0),t&&e.write(t,2)):e=Buffer.alloc(0);let i=Buffer.alloc(2);i[0]=136,i[1]=e.length|128;let I=W.randomBytes(4),g=Buffer.from(e.map((o,n)=>o^I[n%4]));this.$socket.write(Buffer.concat([i,I,g]))}}addEventListener(A,t){this.$listeners[A]&&this.$listeners[A].push(t)}removeEventListener(A,t){this.$listeners[A]&&(this.$listeners[A]=this.$listeners[A].filter(e=>e!==t))}$emit(A,t){A==="message"&&typeof this.onmessage=="function"&&this.onmessage(t),A==="close"&&typeof this.onclose=="function"&&this.onclose(t),A==="error"&&typeof this.onerror=="function"&&this.onerror(t),A==="open"&&typeof this.onopen=="function"&&this.onopen(t),this.$listeners[A].forEach(e=>e(t))}},pt=ye,pe=pt});import dt from"node:dns";import lt from"node:net";import wt from"node:tls";var Qe=B=>{if(!B)return null;let A=new URL(B);return{host:A.hostname,port:parseInt(A.port),user:A.username,pass:A.password,remoteResolve:A.protocol==="socks5h:"}},kA=(B,{method:A,pathname:t,destHost:e,destPort:i,headers:I,body:g},o)=>{let n="";for(let[a,c]of Object.entries(I))n+=`${a}: ${c}\r
8
+ `)+4);c.length>0&&this.$readFrame(c),this.$socket.on("data",r=>this.$readFrame(r)),this.$socket.on("close",()=>this.$emit("close")),this.$socket.on("error",r=>this.$emit("error",r))}})}catch(i){console.error(i),this.$emit("error",i),this.close()}}$readFrame(A){let t=0;for(;t<A.length;){if(t+2>A.length)return;let e=A[t++],i=e&15,I=(e&64)!==0,g=A[t++],o=(g&128)!==0,n=g&127;if(n===126){if(t+2>A.length)return;n=A.readUInt16BE(t),t+=2}else if(n===127){if(t+8>A.length)return;n=Number(A.readBigUInt64BE(t)),t+=8}let C;if(o){if(t+4>A.length)return;C=A.slice(t,t+4),t+=4}if(t+n>A.length)return;let Q=A.slice(t,t+n);if(t+=n,o&&C&&(Q=Buffer.from(Q.map((a,c)=>a^C[c%4]))),(i===1||i===2)&&this.$connectionHeaders["sec-websocket-extensions"]?.includes?.("permessage-deflate")&&I)yt.inflateRaw(Q,(a,c)=>{if(a)return this.$emit("error",a);if(i===1)this.$emit("message",{data:c.toString()});else{let r;this.binaryType==="arraybuffer"?r=c.buffer.slice(c.byteOffset,c.byteOffset+c.byteLength):r=c,this.$emit("message",{data:r})}});else if(i===1)this.$emit("message",{data:Q.toString()});else if(i===2){let a;this.binaryType==="arraybuffer"?a=Q.buffer.slice(Q.byteOffset,Q.byteOffset+Q.byteLength):a=Q,this.$emit("message",{data:a})}else if(i===8){let a,c;Q.length>=2&&(a=Q.readUInt16BE(0),c=Q.slice(2).toString()),this.$emit("close",{code:a,reason:c}),this.readyState===WebSocket.CLOSING?(this.$socket.end(),this.readyState=WebSocket.CLOSED):this.close(a,c)}else i===9?(this.pong(Q),this.$emit("ping",{data:Q})):i===10&&this.$emit("pong",{data:Q})}}ping(A=""){if(this.readyState!==L.OPEN)throw new Error("WebSocket not open");let t=Buffer.from(A),e=Buffer.alloc(2);e[0]=137,e[1]=t.length|128;let i=W.randomBytes(4),I=Buffer.from(t.map((g,o)=>g^i[o%4]));this.$socket.write(Buffer.concat([e,i,I]))}pong(A=""){if(this.readyState!==L.OPEN)throw new Error("WebSocket not open");let t=Buffer.from(A),e=Buffer.alloc(2);e[0]=138,e[1]=t.length|128;let i=W.randomBytes(4),I=Buffer.from(t.map((g,o)=>g^i[o%4]));this.$socket.write(Buffer.concat([e,i,I]))}send(A){if(this.readyState!==1)throw new Error("WebSocket not open");let t=Buffer.from(A),e=typeof A=="string",i=e?1:2,I=this.$perMessageDeflate&&e,g=j((o,n=!1)=>{let C=Buffer.alloc(2);C[0]=128|(n?64:0)|i,o.length<126?C[1]=o.length|128:o.length<65536?(C=Buffer.alloc(4),C[0]=128|(n?64:0)|i,C[1]=254,C.writeUInt16BE(o.length,2)):(C=Buffer.alloc(10),C[0]=128|(n?64:0)|i,C[1]=255,C.writeBigUInt64BE(BigInt(o.length),2));let Q=W.randomBytes(4),a=Buffer.from(o.map((c,r)=>c^Q[r%4]));this.$socket.write(Buffer.concat([C,Q,a]))},"sendFrame");I?yt.deflateRaw(t,(o,n)=>{if(o){this.$emit("error",o);return}g(n,!0)}):g(t,!1)}close(A,t){if(this.readyState!==L.CLOSING&&(this.readyState=L.CLOSING,this.$socket)){let e;A?(e=Buffer.alloc(2+(t?Buffer.byteLength(t):0)),e.writeUInt16BE(A,0),t&&e.write(t,2)):e=Buffer.alloc(0);let i=Buffer.alloc(2);i[0]=136,i[1]=e.length|128;let I=W.randomBytes(4),g=Buffer.from(e.map((o,n)=>o^I[n%4]));this.$socket.write(Buffer.concat([i,I,g]))}}addEventListener(A,t){this.$listeners[A]&&this.$listeners[A].push(t)}removeEventListener(A,t){this.$listeners[A]&&(this.$listeners[A]=this.$listeners[A].filter(e=>e!==t))}$emit(A,t){A==="message"&&typeof this.onmessage=="function"&&this.onmessage(t),A==="close"&&typeof this.onclose=="function"&&this.onclose(t),A==="error"&&typeof this.onerror=="function"&&this.onerror(t),A==="open"&&typeof this.onopen=="function"&&this.onopen(t),this.$listeners[A].forEach(e=>e(t))}},pt=ye,pe=pt});import dt from"node:dns";import lt from"node:net";import wt from"node:tls";var Qe=B=>{if(!B)return null;let A=new URL(B);return{host:A.hostname,port:parseInt(A.port),user:A.username,pass:A.password,remoteResolve:A.protocol==="socks5h:"}},kA=(B,{method:A,pathname:t,destHost:e,destPort:i,headers:I,body:g},o)=>{let n="";for(let[a,c]of Object.entries(I))n+=`${a}: ${c}\r
9
9
  `;g&&!("Content-Length"in I)&&(n+=`Content-Length: ${Buffer.byteLength(g)}\r
10
10
  `);let C=`${A} ${t} HTTP/1.1\r
11
11
  Host: ${e}${i!==80&&i!==443?":"+i:""}\r
@@ -5,7 +5,7 @@ ${a}: ${c}`).join("")+`\r
5
5
  \r
6
6
  `))){if(!Q.includes("101 Switching Protocols")){this.$emit("error",new Error("WebSocket handshake failed")),this.close();return}this.readyState=L.OPEN,this.$emit("open");let c=a.slice(a.indexOf(`\r
7
7
  \r
8
- `)+4);c.length>0&&this.$readFrame(c),this.$socket.on("data",r=>this.$readFrame(r)),this.$socket.on("close",()=>this.$emit("close")),this.$socket.on("error",r=>this.$emit("error",r))}})}catch(i){console.error(i),this.$emit("error",i),this.close()}}$readFrame(A){let t=0;for(;t<A.length;){if(t+2>A.length)return;let e=A[t++],i=e&15,I=(e&64)!==0,g=A[t++],o=(g&128)!==0,n=g&127;if(n===126){if(t+2>A.length)return;n=A.readUInt16BE(t),t+=2}else if(n===127){if(t+8>A.length)return;n=Number(A.readBigUInt64BE(t)),t+=8}let C;if(o){if(t+4>A.length)return;C=A.slice(t,t+4),t+=4}if(t+n>A.length)return;let Q=A.slice(t,t+n);if(t+=n,o&&C&&(Q=Buffer.from(Q.map((a,c)=>a^C[c%4]))),(i===1||i===2)&&this.$connectionHeaders["sec-websocket-extensions"].includes("permessage-deflate")&&I)lt.inflateRaw(Q,(a,c)=>{if(a)return this.$emit("error",a);if(i===1)this.$emit("message",{data:c.toString()});else{let r;this.binaryType==="arraybuffer"?r=c.buffer.slice(c.byteOffset,c.byteOffset+c.byteLength):r=c,this.$emit("message",{data:r})}});else if(i===1)this.$emit("message",{data:Q.toString()});else if(i===2){let a;this.binaryType==="arraybuffer"?a=Q.buffer.slice(Q.byteOffset,Q.byteOffset+Q.byteLength):a=Q,this.$emit("message",{data:a})}else if(i===8){let a,c;Q.length>=2&&(a=Q.readUInt16BE(0),c=Q.slice(2).toString()),this.$emit("close",{code:a,reason:c}),this.readyState===WebSocket.CLOSING?(this.$socket.end(),this.readyState=WebSocket.CLOSED):this.close(a,c)}else i===9?(this.pong(Q),this.$emit("ping",{data:Q})):i===10&&this.$emit("pong",{data:Q})}}ping(A=""){if(this.readyState!==L.OPEN)throw new Error("WebSocket not open");let t=Buffer.from(A),e=Buffer.alloc(2);e[0]=137,e[1]=t.length|128;let i=W.randomBytes(4),I=Buffer.from(t.map((g,o)=>g^i[o%4]));this.$socket.write(Buffer.concat([e,i,I]))}pong(A=""){if(this.readyState!==L.OPEN)throw new Error("WebSocket not open");let t=Buffer.from(A),e=Buffer.alloc(2);e[0]=138,e[1]=t.length|128;let i=W.randomBytes(4),I=Buffer.from(t.map((g,o)=>g^i[o%4]));this.$socket.write(Buffer.concat([e,i,I]))}send(A){if(this.readyState!==1)throw new Error("WebSocket not open");let t=Buffer.from(A),e=typeof A=="string",i=e?1:2,I=this.$perMessageDeflate&&e,g=j((o,n=!1)=>{let C=Buffer.alloc(2);C[0]=128|(n?64:0)|i,o.length<126?C[1]=o.length|128:o.length<65536?(C=Buffer.alloc(4),C[0]=128|(n?64:0)|i,C[1]=254,C.writeUInt16BE(o.length,2)):(C=Buffer.alloc(10),C[0]=128|(n?64:0)|i,C[1]=255,C.writeBigUInt64BE(BigInt(o.length),2));let Q=W.randomBytes(4),a=Buffer.from(o.map((c,r)=>c^Q[r%4]));this.$socket.write(Buffer.concat([C,Q,a]))},"sendFrame");I?lt.deflateRaw(t,(o,n)=>{if(o){this.$emit("error",o);return}g(n,!0)}):g(t,!1)}close(A,t){if(this.readyState!==L.CLOSING&&(this.readyState=L.CLOSING,this.$socket)){let e;A?(e=Buffer.alloc(2+(t?Buffer.byteLength(t):0)),e.writeUInt16BE(A,0),t&&e.write(t,2)):e=Buffer.alloc(0);let i=Buffer.alloc(2);i[0]=136,i[1]=e.length|128;let I=W.randomBytes(4),g=Buffer.from(e.map((o,n)=>o^I[n%4]));this.$socket.write(Buffer.concat([i,I,g]))}}addEventListener(A,t){this.$listeners[A]&&this.$listeners[A].push(t)}removeEventListener(A,t){this.$listeners[A]&&(this.$listeners[A]=this.$listeners[A].filter(e=>e!==t))}$emit(A,t){A==="message"&&typeof this.onmessage=="function"&&this.onmessage(t),A==="close"&&typeof this.onclose=="function"&&this.onclose(t),A==="error"&&typeof this.onerror=="function"&&this.onerror(t),A==="open"&&typeof this.onopen=="function"&&this.onopen(t),this.$listeners[A].forEach(e=>e(t))}},wt=me,pe=wt});import ct from"node:dns";import rt from"node:net";import ht from"node:tls";var ae=B=>{if(!B)return null;let A=new URL(B);return{host:A.hostname,port:parseInt(A.port),user:A.username,pass:A.password,remoteResolve:A.protocol==="socks5h:"}},DA=(B,{method:A,pathname:t,destHost:e,destPort:i,headers:I,body:g},o)=>{let n="";for(let[a,c]of Object.entries(I))n+=`${a}: ${c}\r
8
+ `)+4);c.length>0&&this.$readFrame(c),this.$socket.on("data",r=>this.$readFrame(r)),this.$socket.on("close",()=>this.$emit("close")),this.$socket.on("error",r=>this.$emit("error",r))}})}catch(i){console.error(i),this.$emit("error",i),this.close()}}$readFrame(A){let t=0;for(;t<A.length;){if(t+2>A.length)return;let e=A[t++],i=e&15,I=(e&64)!==0,g=A[t++],o=(g&128)!==0,n=g&127;if(n===126){if(t+2>A.length)return;n=A.readUInt16BE(t),t+=2}else if(n===127){if(t+8>A.length)return;n=Number(A.readBigUInt64BE(t)),t+=8}let C;if(o){if(t+4>A.length)return;C=A.slice(t,t+4),t+=4}if(t+n>A.length)return;let Q=A.slice(t,t+n);if(t+=n,o&&C&&(Q=Buffer.from(Q.map((a,c)=>a^C[c%4]))),(i===1||i===2)&&this.$connectionHeaders["sec-websocket-extensions"]?.includes?.("permessage-deflate")&&I)lt.inflateRaw(Q,(a,c)=>{if(a)return this.$emit("error",a);if(i===1)this.$emit("message",{data:c.toString()});else{let r;this.binaryType==="arraybuffer"?r=c.buffer.slice(c.byteOffset,c.byteOffset+c.byteLength):r=c,this.$emit("message",{data:r})}});else if(i===1)this.$emit("message",{data:Q.toString()});else if(i===2){let a;this.binaryType==="arraybuffer"?a=Q.buffer.slice(Q.byteOffset,Q.byteOffset+Q.byteLength):a=Q,this.$emit("message",{data:a})}else if(i===8){let a,c;Q.length>=2&&(a=Q.readUInt16BE(0),c=Q.slice(2).toString()),this.$emit("close",{code:a,reason:c}),this.readyState===WebSocket.CLOSING?(this.$socket.end(),this.readyState=WebSocket.CLOSED):this.close(a,c)}else i===9?(this.pong(Q),this.$emit("ping",{data:Q})):i===10&&this.$emit("pong",{data:Q})}}ping(A=""){if(this.readyState!==L.OPEN)throw new Error("WebSocket not open");let t=Buffer.from(A),e=Buffer.alloc(2);e[0]=137,e[1]=t.length|128;let i=W.randomBytes(4),I=Buffer.from(t.map((g,o)=>g^i[o%4]));this.$socket.write(Buffer.concat([e,i,I]))}pong(A=""){if(this.readyState!==L.OPEN)throw new Error("WebSocket not open");let t=Buffer.from(A),e=Buffer.alloc(2);e[0]=138,e[1]=t.length|128;let i=W.randomBytes(4),I=Buffer.from(t.map((g,o)=>g^i[o%4]));this.$socket.write(Buffer.concat([e,i,I]))}send(A){if(this.readyState!==1)throw new Error("WebSocket not open");let t=Buffer.from(A),e=typeof A=="string",i=e?1:2,I=this.$perMessageDeflate&&e,g=j((o,n=!1)=>{let C=Buffer.alloc(2);C[0]=128|(n?64:0)|i,o.length<126?C[1]=o.length|128:o.length<65536?(C=Buffer.alloc(4),C[0]=128|(n?64:0)|i,C[1]=254,C.writeUInt16BE(o.length,2)):(C=Buffer.alloc(10),C[0]=128|(n?64:0)|i,C[1]=255,C.writeBigUInt64BE(BigInt(o.length),2));let Q=W.randomBytes(4),a=Buffer.from(o.map((c,r)=>c^Q[r%4]));this.$socket.write(Buffer.concat([C,Q,a]))},"sendFrame");I?lt.deflateRaw(t,(o,n)=>{if(o){this.$emit("error",o);return}g(n,!0)}):g(t,!1)}close(A,t){if(this.readyState!==L.CLOSING&&(this.readyState=L.CLOSING,this.$socket)){let e;A?(e=Buffer.alloc(2+(t?Buffer.byteLength(t):0)),e.writeUInt16BE(A,0),t&&e.write(t,2)):e=Buffer.alloc(0);let i=Buffer.alloc(2);i[0]=136,i[1]=e.length|128;let I=W.randomBytes(4),g=Buffer.from(e.map((o,n)=>o^I[n%4]));this.$socket.write(Buffer.concat([i,I,g]))}}addEventListener(A,t){this.$listeners[A]&&this.$listeners[A].push(t)}removeEventListener(A,t){this.$listeners[A]&&(this.$listeners[A]=this.$listeners[A].filter(e=>e!==t))}$emit(A,t){A==="message"&&typeof this.onmessage=="function"&&this.onmessage(t),A==="close"&&typeof this.onclose=="function"&&this.onclose(t),A==="error"&&typeof this.onerror=="function"&&this.onerror(t),A==="open"&&typeof this.onopen=="function"&&this.onopen(t),this.$listeners[A].forEach(e=>e(t))}},wt=me,pe=wt});import ct from"node:dns";import rt from"node:net";import ht from"node:tls";var ae=B=>{if(!B)return null;let A=new URL(B);return{host:A.hostname,port:parseInt(A.port),user:A.username,pass:A.password,remoteResolve:A.protocol==="socks5h:"}},DA=(B,{method:A,pathname:t,destHost:e,destPort:i,headers:I,body:g},o)=>{let n="";for(let[a,c]of Object.entries(I))n+=`${a}: ${c}\r
9
9
  `;g&&!("Content-Length"in I)&&(n+=`Content-Length: ${Buffer.byteLength(g)}\r
10
10
  `);let C=`${A} ${t} HTTP/1.1\r
11
11
  Host: ${e}${i!==80&&i!==443?":"+i:""}\r
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "yolkbot",
3
3
  "description": "create a shell shockers bot in under 10 lines.",
4
- "version": "1.3.3",
4
+ "version": "1.3.4",
5
5
  "keywords": [
6
6
  "shell shockers",
7
7
  "shellshock.io",
@@ -125,7 +125,7 @@
125
125
  }
126
126
  },
127
127
  "dependencies": {
128
- "wwws": "^1.0.0"
128
+ "wwws": "^1.0.3"
129
129
  },
130
130
  "devDependencies": {
131
131
  "@stylistic/eslint-plugin": "^4.4.1",