7/25/2016

LINUX: จะรู้ได้อย่างไร ว่าเรา ถูก HACK

            หลังจาก hacker ได้ทำการ compromise ระบบแล้วนั้น ส่วนใหญ่ hacker จะไม่ทำการลบข้อมูลหรือทำอะไรที่จะเป็นผลเสียต่อระบบ ของท่าน แต่ hackers จะทำการติดตั้ง back door ในระบบซึ่งทำให้ hacker สามารถเข้าถ้าระบบในฐานะ root หรือบางที hacker อาจใช้ระบบของท่านในการโจมตีระบบอื่นๆต่อไป

เพราะฉะนั้นหากท่านประสบปัญหาอย่างเช่น ระบบของท่านเกิดช้าขึ้นมาอย่างผิดปกติแต่เมื่อท่านได ้ทำการตรวจสอบ disk space และ process แล้วก็ไม่มีสิ่งใดผิดปกติ checklist ต่อไปนี้คือสิ่งที่ท่านควรตรวจสอบเพื่อบอกว่าระบบของ ท่านถูก hacked หรือไม่

1. เหตุการณ์หรือสัญญาณที่ผิดปกติ

ถ้าท่านไม่สามารถทำการ ssh, telnet หรือ login เข้าสู่เครื่องได้เป็นสิ่งบอกเหตุว่าท่านอาจจะถูก hacked ได้
ท่านควรจะทำการตรวจสอบเหตุต่างๆ ที่ไม่สามารถอธิบาย เช่น network ซึ่งผิดปกติ resource ถูกใช้ไปเยอะมากทั้งที่มี users เข้าใช้อยู่เพียงไม่กี่คน
ควรตรวจสอบ /etc/password file ว่ามี account ใดบ้างที่เพิ่งถูกเพิ่มเข้ามาโดยที่คุณไม่ได้ทำการเพ ิ่มเอง รวมทั้งตรวจสอบ accounts ที่ไม่มี password หรือ UID ถูก set ให้เท่ากับ "0"
2. ตรวจหา sniffer


เนื่องจาก sniffer จะทำให้ network interface รับ packet ทุกชนิดที่เข้ามาและทำการบันทึก packet ซึ่งประกอบด้วย username และ password ของ ftp และ telnet แม้ว่าท่านจะแก้ปัญหานี้โดยการใช้ switching แทน hub แต่ถ้าเครื่องดังกล่าวเป็น Internet gateway แล้วปัญหาก็ไม่ได้หมดไป ท่านสามารถทำการ check promiscoous mode ได้โดย # ifconfig - a/grep PROMISC


แต่มี rootkit บางตัวที่ทำการเปลี่ยนแปลง ifconfig เพื่อหลบซ่อนจากการใช้ parameters นี้ เพื่อความแน่ใจให้ท่าน run antisniff http://www.securitysoftwaretech.om/antisniff/ จาก remote machine

3. ตรวจสอบ logs

ทำการตรวจสอบ log files โดยการใช้คำสั่ง last เพื่อที่จะ list logins ท้ายๆออกมาแล้วตรวจสอบว่ามี unknown users หรือ usernames ที่แปลกๆหรือไม่ รวมทั้ง access time ของแต่ละ user ด้วยว่ามีความผิดปกติหรือไม่

# last | head

ตรวจสอบ message file ใน /var/log/ (สำหรับ Linux) หรือ /var/adm/ (สำหรับ Solaris)
รวมทั้งตรวจสอบ log files อื่นๆ ซึ่งใช้โดย syslog (โดยดูจาก /etc/syslog.conf) โดยการ grep su failures ทั้งหลายและเหตุการณ์ที่ vid = 0

# grap "vid = 0" /var/log/
และ
# grep "su" /var/log/


log files ซึ่งมีขนาดเท่ากับ "0" ก็อาจเป็นสัญญาณของการถูกบุกรุกเช่นเดียวกัน
เนื่องจาก rootkit ใหม่ๆ จะทำการลบ usermane จาก wtmp, utmp และ lastlog files เพราะฉะนั้นหากท่านไม่ได้ใช้อุปกรณ์ที่เรียกว่า write once read many เช่น CD-R ในการบันทึก log files ท่านไม่ควรไว้ใจ log files เท่าใดนัก
4. ไม่ควรเชื่อ ps command

