__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
#!/usr/bin/perl
# Print information about forms and their controls present in the HTML.
# See also HTML::Form module
use strict;
use warnings;
use HTML::PullParser ();
use HTML::Entities qw(decode_entities);
use Data::Dumper qw(Dumper);
my @FORM_TAGS = qw(form input textarea button select option);
my $p = HTML::PullParser->new(
file => shift || "xxx.html",
start => 'tag, attr',
end => 'tag',
text => '@{text}',
report_tags => \@FORM_TAGS,
) || die "$!";
# a little helper function
sub get_text {
my ($p, $stop) = @_;
my $text;
while (defined(my $t = $p->get_token)) {
if (ref $t) {
$p->unget_token($t) unless $t->[0] eq $stop;
last;
}
else {
$text .= $t;
}
}
return $text;
}
my @forms;
while (defined(my $t = $p->get_token)) {
next unless ref $t; # skip text
if ($t->[0] eq "form") {
shift @$t;
push(@forms, $t);
while (defined(my $t = $p->get_token)) {
next unless ref $t; # skip text
last if $t->[0] eq "/form";
if ($t->[0] eq "select") {
my $sel = $t;
push(@{$forms[-1]}, $t);
while (defined(my $t = $p->get_token)) {
next unless ref $t; # skip text
last if $t->[0] eq "/select";
#print "select ", Dumper($t), "\n";
if ($t->[0] eq "option") {
my $value = $t->[1]->{value};
my $text = get_text($p, "/option");
unless (defined $value) {
$value = decode_entities($text);
}
push(@$sel, $value);
}
else {
warn "$t->[0] inside select";
}
}
}
elsif ($t->[0] =~ /^\/?option$/) {
warn "option tag outside select";
}
elsif ($t->[0] eq "textarea") {
push(@{$forms[-1]}, $t);
$t->[1]{value} = get_text($p, "/textarea");
}
elsif ($t->[0] =~ m,^/,) {
warn "stray $t->[0] tag";
}
else {
push(@{$forms[-1]}, $t);
}
}
}
else {
warn "form tag $t->[0] outside form";
}
}
print Dumper(\@forms), "\n";
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| hanchors | File | 1.17 KB | 0755 |
|
| hbody | File | 729 B | 0755 |
|
| hdisable | File | 740 B | 0755 |
|
| hdump | File | 708 B | 0755 |
|
| hform | File | 2.44 KB | 0755 |
|
| hlc | File | 717 B | 0755 |
|
| hrefsub | File | 3 KB | 0755 |
|
| hstrip | File | 1.73 KB | 0755 |
|
| htext | File | 612 B | 0755 |
|
| htextsub | File | 936 B | 0755 |
|
| htitle | File | 461 B | 0755 |
|