Skip to main content

Over the Wire - Bandit 16

Bandit 16


Objectives
Level GoalThe password for the next level can be retrieved by submitting the password of the current level to port 30001 on localhost using SSL encryption.
Helpful note: Getting “HEARTBEATING” and “Read R BLOCK”? Use -ign_eof and read the “CONNECTED COMMANDS” section in the manpage. Next to ‘R’ and ‘Q’, the ‘B’ command also works in this version of that command…


Solution


bandit15@bandit:~$ echo BfMYroe26WYalil77FoDi9qh59eK5xNr | openssl s_client -ign_eof -connect localhost:30001CONNECTED(00000003)depth=0 CN = localhostverify error:num=18:self signed certificateverify return:1depth=0 CN = localhostverify return:1---Certificate chain 0 s:/CN=localhost   i:/CN=localhost---Server certificate-----BEGIN CERTIFICATE-----MIICBjCCAW+gAwIBAgIEBadydTANBgkqhkiG9w0BAQUFADAUMRIwEAYDVQQDDAlsb2NhbGhvc3QwHhcNMTkwMjI3MDg1MTQ5WhcNMjAwMjI3MDg1MTQ5WjAUMRIwEAYDVQQDDAlsb2NhbGhvc3QwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMyEZzRA+5ll7Ap2bwla+8x39mTviZKqrjnmLuTZj1U3mugt3G2JI5loXyjnFxlXnHUGy/xIOiACFOEJCce2VIkarMa1Cy13wtGuLoZxjcYSAIMzIOPykCh9+FJ89Tt1TIVXmO0CTJaxFMhKdX0ALZlxjN1+xoZgeOtN7yfhprjjAgMBAAGjZTBjMBQGA1UdEQQNMAuCCWxvY2FsaG9zdDBLBglghkgBhvhCAQ0EPhY8QXV0b21hdGljYWxseSBnZW5lcmF0ZWQgYnkgTmNhdC4gU2VlIGh0dHBzOi8vbm1hcC5vcmcvbmNhdC8uMA0GCSqGSIb3DQEBBQUAA4GBACNP1/t8pfANluA2MuoxCAkie0bDCUL/ZV7FDaH1YUAEG7wEZVFJPt8+6L8HkLYcuCPtjc2uxA8yEiqS7fiYRU26PmrQXzm09W0ah1pq+7NGMLKz596BAIpiTkVpA7YCUvGcYvz6yXS202e2GbLOulF2l9kx6hhhBCWubeqh2IjR-----END CERTIFICATE-----subject=/CN=localhostissuer=/CN=localhost---No client certificate CA names sentPeer signing digest: SHA512Server Temp Key: X25519, 253 bits---SSL handshake has read 1019 bytes and written 269 bytesVerification error: self signed certificate---New, TLSv1.2, Cipher is ECDHE-RSA-AES256-GCM-SHA384Server public key is 1024 bitSecure Renegotiation IS supportedCompression: NONEExpansion: NONENo ALPN negotiatedSSL-Session:    Protocol  : TLSv1.2    Cipher    : ECDHE-RSA-AES256-GCM-SHA384    Session-ID: 44478770157CC92CC115519B8669DEAEDF5BE611B3CBF3A68BAD59DAC19061D3    Session-ID-ctx:    Master-Key: 502DE099D6BF9CA7EAEC5A2BAF971B4ECBE66F8674B17AFC7A35DAED79AD9F43C7C1165C22016D86915850C97A56923A    PSK identity: None    PSK identity hint: None    SRP username: None    TLS session ticket lifetime hint: 7200 (seconds)    TLS session ticket:    0000 - df 12 86 44 83 09 d4 62-75 55 25 0c f8 4f 2c 53   ...D...buU%..O,S    0010 - 71 95 96 18 78 eb 55 95-cd b2 88 5e 89 65 63 64   q...x.U....^.ecd    0020 - ce 91 d2 f8 87 70 b8 90-a7 6c 51 b5 8f 84 0c a9   .....p...lQ.....    0030 - 2a 1d 54 bc 6d bc 50 f9-34 dc 86 7f 32 e1 f1 7a   *.T.m.P.4...2..z    0040 - fb c4 63 f6 8c b1 fe 1b-53 9e 9a fa 73 07 33 d5   ..c.....S...s.3.    0050 - 69 31 c9 b7 b3 bb d7 11-12 af 5f 47 22 9c 51 95   i1........_G".Q.    0060 - 5a ad 2c 73 a8 80 07 96-cf 11 ab af 3c 0c 6f 8d   Z.,s........<.o.    0070 - 3c ca b7 0d f6 e6 b5 98-59 65 31 2a fa c5 ec e4   <.......Ye1*....    0080 - 9a a3 c0 89 f9 3f 3a 67-1b a4 81 09 1e e4 cc c2   .....?:g........    0090 - 62 76 65 07 af a6 78 29-b1 6c 17 c8 37 6a a5 be   bve...x).l..7j..
    Start Time: 1559235643    Timeout   : 7200 (sec)    Verify return code: 18 (self signed certificate)    Extended master secret: yes---Correct!cluFn7wTiGryunymYOu4RcffSxQluehd
