Git Product home page Git Product logo

drubiobizcaino / data-exfiltration Goto Github PK

View Code? Open in Web Editor NEW

This project forked from omkartotade/data-exfiltration

0.0 1.0 0.0 2 KB

secret_sender is a program that manipulates the IP packet to send a message accepted from command line through one of the protocols (TCMP Echo Request, TCP SYN or UDP) to exfiltrate data onto a server. Since it looks like a normal packet to the server, it does not suspect anything.

Makefile 1.20% Python 98.80%

data-exfiltration's Introduction


Description-


secret_sender is a program that performs data exfiltration on the server. 
It takes the desination_ip, the type of interface, the type of packet and the actual message to be exfiltrated as command line arguments. 
The program then uses scapy to send a custom-made packet of the type specified in the command line (ICMP Echo Request, TCP SYN or UDP) and manipulates the IP header of every packet. 
We use the 'Identification' and the 'Fragment Offset' fields of the IP header to exfiltrate the data that is provided in the command line as message. We encode every character of the message in the Identification field, along with a randomly generated ID for that packet. 
So the higher 8 bits of the Identification field are set to the ASCII hex value of the character in the message and the lower 8 bits are encoded with the randomly generated ID.

The program then manipulates the fragment offset field of the IP packet. The fragment offset of the first packet is set as 0, for the second packet it is set as 1, for the third packet it is set as 2 and so on. 
Finally, when the entire message is sent charcater by character, we send the last packet in which the higher 8 bits of the Identification field are set as 0 and the lower 8 bits are set as the same randomly generated ID, the first bit of the fragment offset is set as 1 and the remaining 12 bits are set as the number of the packets sent.

The program uses scapy-python which is a tool that allows direct manipulation of network packets at any layer. We use the 'send()' command of scapy to actually create a packet with custom values for various fields. 
If we do not specify a particular field for the packet, scapy assigns the default value to that field.
 
The program does this for all of the three types of packets used in this assignment, i.e. ICMP Echo Request, TCP SYN and UDP packets.

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.