GithubHelp home page GithubHelp logo

hyber-code / pastehunter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kevthehermit/pastehunter

0.0 2.0 0.0 89 KB

Scanning pastebin with yara rules

License: GNU General Public License v3.0

Python 100.00%

pastehunter's Introduction

PasteHunter

PasteHunter is a python3 application that is designed to query a collection of sites that host publicliy pasted data. For all the pasts it finds it scans the raw contents against a series of yara rules looking for information that can be used by an org or a researcher.

Supported Inputs

Pastehunter currently has support for the following sites:

  • pastebin.com
  • dumpz.org
  • gist.github.com

Support for the following sites is listed as ToDo:

  • paste.ee

Supported Outputs

Pastehunter supports several output modules:

  • dump to ElasticSearch DB (default)
  • email sending over SMTP
  • dump to JSON file
  • dump to CSV file

SMTP

Multiple recipients can be specified, with different rulesets each. It's possible to combine these rules using simple OR or AND logic (respectively rule_list and mandatory_rule_list). You need to set SMTP_SECURITY in the config file to one of the following options:

  • 'tls'
  • 'starttls'
  • 'none'

Refer to your email provider to determine which you require.

PostProcess Modules

Pastehunter comes with a couple of post process modules that extact useful data from pastes or pass them to other services The following are default modules:

  • Base64 Decoders
    • Cuckoo
    • Viper

PreReqs

Pastebin

You need a Pro account on pastebin that has access to the scraping API. https://pastebin.com/api_scraping_faq

GitHub

Github needs an oauth token to stop it hitting the free ratelimit. Create one at https://github.com/settings/tokens

YOU DO NOT NEED TO GIVE IT ANY ACCESS PERMISSIONS

Installation

Local install

Elastic Search

https://www.elastic.co/guide/en/elasticsearch/reference/current/deb.html

Kibana

https://www.elastic.co/guide/en/kibana/current/deb.html

Yara

https://yara.readthedocs.io/en/latest/gettingstarted.html#compiling-and-installing-yara

If you have yara errors check the installed version numbers for yara and yara-python match the lastest versions.

PasteHunter

git clone https://github.com/kevthehermit/pastehunter

Python / Deps

Python 3 pip3 install -r requirements.txt

Using Docker

Install Docker & docker-compose

docker build . -t pastehunter

Using Docker-compose

Running all the applications

Run docker-compose up -d

Kibana

Kibana is running only on the localhost interface on default port (5601).

Kibana use the default login and password : elastic and changme

Kibana is using the static IP address : 172.16.10.12 in the esnet network

Elasticsearch

Elasticsearch is running only on the localhost interface on default port 9200. The mount point is /usr/share/elasticsearch/data by default

if elastic search fails to start and you see "max virtual memory areas vm.max_map_count [65530] likely too low" in the logs then try

sudo sysctl -w vm.max_map_count=262144

https://elk-docker.readthedocs.io/#troubleshooting Paragraph starting As from version 5

Pastehunter

You can re-run the pastehunter script by doing docker-compose up -d Docker-compose will use already running instances of Elasticsearch and Kibana

Configure

copy settings.json.sample to settings.json populate the details. For the scraping API you need to whitelist your IP on pastebin. No API key is required. See the link above

The logging level can be set to one of the following values.

Level Numerical
CRITICAL 50
ERROR 40
WARNING 30
INFO 20
DEBUG 10
NOTSET 0

The default is INFO:20

Running

Start the application with python3 pastehunter.py

It may be useful to run in a screen to keep it running in the background.

Service

Service config is coming

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.