closed




password is
cluFn7wTiGryunymYOu4RcffSxQluehd

Now in Python




import os
os.system('echo BfMYroe26WYalil77FoDi9qh59eK5xNr | openssl s_client -ign_eof -connect localhost:30001')




***Again this this is kind of cheating to call this a python solution***

Comments

Popular posts from this blog

RingZero CTF - Cyrptography - You're Drunk

RingZero CTF - Cyptography - Your're Drunk Problem: Ayowe awxewr nwaalfw die tiy rgw fklf ua xgixiklrw! Tiy lew qwkxinw. Solution: So just looking at this one it looks like its formatted as a sentence. There is spacing between words, punctuation and capitalization. At fist I thought Cesar cipher, but I ran through some shifts and none of them came back with english words. So then I though substitution cipher. We know from frequency analysis of the English language some good starting points. The most common letter would be "E" The most common double letters would be "OO", "EE" and"SS"  so let start with that and see what we can come up with This site is a great resource for some of the assumptions I'm making here ( http://practicalcryptography.com/ciphers/monoalphabetic-substitution-category/simple-substitution/ ) I used this website to count the letter frequency for me ( https://www.dcode.fr/frequency-analysis ) ...

HacktheBox - Retired - Frolic

HacktheBox - Retired - Frolic Recon Let's start out with a threader3000 scan Some interesting results here Port 22 and 445 aren't uncommon… but 1880 and 9999 are.. Let's let nmap run through these ports  Option Selection: 1 nmap -p22,445,1880,9999 -sV -sC -T4 -Pn -oA 10.10.10.111 10.10.10.111 Host discovery disabled (-Pn). All addresses will be marked 'up' and scan times will be slower. Starting Nmap 7.91 ( https://nmap.org ) at 2021-05-05 16:17 EDT Nmap scan report for 10.10.10.111 Host is up (0.060s latency). PORT     STATE SERVICE     VERSION 22/tcp   open  ssh         OpenSSH 7.2p2 Ubuntu 4ubuntu2.4 (Ubuntu Linux; protocol 2.0) | ssh-hostkey: |   2048 87:7b:91:2a:0f:11:b6:57:1e:cb:9f:77:cf:35:e2:21 (RSA) |   256 b7:9b:06:dd:c2:5e:28:44:78:41:1e:67:7d:1e:b7:62 (ECDSA) |_  256 21:cf:16:6d:82:a4:30:c3:c6:9c:d7:38:ba:b5:02:b0 (ED25519) 445/tcp  open  netbios-ssn Samba smbd 4.3.11-Ubuntu (workgroup: WORKGROUP) 1880/tcp open  http        Node.js (Express middlewar...

De-ICE: S1.140 - Write up

De-ICE: S1.140 https://www.vulnhub.com/entry/de-ice-s1140,57/ I've been doing a lot of hackthebox.eu boxes, I've decided to take a small break from those and focus on other vuln boxes for a while, A colleague told me about these ICE boxes he did for labs during school. So  I decided to check them out. Recon Since these are live CD's the first thing I need to do is find out the ip address of the live CD VM i'm running. My home network is 192.168.50.0/24 so I started with a small updown nmap scan of my entire subnet to find the target VM nmap -T4 -oX /root/Desktop/ice/nmap.xml 192.168.50.0/24 I then converted the XML output to HTML to make it pretty xsltproc /root/Desktop/ice/nmap.xml -o /root/Desktop/ice/nmap.html Found the target at 192.168.50.176 So now let's rescan the open ports with the -A switch to finger the OS/Services Let's recap what we found Port 21 PROFTPD 1.3.4a Port 22 OPenSSH 5.9p1 Port 80 Apa...