Advertisement
Guest User

cascading wp attacks on modern linux systems

a guest
Mar 16th, 2016
370
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.84 KB | None | 0 0
  1. “Cascading White Privilege attacks against modern Linux systems, Bespoke CP attacks”
  2.  
  3. _.-"""-._
  4. .' `.
  5. / \
  6. | |
  7. | crustsec |
  8. | |
  9. \ / _.-"""-._
  10. _.`. .'. .' `.
  11. |`-._`-.._..-'_.-| / \
  12. | _ `-._ _.-' | | |
  13. | | `-._ " _.-'| | | |
  14. | | || | | | | |
  15. | | || | | | \ /
  16. | | || | | | _`. .'.
  17. | | || | | | |`-.`-.._..-'.-'|
  18. | | || | | | | `-._.-' |
  19. | | _.-'| |_ | | | |`-._ _.-'| |
  20. | |'_.-'| |_`-.| | | | || | | |
  21. |_.-' | | `-._ `._|`-._ | | || | | |
  22. / / | | ``---._ `-._ | | || | | |
  23. | / / .-' `-._|`-._ ``-._ `-._ | | || | | |
  24. || || / /|-| |-._ `-._ `--._`-._|`-._ | | || | | |
  25. | | ' || |\ `-._ `-._ ``---._ `| | || | | |
  26. | - | | | || | \ | |`-._ `-._|`-._ ``-| |`-.|| | | |
  27. _.-' | | || | \ | | `-._ `-._ | |-._ | |._ | |
  28. _.-' | | || | \| | `-._ `-.| | `| |_ `-| |
  29. | | | || | | | `-._ _.| | | | `.-| |
  30. | | || || | | | _.-'|_.-'_.-' | |_.-' |
  31. | | | . || | | | _.-' __.---'' _.| ' |
  32. | | || || | | |\_.-'|_.-'_.-'' _.-'|_.-' _. |
  33. | | | || | | |' _- _.-' _.-' | |
  34. || || || |_.-'| |_.---'' _.-' _ | | |
  35. \ | | | || |_.-'| | _.-'|_.-' _.-'|| | | |
  36. \ | || .'_| | | |_.-' _.-'| | || | | |
  37. \ | | |._ | | | `-._ _.-' | | || | | |
  38. \ || | | `| | ```-._`-._|`-._ _.-' | | || | | |
  39. |\_.-| | `-._ ``---._ `-._ | | || | | |
  40. | | `-._|`-._ ``-._ `-._ | | || | | |
  41. | || || | `-._ `--._`-._|`| | || | | |
  42. | | | | `-._ ``---.| |`|| | | |
  43. | | | | |`-._ `-._|`-._ | |-.| |-._ | |
  44. | | ||`-._ `-.| | | |._ `-| |
  45. | | | | || | `-._ _.| | | | `-_| |
  46. | | | ||__ | | | `-._ _.-'|_.-'_.-' | |_.-' |
  47. | | | | ._.-| |. | | `-._ _.-' __.---'' _| |
  48. | | | ||/ | | \ | | _.-'|_.-'_.-'' _.-'|_.-' |
  49. | || || | | .'| |-' __.---'' _.-' |
  50. | | | | |.| '| |-'' _.-'|_.-' |
  51. | | || _. | | | | | _.-' |
  52. | | | ' | | | | |_.-' |
  53. | || | | \ | | / _| ' _.-'
  54. |_.-' | _`.| |'-' _.-'
  55. |`-._ _.| _.-'
  56. | `-._ _.-' _.-'
  57. | |' _.-'
  58. | | _.-'
  59. | | _.-'
  60. | | _.-'
  61. | | _.-'
  62. | | _.-'
  63. | | _.-'
  64. _ | | _.-'
  65. `-|_ | _.-'
  66. `-._ | _.-'
  67. `-.|.-'
  68.  
  69.  
  70. First, let’s show off the trick, then get down to the details!
  71.  
  72. root@instance-1:/# id
  73. uid=0(root) gid=0(root) groups=0(root)
  74. root@instance-1:/# ./expl
  75. nobody@instance-1:/$ id
  76. uid=65534(nobody) gid=65534(nogroup) groups=65534(nogroup)
  77. nobody@instance-1:/$ uname -a
  78. Linux instance-1 3.19.0-51-generic #58~14.04.1-Ubuntu SMP Fri Feb 26 22:02:58 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
  79.  
  80. Now that we’ve all seen it, what’s going on here? An escalation from uid0 to uid 65534, a HUGE increase in UID. We’ve elevated privileges from the user “root”, to the much more powerful “nobody” user. Nobody is more powerful than root. Additionally, such an increase in numbers could be applied to an “integer overflow” attack, if we make the numbers too big! Imagine code like this:
  81.  
  82. int main(void) {
  83. uid_t myuid = getuid();
  84. char x = (char)myuid; // assuming that uid was 0.
  85. // BOOM we’ve overflowed x, and can do all sort of nasty stuff.
  86. }
  87.  
  88. On linux systems, the user id is stored in the file “/etc/passwd”. Needless to say, you know what that means. Bingo, game over. We now have the highest number of uid, and can read all other passwords on the system.
  89.  
  90. The attack is currently 0day, works against all known ubuntu linux versions, and the exploit has been sent to the kernel maintainers for patching, after which it will be released.
  91.  
  92. Team xXx.CrUsT.s3C.xXx
  93.  
  94.  
  95. __ __ ____ _ _ _____ _____ ____ __ __
  96. \ \/ /__ __ / ___|_ __| | | |__|_ _|___|___ / / ___| __ __\ \/ /
  97. \ / \ \/ /| | | '__| | | / __|| | / __| |_ \| | \ \/ / \ /
  98. / \ > < | |___| | | |_| \__ \| |_\__ \___) | |___ _ > < / \
  99. /_/\_\/_/\_(_)____|_| \___/|___/|_(_)___/____/ \____(_)_/\_\/_/\_\
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement