All Projects → attachmentscanner → carrierwave-attachmentscanner

attachmentscanner / carrierwave-attachmentscanner

Licence: MIT License
Adds the ability to send CarrierWave uploads to Attachment Scanner for virus and malware prevention.

Programming Languages

ruby
36898 projects - #4 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to carrierwave-attachmentscanner

MalwareDatabase
Malware samples for analysis, researchers, anti-virus and system protection testing.(1300+ Malware-samples!)
Stars: ✭ 21 (+50%)
Mutual labels:  virus, malware, virus-scanning
Malware-Sample-Sources
Malware Sample Sources
Stars: ✭ 214 (+1428.57%)
Mutual labels:  virus, malware, virus-scanning
Malware-with-Backdoor-and-Keylogger
👨🏻‍💻 A great tool for Ethical Hackers, a malware programmed with Backdoor and Keylogger.
Stars: ✭ 25 (+78.57%)
Mutual labels:  virus, malware
ToxicEye
👽 Program for remote control of windows computers via telegram bot. Written in C#
Stars: ✭ 305 (+2078.57%)
Mutual labels:  virus, malware
Anti-Debugging
A collection of c++ programs that demonstrate common ways to detect the presence of an attached debugger.
Stars: ✭ 297 (+2021.43%)
Mutual labels:  virus, malware
Botnets
This is a collection of #botnet source codes, unorganized. For EDUCATIONAL PURPOSES ONLY
Stars: ✭ 2,523 (+17921.43%)
Mutual labels:  virus, malware
Serpentine
C++/Win32/Boost Windows RAT (Remote Administration Tool) with a multiplatform Java/Spring RESTful C2 server and Go, C++/Qt5 frontends
Stars: ✭ 216 (+1442.86%)
Mutual labels:  virus, malware
Cypher
Pythonic ransomware proof of concept.
Stars: ✭ 178 (+1171.43%)
Mutual labels:  virus, malware
The-MALWARE-Repo
A repository full of malware samples.
Stars: ✭ 380 (+2614.29%)
Mutual labels:  virus, malware
JavaRansomware
Simple Ransomware Tool in Pure Java
Stars: ✭ 99 (+607.14%)
Mutual labels:  virus, malware
go-malware
Golang Virus Examples
Stars: ✭ 67 (+378.57%)
Mutual labels:  virus, malware
Open Myrtus
RCEed version of computer malware / rootkit MyRTUs / Stuxnet.
Stars: ✭ 208 (+1385.71%)
Mutual labels:  virus, malware
Telegram Rat
Windows Remote Administration Tool via Telegram. Written in Python
Stars: ✭ 201 (+1335.71%)
Mutual labels:  virus, malware
Kicomav
KicomAV is an open source (GPL v2) antivirus engine designed for detecting malware and disinfecting it.
Stars: ✭ 227 (+1521.43%)
Mutual labels:  virus, malware
Php Antimalware Scanner
AMWScan (PHP Antimalware Scanner) is a free tool to scan php files and analyze your project to find any malicious code inside it.
Stars: ✭ 181 (+1192.86%)
Mutual labels:  virus, malware
Cerberus
A complete Grabber, sending data to a TCP server that you have to host and stocking all in a database.
Stars: ✭ 32 (+128.57%)
Mutual labels:  virus, malware
Malware
Rootkits | Backdoors | Sniffers | Virus | Ransomware | Steganography | Cryptography | Shellcodes | Webshells | Keylogger | Botnets | Worms | Other Network Tools
Stars: ✭ 156 (+1014.29%)
Mutual labels:  virus, malware
Antidebugging
A collection of c++ programs that demonstrate common ways to detect the presence of an attached debugger.
Stars: ✭ 161 (+1050%)
Mutual labels:  virus, malware
ConTroll Remote Access Trojan
Created a VERY SIMPLE remote access Trojan that will establish administrative control over any windows machine it compromises.
Stars: ✭ 69 (+392.86%)
Mutual labels:  virus, malware
Fe2O3
Simple prepender virus written in Rust
Stars: ✭ 84 (+500%)
Mutual labels:  virus, malware

Carrierwave::Attachmentscanner

Build Status

Carrierwave::Attachmentscanner allows you to scan any file uploaded by CarrierWave for viruses or other malicious content.

It works by sending the upload to Attachment Scanner to be checked and then raising an error if the file matches a known database.

Installation

Add carrierwave-attachmentscanner to your Gemfile

gem 'carrierwave-attachmentscanner'

Download and install by running:

bundle

Initialize the scanner with your cluster_url and api_token (If you don't already have these values head to Attachment Scanner and sign up for an account):

Adding to an Uploader

You can then include CarrierWave::AttachmentScanner in your uploaders:

class YourUploader < CarrierWave::Uploader::Base
  include CarrierWave::AttachmentScanner
end

Adding your credentials

bundle exec rails generate carrierwave_attachmentscanner:config [CLUSTER_URL] [API_TOKEN]

This will create config/initializers/carrierwave_attachmentscanner.rb with the following content:

CarrierWave::AttachmentScanner.configure do |config|
  config.url = "CLUSTER_URL"
  config.api_token = "API_TOKEN"
end

If you leave things blank we'll assume that you're going to set the config values within ENV variables like the following:

CarrierWave::AttachmentScanner.configure do |config|
  config.url = ENV['ATTACHMENT_SCANNER_URL']
  config.api_token = ENV['ATTACHMENT_SCANNER_API_TOKEN']
end

Usage

Once installed CarrierWave::AttachmentScanner will call the endpoint with any file a user attempts to call on your uploader.

It will raise a CarrierWave::IntegrityError whenever a malicious file is found, by default this will then prevent the model from saving.

Customising the response

There are two methods that can be used to compare the response from the AttachmentScanner API and present an error message within CarrierWave.

The first method blocked_scan_statuses is used to compare the scan result with a list of statuses.

def blocked_scan_statuses
  %w(found)
end

The second can be overridden in order to use the response to alter the upload message.

# This can be overridden in order to change the message
def scan_error_message(result)
  "AttachmentScanner prevented this upload"
end

Finally if you need total control you can override the scan_result_allowed? method completely.

Development / Contributing

Pull requests are welcome. There is an RSpec suite at /spec. Please ensure that tests pass before submitting a pull request.

Thank you for making CarrierWave::AttachmentScanner better.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].