Git Product home page Git Product logo

eonraider / blackhat-python3 Goto Github PK

View Code? Open in Web Editor NEW
2.0K 2.0K 403.0 50.52 MB

Source code for the book "Black Hat Python" by Justin Seitz. The code has been fully converted to Python 3, reformatted to comply with PEP8 standards and refactored to eliminate dependency issues involving the implementation of deprecated libraries.

Python 100.00%
blackhat-python blackhat-python-source-code cybersecurity ethical-hacking hacking-tools network-programming network-security python-hacking

blackhat-python3's People

Contributors

bedirhanbudak avatar cwallans avatar daaawx avatar eonraider avatar tokyoenigma avatar wojciech-mazurowski avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

blackhat-python3's Issues

Replacing Netcat Code

Can you post the Netcat Code? There is an issue with it in the book and it might be helpful if it were here.

Chapter04 pic_carver byte vs string

When I run pic_carver.py the packet[TCP].payload returns a byte object, like b'\r\n' and so on. str(packet[TCP].payload) becomes '\\r\\n' and thus the following if-conditions evaluate to False.

Also, if the pictures and faces directories do not exists the output fails.

I have made some changes so it runs for me, but I'm a junior python coder so there might be some un-pythonic things going on. Please have a look.

And Thank you for the nice upload.
pic_carver.py.gz

Broken pipe error in chapter02/bhnet.py client_sender

client.send(buffer.encode('utf-8'))

Description

An exception occurs in chapter02/bhnet.py in the function client_sender on the second call to client.send() in the sender while-loop. The exception due to a broken pipe.

Reproduction Steps

The bug was found by running chapter02/tcp-server.py and connecting to it with chapter02/bhnet.py:

$ python3 ./bhpnet.py -t 127.0.0.1 -p 9999
Hallo [Ctrl-D]
ACK! Test1
 Test2
[*] Exception! Exiting.
[*] Caught exception socket.error: [Errno 32] Broken pipe

On the server side:

$ python3 ./tcp-server.py 
[*] Listening on 0.0.0.0:9999
[*] Accepted connection from: 127.0.0.1:50890
[*] Received: b'Hallo\n'
('127.0.0.1', 50890)

Note that the outer while-loop (line 128 - 148) is run through twice after the initial successful sending of the buffer to the server but without ever sending data again. The expected behavior is that "Test1" would be sent to the server at the end of one loop cycle and "Test2" would be sent at the end of the next loop cycle. However, the server never receives even "Test1".

issue with the code

i had a question i wanted to ask if we send the data to localhost at port 80 is there a response we are suppose to get? if yes it doesn't seem to work for me.i am not getting any response

Internet Archive Link Missing

In the README.me file, there is a link to the book on Internet Archive. The link now forwards to a removed resource, and no explanation is given on why it was removed.

error installing github3.py

The original code that Blackhat Python used was python 2.7. Now i get an error when installing github3.py
error installing github3 py
on python3. How do we resolve this issue?

Having issue with netcat.py

Traceback (most recent call last):
File "C:\Users\MMR3\Documents\Python\BlackHatPython\netcat.py", line 126, in
nc = NetCat(args, buffer.encode())
File "C:\Users\MMR3\Documents\Python\BlackHatPython\netcat.py", line 24, in init
self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR)
TypeError: setsockopt() takes exactly 3 arguments (2 given)

missing netcat.py in chapter02

I'm trying to debug an error with the pipelined argument example in chapter two echo -ne "GET / HTTP/1.1\r\nHost: reachtim.com\r\n\r\n" |python ./netcat.py -t reachtim.com -p 80 but could not find a netcat.py file to compare in this repository.

Socket close statement missing in 2 files.

Hi. I have been comparing your code with other python 3 rewrites and the code in the prerelease pdf for the new 2nd edition of Black Hat Python. I noticed that in your chapter 2 versions of the udp-client.py and tcp-client.py files you don't call client.close() at the end of the file. I know the call is technically not needed as this programs are ending anyway. However since they are intended to be examples of how to write network code shouldn't the client.close() still be included?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.