r00t-err0r

PIKauth

Jul 21st, 2012
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 3.77 KB | None | 0 0
  1. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  2. ; PIK Auth Get Captcha Code ;
  3. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  4.  
  5. alias pikAUTHid {
  6.   sockopen pikAUTHid %pikauthhost 80
  7. }
  8. on *:SOCKOPEN:pikAUTHid:{
  9.   sockwrite -nt $sockname GET %pikauthurl HTTP/1.1
  10.   sockwrite -nt $sockname Host: %pikauthhost
  11.   sockwrite -nt $sockname $crlf
  12. }
  13. on *:SNOTICE:*U protivnom, posetite*:{
  14.   set %pikauthstrana $17
  15.   if ($regex(%pikauthstrana,/((?:http://)?(?:http://|www\.)([^/\s]+)(/\S+)?)/i)) {
  16.     set %pikauthhost $regml(2)
  17.     set %pikauthurl $regml(3)
  18.     pikAUTHid
  19.   }
  20. }
  21. on *:SNOTICE:*am je dozvoljen*:{
  22.   window -c @PIKauth
  23.   unset %pikauthstrana
  24.   unset %pikauthhost
  25.   unset %pikauthurl
  26.   unset %rezultat
  27.   unset %authslika
  28.   unset %authcode
  29.   if ($findfile($mircdir,slika.gif,0) == 1) { remove slika.gif }
  30. }
  31. on *:SOCKREAD:pikAUTHid:{
  32.   var %read
  33.   sockread -f %read
  34.   if ($sockerr) {
  35.     write SockErr.txt $sockname : $sockerr
  36.     write SockErr.txt Line : %read
  37.     write SockErr.txt $crlf
  38.     echo -a Socket Error - Check SockErr.txt
  39.     halt
  40.   }
  41.   if ($regex(%read,<img src="(.+)" border=.+)) {
  42.     set %rezultat $sock(pikAUTHid).mark $regml(1)
  43.     set %authslika http:// $+ %pikauthhost $+ /auth/ $+ %rezultat
  44.     if ($findfile($mircdir,slika.gif,0) == 1) { remove slika.gif }
  45.     if ($findfile($mircdir,piklogo.gif,0) == 0) { GetPIKlogo }
  46.     GetPica
  47.   }
  48. }
  49.  
  50. ;;;;;;;;;;;;;;;
  51. ; get captcha ;
  52. ;;;;;;;;;;;;;;;
  53.  
  54. Alias GetPica {
  55.   SockOpen GetPica %pikauthhost 80
  56. }
  57. On 1:SockOpen:GetPica:{
  58.   sockwrite -nt $sockname GET %authslika HTTP/1.1
  59.   sockwrite $sockname Host: %pikauthhost $+ $crlf $+ $crlf
  60. }
  61. On 1:SockRead:GetPica:{
  62.   if (!$sock($sockname).mark) {
  63.     var %SockReader
  64.     sockread %SockReader
  65.     if (%SockReader == $null) { sockmark $sockname 1 }
  66.   }
  67.   else {
  68.     sockread &picture
  69.     bwrite $qt($mIRCdir $+ slika.gif) -1 -1 &picture
  70.     showpica
  71.   }
  72. }
  73.  
  74. ;;;;;;;;;;;;
  75. ; get logo ;
  76. ;;;;;;;;;;;;
  77.  
  78. Alias GetPIKlogo {
  79.   SockOpen GetPIKlogo cm.ikimg.com 80
  80. }
  81. On 1:SockOpen:GetPIKlogo:{
  82.   sockwrite -nt $sockname GET /krstarica-srbija-srl.gif HTTP/1.1
  83.   sockwrite $sockname Host: cm.ikimg.com $+ $crlf $+ $crlf
  84. }
  85. On 1:SockRead:GetPIKlogo:{
  86.   if (!$sock($sockname).mark) {
  87.     var %SockReader
  88.     sockread %SockReader
  89.     if (%SockReader == $null) { sockmark $sockname 1 }
  90.   }
  91.   else {
  92.     sockread &picture
  93.     bwrite $qt($mIRCdir $+ piklogo.gif) -1 -1 &picture
  94.   }
  95. }
  96.  
  97. ;;;;;;;;;;;;;;;
  98. ; auth window ;
  99. ;;;;;;;;;;;;;;;
  100.  
  101. Alias ShowPica {
  102.   window -dpCe0k0 +l @PIKauth -1 -1 250 180
  103.   drawpic @PIKauth 40 1 $qt($mIRCdir $+ piklogo.gif)
  104.   drawtext -po @PIKauth 4 10 35 Unesite kod sa slike
  105.   drawtext -po @PIKauth 4 70 92 i stisnite ENTER
  106.   drawpic @PIKauth 50 50 $qt($mIRCdir $+ slika.gif)
  107. }
  108.  
  109. ;;;;;;;;;;;;;;;;;;;;;;;;;;
  110. ; post auth captcha code ;
  111. ;;;;;;;;;;;;;;;;;;;;;;;;;;
  112.  
  113. on 1:INPUT:@PIKauth:{
  114.   set %authcode $1-
  115.   sockopen pikauthpost %pikauthhost 80
  116. }
  117. on *:sockopen:pikauthpost:{
  118.   var -s %data code= $+ %authcode
  119.   sockwrite -n $sockname POST %pikauthurl HTTP/1.1
  120.   sockwrite -n $sockname Host: %pikauthhost
  121.   sockwrite -n $sockname Content-Type: application/x-www-form-urlencoded
  122.   sockwrite -n $sockname Content-Length: $len(%data)
  123.   sockwrite -n $sockname $crlf $+ %data
  124. }
  125. on *:sockread:pikauthpost:{
  126.   var %x
  127.   sockread %x
  128.   if (*autorizacionog* iswm %x) {
  129.     echo -a Greska!
  130.     echo -a Nema autorizacionog koda. Proverite da li ste ispravno kopirali URL. Možda ste već uspešno prošli autorizaciju?
  131.     window -c @PIKauth
  132.     unset %pikauthstrana
  133.     unset %pikauthhost
  134.     unset %pikauthurl
  135.     unset %rezultat
  136.     unset %authslika
  137.     unset %authcode
  138.     if ($findfile($mircdir,slika.gif,0) == 1) { remove slika.gif }
  139.   }
  140.   if (*neispravan* iswm %x) { drawtext -po @PIKauth 4 5 110 Uneli ste neispravan kod, pokušajte ponovo. }
  141. }
Advertisement
Add Comment
Please, Sign In to add comment