Algorithm
2014.07.01 17:55
OCB5 Injection 앗싸뵹! ㅋㅋ
조회 수 2517 댓글 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); }
번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|---|
1153 | Database | [sql] 간단한 SQL 문법 정리 | hooni | 2003.04.23 | 14045 |
1152 | Develop |
[c] 그래픽스 자료(OpenGL 라이브러리) 샘플 소스
![]() |
hooni | 2003.04.23 | 11328 |
1151 | Develop |
[opengl] 컴퓨터 그래픽스 강의 자료(수업자료)
![]() |
hooni | 2003.04.23 | 22048 |
1150 | Develop | [c++] p.47 연습문제 3번 | hooni | 2003.04.23 | 11337 |
1149 | Develop | [c++] p.58 연습문제 2번 | hooni | 2003.04.23 | 17408 |
1148 | Develop | [c++] p.118 확인학습 5번 | hooni | 2003.04.23 | 11935 |
1147 | Develop |
[c] 프로그래밍 ppt, 스킬업 (비트 수업자료)
![]() |
hooni | 2003.04.23 | 9442 |
1146 | System/OS | [linux] 콘솔/Xwindow 에서 PC스피커 소리 없애기 | hooni | 2003.04.23 | 17505 |
1145 | Database | [mysql] 쓰레드가 계속 쌓이기 시작하고 사라지지 않을때.. | hooni | 2003.04.23 | 14000 |
1144 | System/OS | [linux] 쉘 환경변수 PS1(프롬프트) | hooni | 2003.04.23 | 14607 |
1143 | System/OS | [linux] APM(apache, php, mysql) + gd 설치순서.. | hooni | 2003.04.23 | 20064 |
1142 | System/OS | [linux] 메일서버 세팅정보(sendmail) | hooni | 2003.04.23 | 18649 |