본문 바로가기

Etc

1. from pwn import * 번역중. pwntools 를 사용하는 가장 일반적인 방법은 >>> from pwn import * 이다. 아래는 위 import 를 통해 가져오는 objects 와 routines 들을 사용 빈도 등에 따라 대충 정리한 것이다. contextpwnlib.context.contextpwntools 편의성을 위한 거의 대부분의 세팅을 담당한다.익스플로잇이 뭔가 잘못되었을 때 context.log_level = ‘debug’ 를 쓸 수 있다Scope-aware, so you can disable logging for a subsection of code viapwnlib.context.ContextType.localremote, listen, ssh, processpwnlib.tubesCTF 에서 사용하는 거.. 더보기
0. Getting Started 유용한 CTF pwnable 툴인 pwntool 의 레퍼런스를 번역합니다. Getting Started pwntools 을 활용하기 위한 몇 가지 예제를 살펴보도록 하자.익스플로잇을 작성할 때, pwntools 은 "kitchen sink" 접근법을 따른다 >>> from pwn import * 전역 네임스페이스를 다 불러올 수 있도록 한방에 import 해 준다.어셈블, 디스어셈블, 팩, 언팩 기타등등의 모듈들을 쓸 수 있게 된다. Making Connections pwn 하려면 연결을 해야한다. pwntools 에서는 멍청하도록 간단한 모듈인 pwnlib.tubes 를 만들었다.프로세스, 소켓, 시리얼 포트 외 수많은 인터페이스를 제공하므로, 다양한 작업들에 있어 끝내주는 조력자가 될 것이다. 아래와.. 더보기
byte alignment 디스어셈블리를 하다 보면 알게 되는 '4바이트 정렬'패킷을 다루다 보면 나는 분명히 구조체를 5바이트로 만들어서 쐈는데 받을 때에는 8바이트로 받는 일이 있다.흔히 byte alignment 이라고 이야기한다. 최적화에 관련한 PPT 자료. 짧지만 뭐.. 으레 #pragma pack(1) ... #pragma pack() 으로 alignment 를 풀어준다.__packed 를 디파인으로 PACKED 라고 쓰기도 하고.GCC 에서는 __attribute__((packed)) 라고도 쓴다. 혹 맞추고 싶은 alignment 가 있다면 __attribute__((align(4))) 걍 pragma pack 이 유지보수에도 가장 편한 방법.아래는 1바이트 정렬에 대한 글 [1byte alignment 이야기] .. 더보기
해커 선언문 The Conscience of a Hacker by Mentor Written on January 8, 1986 Another one got caught today, it's all over the papers. "Teenager Arrested in Computer Crime Scandal","Hacker Arrested after Bank Tampering"... Damn kids. They're all alike. But did you, in your three-piece psychology and 1950's technobrain,ever take a look behind the eyes of the hacker? Did you ever wonder what made him tick, what .. 더보기