Skip to content

Commit

Permalink
version 0.9
Browse files Browse the repository at this point in the history
  • Loading branch information
deibit committed Sep 23, 2023
1 parent 60b6fab commit 40f142d
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 101 deletions.
123 changes: 29 additions & 94 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
# Cansina

**IMPORTANT**: Clone this repository with:

```
git clone --depth=1 https://github.com/deibit/cansina
```

---

[![Build Status](https://travis-ci.org/deibit/cansina.svg?branch=master)](https://travis-ci.org/deibit/cansina)

Cansina is a Web Content Discovery Application.
Expand All @@ -24,51 +16,20 @@ Cansina is included in [BlackArch Linux](https://www.blackarch.org/), give it a

![CansinaImage](https://github.com/deibit/cansina/raw/gh-pages/images/cansina-showcase.png "Image")

## Speed

Wanna make Cansina run faster? Grab my cup of coffee.

Cansina downloads page content for inspection by default (Yep, Cansina does not racing for speed). but you can disable GET requests and make them HEAD (no body page download). Also, do no print the fancy terminal interface (you will lost some hackish points).

- Put **-H** to make requests lighter
- Put **--no-progress** to print no fancy information in the screen
- Raise default threads to ten with **-t 10** (or even more if you don't mind noise and faulty tries)

## Integrated tree viewer

Cansina integrates a tree viewer (thanks to asciitree package) to output a project sqlite base stored results (http 200 status code by now).

```
./cansina.py -V output/http_testphp.vulnweb.com.sqlite
```

![ViewerImage](https://github.com/deibit/cansina/raw/gh-pages/images/viewer.png "Image")


## Windows

Untested in Windows. It should work with **--no-progress**

## Installation

```
git clone --depth=1 https://github.com/deibit/cansina
cd cansina
pip install -r requirements.txt
pip install cansina
```

From release tagged Py27, Cansina is made with Python 3.x in mind.

[Last version with Python 2.7 support](https://github.com/deibit/cansina/tree/Py27)
If you don't want to pollute your environment to try cansina just create a virtual env

## Usage

[Wiki](https://github.com/deibit/cansina/wiki) is full of documentation and examples. But as a fast example:

```
python3 cansina.py -u <site_url> -p <payload_file>
cansina -u <site_url> -p <payload_file>
```

Help summary:
Expand All @@ -80,57 +41,7 @@ python3 cansina.py -h
## Options

```
usage: cansina.py -u url -p payload [options]
Cansina is a web content discovery tool. It makes requests and analyze the
responses trying to figure out whether the resource is or not accessible.
optional arguments:
-h, --help show this help message and exit
-A AUTHENTICATION Basic Authentication (e.g: user:password)
-C COOKIES your cookies (e.g: key:value)
-D Check for fake 404 (warning: machine decision)
-H Make HTTP HEAD requests
-P PROXIES Set a http and/or https proxy (ex:
http://127.0.0.1:8080,https://...
-S Remove ending slash for payloads
-T REQUEST_DELAY Time (a float number, e.g: 0.25 or 1.75) between
requests
-U Make payload requests upper-case
-a USER_AGENT The preferred user-agent (default provided)
-b BANNED List of banned response codes
-B UNBANNED List of unbanned response codes, mark all response as
invalid without unbanned response codes, higher
priority than banned
-c CONTENT Inspect content looking for a particular string
-d DISCRIMINATOR If this string if found it will be treated as a 404
-e EXTENSION Extension list to use e.g: php,asp,...(default none)
-o OUTPUT Write (append) results in CSV format to a file; -o
<filename>
-p PAYLOAD A single file, a file with filenames (.payload) or a
directory (will do *.txt)
-s SIZE_DISCRIMINATOR
Will skip pages with this size in bytes (or a list of
sizes 0,500,1500...)
-t THREADS Number of threads (default 4)
-u TARGET Target url
-r RESUME Resume a session
-R Parse robots.txt and check its contents
--recursive Recursive descend on path directories
--no-persist Do not Use HTTP persistent connections
--full-path Show full path instead of only resources
--show-type Show content-type in results
--no-follow Do not follow redirections
--line CONTINUE_LINE Continue payload in line <n>
--resumer Save session in a file
--headers HEADERS Set personalized headers: key=value;key=value...
--capitalize Transform 'word' into 'Word'.
--strip-extension Strip word extension: word.ext into word
--alpha Filter non alphanumeric words from wordlist
--no-progress Don't show tested words and progress. (For dumb
terminals)
--no-colors Don't use output colors to keep output clean, e.g.
when redirecting output to file
usage: cansina.py -h
License, requests, etc: https://github.com/deibit/cansina
```
Expand All @@ -156,6 +67,26 @@ License, requests, etc: https://github.com/deibit/cansina
- Persistent connections
- Complementary tools

## Speed

Wanna make Cansina run faster? Grab my cup of coffee.

Cansina downloads page content for inspection by default (Yep, Cansina does not racing for speed). but you can disable GET requests and make them HEAD (no body page download). Also, do no print the fancy terminal interface (you will lost some hackish points).

- Put **-H** to make requests lighter
- Put **--no-progress** to print no fancy information in the screen
- Raise default threads to ten with **-t 10** (or even more if you don't mind noise and faulty tries)

## Integrated tree viewer

Cansina integrates a tree viewer (thanks to asciitree package) to output a project sqlite base stored results (http 200 status code by now).

```
cansina -V output/http_testphp.vulnweb.com.sqlite
```

![ViewerImage](https://github.com/deibit/cansina/raw/gh-pages/images/viewer.png "Image")

## Important

This tool is intended to be used in a fair and legal context, meaning, for example,
Expand All @@ -168,7 +99,11 @@ One of its legitimate uses might be the one described in the following article:
## Dependencies

- [requests](https://github.com/kennethreitz/requests)
- Python 3
- [asciitree](https://github.com/mbr/asciitree)

## Windows

Untested in Windows. It should work with **--no-progress**

## Wordlists

Expand Down
1 change: 0 additions & 1 deletion cansina/cansina.py → cansina/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@


current_directory = os.path.dirname(os.path.abspath(__file__))
print(current_directory)

# Default options
#
Expand Down
22 changes: 16 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,26 @@
from setuptools import setup, find_packages

from pathlib import Path

this_directory = Path(__file__).parent
long_description = (this_directory / "README.md").read_text()

setup(
name="cansina",
version="1.0",
version="0.9",
description="Web Content Discovery Tool",
author="David Garcia",
author_email="[email protected]",
url="https://github.com/deibit/cansina",
packages=find_packages(),
entry_points={
"console_scripts": [
"cansina=cansina.cansina:__main__",
"cansina=cansina.main:__main__",
],
},
install_requires=[
"requests",
],
include_package_data=True,
long_description=long_description,
long_description_content_type="text/markdown",
install_requires=["requests", "asciitree"],
package_data={"cansina.utils": ["*.txt"]},
keywords=["pentesting", "cybersecurity", "websecurity"],
)

0 comments on commit 40f142d

Please sign in to comment.