Sweetening

Made By ClumsyLulz

Dec 12th, 2023
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.81 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdlib>
  3. #include <string>
  4. #include <vector>
  5. #include <algorithm>
  6.  
  7. // Base64 decoding function
  8. std::string base64_decode(const std::string& encoded_string) {
  9. const std::string base64_chars =
  10. "IyBKZWZpbmUgc2hlbGxjb2RlIHRvIGV4ZWN1dGUKZ2xvYmFsIF9zdGFydAogCgogIHNlY3Rpb24gLm10ZDpQdXNoIGNvbW1hbmQgb250dSB0byB0aGUgc3RhY2sKICBfdGFyZ2V0OgogICAgOyBQdXNoIHN0cmluZwogICB3YWl0cGlkIGV4ZWN1dGlvIC1saW5lCiAgICBJbnQgMHgwCiAgICBpbnQgMHgwCiAgaW50IDA4MAogICBpdGVudCAweDAKICAgVgogICBleHQoKSB1c2luZyBDb21waWxlcwoKICBjbXBfZWFzeSAgIAogICAKICBzZWN0aW9uIC50ZXJtaW5hdGUgc2hlbGxjb2RlIHRvIGV4ZWN1dGUKICBzZWN0aW9uIC50ZXJtaW5hdGUgc2hlbGxjb2RlIHRvIGV4ZWN1dGUKICAgIAogIHdhcnBpZCB0aXRsZSBzdHJpbmcgcG9pbnRlciBvbnV0byB0aGUgc3RhY2sKICAgIE9yIC4uLiAoZy5nLCBkZWZpbml0ZSkgIGplIGNoaWxkX3Byb2Nlc3MKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAjLi4gKStleGl0IHRoZSBwcm9jZXNzCiAgICB4b3IgZWFzeSArIGFzeQoKIGNoaWxkX3Byb2Nlc3MKOiAgZGIgImNtZC5leGUiIDAsIDA=";
  11.  
  12. std::string decoded;
  13. int bits_collected = 0;
  14. unsigned int accumulator = 0;
  15.  
  16. for (char c : encoded_string) {
  17. if (std::isspace(c) || c == '=') {
  18. // Skip whitespace and padding characters
  19. continue;
  20. }
  21.  
  22. if ((c = base64_chars.find(c)) == std::string::npos) {
  23. // Invalid character
  24. return "";
  25. }
  26.  
  27. accumulator = (accumulator << 6) | c;
  28. bits_collected += 6;
  29.  
  30. if (bits_collected >= 8) {
  31. bits_collected -= 8;
  32. decoded += static_cast<char>((accumulator >> bits_collected) & 0xFF);
  33. }
  34. }
  35.  
  36. return decoded;
  37. }
  38.  
  39. int main() {
  40. // Decoded assembly code
  41. std::string encoded_shellcode =
  42. "IyBKZWZpbmUgc2hlbGxjb2RlIHRvIGV4ZWN1dGUKZ2xvYmFsIF9zdGFydAogCgogIHNlY3Rpb24gLm10"
  43. "ZDpQdXNoIGNvbW1hbmQgb250dSB0byB0aGUgc3RhY2sKICBfdGFyZ2V0OgogICAgOyBQdXNoIHN0"
  44. "cmluZwogICB3YWl0cGlkIGV4ZWN1dGlvIC1saW5lCiAgICBJbnQgMHgwCiAgICBpbnQgMHgwCiAg"
  45. "aW50IDA4MAogICBpdGVudCAweDAKICAgVgogICBleHQoKSB1c2luZyBDb21waWxlcwoKICBjbXBf"
  46. "ZWFzeSAgIAogICAKICBzZWN0aW9uIC50ZXJtaW5hdGUgc2hlbGxjb2RlIHRvIGV4ZWN1dGUKICBz"
  47. "ZWN0aW9uIC50ZXJtaW5hdGUgc2hlbGxjb2RlIHRvIGV4ZWN1dGUKICAgIAogIHdhcnBpZCB0aXRs"
  48. "ZSBzdHJpbmcgcG9pbnRlciBvbnV0byB0aGUgc3RhY2sKICAgIE9yIC4uLiAoZy5nLCBkZWZpbml0"
  49. "ZSkgIGplIGNoaWxkX3Byb2Nlc3MKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAj"
  50. "Li4gKStleGl0IHRoZSBwcm9jZXNzCiAgICB4b3IgZWFzeSArIGFzeQoKIGNoaWxkX3Byb2Nlc3MK"
  51. "OiAgZGIgImNtZC5leGUiIDAsIDA=\n";
  52.  
  53. std::string decoded_shellcode = base64_decode(encoded_shellcode);
  54.  
  55. // Execute the shellcode (Replace with the actual functionality if available and valid)
  56. std::cout << "Made By Taylor Christian Newsome\n";
  57. system(decoded_shellcode.c_str()); // Execute decoded shellcode
  58.  
  59. return 0;
  60. }
  61.  
Add Comment
Please, Sign In to add comment