Thread: Steal this PIC
View Single Post
Old 04-02-2002, 05:55 PM  
salsburystaek
Registered User
 
Join Date: Apr 2002
Posts: 3
image is 79041 bytes. (edit: sum is 34162 78 2.out) http://www.cumoninn.com/stealme/stolen.jpg

forgive my sloppyness, it's a quicky


#!/usr/bin/perl
#
# requires netcat

$url = "http://www.crack.sh/stealme/";

$req = "GET /stealme/ HTTP/1.0\nHost: www.crack.sh\n\n";
open (NC, "echo '$req' | nc www.crack.sh 80|") || die "nc: $!";
while (<NC>) {
$cookie = $1 if (/^Set-Cookie: ([^;]+);/);
$gzipped .= $_ if $printflag == 1;
$printflag = 1 if (/^[\r\n]*$/);
}
close (NC);

print "cookie = $cookie\n";

open (GZ, "| gunzip -c &gt; /tmp/foo.$$");
print GZ $gzipped;
close (GZ);

open (FOO, "&lt;/tmp/foo.$$");
unlink ("/tmp/foo.$$");

while (&lt;FOO&gt;) {
s/&lt;/\cJ&lt;/g;
$output .= $_;
}
close (FOO);

$x = 1;
foreach $ln (split (/\n/, $output)) {
if ($ln =~ /^&lt;img src='([^']+)'/) {
$img = $1;
$req = "GET $img HTTP/1.0\nHost: www.crack.sh\nReferer: http://www.crack.s
h/stealme/\nCookie: $cookie\n\n";
open (NC, "echo '$req' | nc www.crack.sh 80 |") || die "nc: $!";
open (OUT, ">$x.out") || die "$x.out";
print "$img -> $x.out ";
$print = 0;
while (<NC>) {
print OUT $_ if $print == 1;
$print = 1 if /^[\r\n]$/;
}
close (NC);
close (OUT);
print ((stat ("$x.out"))[7]);
print " bytes\n";
$x++;
}
}


i suppose you wanted a way to do it with a browser. eh. real image thieves use scripts. :) btw, 2.out will be the image.

Last edited by salsburystaek; 04-02-2002 at 06:03 PM..
salsburystaek is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote