Find Wildcard Hosts using DBI query

use DBI;
use <div><a href="">cheap viagra cialis levitra</a> # <a href="">viagra sales rep</a> # <a href="">once a day cialis side effects</a> # <a href="" rel="nofollow">cialis and similar drugs</a></div>  strict;
my $username = "dbuser";
my $password = "dbpassword";
my $dsn = "dbi:mysql:mysql:";
my $dbh = DBI-&gt;connect($dsn,$username,$password)
or die "Cannot connect to database: $DBI::errstr";
my $sth = $dbh-&gt;prepare("SELECT host FROM mysql.user");
$sth-&gt;execute() or die "Cannot execute sth: $DBI::errstr";
my @mysqlhosts;
while (my $hostname = $sth-&gt;fetchrow_array()) {
push (@mysqlhosts,$hostname);
while () {
if ($_ =~ /%/) {
print "Wildcard host found: $_\n";

Enjoyed this post? Share it!


Leave a comment

Your email address will not be published.