k7f

register.cgi seccon2015

k7f
Dec 7th, 2015
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 1.55 KB | None | 0 0
  1. #!/usr/bin/perl
  2. # by KeigoYAMAZAKI, 2015.11.02-
  3.  
  4. use CGI;
  5. my $q = new CGI;
  6.  
  7. print<<'EOM';
  8. Content-Type: text/html; charset=utf-8
  9.  
  10. <html>
  11. <head>
  12.   <meta charset="utf-8">
  13.   <title>SECCON 2015</title>
  14. </head>
  15. <body style='background:#000;color:#52d6eb;font-family:"ヒラギノ明朝 ProN W6", "HiraMinProN-W6", "HG明朝E", "MS P明朝", "MS PMincho", "MS 明朝", serif'>
  16. <img src="logo.png">
  17. <h2 style="text-align:center">SECURITY CONTEST 2015</h2>
  18. <h1 style="font-size:28px;border-top:1px solid #28363D;border-bottom:1px solid #28363D;padding:15px">Entry Form</h1>
  19. <form action="?" method="get"><pre>
  20. EOM
  21.  
  22. if($q->param("mail") ne '' && $q->param("name") ne '') {
  23.   open(SH, "|/usr/sbin/sendmail -bm '".$q->param("mail")."'");
  24.   print SH "From: keigo.yamazaki\@seccon.jp\nTo: ".$q->param("mail")."\nSubject: from SECCON Entry Form\n\nWe received your entry.\n";
  25.   close(SH);
  26.  
  27.   open(LOG, ">>log"); ### <-- FLAG HERE ###
  28.   flock(LOG, 2);
  29.   seek(LOG, 0, 2);
  30.   print LOG "".$q->param("mail")."\t".$q->param("name")."\n";
  31.   close(LOG);
  32.  
  33.   print "<h1>Your entry was sent. <a href='?' style='color:#52d6eb'>Go Back</a></h1>";
  34.   exit;
  35. }
  36.  
  37. print <<'EOM';
  38. </pre><table border="0" style="margin:30px">
  39. <tr><td>Your E-Mail address:</td><td><input type="email" name="mail" size="30" required></td></tr>
  40. <tr><td>Your Name:</td><td><input type="text" name="name" size="30" required></td></tr>
  41. <tr><td colspan="2"><input type="submit" name="action" value="Send" style="background-color:#52d6eb;border-style:none;padding:5px;margin:10px"></td></tr>
  42. </table>
  43. </form>
  44. </body>
  45. </html>
  46. EOM
  47.  
  48. 1;
Advertisement
Add Comment
Please, Sign In to add comment