There are many SLAE64 blogposts each explaining their variant of shellcode out there. I thought I would join in the fun. This is my version of the Bindshell TCP shellcode. I'll keep it brief and only list down the interesting or unique points in my shellcode.
- Line 9: To reduce size, I only assigned 2 bytes out of the 8 required for
new_sock_struct
, which is used to store the client socket descriptor. It will overwrite thelea
instruction immediately after but since the instruction has already been executed, it does not matter. - Line 43: Used
shr
to zero out last 4 bytes ofbind_data_struct
. Required so that shell can listen on 0.0.0.0. - Line 105: I reused the first byte in
bind_data_struct
as a buffer to store the password input. By that time, the client has connected and thebind_data_struct
is unused. - Line 112: Jump outside of code region if password fails, causing a segfault, save a few bytes compared to exiting gracefully.
Total size: 175 bytes
1 2 3 4 5 6 7 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 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 |
|
This blog post has (not) been created for completing the requirements of the SecurityTube Linux Assembly Expert certification:
Student ID: SLAE64-XXXXX