?

Log in

No account? Create an account
entries friends calendar profile adric.net Previous Previous Next Next
Moodle sql injection works, milestone complete. - nil.enroll(aetheric_username, quantum_class_id)
yljatlhQo'! QIch lo'laltbebej!
adric
adric
Moodle sql injection works, milestone complete.
## Since the Moodle external enrollment database code doesn't work,
## we fall back to manual SQL injection for MySQL, eg:
        ## +insert into mdl_role_assignments (roleid,contextid,userid,hidden,timestart,timeend,
        ## timemodified,modifierid,enrol,sortorder) VALUES (5,14,10,0,NOW(),0,NOW(), 2, 'manual',0);+

        ##get Moodle context id
        context_id = CONTEXT_DICTIONARY[course_id]

        ## get a real MySQL handle, scary!
        mysql = ActiveRecord::Base.connection

        ### p "Debug: injecting mysql with payload of 5,#{context_id},#{user_id},0,unix_timestamp(),0,unix_timestamp(), 2, 'manual',0"

        injector = "insert into mdl_role_assignments (roleid,contextid,userid,hidden,timestart,timeend,timemodified,modifierid,enrol,sortorder) 
        VALUES (5,#{context_id},#{user_id},0,unix_timestamp(),0,unix_timestamp(), 2, 'manual',0);"


r175 | bsk | 2008-12-13 21:44:28 -0500 (Sat, 13 Dec 2008) | 1 line

even less debug. also, it seems to work on the dev data


That was a few hours, 15 deltas and a lot of documentation and fiddling ago.
Now I'm just screwing around with Trac.

Tags:
Current Location: NOC
Current Music: Julee Cruise - Into the Night | Powered by Last.fm

Leave a comment