人生第一场CTF的解题报告(部分) - philippica - 博客园



人生第一场CTF的解题报告(部分) - philippica - 博客园

小王入职了一段时间,最近有点无聊。Web安全项目不多,白天看着其他项目组的同事忙得热火朝天,小王有点坐不住了,这也许是新人都会有的想法,乐于助人。想到这,小王一眼看到了隔壁的小丽,哎,IT界小丽绝对算得上是一位美女啦,于是小王凑了过去对小丽说:小丽,看你眉头紧锁的,需要本大侠帮忙吗?小丽转头看着小王,愣了足足有10秒,突然说:那,那好吧,如果你帮我搞定这三个问题,嗯~我请你吃晚饭,就我们两个。天哪,这,这,小王已经按耐不住突如其来的喜悦,战斗力倍增,大喝一声:好,来吧! (为了得到美女垂青,小王决定放手一搏)

描述

题干:小丽被分派去破解一份被加密的数据库登录配置文件,小丽通过N次测试后发现,原来TEST 用户的密码竟然是TEST123123,但这个数据库帐号能用的功能太少了,而小丽的组长却要求她分析出SA的密码。于是小丽把这个任务作为第二个难题抛给了小王。事实上,这件事对于小王来说也不算难,小王沉下心来努力还原算法,最终得到了 sa的密码(flag)。
DatabaseName="TEST" user="TEST" password="00560041005b00440011007200b3013100300037"
DatabaseName="GCOA" user="sa" password="0071007e007f006a004b002a00e70163006d0065002900500003"

 

解题:一开始关注到了后面的数字都比前面的大,并且是四个四个一组的,上了个厕所后脑洞大开,TEST123123--------ascii----》84 69 83 84 49 50 51 49 50 51------binary---à 1010100 1000101 1010011 1010100 110001 110010 110011 110001 110010 110011 

 

0056 0041 005b 0044 0011 0072 00b3 0131 0030 0037------binary------à1010110 1000001 1011011 1000100 10001 1110010 10110011 100110001 110000 110111

 

将两个二进制放在一起并且添加前导0对比:

1010100 1000101 1010011 1010100 110001 110010 110011 110001 110010 110011 

1010110 1000001 1011011 1000100 10001 1110010 10110011 100110001 110000 110111

发现上下两个串便是XOR 10 100 1000 10000 100000…10 100 1000….找到规律后迅速解决了这题

 

1110001 1111110 1111111 1101010 1001011 101010 11100111 101100011 1101101 1100101 101001 1010000 11  --》

1110011 1111010 1110111 1111010 1101011 1101010 1100111 1100011 1101111 1100001 100001 1000000 100011


Read full article from 人生第一场CTF的解题报告(部分) - philippica - 博客园


No comments:

Post a Comment

Labels

Algorithm (219) Lucene (130) LeetCode (97) Database (36) Data Structure (33) text mining (28) Solr (27) java (27) Mathematical Algorithm (26) Difficult Algorithm (25) Logic Thinking (23) Puzzles (23) Bit Algorithms (22) Math (21) List (20) Dynamic Programming (19) Linux (19) Tree (18) Machine Learning (15) EPI (11) Queue (11) Smart Algorithm (11) Operating System (9) Java Basic (8) Recursive Algorithm (8) Stack (8) Eclipse (7) Scala (7) Tika (7) J2EE (6) Monitoring (6) Trie (6) Concurrency (5) Geometry Algorithm (5) Greedy Algorithm (5) Mahout (5) MySQL (5) xpost (5) C (4) Interview (4) Vi (4) regular expression (4) to-do (4) C++ (3) Chrome (3) Divide and Conquer (3) Graph Algorithm (3) Permutation (3) Powershell (3) Random (3) Segment Tree (3) UIMA (3) Union-Find (3) Video (3) Virtualization (3) Windows (3) XML (3) Advanced Data Structure (2) Android (2) Bash (2) Classic Algorithm (2) Debugging (2) Design Pattern (2) Google (2) Hadoop (2) Java Collections (2) Markov Chains (2) Probabilities (2) Shell (2) Site (2) Web Development (2) Workplace (2) angularjs (2) .Net (1) Amazon Interview (1) Android Studio (1) Array (1) Boilerpipe (1) Book Notes (1) ChromeOS (1) Chromebook (1) Codility (1) Desgin (1) Design (1) Divide and Conqure (1) GAE (1) Google Interview (1) Great Stuff (1) Hash (1) High Tech Companies (1) Improving (1) LifeTips (1) Maven (1) Network (1) Performance (1) Programming (1) Resources (1) Sampling (1) Sed (1) Smart Thinking (1) Sort (1) Spark (1) Stanford NLP (1) System Design (1) Trove (1) VIP (1) tools (1)

Popular Posts