spoof-detect / README.org
Niv Sardi
update README
50a0ff5
#+TITLE: Spoof Detect
Detect spoofed website by detecting logos from bank and financial entities in
pages with =ssl certificates= that do not match.
The process is pretty simple:
- [1/2] scrape gvt websites to get a list of entities.
- [x] 🇦🇷 BCRA
- [ ] other countries
- [x] get logos, names and url
- [x] navigate the url, extract the ssl certificate and look for =img= and tags
with =id= or =class= logo (needs more heuristics) to make a db of logos
- [x] screenshot the page and slice it into tiles generating YOLO annotations for
the detected logos
- [x] augment data using the logos database and the logoless tiles as background images
- [x] train yolov5s
- [x] feed everything to a web extension that will detect the logos in any page and show a warning if the =SSL certificate= mismatches the collected one. (this is actually a bit hacky, as yolov6 has A LOT of postprocessing and i can't be bothered to reimplement it all in JS for TSJS to work, it currently relies on a rather hackish local deamon written in python)
* running
#+begin_src sh
# build the training dataset
docker-compose up --build --remove-orphans -d
docker-compose exec python ./run
# run the training on your machine or collab
# https://colab.research.google.com/drive/10R7uwVJJ1R1k6oTjbkkhxPDka7COK-WE
git clone https://github.com/ultralytics/yolov5 # clone repo
pip install -U -r yolov5/requirements.txt # install dependencies
python3 yolov5/train.py --img 416 --batch 80 --epochs 100 --data ./ia/data.yaml --cfg ./ia/yolov5s.yaml --weights ''
#+end_src
* research
** yolo
https://github.com/ModelDepot/tfjs-yolo-tiny
https://github.com/Hyuto/yolov5-tfjs
** augmentation
there were a lot of augmentation solutions out there, because it had better
piplines and multicore support we went with:
- https://github.com/aleju/imgaug
but leaving the other here for refs
- https://github.com/srp-31/Data-Augmentation-for-Object-Detection-YOLO-
- https://github.com/mdbloice/Augmentor
** proveedores
http://www.bcra.gov.ar/SistemasFinancierosYdePagos/Proveedores-servicios-de-pago-ofrecen-cuentas-de-pago.asp
http://www.bcra.gov.ar/SistemasFinancierosYdePagos/Proveedores-servicios-de-billeteras-digitales-Interoperables.asp
http://www.bcra.gob.ar/SistemasFinancierosYdePagos/Entidades_financieras.asp
** certs in browsers
https://stackoverflow.com/questions/6566545/is-there-any-way-to-access-certificate-information-from-a-chrome-extension
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/webRequest#accessing_security_information
https://chromium-review.googlesource.com/c/chromium/src/+/644858
** papers
https://logomotive.sidnlabs.nl/downloads/LogoMotive_paper.pdf