continuous intrusion: why ci tools are an attacker’s ... · * hudson was not evaluated...

30
1

Upload: ngonhu

Post on 20-May-2018

216 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Continuous Intrusion: Why CI tools are an attacker’s ... · * Hudson was not evaluated separately. Most of the things which apply on Jenkins should apply on Hudson as well. 7

1

Page 2: Continuous Intrusion: Why CI tools are an attacker’s ... · * Hudson was not evaluated separately. Most of the things which apply on Jenkins should apply on Hudson as well. 7

2

Page 3: Continuous Intrusion: Why CI tools are an attacker’s ... · * Hudson was not evaluated separately. Most of the things which apply on Jenkins should apply on Hudson as well. 7

3

Page 4: Continuous Intrusion: Why CI tools are an attacker’s ... · * Hudson was not evaluated separately. Most of the things which apply on Jenkins should apply on Hudson as well. 7

More about Continuous Integration: http://www.martinfowler.com/articles/continuousIntegration.html

4

Page 5: Continuous Intrusion: Why CI tools are an attacker’s ... · * Hudson was not evaluated separately. Most of the things which apply on Jenkins should apply on Hudson as well. 7

5

Page 6: Continuous Intrusion: Why CI tools are an attacker’s ... · * Hudson was not evaluated separately. Most of the things which apply on Jenkins should apply on Hudson as well. 7

6

Page 7: Continuous Intrusion: Why CI tools are an attacker’s ... · * Hudson was not evaluated separately. Most of the things which apply on Jenkins should apply on Hudson as well. 7

* Hudson was not evaluated separately. Most of the things which apply on Jenkins should apply on Hudson as well.

7

Page 8: Continuous Intrusion: Why CI tools are an attacker’s ... · * Hudson was not evaluated separately. Most of the things which apply on Jenkins should apply on Hudson as well. 7

8

Page 9: Continuous Intrusion: Why CI tools are an attacker’s ... · * Hudson was not evaluated separately. Most of the things which apply on Jenkins should apply on Hudson as well. 7

9

Page 11: Continuous Intrusion: Why CI tools are an attacker’s ... · * Hudson was not evaluated separately. Most of the things which apply on Jenkins should apply on Hudson as well. 7

The rights of the user to add or change build configuration are managed using Matrix based security or Project-based Matrix Authorization Strategy.https://wiki.jenkins-ci.org/display/JENKINS/Matrix-based+security

When running commands on a Windows machine we can leverage PowerShell to execute advanced scripts using this method.

11

Page 12: Continuous Intrusion: Why CI tools are an attacker’s ... · * Hudson was not evaluated separately. Most of the things which apply on Jenkins should apply on Hudson as well. 7

Taken from http://thiébaud.fr/jenkins_credentials.html

12

Page 13: Continuous Intrusion: Why CI tools are an attacker’s ... · * Hudson was not evaluated separately. Most of the things which apply on Jenkins should apply on Hudson as well. 7

We need credentials.xml from $JENKINS_HOME and master.key and hudson.util.secret from $JENKINS_HOME/secrets/

We are reading the keys master.key and hudson.util.secret in bytes and will convert them back to file on our own machine. On a Windows machine the conversion could be done by using TextToExe.ps1 from Nishang. https://github.com/samratashok/nishang/blob/master/Utility/TexttoExe.ps1

13

Page 14: Continuous Intrusion: Why CI tools are an attacker’s ... · * Hudson was not evaluated separately. Most of the things which apply on Jenkins should apply on Hudson as well. 7

14

Page 15: Continuous Intrusion: Why CI tools are an attacker’s ... · * Hudson was not evaluated separately. Most of the things which apply on Jenkins should apply on Hudson as well. 7

15

Page 16: Continuous Intrusion: Why CI tools are an attacker’s ... · * Hudson was not evaluated separately. Most of the things which apply on Jenkins should apply on Hudson as well. 7

16

Page 17: Continuous Intrusion: Why CI tools are an attacker’s ... · * Hudson was not evaluated separately. Most of the things which apply on Jenkins should apply on Hudson as well. 7

17

Page 18: Continuous Intrusion: Why CI tools are an attacker’s ... · * Hudson was not evaluated separately. Most of the things which apply on Jenkins should apply on Hudson as well. 7

18

Page 19: Continuous Intrusion: Why CI tools are an attacker’s ... · * Hudson was not evaluated separately. Most of the things which apply on Jenkins should apply on Hudson as well. 7

Also see: https://github.com/foxglovesec/JavaUnserializeExploitshttps://github.com/frohoff/ysoserial

19

Page 20: Continuous Intrusion: Why CI tools are an attacker’s ... · * Hudson was not evaluated separately. Most of the things which apply on Jenkins should apply on Hudson as well. 7

I am using an encoded one line PowerShell reverse shell from Nishang as the payload in the above screenshot. (https://github.com/samratashok/nishang/blob/master/Shells/Invoke-PowerShellTcpOneLine.ps1)

20

Page 21: Continuous Intrusion: Why CI tools are an attacker’s ... · * Hudson was not evaluated separately. Most of the things which apply on Jenkins should apply on Hudson as well. 7

21

Page 22: Continuous Intrusion: Why CI tools are an attacker’s ... · * Hudson was not evaluated separately. Most of the things which apply on Jenkins should apply on Hudson as well. 7

22

Page 23: Continuous Intrusion: Why CI tools are an attacker’s ... · * Hudson was not evaluated separately. Most of the things which apply on Jenkins should apply on Hudson as well. 7

23

Page 24: Continuous Intrusion: Why CI tools are an attacker’s ... · * Hudson was not evaluated separately. Most of the things which apply on Jenkins should apply on Hudson as well. 7

24

Page 25: Continuous Intrusion: Why CI tools are an attacker’s ... · * Hudson was not evaluated separately. Most of the things which apply on Jenkins should apply on Hudson as well. 7

25

Page 26: Continuous Intrusion: Why CI tools are an attacker’s ... · * Hudson was not evaluated separately. Most of the things which apply on Jenkins should apply on Hudson as well. 7

26

Page 27: Continuous Intrusion: Why CI tools are an attacker’s ... · * Hudson was not evaluated separately. Most of the things which apply on Jenkins should apply on Hudson as well. 7

27

Page 28: Continuous Intrusion: Why CI tools are an attacker’s ... · * Hudson was not evaluated separately. Most of the things which apply on Jenkins should apply on Hudson as well. 7

28

Page 29: Continuous Intrusion: Why CI tools are an attacker’s ... · * Hudson was not evaluated separately. Most of the things which apply on Jenkins should apply on Hudson as well. 7

29

Page 30: Continuous Intrusion: Why CI tools are an attacker’s ... · * Hudson was not evaluated separately. Most of the things which apply on Jenkins should apply on Hudson as well. 7

30