ตรวจสอบชื่อและจำนวนของ running processes และพยายามหา processes ที่ไม่ค่อยคุ้น ข้อแปลกๆ หรือ startup time ที่ไม่ค่อยปกติ รวมทั้ง process ที่ใช้ CPU time มากๆอย่างไรก็ตามโดยปกติแล้วผู้บุกรุกจะ run sniffers อยู่ภายใต้ daemon ปกติ เช่น sendmail หรือ named และ rootkits โดยส่วนใหญ่ก็จะทำการเปลี่ยนแปลง ps และ pidof เพื่อที่จะหลบซ่อน process ของพวกเขา ดังนั้นท่านควรจะเปรียบเทียบระหว่างผลลัพธ์ของ ps กับผลลัพธ์ใน /proc เช่น

#ps --no-headers -ef | wc

เมื่อท่าน run คำสั่งต่อไปนี้ใน RedHat 7.0 # ps - -no- headers- ef | wc แล้วผลต่างกันกับที่ run # ls - d /proc/ [0-9]* นั่นคืออาจมี process ที่แอบซ่อนอยู่
ในระบบ Solaris อาจใช้คำสั่ง crash เพื่อที่จะแสดง list ของ processes แล้วเปรียบเทียบกับ ps output
violin $ crash dumpfile = /dev/mem, namelist = /dev/ksyms, outfile = stdout > proc
หรือท่านอาจจะติดตั้งและ run Isof ftp://vic.cc.purdue.edu/pub/tools/ ซึ่งโปรแกรมนั้นจะบอกท่านว่า process ไหนกำลังใช้ files อะไร

5. ตรวจสอบ ports

