How to cheat in html games

How to cheat in html games

HTML5-игры и GodMode: все просто!

В этой статье я на двух примерах покажу, как с помощью подручных средств можно нечестно играть в игры на HTML5.

Ядро любой HTML5-игры — JavaScript. Единственной, на данный момент, защитой этого ядра является обфускация кода. Согласитесь, увидеть «простыню» в 10 000 строк обфусцированного кода без new-line — это поначалу страшно. Но если немного покопать — логика и архитектура приложения как на ладони. Главное — определить цель читерства (скорость, ресурсы, GodMode). В качестве инструмента используем Chrome и его Web Inspector. Во вкладке Sources можно «на горячую» изменять исполняемый код.

Google Doodles

Начну с простого примера: http://www.google.com/doodles/slalom-canoe-2012. Сравнительно свежий олимпийский Doodle.

How to cheat in html games. Смотреть фото How to cheat in html games. Смотреть картинку How to cheat in html games. Картинка про How to cheat in html games. Фото How to cheat in html games

Основная цель игры — пройти трассу как можно быстрее. В голову сразу приходят несколько уловок:

Нас интересует JavaScript-код игры.

How to cheat in html games. Смотреть фото How to cheat in html games. Смотреть картинку How to cheat in html games. Картинка про How to cheat in html games. Фото How to cheat in html games

Логично предположить, что это slalom_canoe12-2.js.

Начинаем рассуждать. По нажатию клавиши или при прохождении через ворота лодка ускоряется. Следовательно, где-то есть параметр «скорость» и он должен (скорее всего) инкрементироваться. Ищем по коду все операторы «+=» (благо объем и сложность кода позволяют), их находится всего 12. В принципе можно включить метод «научного тыка» и попробовать изменить все 12 по очереди. А можно и подумать.

Остановимся и проверим. Обновляем страницу (на всякий случай). Открываем Sources slalom_canoe12-2.js. Находим R+=Qc*b. Предположим, что b — коэффициент ускорения. И заменим его на 500 (не забываем нажать Ctrl + S).

How to cheat in html games. Смотреть фото How to cheat in html games. Смотреть картинку How to cheat in html games. Картинка про How to cheat in html games. Фото How to cheat in html games

Жмем Play в игре и…

How to cheat in html games. Смотреть фото How to cheat in html games. Смотреть картинку How to cheat in html games. Картинка про How to cheat in html games. Фото How to cheat in html games

Бинго! Наш чудо-катер устремляется к финишу. Теперь можно похвастаться перед друзьями скоростью своих пальцев 🙂

Отмечу, что приведенный пример — это случай, в котором удалось обойтись малой кровью. И не потребовало глубоких знаний JavaScript, архитектуры, отладки. Только арифметика.

Перейдем к другому примеру.

Spelunky

How to cheat in html games. Смотреть фото How to cheat in html games. Смотреть картинку How to cheat in html games. Картинка про How to cheat in html games. Фото How to cheat in html games

Открываем сайт с игрой. В инспекторе находим index.js, это и есть код игры. Первая мысль: «Какой кошмар».

Однако стоп! Встречаются и понятные слова. Например Bomb, Rope. Это уже интересно. Значит можно попробовать найти кусок кода, который обрабатывает получение предмета. А там где-то должно увеличивать количество оного…

Ищем слово Bomb. Результатов немало — 79. Попробуем Bomb Bag. И вот оно, первым же результатом!

How to cheat in html games. Смотреть фото How to cheat in html games. Смотреть картинку How to cheat in html games. Картинка про How to cheat in html games. Фото How to cheat in html games

Открываем Console и вводим следующее.

Отпускаем паузу — и наслаждаемся полученным результатом! Не буду описывать, как нарисовать себе жизней. Пусть читатель сам попробует разобраться с этой переменной.

Вывод: умный в гору не пойдет. Изменение JavaScript-кода — это легче легкого. Обфускация — это не смертельно. Старайтесь мыслить логически. И еще: любое читерство постепенно убивает интерес к игре (во всяком случае у меня), аккуратней с этим.

Данная статья носит информационный характер.

How to cheat in html games

How can I call a function declared in Balls.js or NG.min.js?

For firefox, there is a js command cd function, but I forget how to operate it.

After context changed, js command will be act on that window frame,eg/

Code:
alert(window.document.body.innerHTML)
jschangeContext.jpg
Description:
chrome
Filesize:123.24 KB
Viewed:25164 Time(s)
How to cheat in html games. Смотреть фото How to cheat in html games. Смотреть картинку How to cheat in html games. Картинка про How to cheat in html games. Фото How to cheat in html games

For firefox, there is a js command cd function, but I forget how to operate it.

After context changed, js command will be act on that window frame,eg/

Code:
alert(window.document.body.innerHTML)

