發表文章

ROP Notes

[SOCAT] $ socat TCP4-LISTEN:14952,fork EXEC:./ropme [PWNTOOLS] [PEDA] [QIRA] $ qira ./a.out $ qira -s ./a.out $ socat tcp-l:4000,reuseaddr,fork exec:"qira ./a.out" [ROPgadget] [GCC] $ gcc -z execstack -fno-stack-protector -o ./ropme ./ropme.c # Cancel DEP and Stack Protector [Core Dump Setting] $ ulimit -c unlimited [DEP Check] $ readelf -l ./ropme [ASLR Check] $ echo 0 > /proc/sys/kernel/randomize_va_space $ echo 2 > /proc/sys/kernel/randomize_va_space $ cat /proc/[pid]/maps $ ldd ./ropme [Check Content] $ objdump -s ./ropme $ objdump -s -j .rodata ./ropme $ string ./ropme [PLT Function] $ objdump -d -j .plt ./ropme [GOT Table] $ objdump -R ./ropme [BSS Section Get] $ objdump -H ./ropme $ readelf -S ./ropme [GDB Usages] # Debug Core Dump $ gdb -c <core_file> ./ropme  (gdb) bt  (gdb) bt full $ gdb ./ropme  (gdb) break main  (gdb) run < payload  (gdb) print system # print variable "system"...

LeetCode - 515. Find Largest Value in Each Tree Row

Category:  Algorithm Difficulty:  Medium Tags:  Tree,  Depth-first Search , Breadth-first Search Discription:  https://leetcode.com/problems/find-largest-value-in-each-tree-row/#/description

LeetCode - 130. Surrounded Regions

Category:  Algorithm Difficulty:  Medium Tags:  Breadth-first Search, Union Find Discription:  https://leetcode.com/problems/surrounded-regions/#/description

LeetCode - 66. Plus One

Category:  Algorithm Difficulty:  Easy Tags:  Array, Math Discription:  https://leetcode.com/problems/plus-one/#/description

LeetCode - 344. Reverse String

Category:  Algorithm Difficulty:  Easy Tags:  Two Pointers, String Discription:  https://leetcode.com/problems/plus-one/#/description

LeetCode - 187. Repeated DNA Sequences

Category:  Algorithm Difficulty:  Medium Tags:  Hash Table, Bit Manipulation Discription:  https://leetcode.com/problems/repeated-dna-sequences/#/description

LeetCode - 15. 3Sum

Category:  Algorithm Difficulty:  Medium Tags:  Array, Two Pointers Discription:  https://leetcode.com/problems/3sum/#/description

LeetCode - 141. Linked List Cycle

Category:  Algorithm Difficulty:  Easy Tags:  Linked List, Two Pointers Discription:  https://leetcode.com/problems/linked-list-cycle/#/description

LeetCode - 329. Longest Increasing Path in a Matrix

Category:  Algorithm Difficulty:  Hard Tags:  Depth-first Search, Topological Sort, Memoization Discription:  https://leetcode.com/problems/longest-increasing-path-in-a-matrix/#/description

LeetCode - 55. Jump Game

Category:  Algorithm Difficulty:  Medium Tags:  Array, Greedy Discription:  https://leetcode.com/problems/jump-game/#/description

LeetCode - 94. Binary Tree Inorder Traversal

Category:  Algorithm Difficulty:  Medium Tags:  Tree, Hash Table,  Stack Discription:  https://leetcode.com/problems/binary-tree-inorder-traversal/#/description

LeetCode - 199. Binary Tree Right Side View

Category:  Algorithm Difficulty:  Medium Tags:  Tree, Depth-first Search,  Btradth-first Search Discription:  https://leetcode.com/problems/binary-tree-right-side-view/#/description

WriteUp - AlexCTF: RE2: C++ is awesome

Category:  Reverse Engineering Reference:  https://github.com/ctfs/write-ups-2017/tree/master/alexctf-2017/reverse-engineering/re2-cpp-is-awesome-100 Download:   re2