Browse Source

* Decode Auditor captchas.

git-svn-id: file:///srv/caca.zoy.org/var/lib/svn/pwntcha/trunk@401 92316355-f0b4-4df1-b90c-862c8a59935f
master
sam 20 years ago
parent
commit
dea689a955
100 changed files with 43 additions and 3 deletions
  1. +3
    -1
      src/main.c
  2. +40
    -2
      src/scode.c
  3. BIN
      testsuite/auditor/auditor00.png
  4. BIN
      testsuite/auditor/auditor01.png
  5. BIN
      testsuite/auditor/auditor02.png
  6. BIN
      testsuite/auditor/auditor03.png
  7. BIN
      testsuite/auditor/auditor04.png
  8. BIN
      testsuite/auditor/auditor05.png
  9. BIN
      testsuite/auditor/auditor06.png
  10. BIN
      testsuite/auditor/auditor07.png
  11. BIN
      testsuite/auditor/auditor08.png
  12. BIN
      testsuite/auditor/auditor09.png
  13. BIN
      testsuite/auditor/auditor10.png
  14. BIN
      testsuite/auditor/auditor11.png
  15. BIN
      testsuite/auditor/auditor12.png
  16. BIN
      testsuite/auditor/auditor13.png
  17. BIN
      testsuite/auditor/auditor14.png
  18. BIN
      testsuite/auditor/auditor15.png
  19. BIN
      testsuite/auditor/auditor16.png
  20. BIN
      testsuite/auditor/auditor17.png
  21. BIN
      testsuite/auditor/auditor18.png
  22. BIN
      testsuite/auditor/auditor19.png
  23. BIN
      testsuite/auditor/auditor20.png
  24. BIN
      testsuite/auditor/auditor21.png
  25. BIN
      testsuite/auditor/auditor22.png
  26. BIN
      testsuite/auditor/auditor23.png
  27. BIN
      testsuite/auditor/auditor24.png
  28. BIN
      testsuite/auditor/auditor25.png
  29. BIN
      testsuite/auditor/auditor26.png
  30. BIN
      testsuite/auditor/auditor27.png
  31. BIN
      testsuite/auditor/auditor28.png
  32. BIN
      testsuite/auditor/auditor29.png
  33. BIN
      testsuite/auditor/auditor30.png
  34. BIN
      testsuite/auditor/auditor31.png
  35. BIN
      testsuite/auditor/auditor32.png
  36. BIN
      testsuite/auditor/auditor33.png
  37. BIN
      testsuite/auditor/auditor34.png
  38. BIN
      testsuite/auditor/auditor35.png
  39. BIN
      testsuite/auditor/auditor36.png
  40. BIN
      testsuite/auditor/auditor37.png
  41. BIN
      testsuite/auditor/auditor38.png
  42. BIN
      testsuite/auditor/auditor39.png
  43. BIN
      testsuite/auditor/auditor40.png
  44. BIN
      testsuite/auditor/auditor41.png
  45. BIN
      testsuite/auditor/auditor42.png
  46. BIN
      testsuite/auditor/auditor43.png
  47. BIN
      testsuite/auditor/auditor44.png
  48. BIN
      testsuite/auditor/auditor45.png
  49. BIN
      testsuite/auditor/auditor46.png
  50. BIN
      testsuite/auditor/auditor47.png
  51. BIN
      testsuite/auditor/auditor48.png
  52. BIN
      testsuite/auditor/auditor49.png
  53. BIN
      testsuite/auditor/auditor50.png
  54. BIN
      testsuite/auditor/auditor51.png
  55. BIN
      testsuite/auditor/auditor52.png
  56. BIN
      testsuite/auditor/auditor53.png
  57. BIN
      testsuite/auditor/auditor54.png
  58. BIN
      testsuite/auditor/auditor55.png
  59. BIN
      testsuite/auditor/auditor56.png
  60. BIN
      testsuite/auditor/auditor57.png
  61. BIN
      testsuite/auditor/auditor58.png
  62. BIN
      testsuite/auditor/auditor59.png
  63. BIN
      testsuite/auditor/auditor60.png
  64. BIN
      testsuite/auditor/auditor61.png
  65. BIN
      testsuite/auditor/auditor62.png
  66. BIN
      testsuite/auditor/auditor63.png
  67. BIN
      testsuite/auditor/auditor64.png
  68. BIN
      testsuite/auditor/auditor65.png
  69. BIN
      testsuite/auditor/auditor66.png
  70. BIN
      testsuite/auditor/auditor67.png
  71. BIN
      testsuite/auditor/auditor68.png
  72. BIN
      testsuite/auditor/auditor69.png
  73. BIN
      testsuite/auditor/auditor70.png
  74. BIN
      testsuite/auditor/auditor71.png
  75. BIN
      testsuite/auditor/auditor72.png
  76. BIN
      testsuite/auditor/auditor73.png
  77. BIN
      testsuite/auditor/auditor74.png
  78. BIN
      testsuite/auditor/auditor75.png
  79. BIN
      testsuite/auditor/auditor76.png
  80. BIN
      testsuite/auditor/auditor77.png
  81. BIN
      testsuite/auditor/auditor78.png
  82. BIN
      testsuite/auditor/auditor79.png
  83. BIN
      testsuite/auditor/auditor80.png
  84. BIN
      testsuite/auditor/auditor81.png
  85. BIN
      testsuite/auditor/auditor82.png
  86. BIN
      testsuite/auditor/auditor83.png
  87. BIN
      testsuite/auditor/auditor84.png
  88. BIN
      testsuite/auditor/auditor85.png
  89. BIN
      testsuite/auditor/auditor86.png
  90. BIN
      testsuite/auditor/auditor87.png
  91. BIN
      testsuite/auditor/auditor88.png
  92. BIN
      testsuite/auditor/auditor89.png
  93. BIN
      testsuite/auditor/auditor90.png
  94. BIN
      testsuite/auditor/auditor91.png
  95. BIN
      testsuite/auditor/auditor92.png
  96. BIN
      testsuite/auditor/auditor93.png
  97. BIN
      testsuite/auditor/auditor94.png
  98. BIN
      testsuite/auditor/auditor95.png
  99. BIN
      testsuite/auditor/auditor96.png
  100. BIN
      testsuite/auditor/auditor97.png

