Algorithm
2014.07.01 17:55
OCB5 Injection 앗싸뵹! ㅋㅋ
조회 수 1671 댓글 0
첨부 '6' |
---|
앗쌰뵹 ㅋㅋㅋ
이렇게 Javascript Injection 으로 점수 조작이 가능하다 ㅋㄷ;
# 인젝션 함수 실행 부분 Example
1 2 3 4 | if ([request.URL.absoluteString hasPrefix:prefixUrl1]) { [ self performSelector: @selector (doInjection) withObject: nil afterDelay:5.0]; } |
# Javascript 인젝션 함수 Example
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | - ( void )doInjection { NSString *buildString = @ "game2048_04210214" ; NSString *scoreString = @ "513842" ; NSString *keyString = @ "26gameState" ; // 초기 값 확인 함 [ self viewJson:keyString]; // 스코어 인젝션 NSString *game2048String = [[ NSUserDefaults standardUserDefaults] objectForKey:buildString]; if ([game2048String isEqualToString:@ "Y" ] == NO ) { [[ NSUserDefaults standardUserDefaults] setObject:@ "Y" forKey:buildString]; [ self injectScore:scoreString key:keyString]; // 잘 됐는지 확인 함 [ self viewJson:keyString]; } } - ( void )viewJson:( NSString *)keyString { //NSString *result1 = [NSString stringWithFormat:@"localStorage.getItem('12gameState');"]; NSString *result1 = [ NSString stringWithFormat:@ "localStorage.getItem('%@');" , keyString]; NSString *value1 = [_webView stringByEvaluatingJavaScriptFromString:result1]; NSLog (@ "------> value1 : %@" , value1); } - ( void )injectScore:( NSString *)scoreString key:( NSString *)keyString { //NSString *keyString = @"12gameState"; //NSString *scoreString = @"460182"; //NSString *buildString = @"game2048_1127"; NSString *result0 = [ NSString stringWithFormat:@"localStorage.setItem(\"%@\", JSON.stringify({\"grid\":{\"size\":4,\"cells\":[[{\"position\":{\"x\":0,\"y\":0},\"value\":2}, {\"position\":{\"x\":0,\"y\":1},\"value\":1024},{\"position\":{\"x\":0,\"y\":2},\"value\":8192}, {\"position\":{\"x\":0,\"y\":3},\"value\":64}],[{\"position\":{\"x\":1,\"y\":0},\"value\":512}, {\"position\":{\"x\":1,\"y\":1},\"value\":256},{\"position\":{\"x\":1,\"y\":2},\"value\":256}, {\"position\":{\"x\":1,\"y\":3},\"value\":128}],[{\"position\":{\"x\":2,\"y\":0},\"value\":1024}, {\"position\":{\"x\":2,\"y\":1},\"value\":4},{\"position\":{\"x\":2,\"y\":2},\"value\":2}, {\"position\":{\"x\":2,\"y\":3},\"value\":2048}],[{\"position\":{\"x\":3,\"y\":0},\"value\":1024}, null,null,null]]},\ "score\":%@,\"over\":false,\"won\":false,\"keepPlaying\":false,\"started\":true}));" , keyString, scoreString]; NSString *value0 = [_webView stringByEvaluatingJavaScriptFromString:result0]; NSLog (@ "------> value0 : %@" , value0); } |
번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|---|
901 | Develop |
[ios] 카테고리 확장 메소드를 찾지 못하는 경우
![]() |
hooni | 2014.08.08 | 2779 |
900 | Develop | [ios] @property의 속성 (strong, weak, copy) 사용 경우 | hooni | 2014.08.08 | 2422 |
» | Algorithm |
OCB5 Injection 앗싸뵹! ㅋㅋ
![]() |
hooni | 2014.07.01 | 1671 |
898 | Develop | [ios] TextField 특정 문자만 사용하도록 하기 | hooni | 2014.06.30 | 3241 |
897 | Develop | [ios] XCode에서 Provisioning Profile 여러개 중복될 때 | hooni | 2014.06.26 | 3378 |
896 | Develop | 알고리즘 성능 분석 기준 | hooni | 2014.06.24 | 3532 |
895 | Develop |
알고리즘 성능분석
![]() |
hooni | 2014.06.24 | 3832 |
894 | Develop | [ios] iOS에서 디바이스 종류 알아오기 | hooni | 2014.05.24 | 4218 |
893 | Develop | [ios] 아이폰 GPS 사용하기 | hooni | 2014.05.24 | 4578 |
892 | Develop | [ios] 언어, 지역, 국가 설정 가져오기 | hooni | 2014.05.12 | 284441 |
891 | Develop | [ios] URL 파라미터 파싱~ | hooni | 2014.05.12 | 4154 |
890 | Develop | [ios] 앱 딜리게이트 얻어오기. (AppDelegate) | hooni | 2014.05.10 | 4045 |