We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Your fingers too slow to smash, tbh.
We need to keep inputing the code on the image, so just create an automation script and do OCR.
The problem is, the OCR library is not that accurate, my solution is to use a fallback language and hope it works.
const puppeteer = require('puppeteer'); const path = require('path') const fs = require('fs') const pageUrl = 'http://challenge.ctf.games:31205/'; const { createWorker, PSM } = require('tesseract.js'); const worker = createWorker(); const worker2 = createWorker(); const sleep = ms => new Promise(resolve => setTimeout(resolve, ms)); (async () => { await worker.load(); await worker.loadLanguage('eng'); await worker.initialize('eng'); await worker.setParameters({ tessedit_char_whitelist: "0123456789" }); await worker2.load(); await worker2.loadLanguage('chi_tra'); await worker2.initialize('chi_tra'); await worker2.setParameters({ tessedit_char_whitelist: "0123456789" }); const browser = await puppeteer.launch({ headless: false }); const page = await browser.newPage(); await page.goto(pageUrl); send() async function send() { let { data: { text } } = await worker.recognize('http://challenge.ctf.games:31205/static/otp.png'); console.log('text:'+text) if (text.length !== 9) { const result = await worker2.recognize('http://challenge.ctf.games:31205/static/otp.png'); text = result.data.text console.log('text again:'+text) } await page.evaluate((text) => { document.querySelector('input[name=otp_entry]').value = text document.querySelector('input[type=submit]').click() }, text) await page.waitForNavigation(); send() } })();
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Description
Your fingers too slow to smash, tbh.
Writeup
We need to keep inputing the code on the image, so just create an automation script and do OCR.
The problem is, the OCR library is not that accurate, my solution is to use a fallback language and hope it works.
The text was updated successfully, but these errors were encountered: