Coder Social home page Coder Social logo

cristianzsh / freki Goto Github PK

View Code? Open in Web Editor NEW
407.0 24.0 58.0 14.11 MB

:wolf: Malware analysis platform

Home Page: https://cristian.sh/freki

License: GNU Affero General Public License v3.0

Dockerfile 0.06% Python 3.92% YARA 92.88% CSS 0.21% HTML 2.83% Makefile 0.01% Shell 0.10%
malware malware-analysis yara python3 flask virustotal reverse-engineering docker self-hosted self-hosting

freki's Introduction


Freki is a free and open-source malware analysis platform.

Goals

  1. Facilitate malware analysis and reverse engineering;
  2. Provide an easy-to-use REST API for different projects;
  3. Easy deployment (via Docker);
  4. Allow the addition of new features by the community.

Current features

  • Hash extraction.
  • VirusTotal API queries.
  • Static analysis of PE files (headers, sections, imports, capabilities, and strings).
  • Pattern matching with Yara.
  • Web interface and REST API.
  • User management.
  • Community comments.
  • Download samples.

Check our online documentation for more details.

Open an issue to suggest new features. All contributions are welcome.

How to get the source code

git clone https://github.com/cristianzsh/freki.git

Demo

Video demo: https://youtu.be/brvNUPgw7ho.

Running

The easy way: Docker

  1. Install Docker and Docker Compose.
  2. Edit the .env file.
  3. If you are going to use it in production, edit freki.conf to enable HTTPS.
  4. Run docker-compose up or make.

Other ways

If you want to use it locally (e.g., for development), please check our online documentation for more details.

How to cite this work

Freki was presented at the XXI Brazilian Symposium on Information and Computational Systems Security (SBSeg 2021).