+ 3
- 1
src/main.c View File

@@ -117,6 +117,8 @@ int main(int argc, char *argv[])
continue;
}

dprintf("image size %ix%i\n", img->width, img->height);

if(!strcmp(mode, "test"))
result = decode_test(img);
else if(!strcmp(mode, "phpbb"))
@@ -132,7 +134,7 @@ int main(int argc, char *argv[])
dprintf("autodetecting phpBB captcha\n");
result = decode_phpbb(img);
}
else if(img->height == 25)
else if(img->height == 25 || img->height == 30)
{
dprintf("autodetecting scode captcha\n");
result = decode_scode(img);


+ 40
- 2
src/scode.c View File

@@ -30,7 +30,7 @@ char *decode_scode(struct image *img)
/* allocate enough place */
result = malloc(1024 * sizeof(char));

/* Detect background: first 3 lines */
/* Detect background: first and last 3 lines */
for(i = 0; i < 256; i++)
stats[i] = 0;

@@ -39,6 +39,8 @@ char *decode_scode(struct image *img)
{
getpixel(img, x, y, &r, &g, &b);
stats[r]++;
getpixel(img, x, img->width - 1 - y, &r, &g, &b);
stats[r]++;
}

/* Set non-background colours to 0 */
@@ -120,12 +122,47 @@ static char find_glyph(struct image *img, int xmin, int xmax)
{
getpixel(img, x, y, &r, &g, &b);
if(!r)
count += y - ymin;
count += 5 * (y - ymin) ^ 3 * (x - xmin);
//count += y - ymin;
}
}