Tried all the 3 syntax forms,and nothing works (see in screenshot)
(NG is defined in NG.min.js)

iframe.png
Description:
Filesize:16.7 KB
Viewed:25136 Time(s)
How to cheat in html games. Смотреть фото How to cheat in html games. Смотреть картинку How to cheat in html games. Картинка про How to cheat in html games. Фото How to cheat in html games

Chrome has this feature as well. Hit F12 while viewing the page which will open the developer tools. The Javascript console can be found there as well as the html/css editor and some other goodies.
_________________

NG is defined in NG.min.js as :

Code:
var NG = <>;

(I am not really experienced with Javascript).
What should I do to have access to it from the console?

Взлом веб-приложений и игр | JS Injection

Взлом веб-приложений и игр

Взлом веб-приложений и игр – тема сегодняшнего обсуждения. Многие из нас хоть раз играли в игру через браузер, иногда даже очень длительное время. Мы с друзьями часто играем в Telegram и сегодня мы разберемся, как быстро побить рекорды друзей, а также получить желаемое.

То, что мы будем делать на самом деле нельзя назвать взломом, так как мы ничего не получаем, кроме игровых преимуществ. Всё, что на самом деле мы делаем называется javascript injection.

Примером для нас послужит игра под названием Kicker King из Telegram. На её примере мы получим 20000 очков с помощью всего 1 броска. Вообще в игре 1 бросок – 1 балл.

Взлом веб-приложений и игр | Практика javascript injection

Для начала нам нужно зайти в веб-версию самого Telegram и запустить игру. Это нужно для того, чтобы мы могли увидеть и найти нужный нам метод в js файле, который подключен для работы приложения.

После запуска игры заходим в исходный код фрейма, если игра открылась на полный экран, не во фрейме, то заходим в исходный код страницы.

Скрипты подключаются как в самом верху, так и внизу страницы, чаще всего скрипт игры находиться внизу. Редки случаи, когда игровой javascript файл подключают вверху.

Открыв код игры, которую мы используем для примера и пролистав страницу вниз мы видим вот такие подключенные скрипты.

How to cheat in html games. Смотреть фото How to cheat in html games. Смотреть картинку How to cheat in html games. Картинка про How to cheat in html games. Фото How to cheat in html games

Чтобы осуществить взлом веб-приложений и игр нам нужно найти тот участок кода, который отвечает за обновление игровых баллов, в данном случае. Вообще, в случае с другими веб-приложениями, веб-играми это может быть другой участок кода, например Coins, Radius, Scale, Points или Health. В общем, всё что душе угодно.

Чтобы долго не искать, вводим в поисковике Score и ищем то, что нам нужно.

How to cheat in html games. Смотреть фото How to cheat in html games. Смотреть картинку How to cheat in html games. Картинка про How to cheat in html games. Фото How to cheat in html games

Как вы видите, мы нашли метод отвечающий за обновление баллов. Копируем его и в нужный нам момент запускаем в Console.

n – количество очков, которые вы хотите получить.

Данная консоль находиться в инспекторе элементов, пункт может называться “просмотреть код элемента”, зависит от браузера.

Всё, теперь можем проигрывать, все очки сохраняются и отображаются в общем списке результатов.

How to cheat in html games. Смотреть фото How to cheat in html games. Смотреть картинку How to cheat in html games. Картинка про How to cheat in html games. Фото How to cheat in html games

Взлом веб-приложений и игр можно осуществить и подменой js кода, загрузив локально свой файл. Для этого можно воспользоваться плагином, в Google Chrome это Resource Override. Такой метод может пригодиться если на сайте используется функция замыкания. В таком случае через консоль ничего изменить не получиться, в общем окружении переменных js нам ничего не доступно и что-то делать через консоль бесполезно.

Взлом веб-приложений и игр | Выводы

Как вы уже поняли js injection довольно серьезный инструмент для WEB. С его помощью можно не только взламывать веб-приложения и игры, но и многое другое, например красть данные. Делать я этого никого не призываю, так как это будет считаться противозаконным действием и только вы несете ответственность за причиненный вами ущерб.

Не используйте данный метод для обмана, делайте всё себе в удовольствие и ради самообразования.

Сегодня мы поговорили о том, как взломать веб-приложения и игры. Если вам понравилась статья, оставляйте свои комментарии, подписывайтесь на обновления сайта, а также наш Telegram.

How to cheat and avoid cheating in Flash games?

I’m writing a small online flash game that keeps high scores of players. Obviously I’d like to keep the players from cheating and getting an arbitrarily high score.

What are the most common methods for cheating in flash games and what can I do to make it hard to use them?

7 Answers 7

Trending sort

Trending sort is based off of the default sorting method — by highest score — but it boosts votes that have happened recently, helping to surface more up-to-date answers.

It falls back to sorting by highest score if no posts are trending.

Switch to Trending sort

The most common way to cheat is to use Cheat Engine.

See it in action on YouTube, along with 100s of tutorials on cheating in the most popular games.

Keeping people from cheating is going to be nearly impossible. But there are several methods for securing the high scores table, which could be applicable to cheating in general.

Sites like http://nonoba.com, and http://www.mochiads.com have highscores APIs with some in-built protection, so that might be an option if it’s just a personal project.

To protect the high score as it’s being sent to your server, either digitally sign it with a key embedded in your app, or else send an HMAC of the data (again, key embedded in app).

This suggestion assumes that people do not reverse-engineer your flash game. Not that this is hard, but in most cases, there are much easier ways to attack flash games, so this will raise the bar a little higher.

Depending on the style of game, it might be possible to verify high scores serverside by a type of «replay» technique.

That is, rather than sending the high score to the server, send the record of the user’s actions to the server.

This is not really suited for use in an action game, though for other types (such as Fantastic Contraption, or even Desktop TD) it is viable. Though maybe you would only enable it for special events (tourneys) or something like that, because for a popular game this would be fairly taxing.

How to cheat in html games

Basically there’s three types of games that a browser game could be. It could be a flash game, a Java
game, or a fancy new games made in HTML5/JS. The way you do basic memory editing with all three
is the same, the issue people run into is figuring out what type of game they’re dealing with and thus
knowing which process to attach to.

— Flash games: Attaching
Examples.
http://www.addictinggames.com/ (Almost anything here.)
http://armorgames.com/ (Again almost anything here.)

By far the most common. These almost always run in their own little rectangle on the page, and if you
right-click you should get some sort of menu like this with settings and a mention of the flash version
at the bottom.
How to cheat in html games. Смотреть фото How to cheat in html games. Смотреть картинку How to cheat in html games. Картинка про How to cheat in html games. Фото How to cheat in html games

If you’re using Firefox or a derivative (or something else using the same plugin standard) then when you
play a flash game you should have an easily-identifiable flash process. If there’s two use the second.
How to cheat in html games. Смотреть фото How to cheat in html games. Смотреть картинку How to cheat in html games. Картинка про How to cheat in html games. Фото How to cheat in html games

If you’re using Chrome, then go into a different tab than the game (because Flash will hijack shortcuts)
or simply click outside of the window and then press Shift+Escape to get to Chrome’s in-program task
manager. Right-click one of the upper bars and make sure that Process ID is selected, then look for
the Flash plugin’s process ID. Note that the ID there is in decimal while CE uses hex, so convert.
How to cheat in html games. Смотреть фото How to cheat in html games. Смотреть картинку How to cheat in html games. Картинка про How to cheat in html games. Фото How to cheat in html games

— Flash games: Hacking
For modern Flash stuff, in my experience you’ll be searching for float or double a lot, but also unknown
scans since Flash game makers have started using easily-available libraries to obfuscate their values in
RAM, making it impossible to search for the numbers you see. Some older games will be easy, but most
of the modern stuff is a little annoying to get it. If you’re finding a certain game difficult to work with,
consider learning Actionscript and installing an SWF «decompiler» so you can edit the game’s code itself.

— Java games: Attaching
How to cheat in html games. Смотреть фото How to cheat in html games. Смотреть картинку How to cheat in html games. Картинка про How to cheat in html games. Фото How to cheat in html games
How to cheat in html games. Смотреть фото How to cheat in html games. Смотреть картинку How to cheat in html games. Картинка про How to cheat in html games. Фото How to cheat in html games
How to cheat in html games. Смотреть фото How to cheat in html games. Смотреть картинку How to cheat in html games. Картинка про How to cheat in html games. Фото How to cheat in html games How to cheat in html games. Смотреть фото How to cheat in html games. Смотреть картинку How to cheat in html games. Картинка про How to cheat in html games. Фото How to cheat in html games
Java makes sure you know when it’s running. Attach to java.exe or javaw.exe.

These are much less in number, but are gaining popularity lately. Unlike Flash and Java games which
tend to run inside their own rectangle, HTML5/JS games tend to take up a full browser tab. If you’re
using Chrome use the same basic idea as for Flash. Press Shift+Escape to open Chrome’s in-browser
task manager, right-click the header to check the Process ID option, then look at the labels and
convert the ID from Decimal to Hex to see which process of Chrome’s to attach to. If you’re using
something like Firefox, unfortunately I don’t know of a way to see which processes are running which
tabs, so your best bet would be to close all your other tabs and then guess from what’s left.

— HTML5/JS: Hacking
In my experience everything will be of the double type, though there might be a little obfuscation so if
you’re not finding stuff do unknown->increased/decreased searches. Also you can just view the source
and edit it to pull in edited versions of the game scripts and junk anyways.
_________________

Источники информации:

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *