tag:blogger.com,1999:blog-57756474786069655572024-03-05T20:21:11.038-08:00UNK-BRDanilo Vazhttp://www.blogger.com/profile/05961143854943568933noreply@blogger.comBlogger10125tag:blogger.com,1999:blog-5775647478606965557.post-34394962992642349692016-12-11T05:45:00.001-08:002016-12-11T05:50:08.991-08:000 ch0r0 3h l1vr3A pedido de um amigo, segue um texto que fala sobre a "comunidade".<br />
<br />
<div style="background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 12.8px;">
Disclaimer: Tudo que escrevo aqui são opiniões minhas, e não refletem a opinião dos organizadores da H2HC de forma individual ou como organização.</div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 12.8px;">
<br /></div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 12.8px;">
Nos últimos dias acabei por ler um blog post feito pelo Carlos Cabral e outro feito pelo Anchises sobre um incidente ocorrido na H2HC deste ano (2016), onde uma pessoa foi hackeada e aparentemente teve seus dados de celular apagados e suas contas em redes sociais comprometidas. Os posts são antigos (feitos logo depois da H2HC), mas só agora eu vi e fiquei sabendo do ocorrido.</div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 12.8px;">
<br /></div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 12.8px;">
Estes posts tentam relacionar o que acontece na comunidade hacking com a comunidade de segurança no Brasil, coisas que obviamente são completamente distintas. Diferente do que o Anchises pinta sobre como deveria ser uma comunidade, a comunidade hacking tem suas próprias regras no Brasil ou em qualquer parte do mundo, e se você vai a conferencias do tipo esteja preparado para conviver com tais regras.</div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 12.8px;">
<br /></div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 12.8px;">
No geral ambientes do tipo são bastante hostis. Durante o tempo em que convivi em meio a esta comunidade eu já muita confusão acontecer. Das que eu me lembro agora posso citar coisas como:</div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 12.8px;">
<br /></div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 12.8px;">
- Por volta de 1996/97 o pessoal da Axur05 (<a data-saferedirecturl="https://www.google.com/url?hl=pt-BR&q=http://www.bertochi.com.br/zines/axur05/&source=gmail&ust=1481532985102000&usg=AFQjCNFqrYyCO09p-yaRIzjhV_WfRbnm9g" href="http://www.bertochi.com.br/zines/axur05/" style="color: #1155cc;" target="_blank">http://www.bertochi.com.br/<wbr></wbr>zines/axur05/</a>) teve uma treta com a zine Barata Elétrica (ou Merdeval e Bezouro Elétrico como eles chamaram na época - <a data-saferedirecturl="https://www.google.com/url?hl=pt-BR&q=http://barataeletrica.blogspot.com.au/&source=gmail&ust=1481532985102000&usg=AFQjCNFYiHRbeo8OkEIix4kzVjMgC1bAtQ" href="http://barataeletrica.blogspot.com.au/" style="color: #1155cc;" target="_blank">http://barataeletrica.<wbr></wbr>blogspot.com.au/</a>). O motivo seria que a zine do Barata nunca foi técnica, era mais algo jornalístico sobre a comunidade, e a zine da Axur05 era de pwnage de verdade. Os caras liberavam senhas de provedores, códigos pra acessar internet sem pagar e em 1996/97 lançaram um packer pra binários do MS-DOS (eh mano brother, um packer feito por um Brasileiro naquela época - foda!).</div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 12.8px;">
- Depois disso tiveram varias zines como a TDK e a F3 (Fatal 3rror), e outras, e sempre rolava treta. Algumas delas fugiram do mundo virtual e terminou em briga de rua (e esses caras hoje achando que o coruja ter apanhado é algo novo).</div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 12.8px;">
- Também sei que os caras da Sekure.org (famosos hoje no mercado de segurança - por desenvolver ferramentas e conteúdo de qualidade) tiveram uma confusão com um cara que tinha o nick de psaux (rolando comprometimento de maquina e tudo mais).</div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 12.8px;">
- Teve uma galera do Rio que era famosa na época (tinham ganhado o campeonato da Argus Putbull usando 0day e tudo mais) que também tiveram confusão do tipo. Os caras tiveram seus servidores comprometidos, e acabaram comprometendo o outro cara de uma forma muito inusitada (usando uma backdoor que tinha no client do rootkit do cara).</div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 12.8px;">
- Entre 2000-2002 o FISL no sul também foi recheado de confusão deste tipo (com pwnage), com várias máquinas de profissionais de renome da área de segurança sendo comprometidas.</div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 12.8px;">
- A Brasnet era um paraíso de tretas do tipo. Quem aí desta época não se lembra das guerras de IRC pra dar takeover em canal? Na época vários servidores da Brasnet foram comprometidos onde instalaram interessantes backdoors. Era possível entrar invisível em canal, e inclusive sniffar conversas individuais.</div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 12.8px;">
- Dessa mesma época da Brasnet, quem não se lembra do Movimento Só Tem Hax0r (<a data-saferedirecturl="https://www.google.com/url?hl=pt-BR&q=http://www.geocities.ws/sohtemhaxor/&source=gmail&ust=1481532985102000&usg=AFQjCNEzmpA358UNXDn5sf-9wYvb952maA" href="http://www.geocities.ws/sohtemhaxor/" style="color: #1155cc;" target="_blank">http://www.geocities.ws/<wbr></wbr>sohtemhaxor/</a>)?</div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 12.8px;">
- Ainda nessa mesma época, varias tretas na lista da Unsekurity. É interessante notar que varias dessas pessoas hoje são profissionais de renome e contribuem muito para a tal comunidade de segurança.</div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 12.8px;">
- Depois disso veio o tempo da Front The Scene / Clube dos Mercenarios e Motd. Listas distintas recheadas de confusão e pwnage de maquinas (me lembro que o Server da motd foi comprometido e deram disclosure). Me lembro que eu e um amigo de São Paulo (estado) cuidávamos dos servidores da FTS e CdM, e por causa de uma confusão dessas eu tive que viajar 1000km pra ajudar a analisar nosso server pois não tínhamos certeza se tínhamos sido comprometidos ou não (nossa conclusão na época foi de que não, mas houveram vários ataques).</div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 12.8px;">
- Depois disso veio a H2HC (2004) com tretas constantes. Pra vc ter uma ideia, na primeira H2HC rolou até spray de pimenta no hotel.</div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 12.8px;">
- Dai vieram os project mayhem internacional (sim, isso começou lá fora - na comunidade hacking internacional) e depois o nacional, onde o objetivo dos caras eram pwnar profissionais de destaque da área de segurança. E falando em comunidade internacional, quem não se lembra da GOBBLES? Vcs se lembram onde era hospedado o site dos caras? Era sub-dir do site de uma empresa muito famosa onde os caras atualmente contribuem (e sempre contribuíram) muito com a comunidade (varias tools, debuggers, etc).</div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 12.8px;">
- E mais recentemente veio a lista Brasil Underground com as tretas com o coruja e luiz vieira, fora outras.</div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 12.8px;">
<br /></div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 12.8px;">
Muitos destes acontecimentos eu vi de perto, outros fiquei sabendo por meio dos envolvidos. Portanto, querer dizer que viver em comunidade "significa saber respeitar o próximo e as diferenças entre todos, e estar disposto a acolher e ajudar a todos" é um erro. Cada comunidade escolhe suas regras, e as do meio hacking são bem hostis. Dizer que esse tipo de coisa é novo é ignorar ou desconhecer o passado. Isso sempre aconteceu no meio hacking, SEMPRE, e não vai deixar de acontecer NUNCA, pois o problema(?) está no tipo de pessoas que esta comunidade atrai. Briga de egos tem aos montes, tretas infinitas, mas também tem amizade verdadeira e muita troca de informação (muita mesmo).</div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 12.8px;">
<br /></div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 12.8px;">
Outro ponto discutido nos posts feitos pelo Cabral e Anchises é dizer que pessoas envolvidas neste tipo de confusão não contribuem para a comunidade. Como não contribuem se vcs nem sabem quem são? Vários envolvidos nas tretas que citei acima eu conheço pessoalmente de longa data, e posso garantir que são bastante ativos na comunidade (hacking e) de segurança, produzindo artigos de qualidade e ferramentas que vcs, profissionais de segurança, usam.</div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 12.8px;">
<br /></div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 12.8px;">
Dizer que esta característica da comunidade hacking afasta os novatos é desconhecer como as coisas funcionam. Hostilidade atrai ainda mais esse tipo de pessoa, pois o que eles mais gostam é de quebrar paradigmas, é de provar que o outro está errado. Se vc fala pra esse tipo de pessoa que uma exploração não é trivial achando que ele vai desistir, está completamente enganado. Este tipo de informação é muito mais um atrativo do que um incentivo à desistência. Dai só porque a ISS (X-Force) fala que a exploração de um of-by-one no bind 8 (frame pointer overflow) não é trivial, o cara vai lá e lança o primeiro exploit que explora esta técnica, primeiro exploit que faz connect-back e ainda me mete uma backdoor no shellcode. É desse tipo de gente que estamos falando aqui.</div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 12.8px;">
<br /></div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 12.8px;">
Vcs dizerem que os novatos não estão contribuindo é outro erro, posso citar vários aqui que surgiram na comunidade nos últimos 5 anos e já tem contribuído bastante com artigos, tools, palestras ou mesmo com um papo de boteco.</div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 12.8px;">
<br /></div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 12.8px;">
O texto do Cabral vai alem e critica o pessoal que vai nessas conferencias e "fica no bar" ao invés de assistir as apresentações, fazendo crer que assistir apresentações é a mesma coisa que aprender a técnica em questão. A maioria das palestras da H2HC (conferencia em questão nos dois posts) são altamente técnicas e muitas vezes requerem um pesado conhecimento prévio apenas para compreender o conteúdo apresentado. Outro ponto é que estudar != assistir uma apresentação/entender determinado conteúdo. Estudar tem muito mais haver com sentar a bunda na cadeira, ler, consultar referencias, replicar os testes, modificar as provas de conceito do que apenas assistir uma apresentação.</div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 12.8px;">
<br /></div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 12.8px;">
Pra mim a melhor coisa dessas conferencias é rever os amigos, bater papo sobre nossas pesquisas e a pesquisa dos amigos do que ficar assistindo apresentações. Até hoje só faltei 1 H2HC e sempre fui da "galera do buteco". Se assisti 5 apresentações no total foi muito. As vezes que me interessei pelo assunto de alguma palestra, peguei o material depois e estudei, ou mesmo fui até o palestrante (que estava bebendo umas no bar) e perguntei sobre minhas dúvidas. Mesmo minhas perguntas sendo humildes, nunca recebi uma patada como o Cabral disse. TODAS as vezes o cara teve paciência de explicar, e muitas vezes eles compartilharam códigos pessoais (não públicos) com o único objetivo de me ajudar. Pra mim o importante dessas conferencias é justamente criar a atmosfera propícia para este tipo de interação. E em conferencias como H2HC ou Null Byte é muito mais legal que uma Defcon, pois são menores o que facilita o acesso a essas pessoas.</div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 12.8px;">
<br /></div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 12.8px;">
Como reflexão final, acredito que no Brasil temos eventos de segurança e eventos de hacking. Não vá achando que uma H2HC ou Null Byte (nem estou citando a Alligator) tem a mesma pegada que o Roadsec. O Roadsec e a Silver Bullet/YSTS são eventos de segurança, feito por profissionais de segurança para o mercado de segurança. Eventos como H2HC, Null Byte, Ekoparty, Infiltrate e Defcon são conferencias de hacking e muito hostis por natureza. É um lugar que vc deve ir preparado e tomar cuidado com seu comportamento durante todo o evento, senão vc pode ser pwnado. É um lugar que vc não vai faltar com o respeito com a metade da conferencia (como disseram que aconteceu), usar a wifi publica e ainda assim achar que vai sair ileso. É um lugar que vc só vai fazer deauth nos participantes do CTF se for no melhor estilo Mr. Robot (não ser pego), do contrário esteja preparado para as devidas consequências.</div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 12.8px;">
<br /></div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 12.8px;">
Não se trata só de não acessar a wifi do evento, mas sim de desligar a wifi do seu celular e ficar atento com possíveis equipamentos estranhos no evento (me lembro que teve uma Defcon que os caras meteram um ATM falso dentro de um hotel cassino, pwnaram muita gente e depois publicaram as infos).<br />
<br />
<div style="font-size: 12.8px;">
Os posts do Cabral e Anchises são estes aqui:</div>
<div style="font-size: 12.8px;">
<br /></div>
<div style="font-size: 12.8px;">
- <a data-saferedirecturl="https://www.google.com/url?hl=pt-BR&q=https://medium.com/nossa-coletividad/sobre-ovos-e-hackear-pessoas-2f8965d75c24%23.qmimpbp8z&source=gmail&ust=1481550591008000&usg=AFQjCNHcOTSTjkZ_SOY3FnUMWPybdbC_lA" href="https://medium.com/nossa-coletividad/sobre-ovos-e-hackear-pessoas-2f8965d75c24#.qmimpbp8z" style="color: #1155cc;" target="_blank">https://medium.com/nossa-<wbr></wbr>coletividad/sobre-ovos-e-<wbr></wbr>hackear-pessoas-2f8965d75c24#.<wbr></wbr>qmimpbp8z</a></div>
<div style="font-size: 12.8px;">
- <a data-saferedirecturl="https://www.google.com/url?hl=pt-BR&q=http://anchisesbr.blogspot.com.au/2016/11/seguranca-revenge-hack.html&source=gmail&ust=1481550591008000&usg=AFQjCNHfdrvYTqkvtd9oeLzWz2Am-2hI-Q" href="http://anchisesbr.blogspot.com.au/2016/11/seguranca-revenge-hack.html" style="color: #1155cc;" target="_blank">http://anchisesbr.blogspot.<wbr></wbr>com.au/2016/11/seguranca-<wbr></wbr>revenge-hack.html</a></div>
</div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 12.8px;">
<br /></div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 12.8px;">
Just my 2 cents.</div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 12.8px;">
<br /></div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 12.8px;">
dmr.</div>
Danilo Vazhttp://www.blogger.com/profile/05961143854943568933noreply@blogger.com0tag:blogger.com,1999:blog-5775647478606965557.post-29596937792256305362016-04-01T14:40:00.001-07:002016-04-01T14:47:19.468-07:00Usando o embedded comemorativo da #H2HC para montar um rubberduckNossa, desculpe o título longo, mas não achei nada que pudesse resumir rsrs<br />
Galera, vamos lá, para quem foi na <a href="https://www.h2hc.com.br/h2hc/pt/" target="_blank">Hackers to Hackers Conference(H2HC)</a> do ano passado pode ter recebido uma placa(embedded) comemorativa igual a esta:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgauf9j_Kq6G1gx2UlNb5ge28d-lw3xaJHx7466MSr5gcHXSuQpH3oH-ASSleUmLW_M99B2Vqs-Afbxsp-R8-A5Kc-8mOXcP0RlHJfvet3RGjsAX3JRaHXFpSfaeqanbgoMmV7qY7D5zClP/s1600/photo77232746618006030.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgauf9j_Kq6G1gx2UlNb5ge28d-lw3xaJHx7466MSr5gcHXSuQpH3oH-ASSleUmLW_M99B2Vqs-Afbxsp-R8-A5Kc-8mOXcP0RlHJfvet3RGjsAX3JRaHXFpSfaeqanbgoMmV7qY7D5zClP/s320/photo77232746618006030.jpg" width="240" /></a></div>
<br />
Essa plaquinha vem com um chip Atmel 32u4, o mesmo usado no arduino leonardo, o legal dela é que esse chip tem uma interface HID(Human interface device), (obrigado @Rogy153 por me ensinar sobre) com esse recurso conseguimos emular um teclado ou até mesmo um mouse no computador, dessa forma conseguimos montar um "payload" capaz de executar comandos de forma automática em sistemas, montando assim um vetor para um ataque ou até montar um brute-force.<br />
<br />
Como exemplo vou utilizar ela para criar um payload que abre o terminal no meu linux e digita comandos para a abertura de outro programa, mas no caso eu poderia usar para outros fins, tanto no Mac quanto no windows também!<br />
<br />
Vamos lá?<br />
<br />
Primeiro, baixe o interpretador do arduino, nesse caso não vou mostrar como funciona a instalação, vou pular para a configuração da placa na IDE do arduino e o código.<br />
<br />
Abra a interface da IDE do arduino e clique em Tools>Board>Arduino Leonardo<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg06Ikl66y5uPKc8pN2tvW5Bj3m902ya7yU-dNOvajHTCWCJO-m_VJOLpq3YR4k4PjxD3NbGDv8MvB2gUVyeyatNKxgbBStS0jHBAk0ChrgfAsrlQe2mplRWgnH8C4zkPuiBUmbwwLqlfVd/s1600/configuracao.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="522" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg06Ikl66y5uPKc8pN2tvW5Bj3m902ya7yU-dNOvajHTCWCJO-m_VJOLpq3YR4k4PjxD3NbGDv8MvB2gUVyeyatNKxgbBStS0jHBAk0ChrgfAsrlQe2mplRWgnH8C4zkPuiBUmbwwLqlfVd/s640/configuracao.png" width="640" /></a></div>
<br />
<br />
Dessa forma ele vai configurar para enviar o código para o chip Atmel 32u4 usado no arduino leonardo.<br />
<br />
Feito isso e tando com a placa conectada ao seu computador, podemos usar o código abaixo:<br />
<br />
<script src="https://gist.github.com/danilovazb/861aae560cc49947a1ef536c868cd65d.js"></script><br />
<br />
Interessante é que podemos fazer códigos para abrir terminais e realizar conexões remotas via netcat, vai da sua imaginação.<br />
<br />
Segue um pequeno vídeo que fiz com o código acima e o embedded da H2HC.<br />
<br />
<iframe allowfullscreen="" frameborder="0" height="315" src="https://www.youtube.com/embed/0aAR7MxnrMc" width="420"></iframe><br />
<br />
<br />
<br />
Caso queira saber mais sobre como montar sua payload, pode consultar direto no site do arduino pelos comando: https://www.arduino.cc/en/Reference/MouseKeyboard<br />
<br />
Lembrando, apenas chips com interface HID tem esse resultado, consulte o site da Atmel antes.<br />
<br />
<br />
Como de costume, aquele som ao fazer o vídeo.<br />
<br />
<iframe allowfullscreen="" frameborder="0" height="315" src="https://www.youtube.com/embed/GkWOrznOTN8" width="420"></iframe>Danilo Vazhttp://www.blogger.com/profile/05961143854943568933noreply@blogger.com0tag:blogger.com,1999:blog-5775647478606965557.post-63954622288795267422016-03-09T07:30:00.002-08:002016-03-09T07:33:23.646-08:00GitMiner - Advance Search for GitHub<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhG3RiDs9Hlm5BMk5na68a8VH0OAGNoVR0jjEf4JQNLiPDk0Uazk7pD9CMP3z-05cvu3-Frb8-MZ_gzhDBNdLfe_-qT80X3W7CqBPrPVOENHQpxfcnO_GJQ-aj_Yn5TytBifohX4y7c1cRc/s1600/gitminer-628x360.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><span style="font-family: inherit;"><img border="0" height="183" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhG3RiDs9Hlm5BMk5na68a8VH0OAGNoVR0jjEf4JQNLiPDk0Uazk7pD9CMP3z-05cvu3-Frb8-MZ_gzhDBNdLfe_-qT80X3W7CqBPrPVOENHQpxfcnO_GJQ-aj_Yn5TytBifohX4y7c1cRc/s320/gitminer-628x360.png" width="320" /></span></a></div>
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;"><span id="docs-internal-guid-0e8be2a4-5819-6743-0542-3cd6832c9d32"></span><br /></span>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; font-family: inherit; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">De tempos eu tive a ideia de criar um script onde eu pudesse procurar de forma automatizada por códigos no Github, confesso que eu vivo perdendo scripts no Gist, plataforma do Github, como eu queria um pouco mais de agilidade na busca de alguns scripts antigos que eu tinha, eu fiz o GitMiner, na primeira versão da tool, eu usei scrapy já que eu estava aprendendo sobre o framework. Nesse tempo eu comecei a aprender um pouco mais sobre termos de pesquisa no próprio Github, isso facilitou para o desenvolvimento do GitMiner 1.2, versão mais nova e pública da tool que ajuda na pesquisa de códigos na plataforma.</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; font-family: inherit; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; font-family: inherit; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Antes de falar da própria ferramenta, vou explicar sobre o Github e sua pesquisa avançada. Durante a semana passada, quando lancei a ferramenta e a ideia sobre pesquisas avançadas no Github, um brother veio me falar sobre um "full disclosure" já lançado em 2013 sobre o Github, nele já apresentavam a mesma ideia que a minha, o link do full disclusure você pode ver no final do artigo.</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; font-family: inherit; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span></div>
<div dir="ltr" style="margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: "arial";"><span style="font-family: inherit; line-height: 20.24px; white-space: pre-wrap;">A Conviso fez um post sobre o full disclusure em 2013, assim que foi lançada a ideia de se usar o Github para pesquisas avançadas de código, o Cooler chegou até a desenvolver uma tool para isso, mas achei ela bem mais simples que a minha.</span></span></div>
<div dir="ltr" style="margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: "arial";"><span style="font-family: inherit; line-height: 20.24px; white-space: pre-wrap;"><br /></span></span></div>
<div dir="ltr" style="margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: "arial";"><span style="font-family: inherit; line-height: 20.24px; white-space: pre-wrap;">Voltando na questão da pesquisa avançada, com ela por si só, já podemos nos entreter um pouco. Assim como uma busca avançada no Google, a busca avançada no Github possui alguns operadores lógicos e alguns filtros que facilitam na pesquisa.</span></span></div>
<div dir="ltr" style="margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: "arial";"><span style="font-family: inherit; line-height: 20.24px; white-space: pre-wrap;"><br /></span></span></div>
<h4 style="margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: "arial";"><span style="font-family: inherit; font-size: large; line-height: 20.24px; white-space: pre-wrap;">Operadores lógicos</span></span></h4>
<div dir="ltr" style="margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: "arial";"><span style="font-family: inherit; line-height: 20.24px; white-space: pre-wrap;"><br /></span></span></div>
<div dir="ltr" style="margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: "arial";"><span style="font-family: inherit; line-height: 20.24px; white-space: pre-wrap;">O interessante da pesquisa avançada é você conseguir usar operadores lógicos em suas buscas para que ela fique mais precisa, o Github possui 3 operadores que nos ajuda a pesquisar com maior precisão, são eles AND, OR e NOT. São usados para filtrar ou complementar certos tipos de pesquisa, exemplo:</span></span></div>
<div dir="ltr" style="margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: "arial";"><span style="font-family: inherit; line-height: 20.24px; white-space: pre-wrap;"><br /></span></span></div>
<div dir="ltr" style="margin-bottom: 0pt; margin-top: 0pt;">
</div>
<ul>
<li><span style="font-family: inherit; line-height: 20.24px; white-space: pre-wrap;"><b>Operador "AND"</b></span></li>
</ul>
<div>
<span style="font-family: "arial";"><span style="font-family: inherit; line-height: 20.24px; white-space: pre-wrap;">Usado para dizer a pesquisa que ela deve conter um termo E um outro termo, exemplo:</span></span></div>
<div>
<span style="font-family: "arial";"><span style="font-family: inherit; line-height: 20.24px; white-space: pre-wrap;"><br /></span></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEha_N5tD7eDiBj7es74Gs0S5C-Fj01vblqgG-4ZxNFDZ_9_7eAd43WJeC_oANOtw80YItVLSN4fKWvTU20bT462vljc08xF22rkLcK6ZbKT0Os6LjcxTZ_oVmddhe9DhgX9Si4yrH9yiIOL/s1600/AND.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><span style="font-family: inherit;"><img border="0" height="177" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEha_N5tD7eDiBj7es74Gs0S5C-Fj01vblqgG-4ZxNFDZ_9_7eAd43WJeC_oANOtw80YItVLSN4fKWvTU20bT462vljc08xF22rkLcK6ZbKT0Os6LjcxTZ_oVmddhe9DhgX9Si4yrH9yiIOL/s640/AND.png" width="640" /></span></a></div>
<div>
<span style="font-family: "arial";"><span style="font-family: inherit; line-height: 20.24px; white-space: pre-wrap;"><br /></span></span></div>
<div>
<span style="font-family: "arial";"><span style="font-family: inherit; line-height: 20.24px; white-space: pre-wrap;">No caso acima, estou pesquisando dentro de arquivos no Github que contenham a palavra "root" E a palavra "password", ou seja, ele vai me trazer arquivos que contenham as duas palavras dentro do mesmo arquivo.</span></span></div>
<div>
<span style="font-family: "arial";"><span style="font-family: inherit; line-height: 20.24px; white-space: pre-wrap;"><br /></span></span></div>
<ul>
<li><span style="font-family: inherit; line-height: 20.24px; white-space: pre-wrap;"><b>Operador "OR"</b></span></li>
</ul>
<div>
<span style="font-family: inherit;"><span style="font-family: "arial";"><span style="line-height: 20.24px; white-space: pre-wrap;">OR é como se estivesse </span></span><span style="line-height: 20.24px; white-space: pre-wrap;">praticamente </span><span style="line-height: 20.24px; white-space: pre-wrap;">dizendo ao buscador o mesmo que quando usei o AND, porém, eu digo que gostaria de pesquisar pela palavra "root" OU "password", nesse caso ele pode me retornar arquivos que possam conter as duas palavras dentro do mesmo como pode me retornar um arquivo que contenha apenas uma das palavras dentro.</span></span></div>
<div>
<span style="font-family: inherit; line-height: 20.24px; white-space: pre-wrap;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlFeG3L1EeEUv-QMDAum0fzEX1UpO3ogRcdTdXaGz0lvZ8TEJ75a2TvM9HdxjhPmvOEuPd0fELih1qzI4uzr2_cfZlfO-hqZke6aBjR8GARJP2EC2metdMw-fs0rvs5TAFcbNtk_mj1Zow/s1600/OR.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><span style="font-family: inherit;"><img border="0" height="188" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlFeG3L1EeEUv-QMDAum0fzEX1UpO3ogRcdTdXaGz0lvZ8TEJ75a2TvM9HdxjhPmvOEuPd0fELih1qzI4uzr2_cfZlfO-hqZke6aBjR8GARJP2EC2metdMw-fs0rvs5TAFcbNtk_mj1Zow/s640/OR.png" width="640" /></span></a></div>
<div>
<span style="font-family: inherit; line-height: 20.24px; white-space: pre-wrap;"><br /></span></div>
<div>
<span style="font-family: inherit; line-height: 20.24px; white-space: pre-wrap;"><br /></span></div>
<ul>
<li><span style="font-family: inherit; line-height: 20.24px; white-space: pre-wrap;"><b>Operador "NOT"</b></span></li>
</ul>
<span style="font-family: inherit;"><br /></span>
<br />
<div dir="ltr" style="margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: inherit; line-height: 20.24px; white-space: pre-wrap;">NOT serve para NÃO pesquisar determinada palavra, um exemplo de busca seria, eu quero pesquisa dentro de arquivos a palavra "password" mas não quero que contenha a palavra "root" em nenhum arquivo que eu pesquise. Exemplo:</span></div>
<div dir="ltr" style="margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: inherit; line-height: 20.24px; white-space: pre-wrap;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsWLlw5jxFHcewnRX0-h-DZCeGYqy2TcBDWBxtalR8O1CzDTdQlqi7o0LkZGZaMfpmRuYYaXDnJQbE9gh3vw1e-tYXxSnH4_wsZycwJaoKm0j6KdoutGjUPJWtBgT0qdaKAyLhtW_WbMr8/s1600/NOT.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><span style="font-family: inherit;"><img border="0" height="178" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsWLlw5jxFHcewnRX0-h-DZCeGYqy2TcBDWBxtalR8O1CzDTdQlqi7o0LkZGZaMfpmRuYYaXDnJQbE9gh3vw1e-tYXxSnH4_wsZycwJaoKm0j6KdoutGjUPJWtBgT0qdaKAyLhtW_WbMr8/s640/NOT.png" width="640" /></span></a></div>
<div dir="ltr" style="margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: inherit; line-height: 20.24px; white-space: pre-wrap;"><br /></span></div>
<div dir="ltr" style="margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: inherit;">Nesse caso acima, não contem a palavra "root", apenas password.</span></div>
<div dir="ltr" style="margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: inherit;"><br /></span></div>
<div dir="ltr" style="margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: inherit;">Isso não é tudo ainda, além de operadores lógicos, nós temos termos de buscas para facilitar ainda mais nossas pesquisas e realizar filtros mais precisos.</span></div>
<div dir="ltr" style="margin-bottom: 0pt; margin-top: 0pt;">
<h4 style="margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-size: large;"><span style="font-family: inherit;"><br /></span></span></h4>
<h4>
<span style="font-size: large;"><span style="font-family: inherit;">
Termos de buscas avançadas</span></span></h4>
</div>
<div dir="ltr" style="margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: inherit;"><br /></span></div>
<div dir="ltr" style="margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: inherit;">O Github nos proporciona alguns termos para pesquisas avançadas, com eles nós conseguimos filtrar ainda mais os resultados de buscas, durante minha pesquisa eu separei apenas alguns termos de busca para uma simples demonstração.</span><br />
<span style="font-family: inherit;"><br /></span>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span style="font-family: inherit;">in:file</span></span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: inherit;"><span style="background-color: white; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Pesquisa palavra dentro do arquivo, ex: </span><span style="background-color: white; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">root in:file</span><span style="background-color: white; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> , faz a pesquisa da palavra root dentro dos arquivos</span></span></div>
<b id="docs-internal-guid-0e8be2a4-5b43-60ff-a93e-d1b080ff61d4" style="font-weight: normal;"><span style="font-family: inherit;"><br /></span></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span style="font-family: inherit;">path:etc</span></span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: inherit;"><span style="background-color: white; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Pesquisa arquivo no diretório etc, ex: </span><span style="background-color: white; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">path:etc</span><span style="background-color: white; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> , pesquisa pastas que tenham o nome de etc</span></span></div>
<b style="font-weight: normal;"><span style="font-family: inherit;"><br /></span></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span style="font-family: inherit;">extension:php</span></span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span style="font-family: inherit;">Pesquisa por extensão de arquivo, como no exemplo do comando, ele procuraria por arquivos cuja extensão seja php</span></span></div>
<b style="font-weight: normal;"><span style="font-family: inherit;"><br /></span></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span style="font-family: inherit;">filename:wp-config root</span></span></div>
<span style="background-color: white; vertical-align: baseline; white-space: pre-wrap;"><span style="font-family: inherit;">Pesquisa por arquivos com o nome de wp-config que contenham a palavra root</span></span><br />
<span style="background-color: white; vertical-align: baseline; white-space: pre-wrap;"><span style="font-family: inherit;"><br /></span></span>
<span style="background-color: white; white-space: pre-wrap;"><span style="font-family: inherit;">Já com essa base de termos de buscas avançadas e alguns operadores lógicos, podemos montar querys de pesquisas avançadas e ver o que achamos, como exemplo eu procurei por aquivos de wordpress para ver se continham informações sensíveis.</span></span><br />
<span style="background-color: white; white-space: pre-wrap;"><span style="font-family: inherit;"><br /></span></span>
<span style="background-color: white; white-space: pre-wrap;"><span style="font-family: inherit;">A pesquisa consiste em procurar dentro de arquivos cujo nome seja "wp-config" a existência da palavra "FTP_HOST". Repare na imagem abaixo.</span></span><br />
<span style="background-color: white; white-space: pre-wrap;"><span style="font-family: inherit;"><br /></span></span>
<span style="background-color: white; white-space: pre-wrap;"><span style="font-family: inherit;"><br /></span></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8amz7EGDpEWwLdX8DnUgOIJESfoIBLtxoozttjM_vOAxvxSw4tegvUWvVYSgcTJw1dFvY3uX-n3q6CKWcEHcbhKYlXY2OFJFfnBtGOLCnNtEyeZkKe2hLQg9mzpQsCJE8guVibTrO6LIF/s1600/evidenciaFTP3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><span style="font-family: inherit;"><img border="0" height="199" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8amz7EGDpEWwLdX8DnUgOIJESfoIBLtxoozttjM_vOAxvxSw4tegvUWvVYSgcTJw1dFvY3uX-n3q6CKWcEHcbhKYlXY2OFJFfnBtGOLCnNtEyeZkKe2hLQg9mzpQsCJE8guVibTrO6LIF/s640/evidenciaFTP3.png" width="640" /></span></a></div>
<span style="background-color: white; white-space: pre-wrap;"><span style="font-family: inherit;"><br /></span></span>
<span style="background-color: white; white-space: pre-wrap;"><span style="font-family: inherit;"><br /></span></span>
<span style="background-color: white; white-space: pre-wrap;"><span style="font-family: inherit;">Assim que fiz a pesquisa, logo o primeiro resultado me trouxe um usuário, uma senha e o host onde ele está armazenado, eu fiz o teste para ver se a senha era válida e veja o que aconteceu:</span></span><br />
<span style="background-color: white; white-space: pre-wrap;"><span style="font-family: inherit;"><br /></span></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiizg6itKzieZxTQmY3uzoDMCntDx58eZ0vQt81dWoyobtedCNRpdWagLwI9BBYT3yQLZM8tPM9oRio5VkjM7bcDOrL0EZ9U1jD7Dt2YM8zkBTwVoKOO0pSYjK8cjB19OKrghOHabznxwAH/s1600/evidenciaFTP.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><span style="font-family: inherit;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiizg6itKzieZxTQmY3uzoDMCntDx58eZ0vQt81dWoyobtedCNRpdWagLwI9BBYT3yQLZM8tPM9oRio5VkjM7bcDOrL0EZ9U1jD7Dt2YM8zkBTwVoKOO0pSYjK8cjB19OKrghOHabznxwAH/s400/evidenciaFTP.png" width="342" /></span></a></div>
<span style="background-color: white; white-space: pre-wrap;"><span style="font-family: inherit;"><br /></span></span>
<span style="background-color: white; white-space: pre-wrap;"><span style="font-family: inherit;">Para confirmar que estava dentro do servidor FTP eu criei uma pasta chama "teste" e logo em seguida eu apaguei.</span></span><br />
<span style="background-color: white; white-space: pre-wrap;"><span style="font-family: inherit;"><br /></span></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwuPtYW4nyDLGfHCcAs0O9kg8-y7wFeKyO6nYIA2lNPFe5Mv0J_XjaexMLSL4Bk4_p-2XyJEnHRPZxWMqIsXauCWztjhtHzMoGXLTlSuBOLHDjV81cKMxqIdeWB8HUZR0ca2a-WnpG0HQ5/s1600/ftpSHEL.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><span style="font-family: inherit;"><img border="0" height="424" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwuPtYW4nyDLGfHCcAs0O9kg8-y7wFeKyO6nYIA2lNPFe5Mv0J_XjaexMLSL4Bk4_p-2XyJEnHRPZxWMqIsXauCWztjhtHzMoGXLTlSuBOLHDjV81cKMxqIdeWB8HUZR0ca2a-WnpG0HQ5/s640/ftpSHEL.png" width="640" /></span></a></div>
<span style="background-color: white; white-space: pre-wrap;"><span style="font-family: inherit;"><br /></span></span>
<span style="background-color: white; white-space: pre-wrap;"><span style="font-family: inherit;"><br /></span></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<span style="background-color: white; white-space: pre-wrap;"><span style="font-family: inherit;">Um outro exemplo de uma pesquisa desse modo é a localização de arquivos de configurações de e-mail, veja o que foi encontrado.</span></span><br />
<span style="background-color: white; white-space: pre-wrap;"><span style="font-family: inherit;"><br /></span></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyemz-kag65Y5u9O8xad-3k-eqqTGnj6MX_RXvcW9IRKqoDZ4r-UauCUu8HFfINPX8RBNZWzGEqbRC8UKUlPV8CNAbGpLZQwBh-Ebk3F4IvCMfTQTpAGOcTtgUQuUkDmWwLt_8P_vugILV/s1600/evidenciaLoginEmail3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><span style="font-family: inherit;"><img border="0" height="428" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyemz-kag65Y5u9O8xad-3k-eqqTGnj6MX_RXvcW9IRKqoDZ4r-UauCUu8HFfINPX8RBNZWzGEqbRC8UKUlPV8CNAbGpLZQwBh-Ebk3F4IvCMfTQTpAGOcTtgUQuUkDmWwLt_8P_vugILV/s640/evidenciaLoginEmail3.png" width="640" /></span></a></div>
<span style="background-color: white; white-space: pre-wrap;"><span style="font-family: inherit;"><br /></span></span>
<span style="background-color: white; white-space: pre-wrap;"><span style="font-family: inherit;">Mas para realizar esse tipo de pesquisa e procurar manualmente código por código é um pouco cansativo, foi então que resolvi fazer uma versão atualizada e pública do GitMiner, para facilitar na busca por códigos dentro do Github.</span></span><br />
<span style="background-color: white; white-space: pre-wrap;"><span style="font-family: inherit;"><br /></span></span>
<span style="font-family: inherit;"><span style="background-color: white; white-space: pre-wrap;">Apesar dessa pesquisa ser "</span><span style="white-space: pre-wrap;">offensive security", vale como forma de conscientização de como desenvolvedores desatentos que usam o Github de forma pública e como isso pode prejudicar não só ele como a empresa na qual ele está postando o source-code.</span></span><br />
<span style="white-space: pre-wrap;"><span style="font-family: inherit;"><br /></span></span>
<br />
<h4>
<span style="white-space: pre-wrap;"><span style="font-family: inherit; font-size: large;">GitMiner</span></span></h4>
<span style="font-family: inherit; white-space: pre-wrap;"><br /></span>
<span style="font-family: inherit; white-space: pre-wrap;">Enfim a "tal" ferramenta, como já havia dito, ela realiza busca no Github, dessa forma vou pular apresentações e vou demonstrar como ela funciona de fato.</span><br />
<span style="font-family: inherit; white-space: pre-wrap;"><br /></span>
<span style="font-family: inherit; white-space: pre-wrap;">Para quem ainda não conhece, segue o link: [http://github.com/danilovazb/GitMiner]</span><br />
<span style="white-space: pre-wrap;"><span style="font-family: inherit;"><br /></span></span>
<b style="font-family: inherit; white-space: pre-wrap;">Realizando Pesquisas:</b><br />
<span style="white-space: pre-wrap;"><span style="font-family: inherit;"><br /></span></span>
<span style="white-space: pre-wrap;">Para pesquisar de forma normal, sem módulos(vou explicar mais a frente), basta digitar:</span><br />
<span style="white-space: pre-wrap;"><br /></span>
<span style="white-space: pre-wrap;">~$> python git_miner.py -q 'path:etc filename:shadow'</span><br />
<span style="white-space: pre-wrap;"><br /></span>
<span style="white-space: pre-wrap;">Ele vai perguntar se você deseja continuar a pesquisa sem um módulo carregado ou abortar a pesquisa, caso deseje continuar basta digitar N para que ele prossiga com a pesquisa.</span><br />
<span style="white-space: pre-wrap;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjqAaMauS1YOM6vLRqqFI2aBRUiZmSzfDrAiumfBKEZopiwwKliptvFvW3g92RvQZCOr6J-aCRAuFY9LaUe57jq7A6vZegglB7KN99M3Nf94cnwatpREUaOgrfBL5gZiWdxrRjUk2McgWgh/s1600/abort.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="424" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjqAaMauS1YOM6vLRqqFI2aBRUiZmSzfDrAiumfBKEZopiwwKliptvFvW3g92RvQZCOr6J-aCRAuFY9LaUe57jq7A6vZegglB7KN99M3Nf94cnwatpREUaOgrfBL5gZiWdxrRjUk2McgWgh/s640/abort.png" width="640" /></a></div>
<span style="white-space: pre-wrap;"><br /></span>
<span style="white-space: pre-wrap;">Caso queira carregar um módulo, basta digitar Y para que cancele a pesquisa.</span><br />
<span style="white-space: pre-wrap;"><br /></span>
<span style="white-space: pre-wrap;">Se continuar a pesquisa sem um módulo carregado, ele vai trazer apenas o link do código da pesquisa e o nome do usuário.</span><br />
<span style="white-space: pre-wrap;"><br /></span>
<span style="white-space: pre-wrap;">Antes de mostrar a pesquisa com um módulo carregado, vou mostrar o que é o módulo que estou falando.</span><br />
<span style="white-space: pre-wrap;"><br /></span>
<span style="white-space: pre-wrap;">Quando fizer um git clone na ferramenta vai notar que há uma pasta chamada "config" e dentro dela tem um arquivo com o nome de "parsers.json", esse é o módulo que falei.</span><br />
<span style="white-space: pre-wrap;"><br /></span>
<span style="white-space: pre-wrap;">Dentro desse arquivo tem a configuração do que desejo filtrar e buscar com o GitMiner, vou exemplificar usando um módulo que já deixei por padrão no repositório.</span><br />
<span style="white-space: pre-wrap;"><br /></span>
<span style="white-space: pre-wrap;">A estrutura do json é a seguinte:</span><br />
<span style="white-space: pre-wrap;"><br /></span>
<script src="https://gist.github.com/danilovazb/5ff7738eacbd28055823.js"></script>
<span style="white-space: pre-wrap;"><br /></span>
<span style="white-space: pre-wrap;">Temos o nome do módulo como "wordpress"(É ele que vamos passar como parâmetro pra ferramenta quando formos pesquisar, vou mostrar a frente, guardem esse nome) e alguns parâmetros abaixo, vou explicar um a um.</span><br />
<span style="white-space: pre-wrap;"><br /></span>
<span style="white-space: pre-wrap;"><b>contains:</b> filtra no código por uma palavra que desejar, mostra no resultado da busca a linha onde ela contém, caso haja mais de uma palavra, ele mostrará as demais linhas onde ela consta.</span><br />
<span style="white-space: pre-wrap;"><br /></span>
<span style="white-space: pre-wrap;"><b>parameters:</b> são separados por nomes como param1, param2, param3 e etc, nunca podendo repetir o nome da chave, sempre sendo nomes únicos e seguindo a mesma lógica acima, param+numero. Em cada chave dessas é colocado um nome no qual quer filtrar e printar na tela do resultado, como no exemplo acima do wordpress, ele printa a linha onde contem, FTP_USER, FTP_PASS, FTP_HOST e etc, assim como está acima.</span><br />
<span style="white-space: pre-wrap;"><br /></span>
<span style="white-space: pre-wrap;"><b>splitparam:</b> usado para separar palavras na linha onde contem os param, um exemplo de uso seria, pesquisar por um arquivo CSV onde seja separado por virgula, nesse parâmetro é passada a virgula(,) para que ele possa fazer a separação de palavras pela virgula.</span><br />
<span style="white-space: pre-wrap;">Exemplo, caso meu<b> param1</b> seja "</span><span style="white-space: pre-wrap;"><b>DB_USER</b>" e ele me retorne a seguinte linha</span><span style="white-space: pre-wrap;">:</span><br />
<span style="white-space: pre-wrap;"><br /></span>
<br />
<pre style="white-space: pre-wrap; word-wrap: break-word;">define('DB_USER', 'USUARIO');</pre>
<span style="white-space: pre-wrap;"><br /></span>
<span style="white-space: pre-wrap;">Eu posso setar o splitparam para separar por <b>'</b>(aspas simples) assim como está no código de exemplo acima. </span><br />
<span style="white-space: pre-wrap;">Sendo assim a linha vai vir da seguinte forma:</span><br />
<br />
['<b><span style="color: red;">define(</span></b>', '<b><span style="color: red;">DB_USER</span></b>', '<b><span style="color: red;">,</span> </b>', '<b><span style="color: red;">USUARIO</span></b>', '<b><span style="color: red;">);</span></b>']<br />
<br />
Pra não confundir, coloquei a palavra separada em vermelho, ela vai vir dessa maneira. Podemos também já falar de um parâmetro de configuração que é utilizado em conjunto.<br />
<br />
<b>splitorder:</b> serve para separar e trazer apenas o necessário para você, como no exemplo que usei acima da separação, se for ver ele em vetor ele tem 5 partes, começamos a contar a partir da 0, ficando do seguinte modo:<br />
<br />
['<b><span style="color: red;">define(</span></b>', '<b><span style="color: red;">DB_USER</span></b>', '<b><span style="color: red;">,</span> </b>', '<b><span style="color: red;">USUARIO</span></b>', '<b><span style="color: red;">);</span></b>']<br />
<b><span style="color: blue;">0 1 2 3 4</span></b><br />
<br />
Sabendo disso, podemos usar o splitorder para trazer apenas o nome do campo e o usuário, assim como está no exemplo do código que dei acima, selecionei apenas o <b><span style="color: blue;">1</span></b> e o <span style="color: blue;"><b>3</b></span> para que ele me retorne.<br />
<br />
Entendendo como funciona o módulo, agora já podemos fazer uma pesquisa simples usando o módulo wordpress(lembra que pedi para guardar esse nome?) que foi setado no arquivo parsers.json.<br />
<br />
$:> python git_miner.py -q 'filename:wp-config extension:php FTP_HOST in:file ' -m wordpress -o result.txt<br />
<br />
E ainda no comando acima, adicionamos a opção "-o result.txt" para salvar o resultado em um arquivo de texto. Veja como ficou:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHbUhvMouh57XP5PLGalpUOZ96_PnYRjfgrRJatABZ86A1ncmTipWTRDZoPfcsbdbHFnbqlC8tzfinZagfPZyk0BV_1sd-p59AMLx_gzw63yDEnciQZvH27AjG-i8dKr7b5DrqZr_aWkox/s1600/wordpressEX.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="462" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHbUhvMouh57XP5PLGalpUOZ96_PnYRjfgrRJatABZ86A1ncmTipWTRDZoPfcsbdbHFnbqlC8tzfinZagfPZyk0BV_1sd-p59AMLx_gzw63yDEnciQZvH27AjG-i8dKr7b5DrqZr_aWkox/s640/wordpressEX.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Bom galera, é isso que queria mostrar para vocês, como de costume, a musiquinha inspiradora do post:</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<iframe allowfullscreen="" frameborder="0" height="315" src="https://www.youtube.com/embed/B0ptVVjOGZY?t=3180" width="560"></iframe></div>
<br />
<span style="font-size: 14.6667px; white-space: pre-wrap;">[REFERENCIAS]</span><br />
<span style="font-size: 14.6667px; white-space: pre-wrap;"><br /></span>
<span style="font-size: 14.6667px; white-space: pre-wrap;">http://blog.conviso.com.br/github-hacking-for-fun-and-sensitive-data-search/</span><br />
<span style="font-size: 14.6667px; white-space: pre-wrap;">https://github.com/convisoappsec/research_github_hack</span><br />
<span style="font-size: 14.6667px; white-space: pre-wrap;">http://seclists.org/fulldisclosure/2013/Jun/15</span><br />
http://www.hackinsight.org/news,573.html<br />
<br /></div>
Danilo Vazhttp://www.blogger.com/profile/05961143854943568933noreply@blogger.com4tag:blogger.com,1999:blog-5775647478606965557.post-71993749536947774802016-02-21T22:57:00.000-08:002016-02-21T22:57:12.310-08:00Utilizando argumentos no framework scrapy e usando tesseract com pythonOlá meninos e meninas, hoje vou mostrar um pouco do framework scrapy, eu tenho desenvolvido um crawler para um amigo (Balestra, to terminando hehehe) e cada vez mais tenho usado o scrapy para poupar tempo no desenvolvimento de crawlers, pela facilidade de interação e de escrita de código.<br />
<br />
Hoje eu vou compartilhar com vocês algo que achei interessante durante o desenvolvimento do crawler que tenho estudado, é a passagem de parâmetros que achei bem simples e uma questão nova que tenho visto que é a utilização do tesseract com python para processar textos de imagens.<br />
<br />
Primeiro, vamos iniciar um projeto no scrapy(Caso não saiba como, <a href="http://unk-br.blogspot.com.br/2015/12/gerando-wordlist-de-username-com-python.html" target="_blank">leia esse artigo</a>).<br />
<br />
Eu iniciei da seguinte forma:<br />
<br />
(sim, vou sacanear e colocar os comandos em imagens, quanto mais você digitar mais você aprende)<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqujMGURdVWqfz1wnD1dFsGgEktWcEGfnXdb5ABLmBLWi1rdxn_yi33hGn-dyvvgz22aOt5Q-VK_CG6fxiwvdXprn6-bS8VqiYVRlEKvazHviWPa_XxGccnkuG1RT0fmltJ-OLmSlRLwzJ/s1600/start_project.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="283" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqujMGURdVWqfz1wnD1dFsGgEktWcEGfnXdb5ABLmBLWi1rdxn_yi33hGn-dyvvgz22aOt5Q-VK_CG6fxiwvdXprn6-bS8VqiYVRlEKvazHviWPa_XxGccnkuG1RT0fmltJ-OLmSlRLwzJ/s640/start_project.jpg" width="640" /></a></div>
<br />
De acordo com os comandos da imagens, eu startei o projeto e criei um spider da olx, agora vamos começar o coding do spider.<br />
<br />
Como disse em outro post, a estrutura de arquivos é a seguinte:<br />
<br />
#:> tree olx_crawl/<br />
olx_crawl/<br />
├── olx_crawl<br />
│ ├── __init__.py<br />
│ ├── __init__.pyc<br />
│ ├── items.py<br />
│ ├── pipelines.py<br />
│ ├── settings.py<br />
│ ├── settings.pyc<br />
│ └── spiders<br />
│ ├── __init__.py<br />
│ ├── __init__.pyc<br />
│ └── olx_spider.py<br />
└── scrapy.cfg<br />
<div>
<br /></div>
<div>
Vamos editar o arquivo "olx_spider.py" que fica dentro da pasta spiders, como pode ver na árvore de diretório acima.</div>
<div>
<br /></div>
<div>
Inicialmente ele vem nessa estrutura:</div>
<div>
<br /></div>
<div>
<script src="https://gist.github.com/danilovazb/824b31ea0eec181ff65e.js"></script></div>
<div>
<br /></div>
<div>
Certo, nesse caso eu quero demonstrar para vocês como usar argumentos no scrapy, vamos modificar o arquivo padrão para que ele aceite argumentos passados na hora de realizar o crawler, primeiro eu entrei no site da OLX e fiz uma pesquisa qualquer na sessão de carros para ver como ele interpretava minha consulta, percebi que ele passa a query por GET da seguinte forma <b>http://sp.olx.com.br/veiculos/carros<span style="color: blue;">?q=</span><span style="color: red;">%22Golf+GTI%22</span></b> , onde "<b><span style="color: blue;">?q=</span></b>" é a variável da pesquisa e o <b><span style="color: red;">%22Golf+GTI%22</span></b> é o parâmetro que queremos pesquisar.</div>
<div>
<br /></div>
<div>
Desse modo vou editar o arquivo padrão e incluir um método __init__ para receber os parâmetros de pesquisa, ficando da seguinte forma:</div>
<div>
<br /></div>
<div>
<script src="https://gist.github.com/danilovazb/9d346ed902c02030bdd7.js"></script></div>
<div>
<br /></div>
<div>
Agora vamos fazer o teste?</div>
<div>
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwPZQI1LvrdEJEyto2jwWg8eYNUtGGYx3dIWS8Yk245lYBz6kqq14l6XNYk7eRvZCXLc4mCcSnB57JKnuwi7YlNfvCEJOnr5GRf80r8E-bRkuStvs7sNTQD7cSEDpmtoMyPX-rE7En5vf9/s1600/start_project1.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="235" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwPZQI1LvrdEJEyto2jwWg8eYNUtGGYx3dIWS8Yk245lYBz6kqq14l6XNYk7eRvZCXLc4mCcSnB57JKnuwi7YlNfvCEJOnr5GRf80r8E-bRkuStvs7sNTQD7cSEDpmtoMyPX-rE7En5vf9/s640/start_project1.jpg" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Se ficar pequena a imagem, clique nela para expandir.</td></tr>
</tbody></table>
<div>
Podemos ver na imagem como foi feio o teste passando o parâmetro depois de ter editado o código, repare no comando:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFvkG5nf3ITqf2lvh1yptbIx3r03ot40oAaXwWfLS8XGx-VnocR2sKd-4zeU07EHmRZbI6F74OKhvh6a_aMjIwwWvIjZuK7bERVhFAg-8Lv3293dXuXPT7O0MwFkLGrxWUxy2SZBg3uoIy/s1600/start_project2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="44" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFvkG5nf3ITqf2lvh1yptbIx3r03ot40oAaXwWfLS8XGx-VnocR2sKd-4zeU07EHmRZbI6F74OKhvh6a_aMjIwwWvIjZuK7bERVhFAg-8Lv3293dXuXPT7O0MwFkLGrxWUxy2SZBg3uoIy/s640/start_project2.jpg" width="640" /></a></div>
<div>
<br /></div>
<div>
Eu fiz uma pesquisa pelo termo exato(adicionando aspas duplas ele pesquisa pelas palavras exatas no titulo do anúncio, pode ver mais search tips aqui http://www.olx.com.br/search_tips.htm) de Golf GTI, por isso a pesquisa com aspas simples e aspas duplas.</div>
<div>
Voltando ao comando, para utilizar o parâmetro basta colocar "-a" e o termo que vai pesquisar que foi inserido no código, pode ver na linha 8 do código, eu atribui a variável como "pesquisa", mas poderia ter colocado a variável como "piricutisco" e usado da seguinte forma:</div>
<div>
</div>
<div>
#:> scrapy crawl olx_spider -a piricutisco='"Golf GTI"'</div>
<div>
<br /></div>
<div>
Sacaram? </div>
<div>
<br /></div>
<div>
- Poxa mano, mas e se minha pesquisa tiver N argumentos?</div>
<div>
R: Poderá fazer desse modo:</div>
<div>
<br /></div>
<div>
<script src="https://gist.github.com/danilovazb/00eff95d5a0fb2688b56.js"></script></div>
<div>
<br /></div>
<div>
<div>
#:> scrapy crawl olx_spider <b><span style="color: blue;">-a</span></b> piricutisco='"Golf GTI"' <b><span style="color: blue;">-a</span></b> Goku="majin boo"</div>
</div>
<div>
<br /></div>
<div>
Note que cada vez que adiciona um parâmetro a chamada(<b><span style="color: blue;">-a</span></b>) do parâmetro tem que ser usada.(Exemplo acima é meramente ilustrativo, ele não funciona na pagina da OLX)</div>
<div>
<br /></div>
<div>
E podemos verificar que o parâmetro foi passado corretamente no LOG, reparem na imagem abaixo:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXWlKq0SNPdVFXeuInHEbMa3i3q6ic5B51sSxl_sUlzWzMY8ciYg8LkSfSjKx9ZXEteOLn3T0Z0-sWZSTITluUEMSxCYIsPMHacf1Ao04b009ajQ_B3pW4djZUEL1s48omkcf9IJAKD5IV/s1600/start_project3.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="217" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXWlKq0SNPdVFXeuInHEbMa3i3q6ic5B51sSxl_sUlzWzMY8ciYg8LkSfSjKx9ZXEteOLn3T0Z0-sWZSTITluUEMSxCYIsPMHacf1Ao04b009ajQ_B3pW4djZUEL1s48omkcf9IJAKD5IV/s640/start_project3.jpg" width="640" /></a></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
Certo, voltando ao código original que estávamos desenvolvendo, vamos começar a implementar a inteligência do robô, nesse exemplo, como quero demonstrar o uso também do tesseract, vamos fazer o download e a salvar o telefone de contato do anunciante, caso não tenham reparado, o telefone tem duas proteções contra crawlers:</div>
<div>
<br /></div>
<div>
<ol>
<li>Ele está atrás de um javascript.</li>
<li>O texto do telefone está como imagem, para evitar o salvamento automático do telefone ou sei lá o que.</li>
</ol>
</div>
<div>
<br /></div>
<div>
Mas, como somos trakinas, vamos realizar um bypass.</div>
<div>
<br /></div>
<div>
Primeiro, vamos entender a pagina onde vamos realizar o parser. Assim que realizamos a pesquisa ele nos leva para a pagina onde ficam os resultados, nosso robô tem que entrar em anuncio por anuncio e passar a pagina e assim por diante até acabar os resultados.</div>
<div>
<br /></div>
<div>
Vou usar como referência o artigo do <a href="http://www.gilenofilho.com.br/usando-o-scrapy-e-o-rethinkdb-para-capturar-e-armazenar-dados-imobiliarios-parte-i/" target="_blank">Gileno</a>[1] para realizar o parser das paginas da OLX, mas para entender melhor e não ter que ficar pulando de artigo p/ artigo, vou explicar como realizar o parser aqui.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div>
Abrindo a pagina de pesquisa (estou usando o chrome), eu abri a ferramenta de desenvolvedor do chrome para analisar o código fonte, como na imagem abaixo eu procuro a tag html responsável pela lista de carros, observe:</div>
<div>
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4N42oDNCRuX0tWphMcthuADNYIA70h9f1-xtaJ9OJd-iqY3jT47IyLbXd5bfAFXibJD6Ny901so8LuiFVZfyP1Euu-eCEqNr1iEtxHVWyJRuUK_gqiyZavuZmv0pOdQF8EAZzJP7ItIdj/s1600/start_project4.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="312" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4N42oDNCRuX0tWphMcthuADNYIA70h9f1-xtaJ9OJd-iqY3jT47IyLbXd5bfAFXibJD6Ny901so8LuiFVZfyP1Euu-eCEqNr1iEtxHVWyJRuUK_gqiyZavuZmv0pOdQF8EAZzJP7ItIdj/s640/start_project4.jpg" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td class="tr-caption" style="font-size: 12.8px;">Se ficar pequena a imagem, clique nela para expandir.</td></tr>
</tbody></table>
</td></tr>
</tbody></table>
<div>
No caso da OLX a tag que eu procurava é a <b><i>div class="section_OLXad-list "</i></b> que contém a listagem dos carros, agora vamos pegar a tag <b><i>li class="item"</i></b> que contém o anuncio do carro, dessa forma vamos montar uma consulta de xpath para adicionar no código do crawler pra quele possa realizar o parser.</div>
<div>
<br /></div>
<div>
<div>
//div[contains(@class,"section_OLXad-list")]//li[contains(@class,"item")]</div>
</div>
<div>
<br /></div>
<div>
Acho que o entendimento é bem simples, mas vou tentar explicar da forma que aprendi, caso esteja errado, por favor me corrijam.</div>
<div>
<br /></div>
<div>
Antes, vou explicar sobre os operadores // e / do xpath, eles são utilizados para definir a pesquisa dentro do texto HTML.</div>
<div>
<br /></div>
<div>
/div - usado para fazer a pesquisa da tag div dentro da raiz do html, caso não tenha entendido a questão da raiz, ela funciona da seguinte forma, o html ele tem uma estrutura, assim como uma estrutura de diretórios ou a indentação de um código, o xpath ele faz essa distinção, quando usamos apenas uma barra ele faz a procura penas no "diretório" raiz do HTML.</div>
<div>
<br /></div>
<div>
//div - usado para fazer a pesquisa da tag div em todo o código HTML, seguindo o exemplo acima, seria como pesquisa de forma recursiva dentro de todos os diretórios, trazendo tudo que ele encontrar com a tag div.</div>
<div>
<br /></div>
<div>
Ok, entendido isso, acho que fica mais fácil explicar o xpath acima, ele procura em todo o código pela tag div que contenha o parâmetro class que seja igual a "section_OLXad-list" e assim que ele achar, ele pesquisa dentro de todos esses "divs" encontrados a tag li que contenha a classe "item".</div>
<div>
<br /></div>
<div>
Não sei se consegui ser claro, mas qualquer dúvida que fique, postem nos comentários que vou tentar responder o quanto antes.</div>
<div>
<br /></div>
<div>
Vamos montar o código agora no nosso spider, apenas seguindo o que o Gileno fez, segue o código abaixo com parte do que o Gileno desenvolveu no <a href="http://www.gilenofilho.com.br/usando-o-scrapy-e-o-rethinkdb-para-capturar-e-armazenar-dados-imobiliarios-parte-i/" target="_blank">artigo</a> dele, a princípio esse código servirá como base para coletarmos o telefone e alguns dados a mais.</div>
<div>
<br /></div>
<div>
Caso queira entender como foi realizado as outras linhas de código, visite o artigo do Gileno.</div>
<div>
<br /></div>
<div>
<script src="https://gist.github.com/danilovazb/a7ca0d475e1d184b8ebd.js"></script></div>
<div>
<br /></div>
<div>
Certo, agora vamos para a parte que interessa, vou mostrar como usar o tesseract junto com o python, fazendo ele reconhecer a imagem a partir da pagina web.</div>
<div>
<br /></div>
<div>
No site da OLX, na pagina do anuncio, podemos ver que tem um telefone de contato como mostra na imagem abaixo:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj77MLHRvm40Hg8AVi4jq8y_zVIJEEMUWMmYW2az9o7LE2U4oXXmSoeuc3dG99lc9AfAqeCVLT9mKipY6Z7VuAvDuyNlDnwsMu65Z8LTf6KPmfiXWHryj946jpvxJiW-kLWgIOHfBSpfitC/s1600/start_project5.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj77MLHRvm40Hg8AVi4jq8y_zVIJEEMUWMmYW2az9o7LE2U4oXXmSoeuc3dG99lc9AfAqeCVLT9mKipY6Z7VuAvDuyNlDnwsMu65Z8LTf6KPmfiXWHryj946jpvxJiW-kLWgIOHfBSpfitC/s1600/start_project5.jpg" /></a></div>
<div>
<br /></div>
<div>
O telefone está "protegido" por um javascript, dificultando a ação de crawlers, porém ele foi mal implementado, podemos notar no código fonte da pagina que a imagem original do telefone se encontra dentro das tags <b><i>noscript</i></b>, veja na imagem abaixo:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWeXmlOCFmB6NT4YLJEVHyhaVNeopxx4Hbc9_g-jhb8wAorRAh_LQGlNimXpFkJGZ1sjm3nwDx2Szqm5wBHn93ocYbppd3yotZqIyffRvd6a2PM9VkVrc0zuh347pPBMDuCTmDc1e7xmpv/s1600/start_project6.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWeXmlOCFmB6NT4YLJEVHyhaVNeopxx4Hbc9_g-jhb8wAorRAh_LQGlNimXpFkJGZ1sjm3nwDx2Szqm5wBHn93ocYbppd3yotZqIyffRvd6a2PM9VkVrc0zuh347pPBMDuCTmDc1e7xmpv/s1600/start_project6.jpg" /></a></div>
<div>
<br /></div>
<div>
Repare que dentro da tag <b>noscript</b> tem a imagem original dentro da tag img, nesse caso eu implementei da seguinte forma o código para a leitura da imagem:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-eMGKx_3gfuPp4mNOzrPqePT6lu3sq3jhWVyxAvZbvrgBnfkvqlIErhdqPnBIQ_58sjUjaeNdMjdB8qemqWp0qiarUrFuGchAiZ3yH4o7lG7nCZQOIWFjJRYlq08J5W_BZbCu55KtcQsx/s1600/start_project7.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="50" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-eMGKx_3gfuPp4mNOzrPqePT6lu3sq3jhWVyxAvZbvrgBnfkvqlIErhdqPnBIQ_58sjUjaeNdMjdB8qemqWp0qiarUrFuGchAiZ3yH4o7lG7nCZQOIWFjJRYlq08J5W_BZbCu55KtcQsx/s640/start_project7.jpg" width="640" /></a></div>
<div>
<br /></div>
<div>
Dessa forma eu extraio o link da imagem original, assim consigo acessar a imagem com o telefone e usar o tesseract para transformar a imagem em texto, pode observar no código abaixo que fiz alguns imports novos e add mais 7 linhas no final do código.</div>
<div>
<br /></div>
<div>
<script src="https://gist.github.com/danilovazb/45886f6476b6f92cb9a9.js"></script></div>
<div>
<br /></div>
<div>
Agora, vamos rodar o código para ver se está tudo OK.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEim7ogRFt8ZrhaL_mr_zkV2jRwlEcU51xbiTulrmNLqmOeIzUWO6oSaPZY6Sjq91KYvJZFAK0kgqhaGydAnNqJSQMbjHzW61FUVwKcmxN7C4fugRt2C-Ph3Tpt4m0AfJFcXz4P0y2Rv86PR/s1600/start_project8.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEim7ogRFt8ZrhaL_mr_zkV2jRwlEcU51xbiTulrmNLqmOeIzUWO6oSaPZY6Sjq91KYvJZFAK0kgqhaGydAnNqJSQMbjHzW61FUVwKcmxN7C4fugRt2C-Ph3Tpt4m0AfJFcXz4P0y2Rv86PR/s1600/start_project8.jpg" /></a></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
Ao som de Astrix:</div>
<div>
<br /></div>
<div>
<iframe allowfullscreen="" frameborder="0" height="315" src="https://www.youtube.com/embed/CVrizLqLAr0" width="560"></iframe></div>
<div>
<br /></div>
REFERÊNCIAS:<br />
[1] http://www.gilenofilho.com.br/usando-o-scrapy-e-o-rethinkdb-para-capturar-e-armazenar-dados-imobiliarios-parte-i/<br />
[2] Livro Web Scraping com Python - Capítulo 11 - Processamento de imagens e reconhecimento de texto - Pag 207<br />
[3] https://pypi.python.org/pypi/pytesseractDanilo Vazhttp://www.blogger.com/profile/05961143854943568933noreply@blogger.com4tag:blogger.com,1999:blog-5775647478606965557.post-63525583464478605872016-01-06T15:21:00.000-08:002016-01-06T15:21:48.368-08:00HTTP Dangerous Method - Automatizando exploração com PythonE ai galera, depois de muito rivotril, reconter e pristiq, to de volta no role kkkkk<br />
<br />
Bom, o motivo de postar hoje é uma vul que peguei em um cliente hoje.<br />
O titulo já diz o nome da vul, pelo menos é o que o Nessus me trouxe como nome dela, eu achei interessante a falha pq sinceramente, nunca peguei essa falha realmente vul a não ser em LAB, ai como peguei ela hoje eu resolvi escrever um pouco sobre ela.<br />
<br />
O que acontece é que está habilitado no servidor web os métodos PUT e DELETE, pra quem não conhece, vou explicar melhor.<br />
<br />
PUT:<br />
O método PUT faz uma requisição no servidor web que realiza uma criação de um arquivo remoto, caso já exista, ele é modificado.<br />
<br />
DELETE:<br />
Delete o recurso solicitado.<br />
<br />
OPTIONS:<br />
<span style="background-color: white; color: #222426; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 15px; line-height: 19.5px;">Retorna os métodos HTTP que o servidor suporta para a URL especificada.</span><br />
<span style="background-color: white; color: #222426; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 15px; line-height: 19.5px;"><br /></span>
<span style="background-color: white; color: #222426; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 15px; line-height: 19.5px;">Bom, sabendo sobre esses 3 métodos já da pra entender como funciona a falha, de grosso modo, eu faço uma requisição OPTIONS e vejo o que está habilitado no servidor como na imagem abaixo:</span><br />
<span style="background-color: white; color: #222426; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 15px; line-height: 19.5px;"><br /></span>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgo4RV5kcb_7aJq7bXUt8Rcy1RMEWvcLbNIxBi8z2vOiRuO3UZVl3obKhvaET1qG4ejJUbkBCQqWENCTT5MTbYFZwtliHmV19bs4GdTHE1FreG_Q6smsLyQdhfcaW8uqddQj4vktQ3yJGno/s1600/method.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="182" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgo4RV5kcb_7aJq7bXUt8Rcy1RMEWvcLbNIxBi8z2vOiRuO3UZVl3obKhvaET1qG4ejJUbkBCQqWENCTT5MTbYFZwtliHmV19bs4GdTHE1FreG_Q6smsLyQdhfcaW8uqddQj4vktQ3yJGno/s400/method.png" width="400" /></a></div>
<span style="background-color: white; color: #222426; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 15px; line-height: 19.5px;"><br /></span>
<span style="background-color: white; color: #222426; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 15px; line-height: 19.5px;">O que eu fiz ai foi, usar o netcat pra mandar uma solicitação de OPTIONS e ver o que está permitido(Allow) no meu server, veja que no meu apache está apenas OPTIONS, GET, HEAD e POST.</span><br />
<span style="background-color: white; color: #222426; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 15px; line-height: 19.5px;"><br /></span>
<span style="background-color: white; color: #222426; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 15px; line-height: 19.5px;">No caso do cliente, estava habilitado o método PUT e DELETE, permitindo eu inserir um arquivo e deletar.</span><br />
<span style="background-color: white; color: #222426; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 15px; line-height: 19.5px;"><br /></span>
<span style="background-color: white; color: #222426; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 15px; line-height: 19.5px;">Então eu procurei alguns artigos que mostravam como fazia manualmente o insert, no final do artigo eu vou colocar as fontes de pesquisa que me ajudaram na falha.</span><br />
<span style="background-color: white; color: #222426; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 15px; line-height: 19.5px;"><br /></span>
<span style="background-color: white; color: #222426; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 15px; line-height: 19.5px;">Mas por preguiça de fazer manual nos servers que encontrei a falha eu fiz um script que facilita a minha vida, vou postar ele aqui em baixo:</span><br />
<span style="background-color: white; color: #222426; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 15px; line-height: 19.5px;"><br /></span>
<span style="background-color: white; font-size: 15px; line-height: 19.5px;"><span style="color: #222426; font-family: Arial, Helvetica Neue, Helvetica, sans-serif;"><script src="https://gist.github.com/danilovazb/292761468c9b54f7a082.js"></script></span></span><br />
<span style="background-color: white; font-size: 15px; line-height: 19.5px;"><span style="color: #222426; font-family: Arial, Helvetica Neue, Helvetica, sans-serif;"><br /></span></span>
<span style="background-color: white; font-size: 15px; line-height: 19.5px;"><span style="color: #222426; font-family: Arial, Helvetica Neue, Helvetica, sans-serif;">No script, é preciso criar um arquivo vul.htm antes, assim ele faz o upload, mas se quiser, pode melhorar o script, ele é livre.</span></span><br />
<span style="background-color: white; font-size: 15px; line-height: 19.5px;"><span style="color: #222426; font-family: Arial, Helvetica Neue, Helvetica, sans-serif;"><br /></span></span>
<span style="background-color: white; font-size: 15px; line-height: 19.5px;"><span style="color: #222426; font-family: Arial, Helvetica Neue, Helvetica, sans-serif;">Bom, basicamente é isso galera, uma outra dica, tem um comando no nmap que ajuda da identificação dessa falha:</span></span><br />
<span style="background-color: white; font-size: 15px; line-height: 19.5px;"><span style="color: #222426; font-family: Arial, Helvetica Neue, Helvetica, sans-serif;"><br /></span></span>
<span style="background-color: white; font-size: 15px; line-height: 19.5px;"><span style="color: #222426; font-family: Arial, Helvetica Neue, Helvetica, sans-serif;">nmap --script=http-methods.nse --script-args http-methods.retest=1 127.0.0.1</span></span><br />
<span style="background-color: white; font-size: 15px; line-height: 19.5px;"><span style="color: #222426; font-family: Arial, Helvetica Neue, Helvetica, sans-serif;"><br /></span></span>
<span style="background-color: white; font-size: 15px; line-height: 19.5px;"><span style="color: #222426; font-family: Arial, Helvetica Neue, Helvetica, sans-serif;">Obvio, troque o ip de loopback para o ip ou o range que vai testar.</span></span><br />
Em um pentest isso pode ser crucial para conseguir uma vul.<br />
<br />
É isso galera, tks....e estou de volta no role ;)<br />
<br />
[Referencias]<br />
http://pt.stackoverflow.com/questions/9419/quais-s%C3%A3o-os-m%C3%A9todos-de-requisi%C3%A7%C3%A3o-http-e-qual-%C3%A9-a-diferen%C3%A7a-entre-eles<br />
https://tools.ietf.org/html/rfc7231<br />
https://www.owasp.org/index.php/Test_HTTP_Methods_(OTG-CONFIG-006)<br />
http://httpsecure.org/?works=how-to-exploit-http-methods-put-and-deleteDanilo Vazhttp://www.blogger.com/profile/05961143854943568933noreply@blogger.com1tag:blogger.com,1999:blog-5775647478606965557.post-3660495378753920432015-12-02T00:55:00.001-08:002015-12-02T08:38:23.834-08:00Gerando wordlist de username com python e scrapyFala galera suave?<br />
Faz um tempo que não posto nada não é verdade?<br />
<br />
Bom, agora estou de "férias"(sem trampo rsrsrs) e vou tentar me dedicar mais ao blog, pra falar a verdade, tenho 2 artigos para finalizar, a preguiça e o Elder Scrolls não estão deixando kkkk<br />
<br />
Um deles eu quero passar o básico para se examinar um aplicativo mobile, desde o tráfego de dados até o source code, com foco em apk(Android), algo bem howto mesmo, eu penei um pouco pra achar bons tutos que explicam desde o decompilar até o recompilar com assinatura e tal, enfim.<br />
Outro que quero mostrar é algo que estou criando com o scrapy, mesmo framework que vou demonstrar nesse artigo, enfim, vamos ao que interessa certo?<br />
<br />
Agora na madruga eu estava fazendo um pentest e precisava de nomes de usuários para fazer uma wordlist para enumerar um ssh, porém, queria nomes de pessoas do BR, a solução que achei foi procurar no google por nomes de pessoas brasileiras, então eu achei esse site: http://www.dicionariodenomesproprios.com.br/<br />
<br />
Certo, nele existe uma lista com nomes masculinos e nomes femininos, o que vou mostrar é como automatizar isso para que se pegue todos os nomes do site de forma rápida e fácil.<br />
<br />
Primeiro, caso não tenha instalado o python e/ou scrapy, leia sobre <a href="http://doc.scrapy.org/en/1.0/intro/install.html" target="_blank">aqui</a>.<br />
<br />
Caso já tenha instalado, prosseguiremos. (Obs: não pretendo explicar o que cada comando faz nesse tutorial, estou preparando outro para isso, no final do artigo vou colocar uns posts que me ajudaram a aprender sobre o scrapy caso alguém queira)<br />
<br />
Em seu terminal, digite:<br />
<br />
~$ scrapy startproject nomes_galera<br />
<br />
Será criada uma pasta com o nome de "nomes_galera", agora digite a sequencia de comandos abaixo:<br />
<br />
~$ cd nomes_galera<br />
~$ scrapy genspider masc_nome dicionariodenomesproprios.com.br<br />
<br />
Vejamos, você criou o projeto dando um start nele e atribuindo o nome "nomes_galera", em seguida você entrou na pasta e criou um robo(spider) que vai coletar os dados a partir do domínio dicionariodenomesproprios.com.br com o nome do robo(spider) de masc_nome.<br />
<br />
Certo, espero que até aqui você tenha entendido, caso não, ligue 190 e peça ajuda aos universitários rsrsrs briks, qualquer coisa deixa nos comentários que eu ajudo galera.<br />
<br />
Vamos entrar na pasta onde se encontra o spider, antes de entrar, segue a árvore do diretório só para terem uma noção.<br />
<br />
#:> tree<br />
.<br />
├── nome_galera<br />
│ ├── __init__.py<br />
│ ├── __init__.pyc<br />
│ ├── items.py<br />
│ ├── pipelines.py<br />
│ ├── settings.py<br />
│ ├── settings.pyc<br />
│ └── spiders<br />
│ ├── __init__.py<br />
│ ├── __init__.pyc<br />
│ ├── masc_nome.py<br />
│ └── masc_nome.pyc<br />
└── scrapy.cfg<br />
<div>
<br /></div>
<div>
Entre na pasta spiders com o comando abaixo:</div>
<div>
<br /></div>
<div>
~$ cd nome_galera/spiders/</div>
<div>
<br /></div>
<div>
Vamos editar o arquivo que acabamos de criar, no caso, o robo com o nome de masc_nome.py</div>
<div>
<br /></div>
<div>
A princípio o arquivo é criado com um layout padrão, dessa maneira:</div>
<div>
<br /></div>
<div>
<script src="https://gist.github.com/danilovazb/78bf7bf1ae6635763922.js"></script>
</div>
<div>
<br /></div>
<div>
Note que na linha 9 ele mostra apenas o site certo? Não é isso que queremos, vamos analisar o site e ver onde estão os nomes masculinos.<br />
<br />
Se você entrar nesse link: http://www.dicionariodenomesproprios.com.br/nomes-masculinos/<br />
Vai ver que tem apenas nomes masculinos certo? Nosso desafio é pegar todos esses nomes e de todas as paginas. (Desculpem se não estiver sendo bem claro, estou com um pouco de sono)<br />
<br />
Pra fazer isso, vamos olhar o código fonte da pagina.<br />
Abaixo do Top10 de nomes, veja que começa a lista de nomes do site, em desordem alfabética(acho que inventei esse termo agora) o primeiro nome que aparece é o Davi, usando o chrome, abra a ferramenta de desenvolvedor e inspecione o objeto com o nome do Davi assim como na imagem abaixo:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEit8V-b31aW3i56KeiPNwfKuKVHNMnXMLS4GnWojwOnHVA1agKWfUUYU32maM-fD6A8o5pub1V0cGxGJNN6phefmAtWBO2T_L-76TARzeo3hbKVj_xQqKiwyIX12KfDu3Abp96vJrV8RlQH/s1600/masc.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="336" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEit8V-b31aW3i56KeiPNwfKuKVHNMnXMLS4GnWojwOnHVA1agKWfUUYU32maM-fD6A8o5pub1V0cGxGJNN6phefmAtWBO2T_L-76TARzeo3hbKVj_xQqKiwyIX12KfDu3Abp96vJrV8RlQH/s640/masc.png" width="640" /></a></div>
<br />
<br />
Vejam a tag e o atributo do HTML onde tem o nome do davi, viu?<br />
<br />
Ok, vou colocar aqui.<br />
<br />
<script src="https://gist.github.com/danilovazb/e94eaab21ecf8291f4b7.js"></script>
Repare, temos a tag "a" com o atributo 'class="lista-nome"', se você der um procurar na pagina, você vai ver que todos os nomes listados tem a tag e o atributo em comum, se pensarmos de maneira lógica, temos uma lista de nomes(Dãhr, o próprio nome da class já diz animal). Piadinhas a parte, muitas vezes, por mais obvia que é a questão, deixamos passar na hora de desenvolver, pensamos de forma automática e não reparamos em coisas obvias que nos ajudam a montar mentalmente o código.<br />
<br />
Ok, let's go.<br />
<br />
Vamos ao código agora.<br />
<br />
Leia o código, não continue a ler esse texto, vamos fazer um teste de observação.<br />
<br />
Diga mentalmente qual é a URL que o robô vai dar o start na busca.<br />
<br />
.<br />
.<br />
.<br />
.<br />
.<br />
.<br />
.<br />
.<br />
<br />
Achou?<br />
Certo, muito bom garoto(a), linha 8 do código ali de cima, certo? Que por sua vez, é o código base do robo, agora vamos mudar isso, afinal, começamos a procurar do link que passei sobre nomes masculinos não é mesmo? Ainda lembra dele? Pega ele ali em cima vai, não vou escrever de novo.<br />
<br />
Altere a linha 9 com o link da pagina onde contem os nomes masculinos.<br />
<br />
ficando dessa maneira:<br />
<br />
<script src="https://gist.github.com/danilovazb/181f7ced1259976b7ee5.js"></script><br />
<br />
Agora vamos a parte que interessa, vamos ao parser do "bagulho", vamos coletar os nomes.<br />
Primeiro, vamos entender um pouco o que vamos fazer, lembra-se da tag onde contem o nome do Davi? Vamos fazer ela de base para pegar todos os nomes, vamos usar xpath para gerar uma query generica.<br />
<br />
Vou postar o código aqui já pronto e vou explicar as linhas alteradas no próprio source "serto" galera?<br />
[ATUALIZACAO] Galera, recebi uma dica do <a aria-describedby="js_2a" aria-haspopup="true" aria-owns="js_29" class=" UFICommentActorName" data-ft="{"tn":";"}" data-hovercard="/ajax/hovercard/hovercard.php?id=100003242391140&extragetparams=%7B%22hc_location%22%3A%22ufi_admin%22%7D" dir="ltr" href="https://www.facebook.com/lynneker.salessantos?fref=ufi" id="js_2b" style="background-color: #f6f7f8; color: #3b5998; cursor: pointer; font-family: helvetica, arial, sans-serif; font-size: 12px; font-weight: bold; line-height: 16.08px; text-decoration: none;">Lynneker Sales Santos</a> sobre o fechamento do arquivo, eu estava abrindo e fechando no for, eu troquei isso. Vlw mano<br />
<br />
<br /></div>
<script src="https://gist.github.com/danilovazb/f24f234e154af4fa9de0.js"></script><br />
<br />
<br />
Agora é só fazer isso para a pagina de nomes de mulheres e pronto, faça isso você mesmo para ver se entendeu, qualquer dúvida, postem aqui nos comentários que ajudo.<br />
<br />
Aqui vai uns posts que me ajudaram com scrapy e que me tiram dúvidas até hoje.<br />
<br />
http://www.gilenofilho.com.br/usando-o-scrapy-e-o-rethinkdb-para-capturar-e-armazenar-dados-imobiliarios-parte-i/<br />
<br />
http://www.gilenofilho.com.br/usando-o-scrapy-e-o-rethinkdb-para-capturar-e-armazenar-dados-imobiliarios-parte-ii/<br />
<br />
<br />
Post a base de CBJR<br />
<br />
<iframe allowtransparency="true" frameborder="0" height="80" src="https://embed.spotify.com/?uri=spotify:album:6TU7bDQ5q465gcVt84NPeb" width="300"></iframe>Danilo Vazhttp://www.blogger.com/profile/05961143854943568933noreply@blogger.com3tag:blogger.com,1999:blog-5775647478606965557.post-37328029568087864972015-07-18T08:09:00.002-07:002015-07-18T08:09:42.101-07:00Burlando captcha para manipular votações públicasDe boas galera?<br />
A uns dias atrás, antes do amoço eu achei um concurso e pensei: será que é possível manipular a votação e alterar o resultado final?<br />
<br />
A uns meses atrás, eu de brincadeira fiz um robô para votar em bandas na Lollapalooza (http://www.t4f.com.br/app/lollapalooza/escolha-lollabr2016-1/) e selecionei umas bandas nada a ver com a escolha popular para ver se dá resultado.<br />
Como foi essa história?<br />
O site do Lolla guardava o cookie não deixando mais votar, permitindo apenas 1 único voto, então eu escrevi um script em python usando o requests que não guardava o cookie, assim eu consegui manipular os votos, infelizmente não tinha como saber quais eram as bandas mais votadas, mas se tiver natiruts ano que vem já saberemos :)<br />
<br />
Enfim, voltando ao concurso.<br />
Eu comecei a brincar com o robô antes do almoço, dei uma pequena pausa para comer e voltei a brincadeira, eu fiz o robô que realiza o voto na modelo indicada (identificada por um ID) em um json.<br />
<br />
Vou <strike>tentar</strike> explicar como eu descobri os parâmetros certos e como realizei a votação, nessa altura do campeonato, provável que ela já esteja eleita, pois só vou liberar esse post após o final do sorteio, então, como estou escrevendo antes de terminar, não sei se ela realmente vai ganhar ainda, posto um EDIT depois dizendo se ela levou o premio ou não.<br />
<br />
[EDIT] A mina não ganhou, o robô deu um "gás" na frente da outra mas eu tinha desligado o robô uns dias antes de finalizar, liguei no ultimo dia mas não deu pra fazer a mina ganhar :( [/EDIT]<br />
<br />
Sem mais delongas, vamos ao que interessa.<br />
<br />
O sorteio é da "Belas da Torcida", nele modelos competem para ver quem é a mais bela da torcida. Beleza, a votação em si, é feita através de um GET em um arquivo que retorna um JSON. Abrindo a pagina de votação:<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6KR-cPQpz82FzD0M7JC-m1oQmNKO6H3ZgEXSw_rfdm6AHcu_ijAC6LsggKJy-BI_b8CZ8lllnVG9XY5FAoMEqm1AYM2BuayT4-s2pTU1FMCadVrqsIlqa8gihc2wCKHsbWlU_SwoaQFsl/s1600/votacao.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="324" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6KR-cPQpz82FzD0M7JC-m1oQmNKO6H3ZgEXSw_rfdm6AHcu_ijAC6LsggKJy-BI_b8CZ8lllnVG9XY5FAoMEqm1AYM2BuayT4-s2pTU1FMCadVrqsIlqa8gihc2wCKHsbWlU_SwoaQFsl/s640/votacao.png" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Coloquei a tarja para preservar as modelos <strike>e para não receber processo pq sou pobre</strike></td></tr>
</tbody></table>
Abrindo o "ferramentas de desenvolvedor" do chrome e fazendo a votação normal, conseguimos saber o endereço que ele realiza o get e como ele faz, como podemos ver na imagem abaixo:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBzg3VM_v2F4OA7eu4Udb7V0fXbjYEjyjrmXJnZHrX7_3SqhHQmM7Hfbj3kXS_2fe5O_hKn4_YT50iuwsQWeB1xrs_V3EgR_26Mp-GG1FQ9IMXc7xzJbJVCQrSkbJb4oTdgwcjiTBztJvM/s1600/dados.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="326" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBzg3VM_v2F4OA7eu4Udb7V0fXbjYEjyjrmXJnZHrX7_3SqhHQmM7Hfbj3kXS_2fe5O_hKn4_YT50iuwsQWeB1xrs_V3EgR_26Mp-GG1FQ9IMXc7xzJbJVCQrSkbJb4oTdgwcjiTBztJvM/s640/dados.png" width="640" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
Maravilha, olhem ali ao lado (img abaixo)<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8tUN-Qt7AmaJTzSQqJafr0totNPBWUUAezbwoBYRraFlk-5-zXPD9qxdJYAcvz7lCiTM114513H-Y7Fx-N9WZsdJ85Xe4rT8x0qj5Spt65HsgELind3ufDAcEdz9l-LEKuKktbjS-a2zf/s1600/dados2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8tUN-Qt7AmaJTzSQqJafr0totNPBWUUAezbwoBYRraFlk-5-zXPD9qxdJYAcvz7lCiTM114513H-Y7Fx-N9WZsdJ85Xe4rT8x0qj5Spt65HsgELind3ufDAcEdz9l-LEKuKktbjS-a2zf/s640/dados2.png" width="288" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Podemos observar que temos 4 requests em paginas iniciando com "vote?jsonp=PollVote&format", essas são as pagina que ele realiza a consulta, as duas primeiras ele me retorna o seguinte json:</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
GET</div>
<div class="separator" style="clear: both; text-align: left;">
<span style="background-color: white; color: #303942; font-family: 'dejavu sans mono', monospace; font-size: 11px; white-space: pre-wrap;">http://enquete.xxx.com.br:443/vote?jsonp=PollVote&format=jsonp&id=48058&answers=IDMODELO</span></div>
<br />
JSONP<br />
<div class="callback-function" style="color: grey; font-family: monospace;">
PollVote(</div>
<div id="json" style="font-family: monospace;">
<div class="collapser" style="-webkit-user-select: none; cursor: default; left: -1.5em; padding-left: 6px; padding-right: 6px; position: absolute; top: 1px;">
</div>
{<br />
<ul class="obj collapsible" style="list-style-type: none; margin: 0px 0px 0px 2em; padding: 0px;">
<li style="position: relative;"><div class="hoverable" style="-webkit-transition: background-color 0.2s ease-out 0s; border-radius: 2px; display: inline-block; padding: 1px 2px; transition: background-color 0.2s ease-out 0s;">
<span class="property" style="font-weight: bold;">id</span>: <span class="type-number" style="color: blue;">48058</span>,</div>
</li>
<li style="position: relative;"><div class="hoverable" style="-webkit-transition: background-color 0.2s ease-out 0s; border-radius: 2px; display: inline-block; padding: 1px 2px; transition: background-color 0.2s ease-out 0s;">
<span class="property" style="font-weight: bold;">status</span>: <span class="type-string" style="color: green;">"captcha"</span>,</div>
</li>
<li style="position: relative;"><div class="hoverable" style="-webkit-transition: background-color 0.2s ease-out 0s; border-radius: 2px; display: inline-block; padding: 1px 2px; transition: background-color 0.2s ease-out 0s;">
<span class="property" style="font-weight: bold;">captcha</span>:<br />
<div class="collapser" style="-webkit-user-select: none; cursor: default; left: -1.5em; padding-left: 6px; padding-right: 6px; position: absolute; top: 1px;">
</div>
{<br />
<ul class="obj collapsible" style="list-style-type: none; margin: 0px 0px 0px 2em; padding: 0px;">
<li style="position: relative;"><div class="hoverable" style="-webkit-transition: background-color 0.2s ease-out 0s; border-radius: 2px; display: inline-block; padding: 1px 2px; transition: background-color 0.2s ease-out 0s;">
<span class="property" style="font-weight: bold;">id</span>: <span class="type-string" style="color: green;">"pkX6uFG78AKJODRhQ4TyUCHvPZVI13MlaYigjStNso9rfWq.wx5n0d2mLcEebzB-1gArZ28LZGCEOm4qI2QmZNoiO6SjZHFmJ6uwJgu5RTLxD6QqOgOnRg8xDyO="</span>,</div>
</li>
<li style="position: relative;"><div class="hoverable" style="-webkit-transition: background-color 0.2s ease-out 0s; border-radius: 2px; display: inline-block; padding: 1px 2px; transition: background-color 0.2s ease-out 0s;">
<span class="property" style="font-weight: bold;">audio</span>: <span class="type-string" style="color: green;">"</span><a href="http://vote.captcha.uol.com.br/pkX6uFG78AKJODRhQ4TyUCHvPZVI13MlaYigjStNso9rfWq.wx5n0d2mLcEebzB-1gArZ28LZGCEOm4qI2QmZNoiO6SjZHFmJ6uwJgu5RTLxD6QqOgOnRg8xDyO=.wav">http://vote.captcha.xxx.com.br/pkX6uFG78AKJODRhQ4TyUCHvPZVI13MlaYigjStNso9rfWq.wx5n0d2mLcEebzB-1gArZ28LZGCEOm4qI2QmZNoiO6SjZHFmJ6uwJgu5RTLxD6QqOgOnRg8xDyO=.wav</a><span class="type-string" style="color: green;">"</span>,</div>
</li>
<li style="position: relative;"><div class="hoverable" style="-webkit-transition: background-color 0.2s ease-out 0s; border-radius: 2px; display: inline-block; padding: 1px 2px; transition: background-color 0.2s ease-out 0s;">
<span class="property" style="font-weight: bold;">image</span>: <span class="type-string" style="color: green;">"</span><a href="http://vote.captcha.uol.com.br/pkX6uFG78AKJODRhQ4TyUCHvPZVI13MlaYigjStNso9rfWq.wx5n0d2mLcEebzB-1gArZ28LZGCEOm4qI2QmZNoiO6SjZHFmJ6uwJgu5RTLxD6QqOgOnRg8xDyO=.jpg">http://vote.captcha.xxx.com.br/pkX6uFG78AKJODRhQ4TyUCHvPZVI13MlaYigjStNso9rfWq.wx5n0d2mLcEebzB-1gArZ28LZGCEOm4qI2QmZNoiO6SjZHFmJ6uwJgu5RTLxD6QqOgOnRg8xDyO=.jpg</a><span class="type-string" style="color: green;">"</span></div>
</li>
</ul>
}</div>
</li>
</ul>
}</div>
<div class="callback-function" style="color: grey; font-family: monospace;">
)</div>
<br />
Beleza, sei que naquele link acima se eu fizer um get ele me retornar um jsonp com os dados do ID e a imagem do CAPTCHA, agora vamos ver o que ele me traz quando eu consulto o outro GET, os dois ultimos que iniciam com "vote?jsonp=PollVote&format"<br />
<br />
GET<br />
<span style="background-color: white; color: #303942; font-family: 'dejavu sans mono', monospace; font-size: 11px; white-space: pre-wrap;">http://enquete.xxx.com.br/vote?jsonp=PollVote&format=jsonp&id=48058&answers=IDMODELO&captcha-value=e3z4&captcha-id=nB9gd3ZLsJR-UlO.uDHxtwM6ipzCKAbfGkj28qWQINXrVFcm0TyaPehE4Y57oSv1ALnaixnhp2przWsTC6n0l6kmpg34O6wc-gd0-2dyOH4TlgucU2UaO2sTlxU=</span><br />
<br />
Note que nesse link acima, já temos uns valores interessantes, vou marcar abaixo os interessantes em vermelho:<br />
<span style="background-color: white; color: #303942; font-family: 'dejavu sans mono', monospace; font-size: 11px; white-space: pre-wrap;">http://enquete.xxx.com.br/vote?jsonp=PollVote&format=jsonp&id=48058&answers=IDMODELO&</span><span style="background-color: white; font-family: 'dejavu sans mono', monospace; font-size: 11px; white-space: pre-wrap;"><span style="color: red;">captcha-value=e3z4</span></span><span style="background-color: white; color: #303942; font-family: 'dejavu sans mono', monospace; font-size: 11px; white-space: pre-wrap;">&</span><span style="background-color: white; font-family: 'dejavu sans mono', monospace; font-size: 11px; white-space: pre-wrap;"><span style="color: red;">captcha-id=nB9gd3ZLsJR-UlO.uDHxtwM6ipzCKAbfGkj28qWQINXrVFcm0TyaPehE4Y57oSv1ALnaixnhp2przWsTC6n0l6kmpg34O6wc-gd0-2dyOH4TlgucU2UaO2sTlxU=</span></span><br />
<br />
Certo, captcha-value contem o texto do captcha e o captcha-id contem o ID que vimos ali em cima no primeiro get que fizemos.<br />
<br />
Agora vem a parte interessante, como faço para burlar esse captcha e manipular as votações com robôs de automatização?<br />
<br />
Beleza, nada de OCR, IMAGEMAGIK e a caralhada toda pra complicar, vamos buscar algo mais simples e efetivo que não nos tome tempo. Conheçam o <a href="http://www.deathbycaptcha.com/" target="_blank">DEATH BY CAPTCHA</a>, maravilhoso site que explora o trabalho de indianos na resolução dos nossos captchas de cada dia, o terror de sites como a Receita Federal, Sefaz e por ai vai hu3hu3hu3BR. O melhor de tudo, é MUITO barato, resolução de 5000 captcha sai em torno de 6.29 obamas, coisa chique.<br />
<br />
Certo, como já tenho os dados que preciso, agora é hora de integrar o sistema de votação e no de quebra de captcha, fazendo eles trabalharem juntos :)<br />
<br />
Usaremos o Python, mas da pra ser feito em varias outras linguagens.<br />
<br />
<script src="https://gist.github.com/danilovazb/7cfb4d12fe8b74648d66.js"></script>Danilo Vazhttp://www.blogger.com/profile/05961143854943568933noreply@blogger.com38tag:blogger.com,1999:blog-5775647478606965557.post-71460374941012095842015-06-30T05:05:00.002-07:002015-06-30T05:05:49.662-07:00Jameh - Brute Force em Hash de Senhas /etc/shadowGalera de boa?<div>
Estava caminhando por ai, quando vi no github do Ricardo Longatto o programa que ele fez em C para realizar um brute-force em senhas em hash que ficam no /etc/shadow. </div>
<div>
<br /></div>
<div>
https://github.com/ricardolongatto/loncrack</div>
<div>
<br /></div>
<div>
Então, resolvi fazer o mesmo em python, achei que seria interessante medir a velocidade de quebra em C e em Python, mas eu não consegui fazer rodar o programa em C do Longatto (Sim sou um LOSER), caso alguém consiga e realize o teste, me manda que posto aqui.</div>
<div>
<br /></div>
<div>
Mas enfim, fiz em python, segue abaixo o README dele e o link para testarem.</div>
<div>
<br /></div>
<div>
LINK: https://github.com/danilovazb/jameh</div>
<div>
<br /></div>
<div>
<h1 style="border-bottom-color: rgb(238, 238, 238); border-bottom-style: solid; border-bottom-width: 1px; box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 2.25em; line-height: 1.2; margin-bottom: 16px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important; padding-bottom: 0.3em; position: relative;">
Jameh</h1>
<pre style="background-color: #f7f7f7; border-radius: 3px; box-sizing: border-box; color: #333333; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; font-stretch: normal; line-height: 1.45; margin-bottom: 16px; overflow: auto; padding: 16px; word-wrap: normal;"><code style="background: transparent; border-radius: 3px; border: 0px; box-sizing: border-box; display: inline; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; line-height: inherit; margin: 0px; max-width: initial; overflow: initial; padding: 0px; word-break: normal; word-wrap: normal;">Danilo Vaz - UNK
danilovazb@gmail.com
http://unk-br.blogspot.com
https://twitter.com/unknownantisec
</code></pre>
<h3 style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 1.5em; line-height: 1.43; margin-bottom: 16px; margin-top: 1em; position: relative;">
<a aria-hidden="true" class="anchor" href="https://github.com/danilovazb/jameh/blob/master/README.md#description" id="user-content-description" style="box-sizing: border-box; color: #4078c0; display: block; left: 0px; line-height: 1.2; margin-left: -30px; padding-left: 30px; padding-right: 6px; position: absolute; text-decoration: none; top: 0px;"></a>DESCRIPTION</h3>
<pre style="background-color: #f7f7f7; border-radius: 3px; box-sizing: border-box; color: #333333; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; font-stretch: normal; line-height: 1.45; margin-bottom: 16px; overflow: auto; padding: 16px; word-wrap: normal;"><code style="background: transparent; border-radius: 3px; border: 0px; box-sizing: border-box; display: inline; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; line-height: inherit; margin: 0px; max-width: initial; overflow: initial; padding: 0px; word-break: normal; word-wrap: normal;">Jameh, que na verdade se escreve e se lê 'Jamé' que do Tupi Guarani significa oculto,
misterioso, tem como objetivo realizar um brute-force em hash de senhas contidas no /etc/shadow,
passando o salt do hash e a senha criptografada ele tenta por meio de dicionário quebrar a
senha.
</code></pre>
<h3 style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 1.5em; line-height: 1.43; margin-bottom: 16px; margin-top: 1em; position: relative;">
<a aria-hidden="true" class="anchor" href="https://github.com/danilovazb/jameh/blob/master/README.md#requeriments" id="user-content-requeriments" style="box-sizing: border-box; color: #4078c0; display: block; left: 0px; line-height: 1.2; margin-left: -30px; padding-left: 30px; padding-right: 6px; position: absolute; text-decoration: none; top: 0px;"></a>REQUERIMENTS</h3>
<pre style="background-color: #f7f7f7; border-radius: 3px; box-sizing: border-box; color: #333333; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; font-stretch: normal; line-height: 1.45; margin-bottom: 16px; overflow: auto; padding: 16px; word-wrap: normal;"><code style="background: transparent; border-radius: 3px; border: 0px; box-sizing: border-box; display: inline; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; line-height: inherit; margin: 0px; max-width: initial; overflow: initial; padding: 0px; word-break: normal; word-wrap: normal;"> ----------------------------------------------------------
Import:
threading
time
crypt
argparse
sys
subprocess
permission Reading & Writing
User root privilege, or is in the sudoers group
Operating system LINUX
Python 2.7
----------------------------------------------------------
</code></pre>
<h3 style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 1.5em; line-height: 1.43; margin-bottom: 16px; margin-top: 1em; position: relative;">
<a aria-hidden="true" class="anchor" href="https://github.com/danilovazb/jameh/blob/master/README.md#install" id="user-content-install" style="box-sizing: border-box; color: #4078c0; display: block; left: 0px; line-height: 1.2; margin-left: -30px; padding-left: 30px; padding-right: 6px; position: absolute; text-decoration: none; top: 0px;"></a>INSTALL</h3>
<pre style="background-color: #f7f7f7; border-radius: 3px; box-sizing: border-box; color: #333333; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; font-stretch: normal; line-height: 1.45; margin-bottom: 16px; overflow: auto; padding: 16px; word-wrap: normal;"><code style="background: transparent; border-radius: 3px; border: 0px; box-sizing: border-box; display: inline; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; line-height: inherit; margin: 0px; max-width: initial; overflow: initial; padding: 0px; word-break: normal; word-wrap: normal;">git clone http://github.com/danilovazb/jameh
</code></pre>
<h3 style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 1.5em; line-height: 1.43; margin-bottom: 16px; margin-top: 1em; position: relative;">
<a aria-hidden="true" class="anchor" href="https://github.com/danilovazb/jameh/blob/master/README.md#help" id="user-content-help" style="box-sizing: border-box; color: #4078c0; display: block; left: 0px; line-height: 1.2; margin-left: -30px; padding-left: 30px; padding-right: 6px; position: absolute; text-decoration: none; top: 0px;"></a>HELP</h3>
<pre style="background-color: #f7f7f7; border-radius: 3px; box-sizing: border-box; color: #333333; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; font-stretch: normal; line-height: 1.45; margin-bottom: 16px; overflow: auto; padding: 16px; word-wrap: normal;"><code style="background: transparent; border-radius: 3px; border: 0px; box-sizing: border-box; display: inline; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; line-height: inherit; margin: 0px; max-width: initial; overflow: initial; padding: 0px; word-break: normal; word-wrap: normal;">usage: jameh.py [-h] [-t 10] -f word_list.txt -s '$6$DgAOLzvU' -ha
'$xw5oqFEZw30SSCdgD9KOiK2BG1J.O135BowUgdsUZB3ErEeZii6s1vC07BcBoPY06iNcJpxhQYTwzBpjVj7oq.'
optional arguments:
-h, --help show this help message and exit
-t 10, --threads 10
Threads
-f word_list.txt, --file word_list.txt
Opens file with passwords
-s '$6$DgAOLzvU', --salt '$6$DgAOLzvU'
Salt, '$6$DgAOLzvU'
-ha '$xw5oqFEZw30SSCdgD9KOiK2BG1J.O135BowUgdsUZB3ErEeZii6s1vC07BcBoPY06iNcJpxhQYTwzBpjVj7oq.', --hash '$xw5oqFEZw30SSCdgD9KOiK2BG1J.O135BowUgdsUZB3ErEeZii6s1vC07BcBoPY06iNcJpxhQYTwzBpjVj7oq.'
hash, '$xw5oqFEZw30SSCdgD9KOiK2BG1J.O135BowUgdsUZB3ErEeZii
6s1vC07BcBoPY06iNcJpxhQYTwzBpjVj7oq.'
</code></pre>
<h3 style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 1.5em; line-height: 1.43; margin-bottom: 16px; margin-top: 1em; position: relative;">
<a aria-hidden="true" class="anchor" href="https://github.com/danilovazb/jameh/blob/master/README.md#example" id="user-content-example" style="box-sizing: border-box; color: #4078c0; display: block; left: 0px; line-height: 1.2; margin-left: -30px; padding-left: 30px; padding-right: 6px; position: absolute; text-decoration: none; top: 0px;"></a>EXAMPLE</h3>
<pre style="background-color: #f7f7f7; border-radius: 3px; box-sizing: border-box; color: #333333; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; font-stretch: normal; line-height: 1.45; overflow: auto; padding: 16px; word-wrap: normal;"><code style="background: transparent; border-radius: 3px; border: 0px; box-sizing: border-box; display: inline; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; line-height: inherit; margin: 0px; max-width: initial; overflow: initial; padding: 0px; word-break: normal; word-wrap: normal;">SENHA: s3nh42015!@#
~# cat /etc/shadow
root:!:16440:0:99999:7:::
daemon:*:16273:0:99999:7:::
bin:*:16273:0:99999:7:::
sys:*:16273:0:99999:7:::
sync:*:16273:0:99999:7:::
games:*:16273:0:99999:7:::
man:*:16273:0:99999:7:::
lp:*:16273:0:99999:7:::
mail:*:16273:0:99999:7:::
news:*:16273:0:99999:7:::
uucp:*:16273:0:99999:7:::
proxy:*:16273:0:99999:7:::
www-data:*:16273:0:99999:7:::
backup:*:16273:0:99999:7:::
list:*:16273:0:99999:7:::
irc:*:16273:0:99999:7:::
gnats:*:16273:0:99999:7:::
nobody:*:16273:0:99999:7:::
libuuid:!:16273:0:99999:7:::
syslog:*:16273:0:99999:7:::
messagebus:*:16273:0:99999:7:::
usbmux:*:16273:0:99999:7:::
dnsmasq:*:16273:0:99999:7:::
avahi-autoipd:*:16273:0:99999:7:::
kernoops:*:16273:0:99999:7:::
rtkit:*:16273:0:99999:7:::
saned:*:16273:0:99999:7:::
whoopsie:*:16273:0:99999:7:::
speech-dispatcher:!:16273:0:99999:7:::
avahi:*:16273:0:99999:7:::
lightdm:*:16273:0:99999:7:::
colord:*:16273:0:99999:7:::
hplip:*:16273:0:99999:7:::
pulse:*:16273:0:99999:7:::
danilo:$6$DgAOLzvU$Mt0WllW7AFJt5eFk0HPzjQNes/vvPkHaVmPIaWEb7K64uayPJ3CrEW8gjlBinh9Dzqj4RZXfRAN45XxrpWYjX.:16440:0:99999:7:::
~# python jameh.py --file wl.txt --threads 10 --salt '$6$DgAOLzvU' --hash '$Mt0WllW7AFJt5eFk0HPzjQNes/vvPkHaVmPIaWEb7K64uayPJ3CrEW8gjlBinh9Dzqj4RZXfRAN45XxrpWYjX.'
_ _
| | | |
| | __ _ _ __ ___ ___| |__
_ | |/ _` | '_ ` _ \ / _ \ '_ \
| |__| | (_| | | | | | | __/ | | |
\____/ \__,_|_| |_| |_|\___|_| |_|
[+] Author: Danilo Vaz a.k.a. UNK
[+] http://github.com/danilovazb
[+] http://unk-br.blogspot.com.br
PASS: s3nh42015!@#
Terminado</code></pre>
</div>
Danilo Vazhttp://www.blogger.com/profile/05961143854943568933noreply@blogger.com2tag:blogger.com,1999:blog-5775647478606965557.post-5889733938710709672015-06-10T11:58:00.001-07:002015-06-10T12:01:45.664-07:00SAWEF - Crawler de e-mail e de linksE ai galera, tranquilo?<br />
A alguns dias atrás eu criei uma ferramenta chamada SAWEF que realiza algumas funções em HTTP, tais como, enviar POST e GET, porém, vi uma oportunidade de expandir algumas funcionalidades dela a caráter de teste, então adicionei as funções abaixo, breve gravo um vídeo demonstrando.<br />
<br />
<pre style="background-color: #f7f7f7; border-radius: 3px; box-sizing: border-box; color: #333333; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; font-stretch: normal; line-height: 1.45; margin-bottom: 16px; overflow: auto; padding: 16px; word-wrap: normal;"><code style="background: transparent; border-radius: 3px; border: 0px; box-sizing: border-box; display: inline; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; line-height: inherit; margin: 0px; max-width: initial; overflow: initial; padding: 0px; word-break: normal; word-wrap: normal;">- Email Crawler in sites
- Crawler forms on the page
- Crawler links on web pages
- Sending POST and GET
- Support for USER-AGENT
- Support for THREADS
- Support for COOKIES</code></pre>
<br />
<b>GITHUB</b>: https://github.com/danilovazb/sawef<br />
<br />
<b>EXEMPLOS:</b><br />
<b><br /></b>
<b>PEGANDO EMAIL DAS PAGINAS</b><br />
$:> python sawef.py --url "http://pastebin.com/ajaYnLYc" --response emails<br />
[...]<br />
[+] EMAIL = manothradevi@yahoo.com<br />
[+] EMAIL = fantaghiroaziera@yahoo.com<br />
[+] EMAIL = naqibjohari@yahoo.com<br />
[+] EMAIL = azliey3036@yahoo.com<br />
[+] EMAIL = azlin_4531@yahoo.com.my<br />
[+] EMAIL = urshawal96@yahoo.com<br />
[+] EMAIL = weeta_aida88@yahoo.com.my<br />
FOUND = 3065<br />
<br />
<b>PEGANDO LINKS DAS PAGINAS</b><br />
$:> python sawef.py --url "http://terra.com.br" --response links<br />
[...]<br />
[+] LINK = http://uol.com.br/https://pagseguro.uol.com.br/vender<br />
[+] LINK = http://www.uolhost.com.br/registro-de-dominio.html<br />
[+] LINK = http://noticias.uol.com.br/arquivohome/<br />
[+] LINK = http://noticias.uol.com.br/erratas/<br />
[+] LINK = http://uol.com.br/#<br />
<br />
[+] FOUND = 360<br />
<div>
<br /></div>
<br />
<br />
Abaixo a descrição da ferramenta e como baixar:<br />
<br />
<h3 style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 1.5em; line-height: 1.43; margin-bottom: 16px; margin-top: 1em; position: relative;">
DESCRIPTION</h3>
<pre style="background-color: #f7f7f7; border-radius: 3px; box-sizing: border-box; color: #333333; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; font-stretch: normal; line-height: 1.45; margin-bottom: 16px; overflow: auto; padding: 16px; word-wrap: normal;"><code style="background: transparent; border-radius: 3px; border: 0px; box-sizing: border-box; display: inline; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; line-height: inherit; margin: 0px; max-width: initial; overflow: initial; padding: 0px; word-break: normal; word-wrap: normal;">The purpose of this tool is to be a Swiss army knife
for anyone who works with HTTP, so far it she is basic,
bringing only some of the few features that want her to have,
but we can already see in this tool:
- Email Crawler in sites
- Crawler forms on the page
- Crawler links on web pages
- Sending POST and GET
- Support for USER-AGENT
- Support for THREADS
- Support for COOKIES
</code></pre>
<h3 style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 1.5em; line-height: 1.43; margin-bottom: 16px; margin-top: 1em; position: relative;">
<a aria-hidden="true" class="anchor" href="https://github.com/danilovazb/sawef#requeriments" id="user-content-requeriments" style="box-sizing: border-box; color: #4078c0; display: block; left: 0px; line-height: 1.2; margin-left: -30px; padding-left: 30px; padding-right: 6px; position: absolute; text-decoration: none; top: 0px;"></a>REQUERIMENTS</h3>
<pre style="background-color: #f7f7f7; border-radius: 3px; box-sizing: border-box; color: #333333; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; font-stretch: normal; line-height: 1.45; margin-bottom: 16px; overflow: auto; padding: 16px; word-wrap: normal;"><code style="background: transparent; border-radius: 3px; border: 0px; box-sizing: border-box; display: inline; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; line-height: inherit; margin: 0px; max-width: initial; overflow: initial; padding: 0px; word-break: normal; word-wrap: normal;"> ----------------------------------------------------------
Import:
threading
time
argparse
requests
json
re
BeautifulSoup
permission Reading & Writing
User root privilege, or is in the sudoers group
Operating system LINUX
Python 2.7
----------------------------------------------------------
</code></pre>
<h3 style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 1.5em; line-height: 1.43; margin-bottom: 16px; margin-top: 1em; position: relative;">
<a aria-hidden="true" class="anchor" href="https://github.com/danilovazb/sawef#install" id="user-content-install" style="box-sizing: border-box; color: #4078c0; display: block; left: 0px; line-height: 1.2; margin-left: -30px; padding-left: 30px; padding-right: 6px; position: absolute; text-decoration: none; top: 0px;"></a>INSTALL</h3>
<pre style="background-color: #f7f7f7; border-radius: 3px; box-sizing: border-box; color: #333333; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; font-stretch: normal; line-height: 1.45; margin-bottom: 16px; overflow: auto; padding: 16px; word-wrap: normal;"><code style="background: transparent; border-radius: 3px; border: 0px; box-sizing: border-box; display: inline; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; line-height: inherit; margin: 0px; max-width: initial; overflow: initial; padding: 0px; word-break: normal; word-wrap: normal;">git clone http://github.com/danilovazb/SAWEF
sudo apt-get install python-bs4 python-requests
</code></pre>
<h3 style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 1.5em; line-height: 1.43; margin-bottom: 16px; margin-top: 1em; position: relative;">
<a aria-hidden="true" class="anchor" href="https://github.com/danilovazb/sawef#help" id="user-content-help" style="box-sizing: border-box; color: #4078c0; display: block; left: 0px; line-height: 1.2; margin-left: -30px; padding-left: 30px; padding-right: 6px; position: absolute; text-decoration: none; top: 0px;"></a>HELP</h3>
<pre style="background-color: #f7f7f7; border-radius: 3px; box-sizing: border-box; color: #333333; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; font-stretch: normal; line-height: 1.45; margin-bottom: 16px; overflow: auto; padding: 16px; word-wrap: normal;"><code style="background: transparent; border-radius: 3px; border: 0px; box-sizing: border-box; display: inline; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; line-height: inherit; margin: 0px; max-width: initial; overflow: initial; padding: 0px; word-break: normal; word-wrap: normal;">usage: tool [-h] --url http://url.com/
[--user_agent '{"User-agent": "Mozilla/5.0 Windows; U; Windows NT 5.1; hu-HU; rv:1.7.8 Gecko/20050511 Firefox/1.0.4"}"]
[--threads 10] [--data '{"data":"value","data1":"value"}']
[--qtd 5] [--method post|get]
[--referer '{"referer": "http://url.com"}']
[--response status_code|headers|encoding|html|json|form]
[--cookies '{"__utmz":"176859643.1432554849.1.1.utmcsr=direct|utmccn=direct|utmcmd=none"}']
optional arguments:
-h, --help show this help message and exit
--url http://url.com/
URL to request
--user_agent '{"User-agent": "Mozilla/5.0 (Windows; U; Windows NT 5.1; hu-HU; rv:1.7.8) Gecko/20050511 Firefox/1.0.4"}"
For a longer list, visit:
http://www.useragentstring.com/pages/useragentstring.php
--threads 10 Threads
--data '{"data":"value","data1":"value"}'
Data to be transmitted by post
--qtd 5 Quantity requests
--method post|get
Method sends requests
--referer '{"referer": "http://url.com"}'
Referer
--response status_code|headers|encoding|html|json|form
Status return
--cookies '{"__utmz":"176859643.1432554849.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)"}'
Cookies from site
</code></pre>
<h3 style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 1.5em; line-height: 1.43; margin-bottom: 16px; margin-top: 1em; position: relative;">
<a aria-hidden="true" class="anchor" href="https://github.com/danilovazb/sawef#example" id="user-content-example" style="box-sizing: border-box; color: #4078c0; display: block; left: 0px; line-height: 1.2; margin-left: -30px; padding-left: 30px; padding-right: 6px; position: absolute; text-decoration: none; top: 0px;"></a>EXAMPLE</h3>
<pre style="background-color: #f7f7f7; border-radius: 3px; box-sizing: border-box; color: #333333; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; font-stretch: normal; line-height: 1.45; margin-bottom: 16px; overflow: auto; padding: 16px; word-wrap: normal;"><code style="background: transparent; border-radius: 3px; border: 0px; box-sizing: border-box; display: inline; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; line-height: inherit; margin: 0px; max-width: initial; overflow: initial; padding: 0px; word-break: normal; word-wrap: normal;">*Send 1 SMS anonymous to POST [in BR]:
-------------
$:> python sawef.py --url "https://smsgenial.com.br/forms_teste/enviar.php" --data '{"celular":"(11) XXXX-XXXXX","mensagem":"Teste","Testar":"Enviar"}' --threads 10 --qtd 1 --user_agent '{"User-agent":"Mozilla/5.0 Windows; U; Windows NT 5.1; hu-HU; rv:1.7.8) Gecko/20050511 Firefox/1.0.4"}'
*List Form attributes:
-------------
$:> python sawef.py --url "https://smsgenial.com.br/" --method post --response form
OUTPUT:
--------------------------------
NOME_FORM[None]
URL[http://paineldeenvios.com/painel/app/login/login.php]
METHOD[post]
email:Digite Seu Login (text)
passwd:Senha (password)
Entrar:Entrar (submit)
--------------------------------
NOME_FORM[form1]
URL[/forms_teste/criaruser.php]
METHOD[post]
action:criarconta (hidden)
nome:<none> (text)
celular:<none> (text)
email:<none> (text)
Testar:Criar (submit)
Testar:Enviar (hidden)
--------------------------------
NOME_FORM[None]
URL[/forms_teste/enviar.php]
METHOD[post]
celular:<none> (text)
Testar:Enviar (submit)
* Get email web pages
$:> python sawef.py --url "http://pastebin.com/ajaYnLYc" --response emails
[...]
[+] EMAIL = manothradevi@yahoo.com
[+] EMAIL = fantaghiroaziera@yahoo.com
[+] EMAIL = naqibjohari@yahoo.com
[+] EMAIL = azliey3036@yahoo.com
[+] EMAIL = azlin_4531@yahoo.com.my
[+] EMAIL = urshawal96@yahoo.com
[+] EMAIL = weeta_aida88@yahoo.com.my
FOUND = 3065
* Get links on web pages
$:> python sawef.py --url "http://terra.com.br" --response links
[...]
[+] LINK = http://uol.com.br/https://pagseguro.uol.com.br/vender
[+] LINK = http://www.uolhost.com.br/registro-de-dominio.html
[+] LINK = http://noticias.uol.com.br/arquivohome/
[+] LINK = http://noticias.uol.com.br/erratas/
[+] LINK = http://uol.com.br/#
[+] FOUND = 360
</none></none></none></none></code></pre>
<h3 style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 1.5em; line-height: 1.43; margin-bottom: 16px; margin-top: 1em; position: relative;">
<a aria-hidden="true" class="anchor" href="https://github.com/danilovazb/sawef#screenshot" id="user-content-screenshot" style="box-sizing: border-box; color: #4078c0; display: block; left: 0px; line-height: 1.2; margin-left: -30px; padding-left: 30px; padding-right: 6px; position: absolute; text-decoration: none; top: 0px;"></a>SCREENSHOT</h3>
<div style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;">
<a href="https://camo.githubusercontent.com/200a51621d74f3a0f9831b7219f37c5842ccdffc/68747470733a2f2f756e6b6e6f776e7365632e66696c65732e776f726470726573732e636f6d2f323031352f30362f73637265656e73686f742e706e67" style="box-sizing: border-box; color: #4078c0; text-decoration: none;" target="_blank"><img alt="Screenshot" data-canonical-src="https://unknownsec.files.wordpress.com/2015/06/screenshot.png" src="https://camo.githubusercontent.com/200a51621d74f3a0f9831b7219f37c5842ccdffc/68747470733a2f2f756e6b6e6f776e7365632e66696c65732e776f726470726573732e636f6d2f323031352f30362f73637265656e73686f742e706e67" style="border: 0px; box-sizing: border-box; max-width: 100%;" /></a></div>
Danilo Vazhttp://www.blogger.com/profile/05961143854943568933noreply@blogger.com0tag:blogger.com,1999:blog-5775647478606965557.post-89835453926921636642015-06-01T13:53:00.001-07:002015-06-02T21:30:51.851-07:00Send Attack Web Forms - ToolHey guys, all beauty?<br />
Lately I've been using many scripts to test some parameters in POST and GET, this demand grew a bit, i decided to craft this tool, it is available on Github in GPL license.<br />
<br />
Basically it does POST with some basic parameters, and change the HEADER, COOKIES and NUMBER OF SUBMISSIONS.<br />
<br />
<b><span style="color: red;">[EDIT] </span></b>Consult attributes of a form in an HTML page and set the POST or GET request method <b><span style="color: red;">[/EDIT]</span></b><br />
<div>
<br /></div>
Tool:<br />
https://github.com/danilovazb/SAWEF<br />
<br />
<h1 style="border-bottom-color: rgb(238, 238, 238); border-bottom-style: solid; border-bottom-width: 1px; box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 2.25em; line-height: 1.2; margin-bottom: 16px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important; padding-bottom: 0.3em; position: relative;">
SAWEF - Send Attack Web Forms</h1>
<h1 style="border-bottom-color: rgb(238, 238, 238); border-bottom-style: solid; border-bottom-width: 1px; box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 2.25em; line-height: 1.2; margin: 1em 0px 16px; padding-bottom: 0.3em; position: relative;">
</h1>
<pre style="background-color: #f7f7f7; border-radius: 3px; box-sizing: border-box; color: #333333; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; font-stretch: normal; line-height: 1.45; margin-bottom: 16px; overflow: auto; padding: 16px; word-wrap: normal;"><code style="background: transparent; border-radius: 3px; border: 0px; box-sizing: border-box; display: inline; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; line-height: inherit; margin: 0px; max-width: initial; overflow: initial; padding: 0px; word-break: normal; word-wrap: normal;">Danilo Vaz - UNK
danilovazb@gmail.com
http://unk-br.blogspot.com
https://twitter.com/unknownantisec
</code></pre>
<ul style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px; margin-bottom: 16px; margin-top: 0px; padding: 0px 0px 0px 2em;">
<li style="box-sizing: border-box;">REQUERIMENTS</li>
</ul>
<pre style="background-color: #f7f7f7; border-radius: 3px; box-sizing: border-box; color: #333333; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; font-stretch: normal; line-height: 1.45; margin-bottom: 16px; overflow: auto; padding: 16px; word-wrap: normal;"><code style="background: transparent; border-radius: 3px; border: 0px; box-sizing: border-box; display: inline; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; line-height: inherit; margin: 0px; max-width: initial; overflow: initial; padding: 0px; word-break: normal; word-wrap: normal;"> ----------------------------------------------------------
threading
time
argparse
requests
json
BeautifulSoap
permission Reading & Writing
User root privilege, or is in the sudoers group
Operating system LINUX
Python 2.7
----------------------------------------------------------
</code></pre>
<ul style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px; margin-bottom: 16px; margin-top: 0px; padding: 0px 0px 0px 2em;">
<li style="box-sizing: border-box;">INSTALL</li>
</ul>
<pre style="background-color: #f7f7f7; border-radius: 3px; box-sizing: border-box; color: #333333; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; font-stretch: normal; line-height: 1.45; margin-bottom: 16px; overflow: auto; padding: 16px; word-wrap: normal;"><code style="background: transparent; border-radius: 3px; border: 0px; box-sizing: border-box; display: inline; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; line-height: inherit; margin: 0px; max-width: initial; overflow: initial; padding: 0px; word-break: normal; word-wrap: normal;">git clone http://github.com/danilovazb/SAWEF
sudo apt-get install python-bs4 python-requests
</code></pre>
<ul style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px; margin-bottom: 16px; margin-top: 0px; padding: 0px 0px 0px 2em;">
<li style="box-sizing: border-box;">HELP</li>
</ul>
<pre style="background-color: #f7f7f7; border-radius: 3px; box-sizing: border-box; color: #333333; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; font-stretch: normal; line-height: 1.45; margin-bottom: 16px; overflow: auto; padding: 16px; word-wrap: normal;"><code style="background: transparent; border-radius: 3px; border: 0px; box-sizing: border-box; display: inline; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; line-height: inherit; margin: 0px; max-width: initial; overflow: initial; padding: 0px; word-break: normal; word-wrap: normal;">usage: tool [-h] --url http://url.com/
[--user_agent '{"User-agent": "Mozilla/5.0 Windows; U; Windows NT 5.1; hu-HU; rv:1.7.8 Gecko/20050511 Firefox/1.0.4"}"]
[--threads 10] [--data '{"data":"value","data1":"value"}']
[--qtd 5] [--method post|get]
[--referer '{"referer": "http://url.com"}']
[--response status_code|headers|encoding|html|json|form]
[--cookies '{"__utmz":"176859643.1432554849.1.1.utmcsr=direct|utmccn=direct|utmcmd=none"}']
optional arguments:
-h, --help show this help message and exit
--url http://url.com/
URL to request
--user_agent '{"User-agent": "Mozilla/5.0 (Windows; U; Windows NT 5.1; hu-HU; rv:1.7.8) Gecko/20050511 Firefox/1.0.4"}"
For a longer list, visit:
http://www.useragentstring.com/pages/useragentstring.php
--threads 10 Threads
--data '{"data":"value","data1":"value"}'
Data to be transmitted by post
--qtd 5 Quantity requests
--method post|get
Method sends requests
--referer '{"referer": "http://url.com"}'
Referer
--response status_code|headers|encoding|html|json|form
Status return
--cookies '{"__utmz":"176859643.1432554849.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)"}'
Cookies from site
</code></pre>
<ul style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px; margin-bottom: 16px; margin-top: 0px; padding: 0px 0px 0px 2em;">
<li style="box-sizing: border-box;">EXAMPLE</li>
</ul>
<pre style="background-color: #f7f7f7; border-radius: 3px; box-sizing: border-box; color: #333333; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; font-stretch: normal; line-height: 1.45; margin-bottom: 16px; overflow: auto; padding: 16px; word-wrap: normal;"><code style="background: transparent; border-radius: 3px; border: 0px; box-sizing: border-box; display: inline; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6000003814697px; line-height: inherit; margin: 0px; max-width: initial; overflow: initial; padding: 0px; word-break: normal; word-wrap: normal;">*Send 1 SMS anonymous to POST [in BR]:
-------------
$:> python sawef.py --url "https://smsgenial.com.br/forms_teste/enviar.php" --data '{"celular":"(11) XXXX-XXXXX","mensagem":"Teste","Testar":"Enviar"}' --threads 10 --qtd 1 --user_agent '{"User-agent":"Mozilla/5.0 Windows; U; Windows NT 5.1; hu-HU; rv:1.7.8) Gecko/20050511 Firefox/1.0.4"}'
*List Form attributes:
-------------
$:> python sawef.py --url "https://smsgenial.com.br/ --method post --response form
OUTPUT:
--------------------------------
NOME_FORM[None]
URL[http://paineldeenvios.com/painel/app/login/login.php]
METHOD[post]
email:Digite Seu Login (text)
passwd:Senha (password)
Entrar:Entrar (submit)
--------------------------------
NOME_FORM[form1]
URL[/forms_teste/criaruser.php]
METHOD[post]
action:criarconta (hidden)
nome:<none> (text)
celular:<none> (text)
email:<none> (text)
Testar:Criar (submit)
Testar:Enviar (hidden)
--------------------------------
NOME_FORM[None]
URL[/forms_teste/enviar.php]
METHOD[post]
celular:<none> (text)
Testar:Enviar (submit)
</none></none></none></none></code></pre>
<ul style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px; margin-bottom: 0px !important; margin-top: 0px; padding: 0px 0px 0px 2em;">
<li style="box-sizing: border-box;">SCREENSHOT <a href="https://camo.githubusercontent.com/200a51621d74f3a0f9831b7219f37c5842ccdffc/68747470733a2f2f756e6b6e6f776e7365632e66696c65732e776f726470726573732e636f6d2f323031352f30362f73637265656e73686f742e706e67" style="box-sizing: border-box; color: #4078c0; text-decoration: none;" target="_blank"><img alt="Screenshot" data-canonical-src="https://unknownsec.files.wordpress.com/2015/06/screenshot.png" src="https://camo.githubusercontent.com/200a51621d74f3a0f9831b7219f37c5842ccdffc/68747470733a2f2f756e6b6e6f776e7365632e66696c65732e776f726470726573732e636f6d2f323031352f30362f73637265656e73686f742e706e67" style="border: 0px; box-sizing: border-box; max-width: 100%;" /></a></li>
</ul>
Danilo Vazhttp://www.blogger.com/profile/05961143854943568933noreply@blogger.com2