switch(count)
{
/* Scode font */
case 778: return '0';
case 621: return '1';
case 854: return '2';
case 784: return '3';
case 766: return '4';
case 771: return '5';
case 976: return '6';
case 585: return '7';
case 980: return '8';
case 896: return '9';
/* Small font */
case 584: return '0';
case 454: return '1';
case 517: return '2';
case 447: return '3';
case 469: return '4';
case 472: return '5';
case 564: return '6';
case 298: return '7';
case 560: return '8';
case 536: return '9';
/* Thin font */
case 438: return '0';
case 405: return '1';
case 485: return '2';
case 486: return '3';
case 413: return '4';
case 509: return '5';
case 582: return '6';
case 242: return '7';
case 579: return '8';
case 440: return '9';
#if 0
case 162: return '0';
case 131: return '1';
case 150: return '2';
@@ -136,6 +173,7 @@ static char find_glyph(struct image *img, int xmin, int xmax)
case 90: return '7';
case 180: return '8';
case 170: return '9';
#endif
default:
dprintf("don't know about checksum %i\n", count);
return '?';


BIN
testsuite/auditor/auditor00.png View File

Before After
Width: 120  |  Height: 30  |  Size: 478 B

BIN
testsuite/auditor/auditor01.png View File

Before After
Width: 120  |  Height: 30  |  Size: 485 B

BIN
testsuite/auditor/auditor02.png View File

Before After
Width: 120  |  Height: 30  |  Size: 504 B

BIN
testsuite/auditor/auditor03.png View File

Before After
Width: 120  |  Height: 30  |  Size: 473 B

BIN
testsuite/auditor/auditor04.png View File

Before After
Width: 120  |  Height: 30  |  Size: 540 B

BIN
testsuite/auditor/auditor05.png View File

Before After
Width: 120  |  Height: 30  |  Size: 473 B

BIN
testsuite/auditor/auditor06.png View File

Before After
Width: 120  |  Height: 30  |  Size: 480 B

BIN
testsuite/auditor/auditor07.png View File

Before After
Width: 120  |  Height: 30  |  Size: 509 B

BIN
testsuite/auditor/auditor08.png View File

Before After
Width: 120  |  Height: 30  |  Size: 505 B

BIN
testsuite/auditor/auditor09.png View File

Before After
Width: 120  |  Height: 30  |  Size: 464 B

BIN
testsuite/auditor/auditor10.png View File

Before After
Width: 120  |  Height: 30  |  Size: 507 B

BIN
testsuite/auditor/auditor11.png View File

Before After
Width: 120  |  Height: 30  |  Size: 458 B

BIN
testsuite/auditor/auditor12.png View File

Before After
Width: 120  |  Height: 30  |  Size: 490 B

BIN
testsuite/auditor/auditor13.png View File

Before After
Width: 120  |  Height: 30  |  Size: 455 B

BIN
testsuite/auditor/auditor14.png View File

Before After
Width: 120  |  Height: 30  |  Size: 521 B

BIN
testsuite/auditor/auditor15.png View File

Before After
Width: 120  |  Height: 30  |  Size: 464 B

BIN
testsuite/auditor/auditor16.png View File

Before After
Width: 120  |  Height: 30  |  Size: 483 B

BIN
testsuite/auditor/auditor17.png View File

Before After
Width: 120  |  Height: 30  |  Size: 482 B

BIN
testsuite/auditor/auditor18.png View File

Before After
Width: 120  |  Height: 30  |  Size: 448 B

BIN
testsuite/auditor/auditor19.png View File

Before After
Width: 120  |  Height: 30  |  Size: 522 B

BIN
testsuite/auditor/auditor20.png View File

Before After
Width: 120  |  Height: 30  |  Size: 478 B

BIN
testsuite/auditor/auditor21.png View File

Before After
Width: 120  |  Height: 30  |  Size: 479 B

BIN
testsuite/auditor/auditor22.png View File

Before After
Width: 120  |  Height: 30  |  Size: 511 B

BIN
testsuite/auditor/auditor23.png View File

Before After
Width: 120  |  Height: 30  |  Size: 502 B

BIN
testsuite/auditor/auditor24.png View File

Before After
Width: 120  |  Height: 30  |  Size: 511 B

BIN
testsuite/auditor/auditor25.png View File

Before After
Width: 120  |  Height: 30  |  Size: 513 B

BIN
testsuite/auditor/auditor26.png View File

Before After
Width: 120  |  Height: 30  |  Size: 495 B

BIN
testsuite/auditor/auditor27.png View File

Before After
Width: 120  |  Height: 30  |  Size: 485 B

BIN
testsuite/auditor/auditor28.png View File

Before After
Width: 120  |  Height: 30  |  Size: 517 B

BIN
testsuite/auditor/auditor29.png View File

Before After
Width: 120  |  Height: 30  |  Size: 477 B

BIN
testsuite/auditor/auditor30.png View File

Before After
Width: 120  |  Height: 30  |  Size: 512 B

BIN
testsuite/auditor/auditor31.png View File

Before After
Width: 120  |  Height: 30  |  Size: 512 B

BIN
testsuite/auditor/auditor32.png View File

Before After
Width: 120  |  Height: 30  |  Size: 477 B

BIN
testsuite/auditor/auditor33.png View File

Before After
Width: 120  |  Height: 30  |  Size: 464 B

BIN
testsuite/auditor/auditor34.png View File

Before After
Width: 120  |  Height: 30  |  Size: 482 B

BIN
testsuite/auditor/auditor35.png View File

Before After
Width: 120  |  Height: 30  |  Size: 500 B

BIN
testsuite/auditor/auditor36.png View File

Before After
Width: 120  |  Height: 30  |  Size: 472 B

BIN
testsuite/auditor/auditor37.png View File

Before After
Width: 120  |  Height: 30  |  Size: 496 B

BIN
testsuite/auditor/auditor38.png View File

Before After
Width: 120  |  Height: 30  |  Size: 468 B

BIN
testsuite/auditor/auditor39.png View File

Before After
Width: 120  |  Height: 30  |  Size: 493 B

BIN
testsuite/auditor/auditor40.png View File

Before After
Width: 120  |  Height: 30  |  Size: 480 B

BIN
testsuite/auditor/auditor41.png View File

Before After
Width: 120  |  Height: 30  |  Size: 518 B

BIN
testsuite/auditor/auditor42.png View File

Before After
Width: 120  |  Height: 30  |  Size: 518 B

BIN
testsuite/auditor/auditor43.png View File

Before After
Width: 120  |  Height: 30  |  Size: 458 B

BIN
testsuite/auditor/auditor44.png View File

Before After
Width: 120  |  Height: 30  |  Size: 529 B

BIN
testsuite/auditor/auditor45.png View File

Before After
Width: 120  |  Height: 30  |  Size: 452 B

BIN
testsuite/auditor/auditor46.png View File

Before After
Width: 120  |  Height: 30  |  Size: 445 B

BIN
testsuite/auditor/auditor47.png View File

Before After
Width: 120  |  Height: 30  |  Size: 447 B

BIN
testsuite/auditor/auditor48.png View File

Before After
Width: 120  |  Height: 30  |  Size: 487 B

BIN
testsuite/auditor/auditor49.png View File

Before After
Width: 120  |  Height: 30  |  Size: 489 B

BIN
testsuite/auditor/auditor50.png View File

Before After
Width: 120  |  Height: 30  |  Size: 514 B

BIN
testsuite/auditor/auditor51.png View File

Before After
Width: 120  |  Height: 30  |  Size: 516 B

BIN
testsuite/auditor/auditor52.png View File

Before After
Width: 120  |  Height: 30  |  Size: 499 B

BIN
testsuite/auditor/auditor53.png View File

Before After
Width: 120  |  Height: 30  |  Size: 438 B

BIN
testsuite/auditor/auditor54.png View File

Before After
Width: 120  |  Height: 30  |  Size: 480 B

BIN
testsuite/auditor/auditor55.png View File

Before After
Width: 120  |  Height: 30  |  Size: 474 B

BIN
testsuite/auditor/auditor56.png View File

Before After
Width: 120  |  Height: 30  |  Size: 470 B

BIN
testsuite/auditor/auditor57.png View File

Before After
Width: 120  |  Height: 30  |  Size: 506 B

BIN
testsuite/auditor/auditor58.png View File

Before After
Width: 120  |  Height: 30  |  Size: 486 B

BIN
testsuite/auditor/auditor59.png View File

Before After
Width: 120  |  Height: 30  |  Size: 457 B

BIN
testsuite/auditor/auditor60.png View File

Before After
Width: 120  |  Height: 30  |  Size: 497 B

BIN
testsuite/auditor/auditor61.png View File

Before After
Width: 120  |  Height: 30  |  Size: 538 B

BIN
testsuite/auditor/auditor62.png View File

Before After
Width: 120  |  Height: 30  |  Size: 510 B

BIN
testsuite/auditor/auditor63.png View File

Before After
Width: 120  |  Height: 30  |  Size: 499 B

BIN
testsuite/auditor/auditor64.png View File

Before After
Width: 120  |  Height: 30  |  Size: 518 B

BIN
testsuite/auditor/auditor65.png View File

Before After
Width: 120  |  Height: 30  |  Size: 514 B

BIN
testsuite/auditor/auditor66.png View File

Before After
Width: 120  |  Height: 30  |  Size: 487 B

BIN
testsuite/auditor/auditor67.png View File

Before After
Width: 120  |  Height: 30  |  Size: 483 B

BIN
testsuite/auditor/auditor68.png View File

Before After
Width: 120  |  Height: 30  |  Size: 476 B

BIN
testsuite/auditor/auditor69.png View File

Before After
Width: 120  |  Height: 30  |  Size: 478 B

BIN
testsuite/auditor/auditor70.png View File

Before After
Width: 120  |  Height: 30  |  Size: 499 B

BIN
testsuite/auditor/auditor71.png View File

Before After
Width: 120  |  Height: 30  |  Size: 521 B

BIN
testsuite/auditor/auditor72.png View File

Before After
Width: 120  |  Height: 30  |  Size: 497 B

BIN
testsuite/auditor/auditor73.png View File

Before After
Width: 120  |  Height: 30  |  Size: 476 B

BIN
testsuite/auditor/auditor74.png View File

Before After
Width: 120  |  Height: 30  |  Size: 449 B

BIN
testsuite/auditor/auditor75.png View File

Before After
Width: 120  |  Height: 30  |  Size: 536 B

BIN
testsuite/auditor/auditor76.png View File

Before After
Width: 120  |  Height: 30  |  Size: 464 B

BIN
testsuite/auditor/auditor77.png View File

Before After
Width: 120  |  Height: 30  |  Size: 490 B

BIN
testsuite/auditor/auditor78.png View File

Before After
Width: 120  |  Height: 30  |  Size: 505 B

BIN
testsuite/auditor/auditor79.png View File

Before After
Width: 120  |  Height: 30  |  Size: 488 B

BIN
testsuite/auditor/auditor80.png View File

Before After
Width: 120  |  Height: 30  |  Size: 495 B

BIN
testsuite/auditor/auditor81.png View File

Before After
Width: 120  |  Height: 30  |  Size: 513 B

BIN
testsuite/auditor/auditor82.png View File

Before After
Width: 120  |  Height: 30  |  Size: 473 B

BIN
testsuite/auditor/auditor83.png View File

Before After
Width: 120  |  Height: 30  |  Size: 501 B

BIN
testsuite/auditor/auditor84.png View File

Before After
Width: 120  |  Height: 30  |  Size: 501 B

BIN
testsuite/auditor/auditor85.png View File

Before After
Width: 120  |  Height: 30  |  Size: 480 B

BIN
testsuite/auditor/auditor86.png View File

Before After
Width: 120  |  Height: 30  |  Size: 528 B

BIN
testsuite/auditor/auditor87.png View File

Before After
Width: 120  |  Height: 30  |  Size: 542 B

BIN
testsuite/auditor/auditor88.png View File

Before After
Width: 120  |  Height: 30  |  Size: 482 B

BIN
testsuite/auditor/auditor89.png View File

Before After
Width: 120  |  Height: 30  |  Size: 482 B

BIN
testsuite/auditor/auditor90.png View File

Before After
Width: 120  |  Height: 30  |  Size: 464 B

BIN
testsuite/auditor/auditor91.png View File

Before After
Width: 120  |  Height: 30  |  Size: 507 B

BIN
testsuite/auditor/auditor92.png View File

Before After
Width: 120  |  Height: 30  |  Size: 473 B

BIN
testsuite/auditor/auditor93.png View File

Before After
Width: 120  |  Height: 30  |  Size: 499 B

BIN
testsuite/auditor/auditor94.png View File

Before After
Width: 120  |  Height: 30  |  Size: 466 B

BIN
testsuite/auditor/auditor95.png View File

Before After
Width: 120  |  Height: 30  |  Size: 467 B

BIN
testsuite/auditor/auditor96.png View File

Before After
Width: 120  |  Height: 30  |  Size: 483 B

BIN
testsuite/auditor/auditor97.png View File

Before After
Width: 120  |  Height: 30  |  Size: 496 B

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save