Merge pull request #9 from EffectRenan/master
Fix Improper Input Validation
This commit is contained in:
commit
434fb0ef2e
@ -77,6 +77,14 @@ For major (breaking) changes - **version 4, 3 and 2** - see end of page.
|
||||
|
||||
| Version | Date | Comment |
|
||||
| -------------- | -------------- | -------- |
|
||||
| 5.6.10 | 2021-03-29 | `vboxInfo()` fixed windows bug |
|
||||
| 5.6.9 | 2021-03-28 | `graphics()` fixed nvidia-smi compare bug |
|
||||
| 5.6.8 | 2021-03-22 | typescript definitions fix `wifiInterfces()`, `wifiConnections()` |
|
||||
| 5.6.7 | 2021-03-16 | `inetLatency()` `ineChecksite()` schema validation |
|
||||
| 5.6.6 | 2021-03-16 | code refactoring |
|
||||
| 5.6.5 | 2021-03-15 | `cpuTemperature()` fix (linux) |
|
||||
| 5.6.4 | 2021-03-15 | `sanitizeShellString()` and other security improvements |
|
||||
| 5.6.3 | 2021-03-14 | `sanitizeShellString()` improvement |
|
||||
| 5.6.2 | 2021-03-10 | `networkInterfaces()` `cpu()` improvement (win) |
|
||||
| 5.6.1 | 2021-03-03 | `get()` fixed issue boolean parameters |
|
||||
| 5.6.0 | 2021-03-03 | `cpuTemperature()` added socket and chipset temp (linux) |
|
||||
|
||||
@ -360,9 +360,9 @@ Full function reference with examples can be found at [https://systeminformation
|
||||
| si.fullLoad(cb) | : integer | X | | X | X | | CPU full load since bootup in % |
|
||||
| si.processes(cb) | {...} | X | X | X | X | X | # running processes |
|
||||
| | all | X | X | X | X | X | # of all processes |
|
||||
| | running | X | X | X | X | X | # of all processes running |
|
||||
| | blocked | X | X | X | X | X | # of all processes blocked |
|
||||
| | sleeping | X | X | X | X | X | # of all processes sleeping |
|
||||
| | running | X | X | X | | X | # of all processes running |
|
||||
| | blocked | X | X | X | | X | # of all processes blocked |
|
||||
| | sleeping | X | X | X | | X | # of all processes sleeping |
|
||||
| | unknown | | | | X | | # of all processes unknown status |
|
||||
| | list[] | X | X | X | X | X | list of all processes incl. details |
|
||||
| | ...[0].pid | X | X | X | X | X | process PID |
|
||||
|
||||
@ -56,6 +56,46 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row">5.6.10</th>
|
||||
<td>2021-03-29</td>
|
||||
<td><span class="code">vboxInfo()</span> fixed windows bug</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">5.6.9</th>
|
||||
<td>2021-03-28</td>
|
||||
<td><span class="code">graphics()</span> fixed nvidia-smi compare bug</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">5.6.8</th>
|
||||
<td>2021-03-23</td>
|
||||
<td>typescript definitions fix wifiInterfces, wifiConnections</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">5.6.7</th>
|
||||
<td>2021-03-16</td>
|
||||
<td><span class="code">inetLatency()</span> <span class="code">inetChecksite()</span> schema avlidation</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">5.6.6</th>
|
||||
<td>2021-03-16</td>
|
||||
<td>code refactoring</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">5.6.5</th>
|
||||
<td>2021-03-15</td>
|
||||
<td><span class="code">cpuTemperature()</span> fix linux</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">5.6.4</th>
|
||||
<td>2021-03-15</td>
|
||||
<td><span class="code">sanitizeShellString()</span> and other security improvements</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">5.6.3</th>
|
||||
<td>2021-03-14</td>
|
||||
<td><span class="code">sanitizeShellString()</span> improvements</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">5.6.2</th>
|
||||
<td>2021-03-10</td>
|
||||
|
||||
@ -166,11 +166,11 @@
|
||||
<body>
|
||||
<header class="bg-image-full">
|
||||
<div class="top-container">
|
||||
<a href="security.html" class="recommendation">Security advisory:<br>Update to v5.3.2</a>
|
||||
<a href="security.html" class="recommendation">Security advisory:<br>Update to v5.6.4</a>
|
||||
<img class="logo" src="assets/logo.png">
|
||||
<div class="title">systeminformation</div>
|
||||
<div class="subtitle"><span id="typed"></span> </div>
|
||||
<div class="version">New Version: <span id="version">5.6.2</span></div>
|
||||
<div class="version">New Version: <span id="version">5.6.10</span></div>
|
||||
<button class="btn btn-light" onclick="location.href='https://github.com/sebhildebrandt/systeminformation'">View on Github <i class=" fab fa-github"></i></button>
|
||||
</div>
|
||||
<div class="down">
|
||||
@ -192,6 +192,8 @@
|
||||
<a href="https://lgtm.com/projects/g/sebhildebrandt/systeminformation/alerts" rel="nofollow"><img src="https://camo.githubusercontent.com/66428127fdde80fc8247a0c1df4c651f3a6b1c0a/68747470733a2f2f696d672e736869656c64732e696f2f6c67746d2f616c657274732f672f73656268696c64656272616e64742f73797374656d696e666f726d6174696f6e2e7376673f7374796c653d666c61742d737175617265" alt="Total alerts" data-canonical-src="https://img.shields.io/lgtm/alerts/g/sebhildebrandt/systeminformation.svg?style=flat-square" style="max-width:100%;"></a>
|
||||
<a href="https://github.com/sebhildebrandt/systeminformation/blob/master/LICENSE"><img src="https://camo.githubusercontent.com/4b5966a2a252ee0f241a1e03b13417178eb4964f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e7376673f7374796c653d666c61742d737175617265" alt="MIT license" data-canonical-src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" style="max-width:100%;"></a>
|
||||
</div>
|
||||
<div class="text larger"><span class="warning">Security issues:</span> Please have a look at our <a href="../security.html">security advisories</a>.</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="row justify-content-center sectionheader index">
|
||||
@ -201,7 +203,7 @@
|
||||
</div>
|
||||
<div class="row number-section">
|
||||
<div class="col-xl-4 col-lg-4 col-md-4 col-12">
|
||||
<div class="numbers">14,185</div>
|
||||
<div class="numbers">14,225</div>
|
||||
<div class="title">Lines of code</div>
|
||||
</div>
|
||||
<div class="col-xl-4 col-lg-4 col-md-4 col-12">
|
||||
@ -209,7 +211,7 @@
|
||||
<div class="title">Downloads last month</div>
|
||||
</div>
|
||||
<div class="col-xl-4 col-lg-4 col-md-4 col-12">
|
||||
<div class="numbers">395</div>
|
||||
<div class="numbers">407</div>
|
||||
<div class="title">Dependents</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -345,7 +347,7 @@
|
||||
<div class="row">
|
||||
<div class="col-12 sectionheader index">
|
||||
<div class="title-small">Issues</div>
|
||||
<div class="text"><span class="bold">Security issues</span>: Please have a look at our <a href="security.html">security advisories</a></div>
|
||||
<div class="text"><span class="warning">Security issues:</span> We highly recomment to have a look at our <a href="security.html">security advisories</a></div>
|
||||
<div class="text"><span class="bold">Having an issue</span>: If you run into problems, please check out <a href="issues.html">known issues page</a> first.<br>If you still have problems, please feel free to open an issue on our <a href="https://github.com/sebhildebrandt/systeminformation/issues">github page</a></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -242,7 +242,7 @@ si.currentLoad().then(data => console.log(data));</code></pre class="example">
|
||||
<td>X</td>
|
||||
<td>X</td>
|
||||
<td>X</td>
|
||||
<td>X</td>
|
||||
<td></td>
|
||||
<td>X</td>
|
||||
<td># of all processes running</td>
|
||||
</tr>
|
||||
@ -252,7 +252,7 @@ si.currentLoad().then(data => console.log(data));</code></pre class="example">
|
||||
<td>X</td>
|
||||
<td>X</td>
|
||||
<td>X</td>
|
||||
<td>X</td>
|
||||
<td></td>
|
||||
<td>X</td>
|
||||
<td># of all processes blocked</td>
|
||||
</tr>
|
||||
@ -262,7 +262,7 @@ si.currentLoad().then(data => console.log(data));</code></pre class="example">
|
||||
<td>X</td>
|
||||
<td>X</td>
|
||||
<td>X</td>
|
||||
<td>X</td>
|
||||
<td></td>
|
||||
<td>X</td>
|
||||
<td># of all processes sleeping</td>
|
||||
</tr>
|
||||
|
||||
@ -43,6 +43,28 @@
|
||||
<div class="col-12 sectionheader">
|
||||
<div class="title">Security Advisories</div>
|
||||
<div class="text">
|
||||
<h2>Passing User Paramters to Systeminformation</h2>
|
||||
<p>For most of the applications that are using <span class="code">systeminformation</span>, there is no reason to worry. <span class="bold">But be aware!</span> If you are using <span class="code">inetLatency()</span>, <span class="code">inetChecksite()</span>, <span class="code">services()</span>, <span class="code">processLoad()</span> with arbitrary untrusted user input, you should pay extra attention! We are doing a lot of input sanitation for those functions inside this package but we cannot handle all cases!</p>
|
||||
<p class="warning">This can lead to serious impact on your servers!</p>
|
||||
<p>We highly recommend to always upgrade to the latest version of our package. We maintain security updates for version 5 AND also version 4. For version 4 you can install latest version by placing <span class="code">"systeminformation": "^4"</span> in your package.json (dependencies) and run <span class="code">npm install</span></p>
|
||||
|
||||
<h2>Command Injection Vulnerability</h2>
|
||||
<p><span class="bold">Affected versions:</span>
|
||||
< 5.6.4 and < 4.34.17<br>
|
||||
<span class="bold">Date:</span> 2021-03-15<br>
|
||||
<span class="bold">CVE indentifier</span> CVE-2021-21388
|
||||
</p>
|
||||
|
||||
<h4>Impact</h4>
|
||||
<p>We had an issue that there was a possibility to perform a potential command injection possibility by passing a manipulated string prototype as a parameter to the following functions. Affected commands: <span class="code">inetLatency()</span>, <span class="code">inetChecksite()</span>, <span class="code">services()</span>, <span class="code">processLoad()</span>.</p>
|
||||
|
||||
<h4>Patch</h4>
|
||||
<p>Problem was fixed with additional parameter checking. Please upgrade to version >= 5.6.4 (or >= 4.34.17 if you are using version 4).</p>
|
||||
|
||||
<h4>Workarround</h4>
|
||||
<p>If you cannot upgrade, be sure to check or sanitize parameter strings that are passed to <span class="code">inetLatency()</span>, <span class="code">inetChecksite()</span>, <span class="code">services()</span>, <span class="code">processLoad()</span> (string only)</p>
|
||||
<hr>
|
||||
<br>
|
||||
<h2>Insufficient File Scheme Validation</h2>
|
||||
<p><span class="bold">Affected versions:</span>
|
||||
< 5.3.2 and < 4.34.12<br>
|
||||
|
||||
171
docs/styles.css
171
docs/styles.css
@ -1,11 +1,11 @@
|
||||
body {
|
||||
font-family: 'Roboto', 'HelveticaNeue-Light','Helvetica Neue Light','Helvetica Neue',Helvetica,Arial,sans-serif;
|
||||
font-family: "Roboto", "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
font-weight: 300;
|
||||
min-height: 100%;
|
||||
}
|
||||
|
||||
h1, h2, h3, h4 {
|
||||
font-family: 'Roboto', 'HelveticaNeue-Light','Helvetica Neue Light','Helvetica Neue',Helvetica,Arial,sans-serif;
|
||||
font-family: "Roboto", "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
font-weight: 500;
|
||||
color: #3d5cb3;
|
||||
}
|
||||
@ -18,6 +18,16 @@ h1, h2, h3, h4 {
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.warning {
|
||||
font-weight: 500;
|
||||
color: #9c0101;
|
||||
}
|
||||
|
||||
.larger {
|
||||
margin-top: 10px;
|
||||
font-size: 1.5rem !important;
|
||||
}
|
||||
|
||||
.medium {
|
||||
font-weight: 500;
|
||||
}
|
||||
@ -40,45 +50,24 @@ h1, h2, h3, h4 {
|
||||
height: 100vh;
|
||||
height: calc(var(--vh, 1vh) * 100);
|
||||
opacity: 0.95;
|
||||
display: -webkit-box;
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
-webkit-box-pack: center;
|
||||
-ms-flex-pack: center;
|
||||
justify-content: center;
|
||||
justify-content: center;
|
||||
text-align: center;
|
||||
width: 100% !important;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-box-direction: normal;
|
||||
-ms-flex-direction: column;
|
||||
flex-direction: column;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.bg-image-full .top-container {
|
||||
text-align: center;
|
||||
-ms-flex-item-align: center;
|
||||
align-self: center;
|
||||
display: -webkit-box;
|
||||
display: -ms-flexbox;
|
||||
align-self: center;
|
||||
display: flex;
|
||||
-webkit-box-pack: center;
|
||||
-ms-flex-pack: center;
|
||||
justify-content: center;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-box-direction: normal;
|
||||
-ms-flex-direction: column;
|
||||
flex-direction: column;
|
||||
-webkit-box-align: center;
|
||||
-ms-flex-align: center;
|
||||
align-items: center;
|
||||
-webkit-box-flex: 1;
|
||||
-ms-flex-positive: 1;
|
||||
flex-grow: 1;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
flex-grow: 1;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.bg-image-full .recommendation {
|
||||
position: absolute;
|
||||
top: 30px;
|
||||
@ -88,20 +77,17 @@ h1, h2, h3, h4 {
|
||||
display: inline-block;
|
||||
width: 280px;
|
||||
text-align: center;
|
||||
padding: .25em 0;
|
||||
padding: 0.25em 0;
|
||||
color: white;
|
||||
-webkit-transform: rotate(45deg);
|
||||
transform: rotate(45deg);
|
||||
transform: rotate(45deg);
|
||||
background: #971d1d;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 420px) {
|
||||
.bg-image-full .recommendation {
|
||||
font-size: 1.0rem;
|
||||
font-size: 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 767px) {
|
||||
.bg-image-full .recommendation {
|
||||
font-size: 1.1rem;
|
||||
@ -110,7 +96,6 @@ h1, h2, h3, h4 {
|
||||
width: 330px;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 1024px) {
|
||||
.bg-image-full .recommendation {
|
||||
width: 330px;
|
||||
@ -120,11 +105,9 @@ h1, h2, h3, h4 {
|
||||
font-size: 1.2rem;
|
||||
}
|
||||
}
|
||||
|
||||
.bg-image-full .recommendation:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.bg-image-full .title {
|
||||
color: #fff;
|
||||
padding-top: 10px;
|
||||
@ -132,197 +115,164 @@ h1, h2, h3, h4 {
|
||||
margin-bottom: 10px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 374px) {
|
||||
.bg-image-full .title {
|
||||
font-size: 2.1rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 420px) {
|
||||
.bg-image-full .title {
|
||||
font-size: 2.4rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 767px) {
|
||||
.bg-image-full .title {
|
||||
font-size: 3.5rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 1024px) {
|
||||
.bg-image-full .title {
|
||||
font-size: 4rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 1200px) {
|
||||
.bg-image-full .title {
|
||||
font-size: 5rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 1900px) {
|
||||
.bg-image-full .title {
|
||||
font-size: 6rem;
|
||||
}
|
||||
}
|
||||
|
||||
.bg-image-full .logo {
|
||||
width: 100px;
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 420px) {
|
||||
.bg-image-full .logo {
|
||||
width: 120px;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 767px) {
|
||||
.bg-image-full .logo {
|
||||
width: 160px;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 1024px) {
|
||||
.bg-image-full .logo {
|
||||
width: 200px;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 1900px) {
|
||||
.bg-image-full .logo {
|
||||
width: 250px;
|
||||
}
|
||||
}
|
||||
|
||||
.bg-image-full .subtitle {
|
||||
text-align: center;
|
||||
color: #bbb;
|
||||
font-size: 0.78rem;
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 375px) {
|
||||
.bg-image-full .subtitle {
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 420px) {
|
||||
.bg-image-full .subtitle {
|
||||
font-size: 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 767px) {
|
||||
.bg-image-full .subtitle {
|
||||
font-size: 1.1rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 1024px) {
|
||||
.bg-image-full .subtitle {
|
||||
font-size: 1.3rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 1200px) {
|
||||
.bg-image-full .subtitle {
|
||||
font-size: 1.4rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 1900px) {
|
||||
.bg-image-full .subtitle {
|
||||
font-size: 1.6rem;
|
||||
}
|
||||
}
|
||||
|
||||
.bg-image-full .text > a {
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
.bg-image-full .text > a:hover {
|
||||
color: #aaa;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 375px) {
|
||||
.bg-image-full .text > a {
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 420px) {
|
||||
.bg-image-full .text > a {
|
||||
font-size: 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 767px) {
|
||||
.bg-image-full .text > a {
|
||||
font-size: 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 1024px) {
|
||||
.bg-image-full .text > a {
|
||||
font-size: 1.1rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 1200px) {
|
||||
.bg-image-full .text > a {
|
||||
font-size: 1.2rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 1900px) {
|
||||
.bg-image-full .text > a {
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
}
|
||||
|
||||
.bg-image-full .version {
|
||||
text-align: center;
|
||||
margin-bottom: 10px;
|
||||
color: #fff;
|
||||
font-size: .9rem;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 420px) {
|
||||
.bg-image-full .version {
|
||||
font-size: .9rem;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 768px) {
|
||||
.bg-image-full .version {
|
||||
font-size: 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 1024px) {
|
||||
.bg-image-full .version {
|
||||
font-size: 1.1rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 1200px) {
|
||||
.bg-image-full .version {
|
||||
font-size: 1.2rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 1900px) {
|
||||
.bg-image-full .version {
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
}
|
||||
|
||||
.bg-image-full .down {
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
@ -331,7 +281,6 @@ h1, h2, h3, h4 {
|
||||
margin-bottom: 15px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.bg-image-full .down .caret {
|
||||
font-size: 3rem;
|
||||
}
|
||||
@ -347,12 +296,10 @@ h1, h2, h3, h4 {
|
||||
height: 65px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.nav .logo {
|
||||
width: 60px;
|
||||
margin-top: 12px;
|
||||
}
|
||||
|
||||
.nav .title {
|
||||
display: none;
|
||||
color: #fff;
|
||||
@ -361,55 +308,45 @@ h1, h2, h3, h4 {
|
||||
margin-top: 15px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 767px) {
|
||||
.nav .title {
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 1024px) {
|
||||
.nav .title {
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
}
|
||||
|
||||
.nav .text {
|
||||
margin-top: 18px;
|
||||
}
|
||||
|
||||
.nav .text a {
|
||||
color: #fff;
|
||||
margin-top: 12px;
|
||||
font-size: 1.0rem;
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 1023px) {
|
||||
.nav .text a {
|
||||
margin-top: 10px;
|
||||
font-size: 1.2rem;
|
||||
}
|
||||
}
|
||||
|
||||
.nav .text a:hover {
|
||||
color: #aaa;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.nav .github {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 768px) {
|
||||
.nav .github {
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
|
||||
.nav .todocs {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 768px) {
|
||||
.nav .todocs {
|
||||
display: none;
|
||||
@ -420,51 +357,42 @@ h1, h2, h3, h4 {
|
||||
text-align: center;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.features .inner {
|
||||
padding: 10px 0px;
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 768px) {
|
||||
.features .inner {
|
||||
padding: 15px 20px;
|
||||
}
|
||||
}
|
||||
|
||||
.features .inner .icons {
|
||||
display: block;
|
||||
font-size: 3rem;
|
||||
line-height: 1.3;
|
||||
color: #bbb;
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 420px) {
|
||||
.features .inner .icons {
|
||||
font-size: 3.5rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 768px) {
|
||||
.features .inner .icons {
|
||||
font-size: 4rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 1024px) {
|
||||
.features .inner .icons {
|
||||
font-size: 5rem;
|
||||
}
|
||||
}
|
||||
|
||||
.features .inner .icontitle {
|
||||
font-size: 1.2rem;
|
||||
}
|
||||
|
||||
.features .inner:hover {
|
||||
background: #f4f4f4;
|
||||
color: #567adf;
|
||||
}
|
||||
|
||||
.features .inner:hover .icons {
|
||||
color: #567adf;
|
||||
}
|
||||
@ -476,13 +404,11 @@ h1, h2, h3, h4 {
|
||||
font-weight: 500;
|
||||
color: #3d5cb3;
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 420px) {
|
||||
.sectionheader .title {
|
||||
font-size: 2.3rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 768px) {
|
||||
.sectionheader .title {
|
||||
text-align: left;
|
||||
@ -490,27 +416,23 @@ h1, h2, h3, h4 {
|
||||
font-size: 2.6rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 1024px) {
|
||||
.sectionheader .title {
|
||||
padding-top: 40px;
|
||||
font-size: 3rem;
|
||||
}
|
||||
}
|
||||
|
||||
.sectionheader .title-small {
|
||||
text-align: center;
|
||||
font-size: 1.4rem;
|
||||
font-weight: 500;
|
||||
color: #3d5cb3;
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 420px) {
|
||||
.sectionheader .title-small {
|
||||
font-size: 1.6rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 768px) {
|
||||
.sectionheader .title-small {
|
||||
text-align: left;
|
||||
@ -518,53 +440,44 @@ h1, h2, h3, h4 {
|
||||
font-size: 1.8rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 1024px) {
|
||||
.sectionheader .title-small {
|
||||
padding-top: 30px;
|
||||
font-size: 2rem;
|
||||
}
|
||||
}
|
||||
|
||||
.sectionheader .subtitle {
|
||||
text-align: center;
|
||||
font-size: .9rem;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 420px) {
|
||||
.sectionheader .subtitle {
|
||||
font-size: 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 768px) {
|
||||
.sectionheader .subtitle {
|
||||
text-align: left;
|
||||
font-size: 1.1rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 1024px) {
|
||||
.sectionheader .subtitle {
|
||||
font-size: 1.3rem;
|
||||
}
|
||||
}
|
||||
|
||||
.sectionheader .npmicons {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.sectionheader .text {
|
||||
text-align: center;
|
||||
padding-top: 10px;
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 768px) {
|
||||
.sectionheader .text {
|
||||
text-align: left;
|
||||
}
|
||||
}
|
||||
|
||||
.sectionheader hr {
|
||||
margin-top: 40px;
|
||||
margin-bottom: 0px;
|
||||
@ -574,19 +487,15 @@ h1, h2, h3, h4 {
|
||||
.index {
|
||||
margin: 0 0 10px 0;
|
||||
}
|
||||
|
||||
.index .text, .index .subtitle, .index .title, .index .title-small, .index .npmicons {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.index .larger {
|
||||
font-size: 1.2rem;
|
||||
}
|
||||
|
||||
.index a {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.index a:hover {
|
||||
text-decoration: none;
|
||||
color: #567adf;
|
||||
@ -608,34 +517,28 @@ ul {
|
||||
margin-top: 40px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.number-section .numbers {
|
||||
font-size: 2rem;
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 420px) {
|
||||
.number-section .numbers {
|
||||
font-size: 2.4rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 768px) {
|
||||
.number-section .numbers {
|
||||
font-size: 2.8rem;
|
||||
}
|
||||
}
|
||||
|
||||
.number-section .title {
|
||||
color: #999;
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 420px) {
|
||||
.number-section .title {
|
||||
font-size: 1.1rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 768px) {
|
||||
.number-section .title {
|
||||
font-size: 1.2rem;
|
||||
@ -645,60 +548,49 @@ ul {
|
||||
.menu {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 768px) {
|
||||
.menu {
|
||||
margin-top: 30px;
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
|
||||
.menu .title {
|
||||
margin: 25px 0 5px 0;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.menu .title a {
|
||||
width: 100%;
|
||||
color: #000;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.menu .title a:hover {
|
||||
color: #567adf;
|
||||
}
|
||||
|
||||
.menu .title .navtitle {
|
||||
font-size: 1.3rem;
|
||||
margin-bottom: 5px;
|
||||
display: inline-block;
|
||||
color: #3d5cb3;
|
||||
}
|
||||
|
||||
.menu hr {
|
||||
margin: 5px 0;
|
||||
}
|
||||
|
||||
.menu ul {
|
||||
list-style-type: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.menu ul li {
|
||||
padding: 2px 0 1px 0;
|
||||
}
|
||||
|
||||
.menu ul li a {
|
||||
width: 100%;
|
||||
color: #666;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.menu ul li a:hover {
|
||||
color: #567adf;
|
||||
}
|
||||
|
||||
.menu ul li.active > a {
|
||||
color: #567adf;
|
||||
font-weight: 500;
|
||||
@ -734,20 +626,16 @@ pre {
|
||||
.example td:first-child {
|
||||
background-color: #fff !important;
|
||||
}
|
||||
|
||||
.example td:last-child {
|
||||
background-color: #f8faff !important;
|
||||
}
|
||||
|
||||
.example h5 {
|
||||
padding-top: 5px;
|
||||
padding-left: 10px;
|
||||
}
|
||||
|
||||
.example pre {
|
||||
background-color: unset;
|
||||
}
|
||||
|
||||
.example pre .js {
|
||||
background-color: #f0f0f4;
|
||||
}
|
||||
@ -759,22 +647,17 @@ footer {
|
||||
padding-bottom: 30px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
footer .home {
|
||||
color: #3d5cb3;
|
||||
font-size: 1.1rem;
|
||||
}
|
||||
|
||||
footer a {
|
||||
color: #000;
|
||||
}
|
||||
|
||||
footer a:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
footer .badge {
|
||||
color: #fff;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
/*# sourceMappingURL=styles.css.map */
|
||||
}/*# sourceMappingURL=styles.css.map */
|
||||
File diff suppressed because one or more lines are too long
@ -14,6 +14,14 @@ h1, h2, h3, h4 {
|
||||
.bold {
|
||||
font-weight: 500;
|
||||
}
|
||||
.warning {
|
||||
font-weight: 500;
|
||||
color: rgb(156, 1, 1);
|
||||
}
|
||||
.larger {
|
||||
margin-top: 10px;
|
||||
font-size: 1.5rem !important;
|
||||
}
|
||||
.medium {
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
@ -83,6 +83,26 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row">4.34.19</th>
|
||||
<td>2021-03-16</td>
|
||||
<td><span class="code">inetLatency()</span> <span class="code">inetChecksite()</span> schema avlidation</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">4.34.18</th>
|
||||
<td>2021-03-16</td>
|
||||
<td>code refactoring</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">4.34.17</th>
|
||||
<td>2021-03-14</td>
|
||||
<td><span class="code">sanitizeShellString()</span> and other security improvements</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">4.34.16</th>
|
||||
<td>2021-03-14</td>
|
||||
<td><span class="code">sanitizeShellString()</span> improvements</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">4.34.15</th>
|
||||
<td>2020-02-23</td>
|
||||
|
||||
@ -165,12 +165,12 @@
|
||||
<body>
|
||||
<header class="bg-image-full">
|
||||
<div class="container">
|
||||
<a href="security.html" class="recommendation">Security advisory:<br>Update to v4.34.11</a>
|
||||
<a href="security.html" class="recommendation">Security advisory:<br>Update to v4.34.17</a>
|
||||
<img class="logo" src="assets/logo.png">
|
||||
<div class="title">systeminformation </div>
|
||||
<div class="subtitle"><span id="typed"></span> </div>
|
||||
<div class="version larger">Version 4 documentation</div>
|
||||
<div class="version">Current Version: <span id="version">4.34.15</span></div>
|
||||
<div class="version">Current Version: <span id="version">4.34.19</span></div>
|
||||
<button class="btn btn-light" onclick="location.href='https://github.com/sebhildebrandt/systeminformation'">View on Github <i class=" fab fa-github"></i></button>
|
||||
</div>
|
||||
<div class="down">
|
||||
@ -320,7 +320,7 @@
|
||||
<div class="row">
|
||||
<div class="col-12 sectionheader index">
|
||||
<div class="title-small">Issues</div>
|
||||
<div class="text"><span class="bold">Security issues</span>: Please have a look at our <a href="security.html">security advisories</a></div>
|
||||
<div class="text"><span class="warning">Security issues</span>: Please have a look at our <a href="security.html">security advisories</a></div>
|
||||
<div class="text">If you run into problems, please check out <a href="issues.html">known issues page</a> first. If you still have problems, please feel free to open an issue on our <a href="https://github.com/sebhildebrandt/systeminformation/issues">github page</a></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -42,6 +42,28 @@
|
||||
<div class="col-12 sectionheader">
|
||||
<div class="title">Security Advisories</div>
|
||||
<div class="text">
|
||||
<h2>Passing User Paramters to Systeminformation</h2>
|
||||
<p>For most of the applications that are using <span class="code">systeminformation</span>, there is no reason to worry. <span class="bold">But be aware!</span> If you are using <span class="code">inetLatency()</span>, <span class="code">inetChecksite()</span>, <span class="code">services()</span>, <span class="code">processLoad()</span> with arbitrary untrusted user input, you should pay extra attention! We are doing a lot of input sanitation for those functions inside this package but we cannot handle all cases!</p>
|
||||
<p class="warning">This can lead to serious impact on your servers!</p>
|
||||
<p>We highly recommend to always upgrade to the latest version of our package. We maintain security updates for version 5 AND also version 4. For version 4 you can install latest version by placing <span class="code">"systeminformation": "^4"</span> in your package.json (dependencies) and run <span class="code">npm install</span></p>
|
||||
|
||||
<h2>Command Injection Vulnerability</h2>
|
||||
<p><span class="bold">Affected versions:</span>
|
||||
< 4.34.17<br>
|
||||
<span class="bold">Date:</span> 2021-03-15<br>
|
||||
<span class="bold">CVE indentifier</span> -
|
||||
</p>
|
||||
|
||||
<h4>Impact</h4>
|
||||
<p>We had an issue that there was a possibility to perform a potential command injection possibility by passing a manipulated string prototype as a parameter to the following functions. Affected commands: <span class="code">inetLatency()</span>, <span class="code">inetChecksite()</span>, <span class="code">services()</span>, <span class="code">processLoad()</span>.</p>
|
||||
|
||||
<h4>Patch</h4>
|
||||
<p>Problem was fixed with additional parameter checking. Please upgrade to version >= 4.34.17 if you are using version 4.</p>
|
||||
|
||||
<h4>Workarround</h4>
|
||||
<p>If you cannot upgrade, be sure to check or sanitize parameter strings that are passed to <span class="code">inetLatency()</span>, <span class="code">inetChecksite()</span>, <span class="code">services()</span>, <span class="code">processLoad()</span> (string only)</p>
|
||||
<hr>
|
||||
<br>
|
||||
<h2>Insufficient File Scheme Validation</h2>
|
||||
<p><span class="bold">Affected versions:</span>
|
||||
4.34.12<br>
|
||||
|
||||
@ -17,6 +17,11 @@ h1, h2, h3, h4 {
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.warning {
|
||||
font-weight: 500;
|
||||
color: #9c0101;
|
||||
}
|
||||
|
||||
.bg-image-full {
|
||||
background: no-repeat center center scroll;
|
||||
background-color: #4b2313;
|
||||
@ -28,41 +33,20 @@ h1, h2, h3, h4 {
|
||||
height: 100vh;
|
||||
height: calc(var(--vh, 1vh) * 100);
|
||||
opacity: 0.95;
|
||||
display: -webkit-box;
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
-webkit-box-pack: center;
|
||||
-ms-flex-pack: center;
|
||||
justify-content: center;
|
||||
justify-content: center;
|
||||
text-align: center;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-box-direction: normal;
|
||||
-ms-flex-direction: column;
|
||||
flex-direction: column;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.bg-image-full .container {
|
||||
text-align: center;
|
||||
-ms-flex-item-align: center;
|
||||
align-self: center;
|
||||
display: -webkit-box;
|
||||
display: -ms-flexbox;
|
||||
align-self: center;
|
||||
display: flex;
|
||||
-webkit-box-pack: center;
|
||||
-ms-flex-pack: center;
|
||||
justify-content: center;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-box-direction: normal;
|
||||
-ms-flex-direction: column;
|
||||
flex-direction: column;
|
||||
-webkit-box-align: center;
|
||||
-ms-flex-align: center;
|
||||
align-items: center;
|
||||
-webkit-box-flex: 1;
|
||||
-ms-flex-positive: 1;
|
||||
flex-grow: 1;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
.bg-image-full .recommendation {
|
||||
position: absolute;
|
||||
top: 40px;
|
||||
@ -71,26 +55,22 @@ h1, h2, h3, h4 {
|
||||
display: inline-block;
|
||||
width: 330px;
|
||||
text-align: center;
|
||||
padding: .25em 0;
|
||||
padding: 0.25em 0;
|
||||
color: white;
|
||||
-webkit-transform: rotate(45deg);
|
||||
transform: rotate(45deg);
|
||||
transform: rotate(45deg);
|
||||
background: #971d1d;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 420px) {
|
||||
.bg-image-full .recommendation {
|
||||
font-size: 1.0rem;
|
||||
font-size: 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 768px) {
|
||||
.bg-image-full .recommendation {
|
||||
font-size: 1.1rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 1024px) {
|
||||
.bg-image-full .recommendation {
|
||||
top: 50px;
|
||||
@ -98,148 +78,123 @@ h1, h2, h3, h4 {
|
||||
font-size: 1.2rem;
|
||||
}
|
||||
}
|
||||
|
||||
.bg-image-full .recommendation:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.bg-image-full .title {
|
||||
color: #fff;
|
||||
padding-top: 10px;
|
||||
font-size: 1.8rem;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 420px) {
|
||||
.bg-image-full .title {
|
||||
font-size: 2.4rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 768px) {
|
||||
.bg-image-full .title {
|
||||
font-size: 3.2rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 1024px) {
|
||||
.bg-image-full .title {
|
||||
font-size: 4rem;
|
||||
}
|
||||
}
|
||||
|
||||
.bg-image-full .logo {
|
||||
width: 100px;
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 420px) {
|
||||
.bg-image-full .logo {
|
||||
width: 120px;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 768px) {
|
||||
.bg-image-full .logo {
|
||||
width: 160px;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 1024px) {
|
||||
.bg-image-full .logo {
|
||||
width: 200px;
|
||||
}
|
||||
}
|
||||
|
||||
.bg-image-full .subtitle {
|
||||
text-align: center;
|
||||
color: #bbb;
|
||||
font-size: 0.78rem;
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 375px) {
|
||||
.bg-image-full .subtitle {
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 420px) {
|
||||
.bg-image-full .subtitle {
|
||||
font-size: 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 768px) {
|
||||
.bg-image-full .subtitle {
|
||||
font-size: 1.1rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 1024px) {
|
||||
.bg-image-full .subtitle {
|
||||
font-size: 1.3rem;
|
||||
}
|
||||
}
|
||||
|
||||
.bg-image-full .text > a {
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
.bg-image-full .text > a:hover {
|
||||
color: #aaa;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 375px) {
|
||||
.bg-image-full .text > a {
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 420px) {
|
||||
.bg-image-full .text > a {
|
||||
font-size: 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 768px) {
|
||||
.bg-image-full .text > a {
|
||||
font-size: 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 1024px) {
|
||||
.bg-image-full .text > a {
|
||||
font-size: 1.1rem;
|
||||
}
|
||||
}
|
||||
|
||||
.bg-image-full .version {
|
||||
text-align: center;
|
||||
margin-bottom: 10px;
|
||||
color: #fff;
|
||||
font-size: .9rem;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 420px) {
|
||||
.bg-image-full .version {
|
||||
font-size: .9rem;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 768px) {
|
||||
.bg-image-full .version {
|
||||
font-size: 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 1024px) {
|
||||
.bg-image-full .version {
|
||||
font-size: 1.1rem;
|
||||
}
|
||||
}
|
||||
|
||||
.bg-image-full .down {
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
@ -248,7 +203,6 @@ h1, h2, h3, h4 {
|
||||
margin-bottom: 15px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.bg-image-full .down .caret {
|
||||
font-size: 3rem;
|
||||
}
|
||||
@ -264,12 +218,10 @@ h1, h2, h3, h4 {
|
||||
height: 65px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.nav .logo {
|
||||
width: 60px;
|
||||
margin-top: 12px;
|
||||
}
|
||||
|
||||
.nav .title {
|
||||
display: none;
|
||||
color: #fff;
|
||||
@ -277,55 +229,45 @@ h1, h2, h3, h4 {
|
||||
margin-left: 15px;
|
||||
margin-top: 18px;
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 768px) {
|
||||
.nav .title {
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 1024px) {
|
||||
.nav .title {
|
||||
font-size: 1.2rem;
|
||||
}
|
||||
}
|
||||
|
||||
.nav .text {
|
||||
margin-top: 18px;
|
||||
}
|
||||
|
||||
.nav .text a {
|
||||
color: #fff;
|
||||
margin-top: 12px;
|
||||
font-size: 1.0rem;
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 1023px) {
|
||||
.nav .text a {
|
||||
margin-top: 10px;
|
||||
font-size: 1.2rem;
|
||||
}
|
||||
}
|
||||
|
||||
.nav .text a:hover {
|
||||
color: #aaa;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.nav .github {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 768px) {
|
||||
.nav .github {
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
|
||||
.nav .todocs {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 768px) {
|
||||
.nav .todocs {
|
||||
display: none;
|
||||
@ -336,50 +278,41 @@ h1, h2, h3, h4 {
|
||||
text-align: center;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.features .inner {
|
||||
padding: 10px 0px;
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 768px) {
|
||||
.features .inner {
|
||||
padding: 15px 20px;
|
||||
}
|
||||
}
|
||||
|
||||
.features .inner .icons {
|
||||
display: block;
|
||||
font-size: 3rem;
|
||||
color: #bbb;
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 420px) {
|
||||
.features .inner .icons {
|
||||
font-size: 3.5rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 768px) {
|
||||
.features .inner .icons {
|
||||
font-size: 4rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 1024px) {
|
||||
.features .inner .icons {
|
||||
font-size: 5rem;
|
||||
}
|
||||
}
|
||||
|
||||
.features .inner .icontitle {
|
||||
font-size: 1.2rem;
|
||||
}
|
||||
|
||||
.features .inner:hover {
|
||||
background: #f4f4f4;
|
||||
color: #567adf;
|
||||
}
|
||||
|
||||
.features .inner:hover .icons {
|
||||
color: #567adf;
|
||||
}
|
||||
@ -389,13 +322,11 @@ h1, h2, h3, h4 {
|
||||
padding-top: 20px;
|
||||
font-size: 2rem;
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 420px) {
|
||||
.sectionheader .title {
|
||||
font-size: 2.3rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 768px) {
|
||||
.sectionheader .title {
|
||||
text-align: left;
|
||||
@ -403,25 +334,21 @@ h1, h2, h3, h4 {
|
||||
font-size: 2.6rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 1024px) {
|
||||
.sectionheader .title {
|
||||
padding-top: 30px;
|
||||
font-size: 3rem;
|
||||
}
|
||||
}
|
||||
|
||||
.sectionheader .title-small {
|
||||
text-align: center;
|
||||
font-size: 1.4rem;
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 420px) {
|
||||
.sectionheader .title-small {
|
||||
font-size: 1.6rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 768px) {
|
||||
.sectionheader .title-small {
|
||||
text-align: left;
|
||||
@ -429,53 +356,44 @@ h1, h2, h3, h4 {
|
||||
font-size: 1.8rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 1024px) {
|
||||
.sectionheader .title-small {
|
||||
padding-top: 30px;
|
||||
font-size: 2rem;
|
||||
}
|
||||
}
|
||||
|
||||
.sectionheader .subtitle {
|
||||
text-align: center;
|
||||
font-size: .9rem;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 420px) {
|
||||
.sectionheader .subtitle {
|
||||
font-size: 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 768px) {
|
||||
.sectionheader .subtitle {
|
||||
text-align: left;
|
||||
font-size: 1.1rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 1024px) {
|
||||
.sectionheader .subtitle {
|
||||
font-size: 1.3rem;
|
||||
}
|
||||
}
|
||||
|
||||
.sectionheader .npmicons {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.sectionheader .text {
|
||||
text-align: center;
|
||||
padding-top: 10px;
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 768px) {
|
||||
.sectionheader .text {
|
||||
text-align: left;
|
||||
}
|
||||
}
|
||||
|
||||
.sectionheader hr {
|
||||
margin-top: 40px;
|
||||
margin-bottom: 0px;
|
||||
@ -485,15 +403,12 @@ h1, h2, h3, h4 {
|
||||
.index {
|
||||
margin: 0 0 10px 0;
|
||||
}
|
||||
|
||||
.index .text, .index .subtitle, .index .title, .index .title-small, .index .npmicons {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.index a {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.index a:hover {
|
||||
text-decoration: none;
|
||||
color: #567adf;
|
||||
@ -515,34 +430,28 @@ ul {
|
||||
margin-top: 40px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.number-section .numbers {
|
||||
font-size: 2rem;
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 420px) {
|
||||
.number-section .numbers {
|
||||
font-size: 2.4rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 768px) {
|
||||
.number-section .numbers {
|
||||
font-size: 2.8rem;
|
||||
}
|
||||
}
|
||||
|
||||
.number-section .title {
|
||||
color: #999;
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 420px) {
|
||||
.number-section .title {
|
||||
font-size: 1.1rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 768px) {
|
||||
.number-section .title {
|
||||
font-size: 1.2rem;
|
||||
@ -552,53 +461,43 @@ ul {
|
||||
.menu {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 768px) {
|
||||
.menu {
|
||||
margin-top: 30px;
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
|
||||
.menu .title {
|
||||
margin: 25px 0 5px 0;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.menu .title a {
|
||||
width: 100%;
|
||||
color: #000;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.menu .title a:hover {
|
||||
color: #567adf;
|
||||
}
|
||||
|
||||
.menu hr {
|
||||
margin: 5px 0;
|
||||
}
|
||||
|
||||
.menu ul {
|
||||
list-style-type: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.menu ul li {
|
||||
padding: 2px 0;
|
||||
}
|
||||
|
||||
.menu ul li a {
|
||||
width: 100%;
|
||||
color: #666;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.menu ul li a:hover {
|
||||
color: #567adf;
|
||||
}
|
||||
|
||||
.menu ul li.active > a {
|
||||
color: #567adf;
|
||||
}
|
||||
@ -633,20 +532,16 @@ pre {
|
||||
.example td:first-child {
|
||||
background-color: #fff !important;
|
||||
}
|
||||
|
||||
.example td:last-child {
|
||||
background-color: #f8faff !important;
|
||||
}
|
||||
|
||||
.example h5 {
|
||||
padding-top: 5px;
|
||||
padding-left: 10px;
|
||||
}
|
||||
|
||||
.example pre {
|
||||
background-color: unset;
|
||||
}
|
||||
|
||||
.example pre .js {
|
||||
background-color: #f0f0f4;
|
||||
}
|
||||
@ -658,11 +553,9 @@ footer {
|
||||
padding-bottom: 30px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
footer a {
|
||||
color: #000;
|
||||
}
|
||||
|
||||
footer .badge {
|
||||
color: #fff;
|
||||
font-size: 0.9rem;
|
||||
@ -675,5 +568,4 @@ footer .badge {
|
||||
|
||||
.v5 {
|
||||
color: #567adf;
|
||||
}
|
||||
/*# sourceMappingURL=styles.css.map */
|
||||
}/*# sourceMappingURL=styles.css.map */
|
||||
File diff suppressed because one or more lines are too long
@ -13,6 +13,10 @@ h1, h2, h3, h4 {
|
||||
.bold {
|
||||
font-weight: 700;
|
||||
}
|
||||
.warning {
|
||||
font-weight: 500;
|
||||
color: rgb(156, 1, 1);
|
||||
}
|
||||
.bg-image-full {
|
||||
background: no-repeat center center scroll;
|
||||
background-color: #4b2313; /* For browsers that do not support gradients */
|
||||
|
||||
@ -937,7 +937,7 @@ function cpuTemperature(callback) {
|
||||
if (_linux) {
|
||||
// CPU Chipset, Socket
|
||||
try {
|
||||
const cmd = 'cat /sys/class/thermal/thermal_zone*/type; echo "-----"; cat /sys/class/thermal/thermal_zone*/temp;';
|
||||
const cmd = 'cat /sys/class/thermal/thermal_zone*/type 2>/dev/null; echo "-----"; cat /sys/class/thermal/thermal_zone*/temp 2>/dev/null;';
|
||||
const parts = execSync(cmd).toString().split('-----\n');
|
||||
if (parts.length === 2) {
|
||||
const lines = parts[0].split('\n');
|
||||
|
||||
@ -470,7 +470,7 @@ function dockerContainerStats(containerIDs, callback) {
|
||||
if (containerIDsSanitized !== '*') {
|
||||
containerIDsSanitized = '';
|
||||
const s = (util.isPrototypePolluted() ? '' : util.sanitizeShellString(containerIDs, true)).trim();
|
||||
for (let i = 0; i <= 2000; i++) {
|
||||
for (let i = 0; i <= util.mathMin(s.length, 2000); i++) {
|
||||
if (!(s[i] === undefined)) {
|
||||
s[i].__proto__.toLowerCase = util.stringToLower;
|
||||
const sl = s[i].toLowerCase();
|
||||
|
||||
@ -728,7 +728,7 @@ function graphics(callback) {
|
||||
const nvidiaData = nvidiaDevices();
|
||||
// needs to be rewritten ... using no spread operators
|
||||
result.controllers = result.controllers.map((controller) => { // match by busAddress
|
||||
return mergeControllerNvidia(controller, nvidiaData.find(({ pciBus }) => pciBus.endsWith(controller.busAddress)) || {});
|
||||
return mergeControllerNvidia(controller, nvidiaData.find(({ pciBus }) => pciBus.toLowerCase().endsWith(controller.busAddress.toLowerCase())) || {});
|
||||
});
|
||||
}
|
||||
let cmd = 'clinfo --raw';
|
||||
|
||||
2
lib/index.d.ts
vendored
2
lib/index.d.ts
vendored
@ -876,6 +876,8 @@ export function inetChecksite(url: string, cb?: (data: Systeminformation.InetChe
|
||||
export function inetLatency(host?: string, cb?: (data: number) => any): Promise<number>;
|
||||
|
||||
export function wifiNetworks(cb?: (data: Systeminformation.WifiNetworkData[]) => any): Promise<Systeminformation.WifiNetworkData[]>;
|
||||
export function wifiInterfaces(cb?: (data: Systeminformation.WifiInterfaceData[]) => any): Promise<Systeminformation.WifiInterfaceData[]>;
|
||||
export function wifiConnections(cb?: (data: Systeminformation.WifiConnectionData[]) => any): Promise<Systeminformation.WifiConnectionData[]>;
|
||||
|
||||
export function users(cb?: (data: Systeminformation.UserData[]) => any): Promise<Systeminformation.UserData[]>;
|
||||
|
||||
|
||||
@ -13,8 +13,7 @@
|
||||
// 12. Internet
|
||||
// ----------------------------------------------------------------------------------
|
||||
|
||||
const exec = require('child_process').exec;
|
||||
const execFile = require('child_process').execFile;
|
||||
// const exec = require('child_process').exec;
|
||||
const util = require('./util');
|
||||
|
||||
let _platform = process.platform;
|
||||
@ -46,11 +45,11 @@ function inetChecksite(url, callback) {
|
||||
}
|
||||
let urlSanitized = '';
|
||||
const s = util.sanitizeShellString(url, true);
|
||||
for (let i = 0; i <= 2000; i++) {
|
||||
for (let i = 0; i <= util.mathMin(s.length, 2000); i++) {
|
||||
if (!(s[i] === undefined)) {
|
||||
s[i].__proto__.toLowerCase = util.stringToLower;
|
||||
const sl = s[i].toLowerCase();
|
||||
if (sl && sl[0] && !sl[1]) {
|
||||
if (sl && sl[0] && !sl[1] && sl[0].length === 1) {
|
||||
urlSanitized = urlSanitized + sl[0];
|
||||
}
|
||||
}
|
||||
@ -59,18 +58,20 @@ function inetChecksite(url, callback) {
|
||||
try {
|
||||
if (urlSanitized && !util.isPrototypePolluted()) {
|
||||
urlSanitized.__proto__.startsWith = util.stringStartWith;
|
||||
if (urlSanitized.startsWith('file:')) {
|
||||
if (urlSanitized.startsWith('file:') || urlSanitized.startsWith('gopher:') || urlSanitized.startsWith('telnet:') || urlSanitized.startsWith('mailto:') || urlSanitized.startsWith('news:') || urlSanitized.startsWith('nntp:')) {
|
||||
if (callback) { callback(result); }
|
||||
return resolve(result);
|
||||
}
|
||||
let t = Date.now();
|
||||
if (_linux || _freebsd || _openbsd || _netbsd || _darwin || _sunos) {
|
||||
let args = ' -I --connect-timeout 5 -m 5 ' + urlSanitized + ' 2>/dev/null | head -n 1 | cut -d " " -f2';
|
||||
let args = ['-I', '--connect-timeout', '5', '-m', '5'];
|
||||
args.push(urlSanitized);
|
||||
let cmd = 'curl';
|
||||
exec(cmd + args, function (error, stdout) {
|
||||
let statusCode = parseInt(stdout.toString());
|
||||
util.execSafe(cmd, args).then((stdout) => {
|
||||
const lines = stdout.split('\n');
|
||||
let statusCode = lines[0] && lines[0].indexOf(' ') >= 0 ? parseInt(lines[0].split(' ')[1], 10) : 404;
|
||||
result.status = statusCode || 404;
|
||||
result.ok = !error && (statusCode === 200 || statusCode === 301 || statusCode === 302 || statusCode === 304);
|
||||
result.ok = (statusCode === 200 || statusCode === 301 || statusCode === 302 || statusCode === 304);
|
||||
result.ms = (result.ok ? Date.now() - t : null);
|
||||
if (callback) { callback(result); }
|
||||
resolve(result);
|
||||
@ -142,7 +143,7 @@ function inetLatency(host, callback) {
|
||||
}
|
||||
let hostSanitized = '';
|
||||
const s = (util.isPrototypePolluted() ? '8.8.8.8' : util.sanitizeShellString(host, true)).trim();
|
||||
for (let i = 0; i <= 2000; i++) {
|
||||
for (let i = 0; i <= util.mathMin(s.length, 2000); i++) {
|
||||
if (!(s[i] === undefined)) {
|
||||
s[i].__proto__.toLowerCase = util.stringToLower;
|
||||
const sl = s[i].toLowerCase();
|
||||
@ -152,7 +153,7 @@ function inetLatency(host, callback) {
|
||||
}
|
||||
}
|
||||
hostSanitized.__proto__.startsWith = util.stringStartWith;
|
||||
if (hostSanitized.startsWith('file:')) {
|
||||
if (hostSanitized.startsWith('file:') || hostSanitized.startsWith('gopher:') || hostSanitized.startsWith('telnet:') || hostSanitized.startsWith('mailto:') || hostSanitized.startsWith('news:') || hostSanitized.startsWith('nntp:')) {
|
||||
if (callback) { callback(null); }
|
||||
return resolve(null);
|
||||
}
|
||||
@ -160,21 +161,21 @@ function inetLatency(host, callback) {
|
||||
let filt;
|
||||
if (_linux || _freebsd || _openbsd || _netbsd || _darwin) {
|
||||
if (_linux) {
|
||||
params = '-c 2 -w 3 ' + hostSanitized;
|
||||
params = ['-c', '2', '-w', '3', hostSanitized];
|
||||
filt = 'rtt';
|
||||
}
|
||||
if (_freebsd || _openbsd || _netbsd) {
|
||||
params = '-c 2 -t 3 ' + hostSanitized;
|
||||
params = ['-c', '2', '-t', '3', hostSanitized];
|
||||
filt = 'round-trip';
|
||||
}
|
||||
if (_darwin) {
|
||||
params = '-c2 -t3 ' + hostSanitized;
|
||||
params = ['-c2', '-t3', hostSanitized];
|
||||
filt = 'avg';
|
||||
}
|
||||
execFile('ping', params.split(' '), function (error, stdout) {
|
||||
util.execSafe('ping', params).then((stdout) => {
|
||||
let result = null;
|
||||
if (!error) {
|
||||
const lines = stdout.toString().split('\n').filter(line => line.indexOf(filt) >= 0).join('\n');
|
||||
if (stdout) {
|
||||
const lines = stdout.split('\n').filter(line => line.indexOf(filt) >= 0).join('\n');
|
||||
|
||||
const line = lines.split('=');
|
||||
if (line.length > 1) {
|
||||
@ -189,12 +190,12 @@ function inetLatency(host, callback) {
|
||||
});
|
||||
}
|
||||
if (_sunos) {
|
||||
const params = '-s -a ' + hostSanitized + ' 56 2';
|
||||
const params = ['-s', '-a', hostSanitized, '56', '2'];
|
||||
const filt = 'avg';
|
||||
execFile('ping', params.split(' '), { timeout: 3000 }, function (error, stdout) {
|
||||
util.execSafe('ping', params, { timeout: 3000 }).then((stdout) => {
|
||||
let result = null;
|
||||
if (!error) {
|
||||
const lines = stdout.toString().split('\n').filter(line => line.indexOf(filt) >= 0).join('\n');
|
||||
if (stdout) {
|
||||
const lines = stdout.split('\n').filter(line => line.indexOf(filt) >= 0).join('\n');
|
||||
const line = lines.split('=');
|
||||
if (line.length > 1) {
|
||||
const parts = line[1].split('/');
|
||||
@ -210,10 +211,10 @@ function inetLatency(host, callback) {
|
||||
if (_windows) {
|
||||
let result = null;
|
||||
try {
|
||||
const params = hostSanitized + ' -n 1';
|
||||
execFile('ping', params.split(' '), util.execOptsWin, function (error, stdout) {
|
||||
if (!error) {
|
||||
let lines = stdout.toString().split('\r\n');
|
||||
const params = [hostSanitized, '-n', '1'];
|
||||
util.execSafe('ping', params, util.execOptsWin).then((stdout) => {
|
||||
if (stdout) {
|
||||
let lines = stdout.split('\r\n');
|
||||
lines.shift();
|
||||
lines.forEach(function (line) {
|
||||
if ((line.toLowerCase().match(/ms/g) || []).length === 3) {
|
||||
|
||||
@ -1061,7 +1061,7 @@ function networkStatsSingle(iface) {
|
||||
process.nextTick(() => {
|
||||
let ifaceSanitized = '';
|
||||
const s = util.isPrototypePolluted() ? '---' : util.sanitizeShellString(iface);
|
||||
for (let i = 0; i <= 2000; i++) {
|
||||
for (let i = 0; i <= util.mathMin(s.length, 2000); i++) {
|
||||
if (!(s[i] === undefined)) {
|
||||
ifaceSanitized = ifaceSanitized + s[i];
|
||||
}
|
||||
|
||||
@ -485,6 +485,10 @@ function versions(apps, callback) {
|
||||
apps = '*';
|
||||
} else {
|
||||
apps = apps || '*';
|
||||
if (typeof apps !== 'string') {
|
||||
if (callback) { callback({}); }
|
||||
return resolve({});
|
||||
}
|
||||
}
|
||||
const appsObj = checkVersionParam(apps);
|
||||
let totalFunctions = appsObj.counter;
|
||||
|
||||
@ -18,8 +18,6 @@ const fs = require('fs');
|
||||
const path = require('path');
|
||||
const exec = require('child_process').exec;
|
||||
const execSync = require('child_process').execSync;
|
||||
const execFile = require('child_process').execFile;
|
||||
|
||||
|
||||
const util = require('./util');
|
||||
|
||||
@ -111,7 +109,7 @@ function services(srv, callback) {
|
||||
srvString.__proto__.trim = util.stringTrim;
|
||||
|
||||
const s = util.sanitizeShellString(srv);
|
||||
for (let i = 0; i <= 2000; i++) {
|
||||
for (let i = 0; i <= util.mathMin(s.length, 2000); i++) {
|
||||
if (!(s[i] === undefined)) {
|
||||
srvString = srvString + s[i];
|
||||
}
|
||||
@ -164,15 +162,15 @@ function services(srv, callback) {
|
||||
}
|
||||
}
|
||||
}
|
||||
if ((_darwin) && srvString === '*') { // service enumeration mnot yet suported on mac OS
|
||||
if ((_darwin) && srvString === '*') { // service enumeration not yet suported on mac OS
|
||||
if (callback) { callback(result); }
|
||||
resolve(result);
|
||||
}
|
||||
let comm = (_darwin) ? 'ps -caxo pcpu,pmem,pid,command' : 'ps -axo pcpu,pmem,pid,command';
|
||||
let args = (_darwin) ? ['-caxo', 'pcpu,pmem,pid,command'] : ['-axo', 'pcpu,pmem,pid,command'];
|
||||
if (srvString !== '' && srvs.length > 0) {
|
||||
exec(comm + ' | grep -v grep | grep -iE "' + srvString + '"', { maxBuffer: 1024 * 20000 }, function (error, stdout) { // lgtm [js/shell-command-constructed-from-input]
|
||||
if (!error) {
|
||||
let lines = stdout.toString().replace(/ +/g, ' ').replace(/,+/g, '.').split('\n');
|
||||
util.execSafe('ps', args).then((stdout) => {
|
||||
if (stdout) {
|
||||
let lines = stdout.replace(/ +/g, ' ').replace(/,+/g, '.').split('\n');
|
||||
srvs.forEach(function (srv) {
|
||||
let ps;
|
||||
if (_darwin) {
|
||||
@ -267,9 +265,10 @@ function services(srv, callback) {
|
||||
resolve(result);
|
||||
}
|
||||
} else {
|
||||
exec('ps -o comm | grep -v grep | egrep "' + srvString + '"', { maxBuffer: 1024 * 20000 }, function (error, stdout) { // lgtm [js/shell-command-constructed-from-input]
|
||||
if (!error) {
|
||||
let lines = stdout.toString().replace(/ +/g, ' ').replace(/,+/g, '.').split('\n');
|
||||
args = ['-o', 'comm'];
|
||||
util.execSafe('ps', args).then((stdout) => {
|
||||
if (stdout) {
|
||||
let lines = stdout.replace(/ +/g, ' ').replace(/,+/g, '.').split('\n');
|
||||
srvs.forEach(function (srv) {
|
||||
let ps = lines.filter(function (e) {
|
||||
return e.indexOf(srv) !== -1;
|
||||
@ -909,7 +908,7 @@ function processLoad(proc, callback) {
|
||||
processesString.__proto__.trim = util.stringTrim;
|
||||
|
||||
const s = util.sanitizeShellString(proc);
|
||||
for (let i = 0; i <= 2000; i++) {
|
||||
for (let i = 0; i <= util.mathMin(s.length, 2000); i++) {
|
||||
if (!(s[i] === undefined)) {
|
||||
processesString = processesString + s[i];
|
||||
}
|
||||
@ -1057,9 +1056,9 @@ function processLoad(proc, callback) {
|
||||
}
|
||||
|
||||
if (_darwin || _linux || _freebsd || _openbsd || _netbsd) {
|
||||
const params = '-axo pid,pcpu,pmem,comm';
|
||||
execFile('ps', params.split(' '), { maxBuffer: 1024 * 20000 }, function (error, stdout) {
|
||||
if (!error) {
|
||||
const params = ['-axo', 'pid,pcpu,pmem,comm'];
|
||||
util.execSafe('ps', params).then((stdout) => {
|
||||
if (stdout) {
|
||||
let procStats = [];
|
||||
let lines = stdout.toString().split('\n').filter(function (line) {
|
||||
if (processesString === '*') { return true; }
|
||||
|
||||
52
lib/util.js
52
lib/util.js
@ -58,6 +58,7 @@ const stringToString = new String().toString;
|
||||
const stringSubstr = new String().substr;
|
||||
const stringTrim = new String().trim;
|
||||
const stringStartWith = new String().startsWith;
|
||||
const mathMin = Math.min;
|
||||
|
||||
function isFunction(functionToCheck) {
|
||||
let getType = {};
|
||||
@ -332,7 +333,7 @@ function wmic(command, options) {
|
||||
}
|
||||
|
||||
function getVboxmanage() {
|
||||
return _windows ? `${process.env.VBOX_INSTALL_PATH || process.env.VBOX_MSI_INSTALL_PATH}\\VBoxManage.exe` : 'vboxmanage';
|
||||
return _windows ? `"${process.env.VBOX_INSTALL_PATH || process.env.VBOX_MSI_INSTALL_PATH}\\VBoxManage.exe"` : 'vboxmanage';
|
||||
}
|
||||
|
||||
function powerShell(cmd) {
|
||||
@ -389,6 +390,42 @@ function powerShell(cmd) {
|
||||
});
|
||||
}
|
||||
|
||||
function execSafe(cmd, args, options) {
|
||||
let result = '';
|
||||
options = options || {};
|
||||
|
||||
return new Promise((resolve) => {
|
||||
process.nextTick(() => {
|
||||
try {
|
||||
const child = spawn(cmd, args, options);
|
||||
|
||||
if (child && !child.pid) {
|
||||
child.on('error', function () {
|
||||
resolve(result);
|
||||
});
|
||||
}
|
||||
if (child && child.pid) {
|
||||
child.stdout.on('data', function (data) {
|
||||
result += data.toString();
|
||||
});
|
||||
child.on('close', function () {
|
||||
child.kill();
|
||||
resolve(result);
|
||||
});
|
||||
child.on('error', function () {
|
||||
child.kill();
|
||||
resolve(result);
|
||||
});
|
||||
} else {
|
||||
resolve(result);
|
||||
}
|
||||
} catch (e) {
|
||||
resolve(result);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function getCodepage() {
|
||||
if (_windows) {
|
||||
if (!codepage) {
|
||||
@ -506,7 +543,7 @@ function countLines(lines, startingWith) {
|
||||
function sanitizeShellString(str, strict = false) {
|
||||
const s = str || '';
|
||||
let result = '';
|
||||
for (let i = 0; i <= 2000; i++) {
|
||||
for (let i = 0; i <= mathMin(s.length, 2000); i++) {
|
||||
if (!(s[i] === undefined ||
|
||||
s[i] === '>' ||
|
||||
s[i] === '<' ||
|
||||
@ -529,10 +566,11 @@ function sanitizeShellString(str, strict = false) {
|
||||
s[i] === '\'' ||
|
||||
s[i] === '`' ||
|
||||
s[i] === '"' ||
|
||||
strict && s[i] === '@' ||
|
||||
strict && s[i] === ' ' ||
|
||||
strict && s[i] == '{' ||
|
||||
strict && s[i] == ')')) {
|
||||
s[i].length > 1 ||
|
||||
(strict && s[i] === '@') ||
|
||||
(strict && s[i] === ' ') ||
|
||||
(strict && s[i] == '{') ||
|
||||
(strict && s[i] == ')'))) {
|
||||
result = result + s[i];
|
||||
}
|
||||
}
|
||||
@ -924,6 +962,7 @@ exports.wmic = wmic;
|
||||
exports.darwinXcodeExists = darwinXcodeExists;
|
||||
exports.getVboxmanage = getVboxmanage;
|
||||
exports.powerShell = powerShell;
|
||||
exports.execSafe = execSafe;
|
||||
exports.nanoSeconds = nanoSeconds;
|
||||
exports.countUniqueLines = countUniqueLines;
|
||||
exports.countLines = countLines;
|
||||
@ -942,5 +981,6 @@ exports.stringToString = stringToString;
|
||||
exports.stringSubstr = stringSubstr;
|
||||
exports.stringTrim = stringTrim;
|
||||
exports.stringStartWith = stringStartWith;
|
||||
exports.mathMin = mathMin;
|
||||
exports.WINDIR = WINDIR;
|
||||
exports.getFilesInPath = getFilesInPath;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "systeminformation",
|
||||
"version": "5.6.2",
|
||||
"version": "5.6.10",
|
||||
"description": "Simple system and OS information library",
|
||||
"license": "MIT",
|
||||
"author": "Sebastian Hildebrandt <hildebrandt@plus-innovations.com> (https://plus-innovations.com)",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user