• Stars
    star
    107
  • Rank 314,320 (Top 7 %)
  • Language
    Python
  • Created over 8 years ago
  • Updated about 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

『サイバーセキュリティプログラミング』のサポートページ

『サイバーセキュリティプログラミング』のサポートページ

本リポジトリはオライリー・ジャパン発行書籍『サイバーセキュリティプログラミング』(原書名『Black Hat Python』) のサポートサイトです。

サンプルコード

サンプルコードの解説は本書籍をご覧ください。

補足事項

(付録A)bhpasm.pyが異常終了する事象について

2015/10/28にmiasmのparse_txt関数の戻り値が変更されました。 この変更に伴い、2015/10/28以降のmiasmがセットアップされた状態でbhpasm.pyを実行すると、以下のような例外が発生します。

$ python bhpasm.py
Traceback (most recent call last):
  File "bhpasm.py", line 57, in <module>
    native_code = assemble_text(asm_helloworld, [("L_MAIN", 0)])
  File "bhpasm.py", line 15, in assemble_text
    patches = asmbloc.asm_resolve_final(mnemo, sections[0], symbol_pool)
  File "/usr/local/lib/python2.7/dist-packages/miasm2/core/asmbloc.py", line 1050, in asm_resolve_final
    sanity_check_blocks(blocks)
  File "/usr/local/lib/python2.7/dist-packages/miasm2/core/asmbloc.py", line 1031, in sanity_check_blocks
    blocks_graph = basicblocs(blocks)
  File "/usr/local/lib/python2.7/dist-packages/miasm2/core/asmbloc.py", line 1097, in __init__
    self.add_blocs(ab)
  File "/usr/local/lib/python2.7/dist-packages/miasm2/core/asmbloc.py", line 1107, in add_blocs
    for b in ab:
TypeError: 'asm_bloc' object is not iterable

