Coder Social home page Coder Social logo

rakhithjk / tcp_exploit Goto Github PK

View Code? Open in Web Editor NEW

This project forked from seclab-ucr/tcp_exploit

0.0 1.0 0.0 138 KB

Off-Path TCP Exploit: How Wireless Routers Can Jeopardize Your Secret

License: Apache License 2.0

JavaScript 66.24% HTML 2.45% Shell 0.13% Makefile 0.44% C 30.74%

tcp_exploit's Introduction

Off-Path TCP Exploit

We discover a subtle yet serious timing side channel that exists in all generations of IEEE 802.11 or Wi-Fi technology, due to the fact that they are half-duplex. By exploiting the vulnerability, we are able to constrcut reliable and practical off-path TCP injection attacks against the laterst versions of all three major operating systems (macOS, Windows, and Linux). Our attac only requires a devicce connected to the Internet via a wireless router, and be reachable from an attack server. The thread model is that a user is lured to visit a malicious website first and then the puppet (i.e., a malicious javascript) running in a browser collaborates with an off-path adversary to hijack a TCP connection between the client and server for the prupose of injecting a spurious HTTP response that will be cached in the browser. Later on, when the victim accesses to the server, the browser would load the cached object (e.g., a script) rather than request it again. Notice that the victim connection is established and preserved by the puppet who repeatedly includes HTML elements (e.g, images). See web-cache poisoning atttacks for more background.

Supported Platforms

Each branch is maintained for ONE OS. Currently, you're on the branch for Windows.

**Windows (Current Branch)

MacOS

How to build

1.1 sudo apt-get install libnetfilter-queue-dev

1.2 cd tcp_exploit/server/src

1.3 sh build.sh

Notice

You have to adjust some IP addresses in the source code as follows: Change the IP address of the attacker's machine at line 242 in the file tcp_exploit/client/index.html.

The attack needs to know the exact size of the response to the request "http://www.cnn.com/SPECIALS/map.economy/images/jamie.smith.irpt.tn.jpg". However, the size varies on different machines due to HTTP headers embedded in the response. In the paper, we proposed a solution to automatically determine the size, yet I just manually set the correct value (retrieved from the developer tools in Chrome) to it by adding an option -DSEQ_DELTA=1638 in the file tcp_exploit/server/Makefile. You can also use Wireshark to obtain such information.

During the attack's process, the TCP receive window size would grow as we keep requesting images. Based on the maximum window size that the client can achieve, you need to adjust the following at line 316 in the file tcp_exploit/server/src/main.c: #define SEQ_WINDOW MAX_WINDOW_SIZE << 2 where MAX_WINDOW_SIZE is the maximum window size representing the available space at the receiver's side.

Set up environment

In order to set up the environment, we need one windows machine as the victim and one linux machine as the attacker. Our target website is www.cnn.com.

Network Topology:

Attacker -------wire----------|
                           Router ---------wireless-------Victim (client)
Server   -------wire----------|

On the attacker's machine, run the commands below:

2.1 cd tcp_exploit/server

2.2 sudo sh iptables.sh

2.3 cd tcp_exploit/server/src

2.4 sudo ./server

2.5 cd tcp_exploit/client/src

2.6 sudo python -m SimpleHTTPServer 80 (Alternatively, you can access to the malicious code (i.e., tcp_exploit/src/index.html) without setting up the HTTP server if you open the html file in browsers locally.)

How to conduct experiment

3.1 Launch Chrome and then access to the malicious website (http://attacker's IP address or file:///Path_to_the_dir/tcp_exploit/client/src/index.html)

3.2 After the attack program finishes, you can access to the victim's website (i.e. www.cnn.com) to see whether the attack has successfully injected a page cached on the browser.

Disclaimer

This is a reasearch-oriented project. Anyone using it should be aware of the potential risks and responsible for his/her own actions.

Reference

@inproceedings{chen2018off,
  title={Off-Path TCP Exploit: How Wireless Routers Can Jeopardize Your Secrets},
  author={Chen, Weiteng and Qian, Zhiyun},
  booktitle={27th USENIX Security Symposium (USENIX Security 18)},
  year={2018},
  organization={USENIX Association}
}

tcp_exploit's People

Contributors

cvvt avatar

Watchers

 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.