Giter VIP home page Giter VIP logo

pcap_assembler's Introduction

PCAP Assembler with CPP

서문

사실 Python이나 C#쓰면 겁나쉬운건데 살면서 처음다뤄보는 CPP 라고쓰고 C로 해보는 첫 프로젝트입니다

정말 쓸모없는 여담이지만 여자친구 노래 완전좋아요 ㄹㅇ ㅜㅜ

사용 라이브러리

라이브러리같은거 키우는 취미없어요. 오직 노가다 뿐이죠.

사실 라이브러리 쓸줄몰라서 이러는건 안비밀!

사용법

뭐 복잡한거 없어요! 겁나게 쉬워요 , 간지나게 터미널 하고 켜주세요. 이렇게 쳐주세요!

그리고 PCAP Assembler가 있는 경로를 들어가서 ./Fpcap 누르면 에러가 뿜뿜 할거에요.그러니까 ./Fpcap Desktop/doghunnyjam.pcap 요로코롬 하세요 참 쉽죠?

딱히 너보라고 쓰는 정리는 아니라구! 흥!

PCAP Header (With Magic~~,그리고..파이어볼!~~)

                          pcap fileheader

__________________________________________________________________________

|       4             |    2      |      2    |           4               |

__________________________________________________________________________

|  magic(0xa1b2c3d4)  | maj.ver   |  min.ver  |  gmt to localcorrection  |

__________________________________________________________________________

|       4             |           4           |           4              |

 _________________________________________________________________________

|    캡쳐한 시각         |     snap의 최대 길이     |     datalink type        |

_________________________________________________________________________

PCAP Basic Type

                                 pcapheader

_______________________________________________________________________________

|                  8                  |        4       |         4        |

 ______________________________________________________________________________

| seconds(4)       | micro seconds(4) |    캡쳐한 길이    |       패킷 길이    |

_______________________________________________________________________________

Ethernet

                          ethernet protocol stack

 ____________________________________________________________________________

|                   6            |                 6            |       2      |

____________________________________________________________________________

|         dest mac address       |       src mac address        |     type     |

____________________________________________________________________________

IPV4 Stack

                           IPv4 protocol stack

 _____________________________________________________________________________________

|     4     |     4      |        8           |             16                       |

 _____________________________________________________________________________________

|   version |   HLEN     |   service type     |        total length                  |

 _____________________________________________________________________________________

|                       16                    |     3  |                13           |

 _____________________________________________________________________________________

|                identification               |  Flags |      Fragment offset        |

 _____________________________________________________________________________________

|          8             |           8        |            16                        |

 _____________________________________________________________________________________

|    Time To Live        |      Protocol      |        Header Checksum               |

 ____________________________________________________________________________________

|                                        32                                          |

 ____________________________________________________________________________________

|                                  Source IPv4 Address                               |

 ____________________________________________________________________________________

|                                        32                                          |

 ____________________________________________________________________________________

|                               Destination IPv4 Address                             |

 ____________________________________________________________________________________

|                                  0~320(40 바이트)                                  |

 ____________________________________________________________________________________

|                                 Options and Padding                                |

 ____________________________________________________________________________________

##ARP ARP

____________________________________________________________________________
|     4     |     4      |        8           |             16             |

 ___________________________________________________________________________  

|   version |   HLEN     |   Type Of Service  |        total length        |


|    H/W length(8)  | Pro length(8) |           OP code (16)               |

 ____________________________________________________________________________

|         Sender H/W Address (가변 , Ethernet 48bits, 6Bytes)               |

 ____________________________________________________________________________

|          Sender Protocol Address (가변 , IP 32bits, 4Bytes)               |

 ____________________________________________________________________________

|          Target H/W Address (가변 , Ethernet 48bits, 6Bytes)              |

 ____________________________________________________________________________

|            Target Protocol Address (가변 , IP 32bits, 4Bytes)             |

 ____________________________________________________________________________

참고문헌

https://www.tcpdump.org/pcap.html

pcap_assembler's People

Contributors

cokia avatar

Watchers

James Cloos 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.