対処としては、本書執筆時点のmiasmをご利用ください。 具体的には、付録Aに記載されているDockerfileのコメント記号(#)を削除しイメージを再構築することで、本書執筆時点のmiasmをご利用いただけます。

正誤表

下記の通り、誤記がありましたので訂正いたします。ご迷惑をおかけいたしましたことをお詫び申し上げます。 本ページに掲載されていない誤植・間違いを見つけた方は、japan_at_oreilly.co.jpまでお知らせください。

第1刷、第2刷、第3刷、第4刷をお持ちの方

P39の図2-3内

ssh -L 8008:web:80 justin@sshserver

ssh -R 8008:web:80 justin@sshserver

P59の3行目

191.68.0.0/24

192.168.0.0/24

第1刷および第2刷をお持ちの方

P10の1行目

3行目

2行目

P18 ページ下部のソースコード

print "Usage: bhpnet.py -t target_host -p port"

print "Usage: bhnet.py -t target_host -p port"

P19 ソースコード

print "bhpnet.py -t 192.168.0.1 -p 5555 -l -c"
print "bhpnet.py -t 192.168.0.1 -p 5555 -l -u c:\\target.exe"
print "bhpnet.py -t 192.168.0.1 -p 5555 -l -e \"cat /etc/passwd\""
print "echo 'ABCDEFGHI' | ./bhpnet.py -t 192.168.11.12 -p 135"

print "bhnet.py -t 192.168.0.1 -p 5555 -l -c"
print "bhnet.py -t 192.168.0.1 -p 5555 -l -u c:\\target.exe"
print "bhnet.py -t 192.168.0.1 -p 5555 -l -e \"cat /etc/passwd\""
print "echo 'ABCDEFGHI' | ./bhnet.py -t 192.168.11.12 -p 135"

P79 ソースコード

filters   = [".jpg",".gif","png",".css"]

filters   = [".jpg",".gif",".png",".css"]

P122 コマンド実行

$ pip install github3

$ pip install github3.py

P122 注釈

【*1.】ライブラリは<https://github.com/copitux/python-github3/>から入手可能。

【*1.】ライブラリは<https://github.com/sigmavirus24/github3.py/>から入手可能。

P144 上から9行目

サンドバックス

サンドボックス

P162 「10.1 必要要素のインストール」の17行目

1. 次のzipファイルをダウンロードする。
http://www.nostarch.com/blackhatpython/bhpservice.zip
2. バッチファイル`install_service.bat`を使用してサービスをインストールする。`Administrator`同等の権限で実行することを忘れずに。

1. 本書日本語版のサポートページにある次のリポジトリを複製する。
https://github.com/oreilly-japan/black-hat-python-jp-support/tree/master/chapter-10

2. `bhservice.rtf`を参考にサービスをインストールする(`Administrator`同等の権限で実行することを忘れずに)。

P173 「10.5 コードインジェクション」の4行目

そこでコンパイル済みバージョンのbhpnet.py(2章で作成)

そこでコンパイル済みバージョンのbhnet.py(2章で作成)

P173 ページ下部のソースコード

command = "C:\\WINDOWS\\TEMP\\bhpnet.exe -l -p 9999 -c"

command = "C:\\WINDOWS\\TEMP\\bhnet.exe -l -p 9999 -c"

P175 「試してみる」の6行目

スクリプトbhpnet.pyを使用して、

スクリプトbhnet.pyを使用して、

P175 「試してみる」の実行結果

justin$ ./bhpnet.py -t 192.168.1.10 -p 9999

justin$ ./bhnet.py -t 192.168.1.10 -p 9999

More Repositories

1

deep-learning-from-scratch

『ゼロから作る Deep Learning』(O'Reilly Japan, 2016)
Jupyter Notebook
3,891
star
2

deep-learning-from-scratch-2

『ゼロから作る Deep Learning ❷』(O'Reilly Japan, 2018)
Python
1,024
star
3

deep-learning-from-scratch-3

『ゼロから作る Deep Learning ❸』(O'Reilly Japan, 2020)
Python
687
star
4

automatestuff-ja

『退屈なことはPythonにやらせよう』のリポジトリ
Python
346
star
5

deep-learning-from-scratch-4

『ゼロから作る Deep Learning ❹』(O'Reilly Japan, 2022)
Jupyter Notebook
323
star
6

conc_ytakano

『並行プログラミング入門』(O'Reilly Japan, 2021)
Rust
208
star
7

deep-learning-from-scratch-5

『ゼロから作る Deep Learning ❺』(O'Reilly Japan, 2024)
Jupyter Notebook
184
star
8

go-programming-blueprints

Go
179
star
9

learning-react-2e-ja

『Reactハンズオンラーニング 第2版』のリポジトリ
HTML
166
star
10

deep-learning-with-keras-ja

『直感 Deep Learning』のリポジトリ
Python
139
star
11

ml-at-work

電子書籍『仕事ではじめる機械学習』のサポートリポジトリです
Jupyter Notebook
126
star
12

programming-typescript-ja

『プログラミングTypeScript』のリポジトリ
TypeScript
121
star
13

data-science-on-aws-jp

Jupyter Notebook
92
star
14

RecommenderSystems

『推薦システム実践入門』のリポジトリ
Jupyter Notebook
91
star
15

black-hat-python-2e-ja

Python
68
star
16

learning-three-js-2e-ja-support

JavaScript
60
star
17

hands-on-nodejs

『ハンズオンNode.js』のリポジトリ
JavaScript
58
star
18

practical-go-programming

『実用 Go言語』のサポートリポジトリ
Go
58
star
19

real-world-http

書籍『Real World HTTP』のサポートリポジトリ
58
star
20

fundamentals-of-deep-learning-ja

『実践 Deep Learning』のリポジトリ
Python
52
star
21

practical-nlp-ja

Jupyter Notebook
47
star
22

artificial-intelligence-with-python-ja

『PythonによるAIプログラミング入門』のリポジトリ
Jupyter Notebook
42
star
23

ml-security-jp

『セキュリティエンジニアのための機械学習』のリポジトリ
Jupyter Notebook
41
star
24

mithril-book-sample

『Mithril - 最速クライアントサイドMVC』のサンプルコード
JavaScript
37
star
25

julia-programming-cookbook

Jupyter Notebook
36
star
26

unity-virtual-reality-projects-ja

C#
35
star
27

concurrency-in-go-support

『Go言語による並行処理』のサポートリポジトリです。
34
star
28

augmented-reality-game-development-ja

C#
28
star
29

mastering-linux-shell-scripting-2e-ja

Shell
26
star
30

machine-learning-with-python-cookbook

Python
21
star
31

hands-on-javascript

『ハンズオンJavaScript』のリポジトリ
HTML
20
star
32

automatestuff2-ja

Python
19
star
33

pentest-starting-with-port-scanner

『ポートスキャナ自作ではじめるペネトレーションテスト』のリポジトリ
Shell
19
star
34

building-ml-pipelines-ja

『入門 機械学習パイプライン』のリポジトリ
Jupyter Notebook
19
star
35

mobile-game-development-with-unity-ja

『Unityによるモバイルゲーム開発』のリポジトリ
C#
17
star
36

building-search-app-w-ml

『機械学習による検索ランキング改善ガイド』のサンプルコードのリポジトリ
Python
13
star
37

WebAssembly

『ハンズオンWebAssembly』のコードリポジトリ
JavaScript
12
star
38

real-time-3d-graphics-with-webgl2-2e-ja

『初めてのWebGL 2 第2版』のリポジトリ
HTML
12
star
39

OpenEndedCodebook

Python
8
star
40

nlp-with-transformers-ja

7
star
41

high-performance-python-2e-ja

Python
6
star
42

learningtypescript-ja

TypeScript
6
star
43

designing-ml-systems-ja

5
star
44

command-line-rust-ja

5
star
45

network-programmability-and-automation-ja

Python
4
star
46

efficientlinux-ja

4
star
47

practical-dl-for-cloud-mobile-edge-ja

Jupyter Notebook
3
star
48

ProgrammingPHP_4E

『プログラミングPHP 第4版』のファイル置き場
2
star
49

version-control-with-git-3e-ja

1
star