Consult CPF at IRS

3

I would like to somehow check the person's name through the CPF on the recipe site. There are applications on android that just put the CPF and it brings the name and the cadastral situation. But the site has a captcha.

Has anyone ever done anything like this?

in php, jquery

    
asked by anonymous 01.07.2015 / 22:09

2 answers

6

I was in doubt about answering this question, passing knowledge is never too much, who reads decides if it will implement and about any illegalities, I will only address how technically it would be possible to go through such systems.

First of all you really will need to build a robot that automates the methods to go through Captcha, nowadays the vast majority of the options are image and audio.

Image

Dovisualanalysisandtrytofindoutwhatthepatternsare,justbyobserving(givingrefreshseveraltimesincaptcha)youcanconcludethatnoiseseemstobeaproblem,butwhatcouldyoudotoimproveit?unfortunatelydonotexpecttofindanythingreadyyouwillhavetodevelopthealgorithms,anteensurethattheimageisactuallyblackandwhite,lookforblackpixelsconnectedandremoveconnectedpixelssmallerthananXsize,thiswillclearalldotsintheimage,thenextstepwouldnowbetoremovethelinesthatcutandsometimescrossthelettersoftheimage,onesolutionistolookinthematrixoftheimagewhichblackpixelsareinstraightlineandcleanthepixelsthatareinstraightpathbiggerthanvalueXdefinedbyyou.Wellifyoudidthissuccessfullyyourimagewillbecleanandyoucansubmitittoa OCR , you will need to know a little bit about matrix calculations and about signal processing in images.

Audio

ThisAudiosaysNHJKHj

Thereisnotmuchalternativeyouwillneedtoanalyzeandtreattheaudiotoo,firststep,hasalotofnoiseandsqueakswhenyoulistentotheaudio,thefirstproblemisaloudnoisethatismostnoticeablebetweeneachspokenletter,thisisanattempttoconfusealgorithmsthattrytosegment(cut)eachletterbydoingananalysisof fourier in first 2048 frames I can tell at what frequencies and what is the average amplitude that generates this strange noise:

Well,it'sareallynoise,frequenciesoscillatingacrossthespectrumandwithalinearpeakatabout78magnitude,butonaveragethefrequenciesoscillatebelow10magnitude.

OK,butwhatifyoudoanotherfourieranalysisonthefirstletterN:

Whatyoucandohereistouseahighpassfilterandletonlyfrequenciespassabove50Hz(50Hzistheminimumthatthehumanvoiceemits),soyoufacealreadycancelsoutanynoisehappeninginthelowfrequencies,between120and600hertzyounoteasfortheletterNthefrequenciesareconcentratedmore,ifyoumakeananalysisonalltheaudiolettersofthiscaptchawillnotfindfrequencieshigherthan1000hz,wecanthenbuildanequalizerthatattenuatesoreliminatenoiseshappeningaboveofthistrack,thiswillgiveyouacleaneraudio,untilthenyoujusthandledtheaudio,youwillneedtoextractandtreattheaudioforeachletterinthehandtype(A.wav,B.wav),donethisautomatetheprocess,makeanalgorithmthatsegmentstheaudioautomaticallybytrimmingwhereeachletterbeginsandends,treatitasitdidwiththefilesofeachletter,andcalculatethe cross correlation , the result of this correlation will tell you what the letter is.

In short there is no easy way, you will have a great job and there is still a risk that the site will change the captcha system (algorithm).

    
03.08.2015 / 18:25
2

I recently did this in C #, but I did not "go over" the CAPTCHA, I brought the image and asked the user to type, just like it is on the web site, however within my application.

I saw one day a solution that "broke" the CAPTCHA, but I believe it to be somewhat illegal and therefore I will not even indicate (it was also in C #). The guy had reverse engineered an Android APK and got the application key, used in the requests to search.

I think there are already solutions ready on the internet, but if you want to implement yours, it's like @CiganoMorrisonMendez said. You will do so called web scrapping by reading information from a web page and sending requests directly to their server, simulating the action in the browser.

For this, you will probably use the CURL function. I also advise using Fiddler to inspect the requests and understand the traffic flow of the information.

Hug.

    
02.07.2015 / 16:29