Join us at IRC!
The important thing is not to stop questioning. - Albert Einstein
Friday, May 25, 2012
Navigation
Members Online
Total Online: 32
Web Spiders: 14
Guests Online: 30
Members Online: 2

Registered Members: 70208
Newest Member: andresuran
Latest Articles
View Thread

HellBound Hackers | Computer General | Programming

Author

perl url checker

Draggonista
Member

Posts: 39
Location: NSW, Australia
Joined: 26.10.05
Rank:
Mad User
Posted on 24-01-06 13:48
I was trying to make a url checker in perl and now im completely lost

#!/usr/bin/perl

$url = "http://www.hellboundhackers.org/challenges/real2/backups/backup_2004-09-$day_$hour00.sql";

$day = 1;
$hour = 1;

use LWP::Simple;
while(!$check)
{
print $day, " ", $hour, "\n";
$hour = $hour + 1;
if($hour == 24)
{
$day = $day + 1;
$hour = 1;
}
if($day = 1||2||3||4||5||6||7||8||9)
{
$day = "$day";
}
if($hour = 1||2||3||4||5||6||7||8||9)
{
$hour = "$hour0";
}
if($day == 31)
{
print "YOU SCREWED UP, NOTHING WAS FOUND";
exit;
}
my $check = get $url;
}
print "THE URL ", $url, " IS NOT EMPTY";


The problem is that it wont increment the day or hour variables and it wont add them to the URL




Edited by Draggonista on 24-01-06 22:15
xdemon_of_the_darkx@hotmail.com dragon_slayer_51
Author

RE: perl url checker

Draggonista
Member

Posts: 39
Location: NSW, Australia
Joined: 26.10.05
Rank:
Mad User
Posted on 24-01-06 22:16
I fixed up the day and hour, but i still cant add them to the URL, someone help please


xdemon_of_the_darkx@hotmail.com dragon_slayer_51
Author

RE: perl url checker

n3w7yp3
Member

Posts: 358
Location: USA
Joined: 19.03.05
Rank:
Mad User
Posted on 24-01-06 23:04
You have to use string concaticnation. Its done with the '.'. So, to add them into the URL, try:

"(insert URL here)" . $whatever . $whatever . ".php"

A mate of mine actually had code to solve this that was very similar to yours... I told him the same thing and it worked.

GL.


"Root is a state of mind" -- K0resh
Author

RE: perl url checker

Draggonista
Member

Posts: 39
Location: NSW, Australia
Joined: 26.10.05
Rank:
Mad User
Posted on 25-01-06 02:19
but also, can perl read .sql files cause if not.....


xdemon_of_the_darkx@hotmail.com dragon_slayer_51
Author

RE: perl url checker

Draggonista
Member

Posts: 39
Location: NSW, Australia
Joined: 26.10.05
Rank:
Mad User
Posted on 25-01-06 02:27
but also, can perl read .sql files cause if not.....


xdemon_of_the_darkx@hotmail.com dragon_slayer_51
Author

RE: perl url checker

n3w7yp3
Member

Posts: 358
Location: USA
Joined: 19.03.05
Rank:
Mad User
Posted on 25-01-06 17:22
Your code is not reading *sql files, itrs merlely checking for their existance.

While I have never seen a *.sql files, I'm sure that its possible to parse it with Perl. Even if its not ASCII, just chuck Perl into binmode and have it parse it then.


"Root is a state of mind" -- K0resh
Guest
Username

Password

Remember Me


Bookmark This Page
Affiliates
Adverts

 

 

Links
By using, viewing or obtaining any information contained on this site, you agree to the disclaimer.

© HellBound Hackers 2008- 2009. Since 3rd December 2004.