@inproceedings{sbseg_estendido,
 author = {Cristian Souza and Felipe Silva},
 title = {Freki: Uma Ferramenta para Análise Automatizada de Malware},
 booktitle = {Anais do XXI Simpósio Brasileiro em Segurança da Informação e de Sistemas Computacionais},
 location = {Evento Online},
 year = {2021},
 pages = {58--65},
 publisher = {SBC},
 address = {Porto Alegre, RS, Brasil},
 doi = {10.5753/sbseg_estendido.2021.17340},
 url = {https://sol.sbc.org.br/index.php/sbseg_estendido/article/view/17340}
}

License

This project is licensed under the GNU Affero General Public License.

freki's People

Contributors

cristianzsh avatar feehley avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

freki's Issues

Improve the API

The API could save the results and community comments in a database (or Elasticsearch) for future requests. Currently the client is in charge of this.

Also, for performance reasons, it is interesting to avoid using the open function a lot.

Running in Docker: file upload not working

If I upload a file I get a 500 error.
Here is the log output:

db_1 | mbind: Operation not permitted
db_1 | mbind: Operation not permitted
db_1 | mbind: Operation not permitted
db_1 | mbind: Operation not permitted
db_1 | mbind: Operation not permitted
db_1 | mbind: Operation not permitted
db_1 | mbind: Operation not permitted
db_1 | mbind: Operation not permitted
db_1 | mbind: Operation not permitted
db_1 | mbind: Operation not permitted
db_1 | mbind: Operation not permitted
nginx_1 | 192.168.1.22 - - [06/Dec/2020:12:37:25 +0000] "GET / HTTP/1.1" 200 6169 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36" "-"
nginx_1 | 2020/12/06 12:37:34 [warn] 19#19: *1 a client request body is buffered to a temporary file /var/cache/nginx/client_temp/0000000001, client: 192.168.1.22, server: 192.168.99.100, request: "POST /scan_file HTTP/1.1", host: "192.168.1.110", referrer: "http://192.168.1.110/"
freki | /usr/local/lib/python3.8/dist-packages/tzlocal/unix.py:158: UserWarning: Can not find any timezone configuration, defaulting to UTC.
freki | warnings.warn('Can not find any timezone configuration, defaulting to UTC.')
freki | [2020-12-06 12:37:35,618] ERROR in app: Exception on /scan_file [POST]
freki | Traceback (most recent call last):
freki | File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 2447, in wsgi_app
freki | response = self.full_dispatch_request()
freki | File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 1952, in full_dispatch_request
freki | rv = self.handle_user_exception(e)
freki | File "/usr/local/lib/python3.8/dist-packages/flask_restplus/api.py", line 584, in error_router
freki | return original_handler(e)
freki | File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 1821, in handle_user_exception
freki | reraise(exc_type, exc_value, tb)
freki | File "/usr/local/lib/python3.8/dist-packages/flask/_compat.py", line 39, in reraise
freki | raise value
freki | File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 1950, in full_dispatch_request
freki | rv = self.dispatch_request()
freki | File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 1936, in dispatch_request
freki | return self.view_functionsrule.endpoint
freki | File "/usr/local/lib/python3.8/dist-packages/flask_login/utils.py", line 272, in decorated_view
freki | return func(*args, **kwargs)
freki | File "/freki/app/web/main.py", line 102, in scan_file
freki | pe_info = pe_file.get_all()
freki | File "/freki/app/core/pe.py", line 39, in get_all
freki | self.get_imports()
freki | File "/freki/app/core/pe.py", line 167, in get_imports
freki | self.info["imports"][dll_name].append({"name" : i.name.decode(),
freki | AttributeError: 'NoneType' object has no attribute 'decode'
nginx_1 | 192.168.1.22 - - [06/Dec/2020:12:37:35 +0000] "POST /scan_file HTTP/1.1" 500 290 "http://192.168.1.110/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.

Not exposing when using docker-compose

No matter what I try I cannot access freki web

git clone https://github.com/crhenr/freki.git
cd freki
nano .env (to edit keys)
docker-compose up

Here is my output:
freki | Waiting for MySQL to be up...
freki | Waiting for MySQL to be up...
freki_db | 2023-01-09 2:33:00 0 [Note] /usr/bin/mysqld (server 10.6.11-MariaDB) starting as process 1 ...
freki_db | 2023-01-09 2:33:00 0 [Note] InnoDB: Compressed tables use zlib 1.2.13
freki_db | 2023-01-09 2:33:00 0 [Note] InnoDB: Number of pools: 1
freki_db | 2023-01-09 2:33:00 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
freki_db | 2023-01-09 2:33:00 0 [Note] mysqld: O_TMPFILE is not supported on /var/tmp (disabling future attempts)
freki_db | 2023-01-09 2:33:00 0 [Note] InnoDB: Using Linux native AIO
freki_db | 2023-01-09 2:33:00 0 [Note] InnoDB: Initializing buffer pool, total size = 134217728, chunk size = 134217728
freki_db | 2023-01-09 2:33:00 0 [Note] InnoDB: Completed initialization of buffer pool
freki_db | 2023-01-09 2:33:00 0 [Note] InnoDB: 128 rollback segments are active.
freki_db | 2023-01-09 2:33:00 0 [Note] InnoDB: Creating shared tablespace for temporary tables
freki_db | 2023-01-09 2:33:00 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
freki_db | 2023-01-09 2:33:00 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
freki_db | 2023-01-09 2:33:00 0 [Note] InnoDB: 10.6.11 started; log sequence number 42282; transaction id 14
freki_db | 2023-01-09 2:33:00 0 [Note] Plugin 'FEEDBACK' is disabled.
freki_db | 2023-01-09 2:33:00 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
freki_db | 2023-01-09 2:33:00 0 [Note] InnoDB: Buffer pool(s) load completed at 230109 2:33:00
freki_db | 2023-01-09 2:33:00 0 [Note] Server socket created on IP: '0.0.0.0'.
freki_db | 2023-01-09 2:33:00 0 [Note] Server socket created on IP: '::'.
freki_db | 2023-01-09 2:33:00 0 [Warning] 'user' entry '@2f13d7913c93' ignored in --skip-name-resolve mode.
freki_db | 2023-01-09 2:33:00 0 [Warning] 'proxies_priv' entry '@% root@2f13d7913c93' ignored in --skip-name-resolve mode.
freki_db | 2023-01-09 2:33:00 0 [Note] /usr/bin/mysqld: ready for connections.
freki_db | Version: '10.6.11-MariaDB' socket: '/run/mysqld/mysqld.sock' port: 3306 MariaDB Server
freki_db | 2023-01-09 2:33:00 3 [Warning] Access denied for user 'root'@'192.168.99.99' (using password: NO)
freki | Starting Freki...
freki | [2023-01-09 02:33:03 +0000] [1] [INFO] Starting gunicorn 20.1.0
freki | [2023-01-09 02:33:03 +0000] [1] [INFO] Listening at: http://0.0.0.0:8000 (1)
freki | [2023-01-09 02:33:03 +0000] [1] [INFO] Using worker: sync
freki | [2023-01-09 02:33:04 +0000] [25] [INFO] Booting worker with pid: 25
freki | [2023-01-09 02:33:04 +0000] [26] [INFO] Booting worker with pid: 26
freki | [2023-01-09 02:33:04 +0000] [27] [INFO] Booting worker with pid: 27
freki | [2023-01-09 02:33:04 +0000] [28] [INFO] Booting worker with pid: 28
freki | [2023-01-09 02:33:04 +0000] [29] [INFO] Booting worker with pid: 29

Navigating to my docker host's IP and port is unable to connect
I've tried editing passwords/keys, leaving them the same, etc. with absolutely no luck :(

Can someone tell me what I may be doing wrong?

I followed all the steps exactly in: https://cristian.sh/freki/admin/run-docker.html#install-docker-and-docker-compose

Thanks!

Add statistics page

The page should contain an overview of the top users, downloaded samples, file types, etc.

Integration with Cuckoo or CAPEv2

Hi Sir, what a wonderful project.

Do you have any plan to integrate with Cuckoo or CAPEv2 sandbox result? Just like the VirusTotal. Submiting, quering, and displaying the score and the link to the Cuckoo page should be enough.

Thanks Sir.

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.