Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cho đồ án #321

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.6-alpine3.8
FROM python:3.10-alpine3.14

RUN apk -U --no-cache add git build-base && \
rm -rf /root/* && \
Expand Down
674 changes: 0 additions & 674 deletions LICENSE

This file was deleted.

94 changes: 7 additions & 87 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,91 +1,11 @@
SNARE
=====

[![Documentation Status](https://readthedocs.org/projects/snare/badge/?version=latest)](http://snare.readthedocs.io/en/latest/?badge=latest)
[![Build Status](https://travis-ci.org/mushorg/snare.svg?branch=master)](https://travis-ci.org/mushorg/snare)
[![Coverage Status](https://coveralls.io/repos/github/mushorg/snare/badge.svg?branch=master)](https://coveralls.io/github/mushorg/snare?branch=master)

_**Super Next generation Advanced Reactive honEypot**_

About
-----

SNARE is a web application honeypot sensor attracting all sort of maliciousness from the Internet.

Documentation
--------------

The documentation can be found [here](http://snare.readthedocs.io).

Basic Concepts
--------------

- Surface first. Focus on the attack surface generation.
- Sensors and masters. Lightweight collectors (SNARE) and central decision maker (tanner).

Getting started
---------------

- You need Python3.6 to run SNARE
- This was tested with a recent Ubuntu based Linux.

#### Steps to setup

1. Get SNARE: `git clone https://github.com/mushorg/snare.git` and `cd snare`
2. [Optional] Make virtual environment: `python3 -m venv venv`
3. [Optional] Activate virtual environment: `. venv/bin/activate`

**Note:** Do not use sudo with below commands if you're running snare in virtual environment.

4. Install requirements: `sudo pip3 install -r requirements.txt`
5. Setup snare: `sudo python3 setup.py install`
6. Clone a page: `sudo clone --target http://example.com --path <path to base dir>`
7. Run SNARE: `sudo snare --port 8080 --page-dir example.com --path <path to base dir>`
8. Test: Visit http://localhost:8080/index.html
9. (Optionally) Have your own [tanner](https://github.com/mushorg/tanner) service running.

[Note : Cloner clones the whole website, to restrict to a desired depth of cloning add `--max-depth` parameter]

#### Docker build instructions

1. Change current directory to `snare` project directory
2. `docker-compose build`
3. `docker-compose up`
4. Snare will start on 0.0.0.0 with port 80.
More information about running `docker-compose` can be found [here.](https://docs.docker.com/compose/gettingstarted/)

In case of an error while running `docker-compose up`, check the availability of port 80, if it is occupied then refer to Docker documentation to change the default port.

You obviously want to bind to 0.0.0.0 and port 80 when running in _production_.

## Testing

In order to run the tests and receive a test coverage report, we recommend running `pytest`:

## RUN
```
pip install pytest pytest-cov
sudo pytest --cov-report term-missing --cov=snare snare/tests/
docker-compose up --build -d
```

## Sample Output

```shell

# sudo snare --port 8080 --page-dir example.com

_____ _ _____ ____ ______
/ ___// | / / | / __ \/ ____/
\__ \/ |/ / /| | / /_/ / __/
___/ / /| / ___ |/ _, _/ /___
/____/_/ |_/_/ |_/_/ |_/_____/


privileges dropped, running as "nobody:nogroup"
serving with uuid 9c10172f-7ce2-4fb4-b1c6-abc70141db56
Debug logs will be stored in /opt/snare/snare.log
Error logs will be stored in /opt/snare/snare.err
======== Running on http://127.0.0.1:8080 ========
(Press CTRL+C to quit)
you are running the latest version
### NOTE:
Chỉnh link web trong Dockerfile

```
###
Đã fix docker-compose mới nhất.
Dùng python phiên bản mới.
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: '2.3'
version: '3.9'

networks:
snare_local:
Expand Down
2 changes: 1 addition & 1 deletion readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ build:
image: latest

python:
version: 3.6
version: 3.10
12 changes: 6 additions & 6 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
aiohttp==3.7.4
aiohttp_jinja2==1.5.0
beautifulsoup4==4.6.3
cssutils==1.0.2
gitpython==3.1.30
pycodestyle==2.4.0
aiohttp
aiohttp_jinja2
beautifulsoup4
cssutils
gitpython
pycodestyle