Python Forum
Why isn’t there any good hacking books written in Python 3
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Why isn’t there any good hacking books written in Python 3
#1
Hi Guys,

I am currently learning Python 3 recently using the Crash Course for Beginners Book and so far so good. My intention of learning Python is to understand more on security exploits and tools written in Python (due to the nature of my job).

However, I realized that the top 2 most recommended books in the market (Violent Python and Black Hat Python) are written in Python 2 (what a great disappointment).

Do you guys have any good recommendations on learning security exploiting or hacking books that are taught in Python 3? I do found 1 (Author is Sanjib) but the content wasn’t that well .
written.

Please share with me if you know any. Thank you.
Reply
#2
They probably just haven't been updated. I don't know if they were popular enough to warrant a second edition.

Generally, I recommend people start and stick with Python 3 as much as possible, nowadays. But if you're serious about learning things from those Python 2 books, then I'd suggest learning both and making sure you port as much possible as you go along. I would imagine it shouldn't be very difficult, but if you are having some difficulty you can post here and we can try to bridge that gap.
Reply
#3
same with micseydel. Learn python2.x

For the syntax aspect, there are mostly only print states converted to print function, and library name changes between python2.x and python3.x. I use python2.x tutorials all the time and just convert it to python3.x

We even have a python2.x/python3.x syntax table here
https://python-forum.io/pages/porting.php

If those books use 3rd party libs, most are now ported to python 3 today.
Recommended Tutorials:
Reply
#4
can't vouch for the book as I haven't read it, but there's: https://link.springer.com/chapter/10.100...2-2541-7_6
Reply
#5
Thanks for the prompt replies, guys. This was actually my first post in this forum and I didn’t expect the forum to be so active.

I guess I will just continue to learn the basics of python 3 with the my current “Python 3 Crash Course for Beginners” book. Like what you guys advised, I will try to port to python 3 syntax wwhen I start to read the “Violent Python” and “Black Hat Python”, and hope there is a new edition that will publish in the near future.

Once again, thank you for your advices.
Reply
#6
I own Violent Python. It's not that great... not enough for you to be upset haha. I mean it's cool.. But anyone can learn to code a port scanner from the internet. Also some of the modules used in the book aren't really valid anymore. The one that comes to mind is the bluetooth module. It looks as it may have been available via pip when the book was released. But I think it's only available on github now and who knows if the syntax is the same. I just unsuccessfully tried installing pybluez with pip into a virtualenv (python 2) and I am getting errors. It can be done I'm sure but might take some research.

Another thing... the place that I work at (and many others) are running some old systems. A lot of Corporations still use Windows 7 and many Linux corporate servers are running an older version of Redhat (which uses Python 2 by default).

As a matter of fact... anything I program at work has to be done in Python 2 for that reason. The only outside modules that I was allowed to install are the Requests module and Flask... I mean we're running 2.7.5... that is old.

Therefore an alternative argument is that Python 2 is still very valid and will be until at least 2020
Reply
#7
Quote:Python 2 is still very valid and will be until at least 2020
that's only a year and a half away, so be cautious
Also, if you are using python 2 you are missing out on some fantastic improvements.
You should be able to modify code for python 3 with a little effort. There's also a tool '2to3' that will do most if not all of the work for you, see: https://docs.python.org/2/library/2to3.html
Reply
#8
I personally love python3 and use it for my own projects outside of work. I wonder when Python 3 will be standard on new Linux distros? 2020??
Reply
#9
Here's the 'official' statement (PEP 373):
Quote:The End Of Life date (EOL, sunset date) for Python 2.7 has been moved five years into the future, to 2020. This decision was made to clarify the status of Python 2.7 and relieve worries for those users who cannot yet migrate to Python 3. See also PEP 466.

This declaration does not guarantee that bugfix releases will be made on a regular basis, but it should enable volunteers who want to contribute bugfixes for Python 2.7 and it should satisfy vendors who still have to support Python 2 for years to come.

There will be no Python 2.8 (see PEP 404).

Official porting guide: https://docs.python.org/3/howto/pyporting.html

Many new packages are only supporting python 3,
and stopping support for python 2 has already begun, example: https://github.com/python-cmd2/cmd2/issues/260

I personally only use it to answer some forum questions.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Is a good practice naming user defined python functions with prefix udf_? meerkat 2 300 Mar-09-2024, 01:40 PM
Last Post: buran
  find out ore python is good for me ? trix 2 1,074 Mar-26-2023, 02:13 PM
Last Post: trix
  Use of Python in field of cyber Security and Ethical Hacking sumandas89 7 7,157 Mar-17-2023, 03:13 AM
Last Post: ColemanNielsen
  Is Python Good for GUI Desktop Application? praveencqr 0 772 Dec-23-2022, 07:02 AM
Last Post: praveencqr
  Trading Bot written in Python for Windows Pizzlew 1 43,148 Sep-26-2022, 04:42 PM
Last Post: snippsat
  books on learning coding alok 3 2,601 Aug-22-2022, 03:17 PM
Last Post: Larz60+
  Best books for programming katy1234 0 1,369 May-26-2022, 12:47 PM
Last Post: katy1234
  Best Python Books for Starters and more Advanced m0dev 5 10,665 Mar-02-2022, 02:21 PM
Last Post: Haroldmorris
  Is being a Python Developer a good career choice? ankitdixit 1 2,132 May-31-2021, 05:13 AM
Last Post: ankitdixit
  Python Books - Recommendation lasek723 5 3,748 Oct-29-2020, 08:01 AM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020