GithubHelp home page GithubHelp logo

betterwayelectronics / bgp_spoofing_ssh_mitm Goto Github PK

View Code? Open in Web Editor NEW
20.0 2.0 4.0 5 KB

Short guide on how to achieve BGP spoofing and implement a MiTM attack against SSH

bgp mitm ssh honeypot ssh-mitm bgp-mitm bgp-spoofing quagga bgpd zebra

bgp_spoofing_ssh_mitm's Introduction

BGP Spoofing & SSH MiTM

Assumptions

  • You are on a network with numerous systems advertising BGP routers.
  • You have Quagga & BGPD installed and configured and are part of the network

BGP Spoofing


In the above example I am connected to machine 10.1.0.1.
My target will be the machine on 10.45.0.1.

The first step in this process is to modify my own BGPD settings to insert the victim's IP address with a smaller CIDR.
This is done by editing /etc/quagga/bgpd.conf and adding the following line network 10.45.0.0/25 under my own.

This was also done to /etc/quagga/zebra.conf. In this case ip address was modified to suit the intercepted IP on both interfaces.

I reset the BGP and Zebra services and the ip route now appeared as such:

This meant that I was now intercepting all communication to and from 10.45.0.0/25.

If I looked at the routing from another machine, it is again confirmed.

SSH MiTM

I first modified my default SSH port to 1337 and enabled this new port in my nftables. I cant exactly use my SSH while honeypotting it!

I decided against an interactive honeypot as I simply wanted their SSH passwords, they would assume they were already hacked or there was an issue with their password/session in this scenario - but this is only given if I kept the interception going for a short period.

I uploaded the ssh-honeypot to the server and installed it with the following commands

  • apt-get install clang make libssh-dev libjson-c-dev
  • ssh-keygen -t rsa -f ./ssh-honeypot.rsa
  • bin/ssh-honeypot –r ./ssh-honeypot.rsa

I then ran the honeypot with the command bin/ssh-honeypot -h and it was done.
If I attempted to connect to 10.45.0.1 I would get the following result:

A success! I could now from this point monitor any unencrypted data from 10.45.0.1 with the command tcpdump –I ens192 –X src 10.45.0.1. Though in this environment there was no opportunity to do so.

I could also add every single IP in the network to my Zebra and BGP configuration. This would force all IPs to connect through me.

bgp_spoofing_ssh_mitm's People

Contributors

betterwayelectronics avatar

Stargazers

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

Watchers

 avatar  avatar

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.