ทำการ scan ports ของเครื่องโดยใช้ port scanner เช่น nmap [http://www.insecure.org/nmap/ ซึ่งค่า defaults ของ nmap นั้นคือ port1-1024 แต่ trojan horses ส่วนใหญ่จะใช้ ports ที่สูงกว่านั้น หากท่านต้องการเฉพาะเจาะจง ports ที่ต้องการจะ scan ให้ใช้ option-p เช่น


# nmap - p 1 - 65535 your_machin_address
หลังจากนั้น ให้ทำการใช้คำสั่ง netstat -a เพื่อตรวจสอบ port ที่เปิดอยู่บนเครื่องนั้นๆ
# netstat -a

หากพบว่ามี ports ที่ปรากฎใน output ของการใช้ nmap แต่ไม่ปรากฎใน output เมื่อใช้คำสั่ง netstat นั้นอาจหมายถึง netstat ได้ถูกเปลี่ยนแปลงเพื่อหลบซ่อน service บางอย่าง

6. ตรวจสอบ binaries

rootkits ส่วนใหญ่จะทำการเปลี่ยนแปลง system binaries เพื่อทำการหลบซ่อน file, sniffer หรือ port ที่ถูกเปิดอยู่ บน RedHat ท่านสามารถตรวจสอบ binaries ได้โดยใช้คำสั่ง


altis $ rpm - va | grep '1...5'
ซึ่งผลลัพธ์ที่เกิดขึ้นอาจเป็นลักษณะนี้คือ
s.5.....T c/etc/services
s.5....T c/etc/info-dir
s.5....T c/etc/inetd.conf
นั้นหมายถึงขนาดของ file เปลี่ยน (5)
MD5 checksum เปลี่ยน (5)
และเวลาที่ได้รับการเปลี่ยนแปลงถูกเปลี่ยน (T)

บนระบบซึ่งเป็น UNIX ท่านสามารถใช้คำสั่ง find ค้นหา files ที่ถูกเปลี่ยนแปลงในช่วงเวลาหนึ่งๆ ส่วน option ที่ใช้น่าจะใช้ -ctime option ดังนี้

# find/ bin -ctime -7

แต่วิธีที่ดีที่สุดคือใช้คำสั่ง cmp แล้วเปรียบเทียบ วันที่ ขนาดของไฟล์ และ time-stamp ของ system files กับ machine ที่เป็น clean machine และใช้ OS ประเภทเดียวกันซึ่งโดยปกติ binaries files ที่ถูกเปลี่ยนคือ

chsh, crontab, du, df, find, ifconfig, inedd, killall, login, ls, netstat, passwd, ps, sshd, syslogd และ top

ท่านสามารถใช้โปรแกรม tripwire หรือ samhain เพื่อให้แจ้งเตือนเมื่อ system files ถูกเปลี่ยนแปลง

Tripwire http://www.tripwire.org
samhain http://samhain.sourceforge.net


7. ตรวจสอบ Config Files

ท่านควรตรวจสอบ files ซึ่งถูกเปลี่ยนแปลงบ่อยๆได้แก่

/etc/inetd.conf file
หรือ
/etc/xinetd.conf file
หรือ
/etc/xinetd.d directory

พยายามตรวจดู service ที่เพิ่มเข้ามา ถูกเปลี่ยนแปลงหรือเป็น service ที่ท่านไม่คุ้นเคย


/etc/hosts.eguiv, ~/.rhosts

พยายามตรวจดู creationdate และ "+" รวมทั้ง host names ที่ท่านไม่คุ้นเคย

/dev/* เนื่องจากมี rootkits บางประเภทที่จะติดตั้ง configuration files ใน /dev/ ท่านสามารถตรวจสอบ text files ใน /dev directory ได้ดัวนี้

# file /dev/* | grep text
/ dev/ ptyp : ASCIItext
/ dev/ ptyq : ASCIItext
/ dev/ ptyr : ASCIItext


จากตัวอย่างนี้ท่านจะเห็นว่า rootkit ได้ใช้ text file ptyr เพื่อจะหลบซ่อนจาก command lsใช้ ptyq เพื่อจะลบ sockets/ addresses ออกจาก netstat และใช้ ptyq เพื่อจะลบ processes ออกจาก ps

ในฐานะ root ให้ท่าน run crontab - l and atq เพื่อตรวจดูว่ามีโปรแกรมใดที่กำลังรอการทำงานอยู่หรื อไม่

8. ตรวจสอบ setuid, setgid และไฟล์อื่นๆที่หลบซ่อนอยู่

ทำ setuid และ setgid files จะ run อยู่ในฐานะ root แม้ว่าจะถูก executed โดย user ธรรมดาก็ตาม
หากท่านต้องการค้นหา setuid files ให้ใช้คำสั่ง

# find / - perm -4000 -print

และในการค้นหา setgid ให้ใช้คำสั่ง

# find / -perm -2000 -print

โดยปกติแล้วผู้บุกรุกจะแอบซ่อน setuid files และ tools ท่านไว้ใน hidden directories ท่านสามารถตรวจสอบหา files ที่แอบซ่อนอยู่ได้โดยใช้คำสั่ง find

# find / -name " . * "

หรือบางทีผู้บุกรุกจะเลือก directory ไปในการแอบซ่อน files เช่น ~/ gnome, ~/.xauth เหล่านี้เป็นต้น

CREDIT: http://hosxp.net/smf2/index.php?topic=10974.0

7/21/2016

The Visual Microphone: Passive recovery of sound from video.

In a study conducted by MIT researcher Abe Davis, vibrations caused by sound are extracted using high-speed video, turning everyday objects into "visual microphones." (YouTube/Abe Davis)
Imagine someone listening in to your private conversation by filming the bag of chips sitting on the other side of the room. Oddly specific, I know, but researchers at MIT did just that: They've created an algorithm that can reconstruct sound (and even intelligible speech) with the tiny vibrations it causes on video.
When sound hits an object, it makes distinct vibrations. “There’s this very subtle signal that’s telling you what the sound passing through is,” said Abe Davis, a graduate student in electrical engineering and computer science at MIT and first author on the paper. But the movement is tiny – sometimes as small as thousandths of a pixel on video. It’s only when all of these signals are averaged, Davis said, that you can extract sound that makes sense. By observing the entire object, you can filter out the noise.
This particular study grew out of an earlier experiment at MIT, led by Michael Rubinstein, now a postdoctoral researcher at Microsoft Research New England. In 2012, Rubinstein amplified tiny variationsin video to detect things like the skin color change caused by the pumping of blood. Studying the vibrations caused by sound was a logical next step. But getting intelligible speech out of the analysis was surprising, Davis said.
The results are certainly impressive (and a little scary). In one example shown in a compilation video, a bag of chips is filmed from 15 feet away, through sound-proof glass. The reconstructed audio of someone reciting “Mary Had a Little Lamb” in the same room as the chips isn’t crystal clear. But the words being said are possible to decipher.
In most cases, a high-speed camera is necessary to accomplish the feat. Still, at 2,000 to 6,000 frames per second, the camera used by the researchers is nothing compared to the best available on the market, which can surpass 100,000 frames per second. And the researchers found that even cheaper cameras could be used.
“It’s surprisingly possible to take advantage of a bug called rolling shutter,” Davis said. “Usually, it creates these artifacts in the image that people don’t like.” When cameras use rolling shutter to capture an image, they don’t capture one single point in time. Instead, the camera scans across the frame in one direction, picking up each row at a slightly different moment.
By doing so, the camera happens to encode information at a much higher rate than its actual frame rate. For the researchers, that meant being able to analyze vibrations that should have happened too quickly for capture on film. “It kind of turns a two-dimensional low-speed camera into a one-dimensional high-speed camera,” Davis explained. “As a result, we can recover sounds happening at frequencies several times higher than the frame rate of the camera, which is remarkable when you consider that it’s just a complete accident of the way we make them.”
There are definitely limitations to the technology, Davis said, and it may not make for better sound reconstruction than other methods already in use. “Big brother won't be able to hear anything that anyone ever says all of a sudden,” Davis said. “But it is possible that you could use this to discover sound in situations where you couldn’t before. It’s just adding one more tool for those forensic applications.”
Davis and his colleagues care more about applications in scientific research. “This is a new dimension to how you can image objects,” he said. “It tells you something about how they respond physically to pressure, but instead of poking and prodding at them, all you need is to play sound at them.”

7/11/2016

PHP Frameworks: The Best 10 for Modern Web Development

PHP Frameworks: The Best 10 for Modern Web Development

​
best php frameworks
PHP web frameworks have an ecosystem of their own in the world of web development. PHP frameworks are used to build websites and web applications of all sizes and complexity, ranging from small static websites to large scale complex enterprise content management systems.
PHP is the language of choice for web development with almost 80% of all the existing websites breathing on PHP code. It would have been next to impossible to create such a huge web footprint by developing web applications using raw PHP code from scratch. It is the power of PHP frameworks that has fueled such a massive growth. 
Why Use PHP Web Framework?
When we look at modern web development needs, the key to success is speed development with well organized, reusable and maintainable code, all the while ensuring scalability. The best way to achieve this is by using an existing, proven PHP framework.
Frameworks offer ready to use components, libraries, enforce proven architecture, ensure separation of model, view and controller logic (MVC paradigm), abstract you away from the low level security concerns, enforce file and code structure, and the list is quite long. In short, PHP frameworks make web development fun and make you more productive.
Selecting the right framework, however, can be challenging at times. In an attempt to make the selection process a little easier, we haveanalyzed most of the PHP frameworks out there in the wild and listed below the 10 best.
These are the frameworks that are actively maintained, popular among developer community, promote modern web development practices and make it possible to build websites and web applications of all sizes and complexity.

Laravel

Laravel is undisputedly the king of PHP frameworks and spans the widths and depths of large scale web application development. Laravel ecosystem has quickly grown huge with supportive community and boasts tons of free tutorials and learning resources to get you started within no time.
Laravel is built to be simple, easy to learn and supports rapid application development. You get rich set of features to bring any large scale project to life within days. Laravel comes with its own templating engine named “Blade”. The best thing about Blade is that it allows you to write plain PHP in the templates which essentially means that Blade brings no performance overheads to your application.
Another power fact about Laravel is the inclusion of “Homestead” which is the packaged Vagarant box to let you start development without the hassles of installing web server, HHVM, PHP or any other package on your local machine or server.
New to the world of Laravel or PHP development, no problems, there is a dedicated website named Laracasts.com that hosts hundreds of PHP video tutorials. You can access the basic tutorials as well as most advanced ones to master Laravel at a very minimal cost. 
Laravel team has recently released “Lumen”, a micro PHP framework for the web developers who like to build lightning fast API’s as well as Laravel based services.
You can read more about Laravel at - Laravel.com.

Symfony 

Do you have a very complex and large scale enterprise project at hand? If yes, then Symfony 2 is the one framework to get your job done right. Symfony ecosystem as a whole consists of large set of reusable components, vibrant and active community, Symfony framework and a philosophy to take PHP to the next level.
Symfony framework gets all the super powers from the reusable and decoupled set of components it packs within. The power features of Symfony components can be guessed from the fact that even the big brother Laravel utilizes many of Symfony components.
Symfony components fuel some of the largest open source projects like Drupal, PHPBB, PIWIk, OROCRM and Laravel, to name a few. Symfony components also power one of the most popular templating engine named “Twig”.
Symfony framework was first released back in 2005 as open source PHP framework by interactive agency Sensiolabs. Symfony framework is available under MIT license and can be downloaded from its github repository - Github.com/symfony.
Read more about Symfony at - Symfony.com.
Symfony vs Laravel
In Short, I would go for Laravel for large scale rapid application development even with lesser experienced resources, but, if it is about complex enterprise grade application development, my preference would shift towards Symfony, with more skilled developers.

Phalcon

Phalcon is another modern framework and my personal favorite. Phalcon framework is built for speed, it is a PHP extension written in C and arguably the fastest PHP framework available as of today. Even though it is an extension written in C, it is full stack MVC framework and offers most of the modern features like routing, controllers, view templates, query language, Caching and ORM etc.
The framework beats all other frameworks by margins in performance, is easy to learn, brings in all features to develop web applications of any size and complexity, and PHP developers are loving it.
Phalcon is among the frameworks that have seen success in a very short span of time. It was released back in 2012 under BSD license and is a perfect candidate to complete for the top slot in the world of PHP frameworks.
Slightly underrated at the moment, but that is only because developers are finding it hard to accept that a framework is delivered as PHP extension, and written in C. Phalcon, otherwise is very well document with examples and beginners can easily get started with Phalcon PHP framework.
Read more about Phalcon framework at its official website - phalconphp.com.

Yii

Yii dates back to 2008 and is amongst the oldest of PHP frameworks. It was lagging behind Laravel and Symfony for last couple of years but with the release of Yii 2.0, it is fast becoming the preferred choice for enterprise grade web application development.
Yii 2.0 is a modern PHP framework with complete set of features to cater to the needs of modern websites and applications development. Yii also features a very powerful and best in class code generator tool called Gii.
Yii framework competes with none other than Symfony when it comes to building multitenant, secure and performant (powerful caching) applications that need complex workflows. CMS and CRM are among the categories where Yii shines along with Symfony.
Yii 2 community is very active, helpful and determined to take the Yii 2 framework to the next level. It also hosts one of the best documentation you will see in the world of PHP frameworks.
Yii 2 vs Symfony
Both Symfony and Yii2 are excellent frameworks and can deliver any modern large scale complex web application. I would personally select Symfony 2 for the shear elegance it brings on the table but at the cost of a bit more complexity. Yii 2 has more out of the box features, a little easier to grasp and can be selected for speed development instead of Symfony.
You can read more about Yii 2 at - Yiiframework.

Slim

PHP developers love Slim for developing Restful APIs and services, thanks to Josh Lockhart for creating this tiny beast. The best thing about starting with a micro framework like slim is that you don’t need to spend time learning it. The code base is so small that you can run through the entire code in a late night session.
Slim is an open source, sophisticated micro framework that comes with URL routing and best in class middleware architecture. It also supports encrypted cookies, flash messages, page templates and caching apart from many other features.
Slim framework is best suited in scenarios where you want to build simple applications or API’s grounds up with full flexibility in your hands. Slim resides at the core of your application and you write the code around as required or plug existing components from other frameworks to create fully functional web application.
Silex and Lumen are two other frameworks similar to Slim that fall into category of micro PHP frameworks.
You can read more about Slim at - Slimframework.com.

CakePHP

Another giant from the old times that doesn’t want to succumb in front of the most sophisticated modern PHP frameworks like Laravel and Phalcon. With the latest version “cakePHP 3.0”, this framework once again is back in demand and makes a definite point that it is here to stay.
CakePHP framework was originally released back in 2005 and is now available under MIT license. You can use it free of cost in personal, open source as well as commercial projects. CakePHP has held the spot of top PHP framework for a long time span and attracted corporates like BMW, Hyundai, Zumba and Express as its early users. Big names, isn’t it? That reflects the early life of this beast.
CakePHP 3.0 features enhanced session management, standalone libraries and decoupled components for better modularity, improvements in ORM and many helpers.
You can read more about cakePHP at - Cakephp.org.

FuelPHP

FuelPHP is relatively new entrant in the world of PHP frameworks, specifically when we compare it with the old giants like Codeigniter, Symfony, cakePHP and Yii. FuelPHP is a simple, flexible, full stack modern MVC framework that supports HMVC as well at architecture level. FuelPHP has not been able to make a big impact ever since its release and doesn’t really have the biggest of fan following.
Having said that, there is a lot happening around FuelPHP lately and it is very actively developed and upgraded with new features. The framework at its core offers everything to build an end to end web application of any size and complexity. The future of FuelPHP looks quiet promising and I expect FuelPHP to gain grounds in the months to come and definitely plan to keep an eye on it.
You can check out the git repository of FuelPHP at - Fuelphp.com.

Aura

Aura doesn’t compete with full stack PHP frameworks like Phalcon or with micro PHP frameworks like Slim. Aura is a collection of library packages where each package can be used independent of the other, in any code base.
Aura PHP framework is of particular interest and quite useful to PHP developers who love to write their code grounds up without starting off with a full stack opinionated framework. You can also plugin Aura packages to your application even if you are using any other full stack framework.
You can read more about Aura at – Auraphp.com.

Codeigniter

Codeigniter is the one framework that has maintained itself well over the period of time, however, in recent times, it is seeming shaky against the modern and newly launched PHP frameworks. Codeigniter was created by Ellislab back in 2006 and made available to public for free use under MIT license.
Codeigniter has been the framework of choice for the reason that it was lightweight, fast as compared to other contemporary PHP frameworks and easier to learn. As of today, most of PHP beginners are attracted towards Laravel, Phalcon and even FuelPHP rather than Codeigniter.
Although, the framework has been among best of its times, "IMHO" the future ahead for Codeigniter doesn’t look bright. Ellislab also doesn’t seem to support it anymore and it is now fully in control of the community.
Let us see how Codeigniter shapes up in the days to come, read more about Codeigniter at - Codeigniter.com.

Zend PHP Framework

Zend framework has been around for 9 years now and would always be counted in the list of greatest PHP frameworks of all time. Many big corporates like BBC, BNP Paribas and Cisco WebEx use Zend framework in one or the other of their web projects.
Zend’s development team includes developers of the core PHP and ensures that framework is robust, complete and stable. On the other side, Zend is one of the most difficult frameworks to learn and has a very steep learning curve. Additionally, configuration options are enormous that simply increase the complexity.
Shall I go ahead with Zend Framework for my next project?
With many other simple and easy to learn frameworks around, Zend is a strict “no” for small to medium sized projects and for PHP beginners. Many PHP developers these days are moving from Zend framework to Laravel, Phalcon and other simple frameworks.
But there seems to be future ahead for Zend, Zend 3 is just around the corner for release and I am watching it very closely. The features that Zend 3 promises to bring on the table have all the potential to bring it back in the game and compete with best of the modern PHP frameworks around.
Here is the Zend 3 roadmap for a quick reference.
Read more about Zend PHP Framework at - Framework.zend.com.

Conclusion

Phenomenon of PHP frameworks is very old but since the overall web development landscape is fast changing and so are the frameworks. PHP frameworks have always been the default choice of developers for creating complex web applications, specifically large scale open source projects, and enterprise CMS and CRM systems.
Frameworks come with different concepts and methodology but attempt to meet one underlying requirement i.e. speed developing large scale applications with scalable and maintainable code. The frameworks mentioned in this article are among the best PHP Frameworks in the world of web applications development as of today.
Let us know your experience with PHP frameworks and the framework of your choice via comments, cheers!!
About The Author: noeticsunil
Sunil is the founder and contributing editor at noeticforce.com. He writes about anything and everything that makes modern mobile apps, web apps and websites possible. Passionate about coding in any language including Python, Swift, JavaScript, PHP, Java, Android & iOS dev, not excluding CSS/HTML

6/06/2016

Why there are two versions of OpenCV 3.x and 2.4.xx ?

Why there are two versions of OpenCV 3.x and 2.4.xx ?


Question :
Why there are two versions of OpenCV 3.x and 2.4.xx ? I 'm still confused , which one should I select , the two versions seems to be active , is there any plan to stop one of them , what is the rule used to select which version is suitable for my application.


Answer:
It has some historical reasons why both systems exist.
  • In the past you had OpenCV 1.x and OpenCV 2.x. The OpenCV 1.x interface was the C based API, which was the historical starting language for OpenCV. When C++ became more popular OpenCV 2.x API was released, using the possibilities of C++ over the C language.
  • For a long time both versions where supported, since many embedded systems still contained only C support. However since about 2010, that changed drastically and thus OpenCV decided to focus on its C++ API, keeping the old C-API as a sort of backup, but not longer supported and updated frequently.
  • About a year and half ago, OpenCV did a complete overhaul of its backend interface. This in order to support various multithreading interfaces (which are more easily accessible now), hardware support layers, ... the differences are discussed in the transition guide.
  • However the transition forced users to change some structural things in the way they embedded OpenCV in their code. Therefore the OpenCV 2.4.x was maintained, with only allowing bug fixes and efficiency fixes, but no longer new functionality. This allows users to gradually move on to the OpenCV 3.x interface.
So basically
  • If you are starting OpenCV from scratch just now, use OpenCV 3.x.
  • If you got old OpenCV based software depending on heavily changed modules, you either update those or stick to OpenCV 2.x.
  • At all times, stay aways of the OpenCV 1.x C-API. Since the release of OpenCV 3.x it has been seen as obsolete and no longer supported. In the future OpenCV devs might investigate a way to auto generate a C-interface from the existing C++ source code, since there are still some systems (but not many of them) out there only support C.
Good luck!

5/15/2016

The top 5 hacker forums on internet.

The top 5 hacker forums on internet.


You will be amazed to know that a large number of people have the desire to learn how to hack into websites.

With the increasing demand for information on hacking, there has been a large number of hacker forums propping up on the internet. However, with the changing trends and dynamics of the world, the only websites that continue to survive are the ones that keep up with the changing times and offer the best information on hacking.


A few of these are:

1 – Hacking Tutorial: Tech Tips and Hacking Tricks
Hacking Tutorial  has articles to offer which are “Client Side Attack Using Adobe PDF Escape EXE Social Engineering”, “Hacking Using Beef XSS Framework” and “Exploiting MS11_003 Internet Explorer Vulnerability”, which are succinct and extremely technological, but make the information extremely easy to follow by presenting it in stages. It’s not a very large blog, but it is a very effective one as you can discover a plethora of technical tricks by going through it.

2 – EvilZone Hacking Forums
Although the title, EvilZone, is not precisely the most welcoming title – the forum is simply one of the best forum on the theme of hacking. The forum has a large fan-base with over 13,042 members and over 50,000 posts (and counting), which proves that it can provide an answer to any programming question that you throw at it.

3 – Hack a Day
Hack a Day without doubt offers a remarkable store of knowledge on hacking, especially on particular subjects like cell phones, GPS or digital cameras. Over the course of a few years, Hack A Day has metamorphosed into a comparatively famous blog.
Over other sites, this specific “hacking” website is a little more hardware based. It provides information on how to hack gadgets like Game Boys or digital cameras, or on how to make new devices in order to hack into other electronics.

4 – Hack In The Box
Hack In The Box is one other website that has undergone a complete transfiguration and now looks like a Word Pressed-based forum. On a whole, Hack In The Box is a site which keeps in mind the ethical implications of hacking and stresses on safety measures and a fair way to hack. It has taken a different approach and focuses more on its content by providing readers with more news and less tips on hacking.
This makes it a less suitable forum to visit if you want technical hacking guidelines, but it is a great spot to visit for keeping up-to-date with latest hacking news.

5 – Hack This Site!
Finally we’ve come down to the coolest, free programmer instruction website where you can learn how to hack in the most easiest of ways!
The website makers offer multiple “missions,” through which you strive to understand the susceptibility of a website and then try to use your newly learned hacking skills to hack the site page.
This is the ultimate test, and if you manage to correctly hack any one of the tricky missions on this website, then you’ve certainly gained the tag of proficient hacker.

Source: http://www.hackersnewsbulletin.com/2015/02/best-hacker-forums-internet-top-5.html

5/13/2016

Using Raspberry Pi Access Point to Track Devices


Using Raspberry Pi Access Point to Track Devices


I’ve been looking recently at ways to measure population movements across a large outdoor area. There are various ways of doing this: we watch them, we ask them, or we infer. Watching is a popular option at stadia, city centres and large events. Automated footfall cameras can track movements and figure out how many people walk past a certain point in any period. Put enough cameras up and you can get a pretty good plan.
However, this merely measures numbers of people. There is no connectivity. 200 people walk past point A, 400 past point B. Does that mean 600 in total at two locations, or did some of those in point A also walk past point B?
This got me thinking about technical solutions (of course) and fairly quickly I got to wireless networks. Back in 2008, I wrote about a scheme in Portsmouth’s Gunwharf Quays to track mobile devices. At the time I think the company was using bluetooth but since then we’ve had an astounding growth in smartphone usage. Wifi is pretty much standard and – I would perhaps wager – more likely to be turned on.
Keen to see how this might be implemented, I did some research into how mobile phones discover wifi networks and found an interesting behaviour. Every few seconds or minutes, your phone will send out a signal “who’s there” to probe local wifi networks. Any active access points will respond accordingly with their network name “Hi I’m BtHub_12345”. This surprised me a little, as the device itself has to ask for wifi – I was expecting the access points to broadcast themselves and send out signals every few seconds. It seems this is to conserve battery.
Anyway, having established this, it seemed likely the device would be giving its MAC address away. To clarify, the MAC address is the hardware-level identifier for network devices. It’s a bit like a serial number, so when two devices talk to each other they address each other by their MAC address so they know who’s who. MAC addresses are supposed to be unique, so no two devices should ever have the same address.
Curious to see how easy this would be, I have started to build a Raspberry Pi device that is capable of this. It seems possible – hostapd allows the Pi to act as a wifi network access point. This forms the basis for tools such as Karma (which achieves a lot more than I need) and clearly has the capability to show probe requests
There are also some privacy issues that need to be tackled. What are the legal aspects of tracking MAC addresses? It seems that, provided the addresses are not tied to individuals, we do not need disclosure. Indeed, my aim is to aggregate data from the start. Once a path has been created, any trackable information should likely be discarded. I’ll touch on these too.

Tracking Devices via Raspberry Pi (Part Two)
In the last post I described how it could be possible to build a simple tracking device using a Raspberry Pi acting as a wireless network access point. In this post, I try it out for real. This isn’t a detailed technical run-down, just the basics.
IMG_20140325_105251












It seems to get this working you’ll need just a Raspberry Pi (Model B has extra USB + LAN so is easier to configure) and a USB Wireless dongle. I started off with the Nano-USB TP-Link WN725N but this isn’t supported by the default drivers. I managed to get it working thanks tothis thread on the Pi forums, which describes recompiling direct from Realtek’s website.

However, it seems that the Realtek drivers don’t have the necessary hooks for responding to probe requests. My guess is this is usually handled at a lower level and hostapd merely makes use of callbacks to customise the handling of these requests. I didn’t really fancy rewriting large chunks of code to support it, so I opted for Plan B, which is an Edimax 7711USn (the big white thing in the picture).
   The Edimax does seem to work with the default nl80211 drivers and sure enough, when I fired up debug mode, the probe requests came through.

   By default, the probe requests only appear with some really high debug level (makes sense – they’re usually not that useful) and running in this mode would surely generate a whole load of debug messages I wouldn’t need. The second snag is that there is no timestamp with these messages.
   So, next step was to recompile hostapd with some customisations. At this stage, I merely wanted proof-of-concept so I moved the probe request notifications up to INFO level and added a timestamp using some existing functions. I then ran the program for a little while et voila, the requests started coming in. The screenshot below shows the requests being made (MAC address partially obscured) and the timestamp (a second counter).

probereq

These requests will be coming from all sorts of wifi-enabled devices: my phone, my laptop, phones of passers-by. The key thing is that I did nothing to these devices to enable this – they automatically scan for wifi networks and this device is merely visualising it.
In little under forty minutes there were 1720 probe requests from sixteen separate devices. I’d call that a proven concept.
All in, the Raspberry Pi setup cost around thirty pounds. This is for a single device. My original plan was to see how this could be used for tracing paths through a space, such as a city or stadium. For this to work, one would need many more devices, both to triangulate the devices and to provide blanket wifi coverage.
The theory is: with enough of these devices in the right place it should be possible with reasonable accuracy to work out where people are, and where they go. At thirty quid* a pop, this needn’t be a hugely expensive task.
As it turns out, this is precisely the sort of work going on both in the commercial and development world:
CreepyDOL is a networked tracking tool – sniffs network traffic and tracks users. As the name suggests, the powers ‘in the wrong hands’ are creepy indeed.
Wifi tracking of the kind I describe has been in use for a couple of years now, and it’s already used to track customers in supermarkets.
Sure enough, just as I was working on my project, The Register published an article about how Asda and EE in the UK are using wifi to achieve precisely this.

There are quite obvious privacy implications to all of this. MAC addresses are unique and, even if we can’t directly identify someone from them, it may be possible to get their identity from all the clues available (such as where they shop, where they dwell, and by sniffing wifi traffic). Privacy is a huge concern and any technique such as this – even if used with the best intentions and no direct logging – must still be dealt with with care. Last year, it was widely reported that wifi trackers were embedded in some of London’s bins. Officials ordered the company to stop amid privacy concerns, and – despite the company’s protestations that all is anonymous – it has clearly hit a nerve with privacy advocates. There may well be no attempt whatsoever to track individuals, but a poorly executed plan will be met with harsh criticism irrespective of the actual risks.
I have a couple more articles planned to follow up these points – any comments are most welcome.

* There are, of course, all kinds of additional costs: You probably want a case, decent power, and public liability insurance. The Raspberry Pi is also not likely to be a great choice in the long run, for reasons which I hope to pick up later.

Source: https://www.yetanotherblog.com/2014/03/25/using-raspberry-pi-access-point-to-track-devices/