Algorithm
2014.07.01 17:55
OCB5 Injection 앗싸뵹! ㅋㅋ
조회 수 925 댓글 0
첨부 '6' |
---|
앗쌰뵹 ㅋㅋㅋ
이렇게 Javascript Injection 으로 점수 조작이 가능하다 ㅋㄷ;
# 인젝션 함수 실행 부분 Example
NSString *prefixUrl1 = @"https://appgame.okcashbag.com/game/2048/"; if([request.URL.absoluteString hasPrefix:prefixUrl1]) { [self performSelector:@selector(doInjection) withObject:nil afterDelay:5.0]; }
# Javascript 인젝션 함수 Example
- (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); }
번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|---|
1113 | Develop | [ios] 비동기 블럭 코드 예제 | hooni | 2014.11.21 | 898 |
1112 | Database | [mysql] MySQL 백업 및 복구 | hooni | 2019.11.22 | 907 |
1111 | Develop | [ios] GMT Date와 Local Date 변환하기 | hooni | 2015.04.07 | 908 |
1110 | Develop | [js] e.stopPropagation() VS e.preventDefault () | hooni | 2015.04.14 | 910 |
1109 | Develop | [linux] CentOS Apache 웹서버에 HTTPS 적용 | hooni | 2015.10.23 | 912 |
1108 | Develop | [ios] URL 랜딩 속도(OpenURL 10초 정지되는) 이슈 | hooni | 2015.02.09 | 916 |
1107 | Develop | [ios] Thread Loop 내에서 UI 업데이트 방법 | hooni | 2015.01.03 | 920 |
1106 | Develop | [ios] 문자열로 함수 실행하기 (eval 함수처럼) | hooni | 2015.02.10 | 922 |
1105 | Etc | 사이버보안실무 수업 메모 | hooni | 2017.03.30 | 922 |
» | Algorithm | OCB5 Injection 앗싸뵹! ㅋㅋ | hooni | 2014.07.01 | 925 |
1103 | Develop | [io] Apple Watch, Today Extension 앱ID 설정 | hooni | 2016.04.20 | 927 |
1102 | System/OS | [macos] How to Fix ‘You Shut Down Your Computer Because of a Problem’ | hooni | 2022.06.01 | 931 |