Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #install first
- #sudo apt-get install libmojolicious-perl
- #!/usr/bin/perl
- #@kaiux
- use Mojo::UserAgent;
- use strict;
- use warnings;
- use feature 'say';
- binmode(STDOUT, ":utf8");
- sub scan_wp {
- my ($protocol, $domain, $pattern) = @_;
- my $ua = Mojo::UserAgent->new;
- my $url = $protocol."://".$domain."/".$pattern;
- say "Querying for $url";
- my $html = $ua->get($url);
- my $code = $html->res->code;
- if ( $code eq "200" ) {
- say "Found WP in $domain";
- } elsif ( ($code eq "301") or ($code eq "302") ) {
- my $redirect = $html->res->headers->location;
- if ( $redirect =~ /reauth=1/m ) {
- say "Found WP and got a redirect :P";
- }
- if ( $redirect =~ $pattern ) {
- say "Found WP in $domain";
- }
- } else {
- say "Not a WP";
- }
- }
- sub usage {
- say "run http|https domain|ip wp-admin|wp-login";
- exit 0;
- }
- die usage if ( scalar @ARGV != 3 );
- scan_wp($ARGV[0], $ARGV[1], $ARGV[2]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement