{"id":21197388,"url":"https://github.com/victorpreston/hacklab","last_synced_at":"2025-06-11T08:09:58.488Z","repository":{"id":177329865,"uuid":"660216538","full_name":"victorpreston/HackLab","owner":"victorpreston","description":"Welcome to HackLab, your go-to resource for hands-on cybersecurity projects. This repository is a collection of step-by-step projects designed to enhance your understanding of various cybersecurity concepts, techniques, and tools.","archived":false,"fork":false,"pushed_at":"2023-07-06T16:18:11.000Z","size":50,"stargazers_count":36,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-10T05:54:08.092Z","etag":null,"topics":["cyber-security","cybersecurity","hack","hacking","hacking-tools","keylogger","network","network-security","offensive-scripts","password","python","python-hacking","python3","threathunting","wifi"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/victorpreston.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-06-29T14:00:06.000Z","updated_at":"2025-05-07T17:31:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"751b261a-d5ac-4568-b0df-bcfc67223b23","html_url":"https://github.com/victorpreston/HackLab","commit_stats":null,"previous_names":["victorpreston/hacklab"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/victorpreston%2FHackLab","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/victorpreston%2FHackLab/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/victorpreston%2FHackLab/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/victorpreston%2FHackLab/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/victorpreston","download_url":"https://codeload.github.com/victorpreston/HackLab/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/victorpreston%2FHackLab/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259227959,"owners_count":22824904,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cyber-security","cybersecurity","hack","hacking","hacking-tools","keylogger","network","network-security","offensive-scripts","password","python","python-hacking","python3","threathunting","wifi"],"created_at":"2024-11-20T19:44:12.697Z","updated_at":"2025-06-11T08:09:58.473Z","avatar_url":"https://github.com/victorpreston.png","language":"Python","readme":"# HackLab\nA set of network tools for your hacking delight. \n\nOften when you're connected to a server, you don't necessarily have the right tools at hand. Experienced system administrators often removes packages like `netcat` - and you can forget all about `Wireshark`. Luckily we often find the `Python` package to be installed on such servers, though, and that's where these tools come in handy - a replacement for typical needed network tools. \n\n## Table of Content\n* [Host Scanner](https://github.com/victorpreston/HackLab/tree/master/HostScanner)\n* [Netcat Replacement](https://github.com/victorpreston/HackLab/tree/master/NetcatReplacement)\n* [SSH Command](https://github.com/victorpreston/HackLab/tree/master/SSH_Command)\n* [SSH Reverse](#ssh-reverse)\n* [TCP Client and Server](https://github.com/victorpreston/HackLab/tree/master/TCP_Client)\n* [TCP Proxy](#tcp-proxy)\n* [UDP Client](#udp-client)\n\n\u003cbr\u003e\u003cbr\u003e\n### Host Scanner\nScan a network for hosts.\n\nFirst you'd have to figure the local IP of the device you're connected to - something like `ip addr` for Linux, or `ip config` for Windows. Then edit the script (line 11 \u0026 12) with that IP (host) and define what subnet to search (subnet) - ex, .0/24 for the whole subnet.\n\nRun it with root privileges;\n\n    $ sudo python3 hostScanner.py\n\nAfter just a few seconds you'll begin to get devices that responded to a UDP broadcast.\n\n```\nHost Found: 100.103.175.246\nHost Found: 100.103.175.253\nHost Found: 100.103.175.243\nHost Found: 100.103.175.249\n```\n\n\u003cbr\u003e\u003cbr\u003e\n### Netcap Replacement\nNetcat (NC) is a popular network tool, which in some cases might be completly removed from remote servers. In that case might come in handy to have some simple NC functionality, such as pushing files, executing commands or initializing a shell. \n\nRun it with `-h` to get a full set of option and examples;\n\n```\nNetcat Replacement Tool\n\nUse with: netcatRepl.py -t target_host -p target_port\n-l --listen listen on [host]:[port] for incomming connections\n-e --execute=file_to_run to execute a given file on receiving a connection\n-c --command initialize a command shell\n-u --upload=destination to upload a file on receiving a connection\n\n\nExamples: \nnetcatRepl.py -t 192.168.0.1 -p 5555 -l -c\nnetcatRepl.py -t 192.168.0.1 -p 5555 -l -u=c:\\target.exe\nnetcatRepl.py -t 192.168.0.1 -p 5555 -l -e=\"cat /etc/passwd\"\necho 'Hello World' | ./netcatRepl.py -t 192.168.0.1 -p 5555\n```\n\nYou can test it locally by first firing up a listener;\n\n    $ ./netcatRepl.py -l -p 9999 -c\n    \nThe `-c` will initialize a command shell for the client machine. Then fire up a second replacement tool, without the listener;\n\n    $ ./netcatRepl.py -t localhost -p 9999\n    \nOn your client, hit `CTRL-D` to interact with the \"server\" which initializes the command shell;\n\n```\nnetcatRepl:#  ls ~\nDesktop\nDocuments\nDownloads\nDropbox\nMusic\nPictures\nProjects\nPublic\nTemplates\nVideos\nbin\ndotfiles\nmakepkg\n```\n\n\u003cbr\u003e\u003cbr\u003e\n### SSH Command\nFire off a quick command against a SSH host, that you already have the right credentials. \n\nThis requires you to have the `Paramiko` package installed - do so with your package-manager (preferred) or with `pip` ex.\n\n    $ sudo pacman -S python3-paramiko\n\nFirst define your SSH Host, Credentials and Command at the last line in this script. My test server is called `serv` and I'll be running the command `id` - Change the IP accordingly;\n\n```\nsshCommand('192.168.0.1','serv','PASSWORD','id');\n```\n\nThen run it through your glorious system;\n\n```\n$ ./sshCommand.py \nuid=1000(serv) gid=1000(serv) groups=1000(serv),10(wheel)\n```\n\n\u003cbr\u003e\u003cbr\u003e\n### SSH Reverse\nWindows doesn't come with SSH out the box, but we'd often like out communication encryption anyways. We can do this by reversing the communication, such as we'll be sending commands from our SSH server to a simple SSH client we set up on the Windows machine. \n\nWe'll be using `sshServer.py` and `sshReverseCmd.py` for this magic. \n\nThis requires you to have the `Paramiko` package installed - do so with your package-manager (preferred) or with `pip` ex.\n\n    $ sudo pacman -S python3-paramiko\n    \nNote that you'll have to pass along a SSH-Key in the server file. You could use this [Paramiko test key](https://github.com/paramiko/paramiko/blob/master/demos/test_rsa.key) if you feel lazy.\n\nThere's no example for this one (didn't want to be bothered firing up a Windows machine), but the idea is that you fire up a cmd window (on your Windows system), run the server file and point it to your own SSH server - Change the IP and Port accordingly;\n\n    $ sshServer.py 192.168.0.1 22\n    \nNow edit the `sshReverseCmd.py` (last line) with the Credentials for your own SSH server, and run it - This will be acting as our client; \n\n    $ sshReverseCmd.py\n\n\u003cbr\u003e\u003cbr\u003e\n### TCP Client and Server\nA simple example of a TCP client/server communication. This could'nt be more fitting, since we've have just been working with socket programming in my CS class. \n\nDefine the IP and Port in the `tcpServer.py` on line 5 \u0026 6 - By default it will bind to all devices (0.0.0.0) and listen on port 9999.\n\n\nNow, edit the `tcpClient.py` on line 4 \u0026 5 to target the listening server and port. Also edit your request on line 12. This can be done in a test our test-environment;\n\nNow fire up the server and your client (make the request);\n\n```\n$ ./tcpServer.py \n[*] Listening on 0.0.0.0:9999\nConnection accepted from: 127.0.0.1:49854\n[*] Received: Hello World\n```\n\n```\n$ ./tcpClient.py\nACK!\n```\n\nThe server only responds with `ACK!`, but you can easily expand this simple concept with your own returns.\n\n\u003cbr\u003e\u003cbr\u003e\n### TCP Proxy\nRead trafic data to get a better understanding of the applications using the protocol with the `tcpProxy.py`. A nice little test would be to point it at a ftp server. We'll test it on our localhost along with a FTP server that makes sense to you - Port 21 is priviledges, so run it with `sudo`;\n\n```\n$ sudo ./tcpProxy.py localhost 21 ftp.SERVER.com 21 True\n[*] Listening on localhost:21\n```\n\nNow fire up your FTP application and point it to `localhost` at port `21` and connect.\n\n```\n[==\u003e] Received connection from 127.0.0.1:53230\n0000 32 32 30 20 57 65 6C 63 6F 6D 65 20 74 6F 20 6C  220 Welcome to l\n0010 69 6E 75 78 31 34 2E 75 6E 6F 65 75 72 6F 2E 63  inux14.unoeuro.c\n0020 6F 6D 2E 20 54 4C 53 20 69 73 20 73 75 70 70 6F  om. TLS is suppo\n0030 72 74 65 64 2E 0D 0A                             rted...\n[\u003c==] Sending 55 bytes to localhost.\n[==\u003e] Received 10 bytes from localhost.\n0000 41 55 54 48 20 54 4C 53 0D 0A                    AUTH TLS..\n[==\u003e] Sent to remote.\n[\u003c==] Received 25 bytes from remote.\n0000 32 33 34 20 41 55 54 48 20 54 4C 53 20 73 75 63  234 AUTH TLS suc\n0010 63 65 73 73 66 75 6C 0D 0A                       cessful..\n[\u003c==] Sent to localhost.\n[*] No more data. Closing connection.\n```\n\n\u003cbr\u003e\u003cbr\u003e\n### UDP Client\nJust as our TCP client, the UDP client isn't much different. Define a target IP and Port at line 4 \u0026 5. The UDP client will fire off a message defined at line 9 and wait for the reponse. \n## Contributor Guide\n\n```mermaid\nflowchart LR\n    style Star fill:#444444,stroke:#000000,stroke-width:2px,stroke-dasharray:5,5,font-weight:bold\n    style Fork fill:#444444,stroke:#000000,stroke-width:2px,font-weight:bold\n    style branch fill:#444444,stroke:#000000,stroke-width:2px,font-weight:bold\n    style Edit fill:#444444,stroke:#000000,stroke-width:2px,font-weight:bold\n    style commit fill:#444444,stroke:#000000,stroke-width:2px,font-weight:bold\n    style creatpr fill:#444444,stroke:#000000,stroke-width:2px,font-weight:bold\n    Star[\"★ Star the Repository\"]--\u003eFork\n    Fork[Fork the project]--\u003ebranch[Create a New Branch]\n    branch--\u003eEdit[Edit file]\n    Edit--\u003ecommit[Commit the changes]\n    commit --\u003e|Finally|creatpr((Create a Pull Request))\n    \n ```\n\n## Disclaimer\n\nPlease note that the projects in HackLab are intended for ethical purposes only. Ensure that you adhere to ethical guidelines, applicable laws, and obtain proper permissions before applying any techniques or tools demonstrated in the projects. The creator of HackLab is not responsible for any misuse or illegal activities conducted using the information or code provided.\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvictorpreston%2Fhacklab","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvictorpreston%2Fhacklab","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvictorpreston%2Fhacklab/lists"}