{"id":13841475,"url":"https://github.com/mxrch/darkshot","last_synced_at":"2025-07-11T12:32:22.711Z","repository":{"id":39651157,"uuid":"294727354","full_name":"mxrch/darkshot","owner":"mxrch","description":"Lightshot scraper on steroids with OCR.","archived":true,"fork":false,"pushed_at":"2022-09-04T01:16:29.000Z","size":598,"stargazers_count":252,"open_issues_count":5,"forks_count":35,"subscribers_count":11,"default_branch":"master","last_synced_at":"2024-08-05T17:27:59.053Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mxrch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"mxrch","custom":"https://www.blockchain.com/btc/address/362MrYHLLMzWBbvBG7K5yzF18ouxMZeNge"}},"created_at":"2020-09-11T15:07:30.000Z","updated_at":"2024-05-24T08:35:04.000Z","dependencies_parsed_at":"2022-09-20T07:03:38.956Z","dependency_job_id":null,"html_url":"https://github.com/mxrch/darkshot","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mxrch%2Fdarkshot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mxrch%2Fdarkshot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mxrch%2Fdarkshot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mxrch%2Fdarkshot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mxrch","download_url":"https://codeload.github.com/mxrch/darkshot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225720409,"owners_count":17513597,"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":[],"created_at":"2024-08-04T17:01:11.868Z","updated_at":"2024-11-21T11:31:07.902Z","avatar_url":"https://github.com/mxrch.png","language":"Python","funding_links":["https://github.com/sponsors/mxrch","https://www.blockchain.com/btc/address/362MrYHLLMzWBbvBG7K5yzF18ouxMZeNge"],"categories":["JavaScript","JavaScript (485)","Python"],"sub_categories":[],"readme":"![darkshot](https://files.catbox.moe/lx20dm.png)\n\n# Description\nDarkshot is a scraper tool on steroids, to analyze all of the +2 Billions pictures publicly available on Lightshot.\\\nIt uses OCR to analyze pictures and auto-categorize them thanks to keywords and detection functions.\n\nYou can find pretty much everything : credentials, personal informations (emails, phone numbers, addresses, ID cards, passeports), banking information, etc.\\\nSince it's modulable, you can make your own detection function and use it as a monitoring tool.\n\n# Features\n👉 **Multi-threading**\\\n👉 **Anti-conflicting threads protection**\\\n👉 **Auto-saving and resuming session**\\\n👉 **3 links generators : Ascending, Descending and Random**\\\n👉 **Auto-translating keywords**\\\n👉 **Auto-analyzing pictures with multiple OCR langs**\\\n👉 **Auto-downloading OCR langs training data**\\\n👉 **Auto-categorizing pictures with keywords, groups and detection functions**\\\n👉 **Auto-exporting pictures per groups with their statistics in HTML**\\\n👉 **Modulable : add your own detection functions and keywords**\n\n# Screenshots\n\n\u003ch3 align=\"center\"\u003e💻 Default mode :\u003c/h3\u003e\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://files.catbox.moe/qwlcam.jpg\"\u003e\n\u003c/p\u003e\n\u003ch3 align=\"center\"\u003e👨‍💻 Debug mode :\u003c/h3\u003e\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://files.catbox.moe/jjwr19.jpg\"\u003e\n\u003c/p\u003e\n\n# Usage\n\n```\nC:\\Users\\mxrch\\Desktop\\darkshot-beta\u003epython run.py -h\nUsage: run.py [OPTIONS]\n\nOptions:\n  -t, --threads INTEGER  Number of threads  [default: 5]\n  -m, --mode TEXT        The mode to catch the more recent link, using it as a\n                         limit. (noisy, stealth)\n                         - noisy : it uploads a picture to get the more recent\n                         link\n                         - stealth : it uses the last link shown on Twitter\n                         here : https://prntscr.com/twitter.json  [default:\n                         noisy]\n\n  -a, --algo TEXT        Algorithm used to generate links. (ascending,\n                         descending, random)  [default: descending]\n\n  -d, --debug            Verbose mode, for debugging.  [default: False]\n  -ro, --resume_ro       Don't save the resume state, only read it.  [default:\n                         False]\n\n  -c, --clean TEXT       Clean some things you don't want anymore. (logs,\n                         resume, exports)\n                         If you want want to specify multiple values, specify\n                         them comma-separated and without spaces. Ex: \"--clean\n                         logs,exports\"\n\n  -h, --help             Show this message and exit.\n  ```\n\n### Example\n```bash\n$ python run.py -t 5 -m stealth -a descending\n```\n\n# Installation\n\n## Requirements\n\n- Python 3.4+ would be ok. (I developed it with Python 3.8.1)\n- Tesseract\n- These Python modules :\n```\nhttpx\ngoogletrans\npytesseract\nopencv-python\npillow\nscrapy\ntermcolor\nbeautifultable\nreprint\nclick\njson\nshutil\nimghdr\nhashlib\n```\n\n## 1. Tesseract-OCR\n\nYou'll find installation instructions for all main platforms here : https://tesseract-ocr.github.io/tessdoc/Downloads.html \\\n**Don't forget to add tesseract to your PATH.**\n\n## 2. Darkshot\n\n```bash\n$ git clone https://github.com/mxrch/darkshot\n$ cd darkshot\n$ python3 -m pip install -r requirements.txt\n```\nThen, we need to check if the chosen OCR langs in **config.py** are installed, and if not, it will auto-download and install them.\n- Run the file **check_ocr_langs.py** as Administrator.\n\nIf it tells you that it's okay, then it's okay. 🧠\n\n**You are ready !**\n\n# Configuring\n\nThere is a **config.py** file where you can configure almost everything, like the keywords to be translated, the OCR langs data to use, the resume state margin protection, the timeouts, the threads results delimiter (to avoid overloading the RAM), etc.\n\n### Explanations about some exotic parameters:\n#### Resume state margin protection\nBasically, the program keep every current processing link in a variable, and pass it in a function that save it if it detects an exception, like a CTRL+C.\\\nBut there is a problem.\\\nImagine you have 5 threads running, it will keep the last link given to the last thread, even if the thread has not finished.\\\nSo, you'll restart the program from after this link, and you will never really get the results from this link.\\\nThis is where this protection plays its role, it will consistently keep an arbitrary margin between the last link and some links back.\\\nTo calculate it, it sums the number of threads with the value in config.py.\n\n#### Threads results delimiter\nWhile we don't end the threads, their results are kept in the memory.\\\nSince Darkshot is designed to keep running several years, we can't keep the threads results indefinitely in the memory.\\\nSo, it takes the value in config.py (example: 100), and it will unload and restart threads each 100 links.\n\n#### Unwanted pictures folder\nMore simple, it justs calculate the hashes of all pictures in this folder (and subfolders), and if a Lightshot picture has one of these hashes, it don't process it.\\\nIt's like a blacklist but for pictures.\n\n# Detection customization\nAll the detection stuff is in the **lib/detection.py** file.\n\nBy default, I made 3 detection functions:\n- The **basic detection** (just check if the string is in the text)\n- The **isolated detection** (it checks if the string is in the text and if he is between 2 non-alphanumeric characters)\n- The **regex detection** (it checks if the regex finds something valid)\n\n## Detection groups\n1. Go in the file and look at the class, you'll see some functions and then the **Groups detection functions** (credentials, personal, banking and confidential).\n2. For your first detection group, you can simply copy \u0026 paste below the confidential group function.\n3. Change the function name to your desired name, as well as the `group_name` variable below.\n4. Then, you just put the detection functions you want with your keywords in it, where you see the `detec_state` variables.\n5. You now can add your group in `self.groups`, inside the `__init__` function. If your function is named secretsaliens, put `self.secretsaliens`.\n\n![](https://files.catbox.moe/zit7t6.png)\n\nVoilà, your group is added and functional !\n\n![](https://files.catbox.moe/ogrkt1.jpg)\n\n## Blacklists\nThere are two kinds of blacklists :\n- The **base** blacklist, which runs on every detection, whatever the group\n- The **group** blacklist, which runs only within the group it was assigned at.\n\n### Groups blacklists\nImagine if you want to detect pictures of conversation where they are talking about aliens but not related to the Area 51.\n1. First, you can create a detection group relating to the area 51 by simply detecting the string \"area 51\",\n2. Then you can simply add your blacklisted word like this in the `blacklist_groups` array within the `genBlacklists` function:\n\n![](https://files.catbox.moe/y3myyi.png)\n\nAnd then, for every picture detected in the area51 detection group, if the string \"alien\" is present in it, it will not save it.\n\n### Base blacklist\n1. Simply add your string here :\n\n![](https://files.catbox.moe/qxscnk.png)\n\nAnd it will not save the picture if this string is detected.\n\n## Detection functions\nYou can find them here :\n\n![](https://files.catbox.moe/0s82uu.PNG)\n\nIf you want to make your own detection function, you can :\n1. Copy \u0026 paste the `basicDetection` function below.\n2. Next, you can modify the conditions and everything you want.\n\nYou only need to keep the function args, and the return of `detec_state` if the detection finds nothing.\\\nOtherwise, you can return the updated state like this : `return self.updateState(group=group, word=word, lang=lang, detec_state=detec_state)`\n\n## Tradwrapper\nIf you want to use every translation of a certain word with your detection function, you can transform your function call from this :\\\n`detec_state = self.basicDetection(group_name, \"password\", \"\", text, detec_state)`\\\nTo this :\\\n`detec_state = self.tradWrapper(self.basicDetection, group_name, words[\"password\"], text, detec_state)`\n\n**Be sure that you added your word in the `words_to_translate` of the config.py file.**\n\n# Disclaimer\nThis tool is intended for an education usage only, I am not responsible of a possible bad usage of it.\\\nIts main goal is to demonstrate the danger of storing user data with incremental/guessable links, and I wanted to push the thing to the max.\nThis Lightshot issue is known since many years.\n\nPS : I started this project 2 months ago and I didn't saw this project at all before writing this Readme : https://github.com/utkusen/shotlooter \\\nBut you can check that we don't have the same code at all. I hope the two projects complement each other. 🙏\n\n# Thanks\n- @hexabeast for his cool multi-threading class\n- @caracali, @elweth-sec and @dutyfruit for beta-testing on linux \u0026 mac.\n- the HideAndSec team for motivation. ❤️\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmxrch%2Fdarkshot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmxrch%2Fdarkshot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmxrch%2Fdarkshot/lists"}