# docker rmi `docker images -q -notrunc` -q only show numeric IDs
-notrunc Don't truncate output
References :
How does one remove an image in Docker? - Stack Overflow
# docker rmi `docker images -q -notrunc` -q only show numeric IDs
-notrunc Don't truncate output
References :
How does one remove an image in Docker? - Stack Overflow
# docker rm `docker ps --no-trunc -a -q`
-q only show numeric IDs
--no-trunc Don't truncate output
References :
How to remove old docker.io containers
>>> class foo():
... bar = 1
...
>>> foo.bar
1
>>> foo.__dict__['bar']
1
References :
dynamic - python: How to add property to a class dynamically? - Stack Overflow
for i in range(1, 5):
print globals()['somevar_%s' % i]
How to use Vega Web Vulnerability Scanner in Kali LinuxWapiti (Python)
http://rumyittips.com/how-to-use-vega-web-vulnerability-scanner-in-kali-linux/
# Debian / Ubuntudeb http://all.repository.backtrack-linux.org revolution main microverse non-free testing
deb http://32.repository.backtrack-linux.org revolution main microverse non-free testing
deb http://64.repository.backtrack-linux.org revolution main microverse non-free testing
deb http://source.repository.backtrack-linux.org revolution main microverse non-free testing
# Debian
# source
deb [arch=i386,amd64,armel,armhf] http://http.kali.org/kali kali-dev main contrib non-free
deb [arch=i386,amd64,armel,armhf] http://http.kali.org/kali kali-dev main/debian-installer
deb-src http://http.kali.org/kali kali-dev main contrib non-free
# binary
deb [arch=i386,amd64,armel,armhf] http://http.kali.org/kali kali main contrib non-free
deb [arch=i386,amd64,armel,armhf] http://http.kali.org/kali kali main/debian-installer
deb-src http://http.kali.org/kali kali main contrib non-free
# stablerelease
deb [arch=i386,amd64,armel,armhf] http://security.kali.org/kali-security kali/updates main contrib non-free
deb-src http://security.kali.org/kali-security kali/updates main contrib non-free
# nextrelease
deb [arch=i386,amd64,armel,armhf] http://repo.kali.org/kali kali-bleeding-edge main
deb-src http://repo.kali.org/kali kali-bleeding-edge main
# Ubuntudeb http://ppa.launchpad.net/wagungs/kali-linux2/ubuntu YOUR_UBUNTU_VERSION main
deb-src http://ppa.launchpad.net/wagungs/kali-linux2/ubuntu YOUR_UBUNTU_VERSION main
deb http://ppa.launchpad.net/wagungs/kali-linux/ubuntu YOUR_UBUNTU_VERSION main
deb-src http://ppa.launchpad.net/wagungs/kali-linux/ubuntu YOUR_UBUNTU_VERSION main
git clone git://git.kali.org/packages/metasploit.git
git clone git://git.kali.org/packages/metasploit-framework.git
git clone git://git.kali.org/packages/gqrx.git
git clone git://git.kali.org/packages/gr-extras.git
git clone git://git.kali.org/packages/sqlmap.git
git clone git://git.kali.org/packages/gr-baz.git
git clone git://git.kali.org/packages/gr-osmosdr.git
git clone git://git.kali.org/packages/rtl-sdr.git
git clone git://git.kali.org/packages/gr-fcdproplus.git
git clone git://git.kali.org/packages/gr-iqbal.git
git clone git://git.kali.org/packages/sysvinit.git
git clone git://git.kali.org/packages/mfterm.git
git clone git://git.kali.org/packages/kali-menu.git
git clone git://git.kali.org/packages/mfcuk.git
git clone git://git.kali.org/packages/gnuradio.git
git clone git://git.kali.org/packages/veil.git
git clone git://git.kali.org/packages/mfoc.git
git clone git://git.kali.org/packages/libnfc.git
git clone git://git.kali.org/packages/bluesnarfer.git
git clone git://git.kali.org/packages/set.git
git clone git://git.kali.org/packages/hackrf.git
git clone git://git.kali.org/packages/uhd-images.git
git clone git://git.kali.org/packages/uhd.git
git clone git://git.kali.org/packages/ruby-ponder.git
git clone git://git.kali.org/packages/python-pygithub.git
git clone git://git.kali.org/packages/python-clamd.git
git clone git://git.kali.org/packages/python-phply.git
git clone git://git.kali.org/packages/wine-python-2.7.git
git clone git://git.kali.org/packages/cewl.git
git clone git://git.kali.org/packages/pyinstaller.git
git clone git://git.kali.org/packages/ruby-gtk-webkit.git
git clone git://git.kali.org/packages/dotdotpwn.git
git clone git://git.kali.org/packages/ruby-rubber-generate.git
git clone git://git.kali.org/packages/libewf.git
git clone git://git.kali.org/packages/libbfio.git
git clone git://git.kali.org/packages/guymager.git
git clone git://git.kali.org/packages/inetsim.git
git clone git://git.kali.org/packages/cowpatty.git
git clone git://git.kali.org/packages/recon-ng.git
git clone git://git.kali.org/packages/cryptsetup.git
git clone git://git.kali.org/packages/truecrack.git
git clone git://git.kali.org/packages/websploit.git
git clone git://git.kali.org/packages/nmap.git
git clone git://git.kali.org/packages/hydra.git
git clone git://git.kali.org/packages/skipfish.git
git clone git://git.kali.org/packages/nikto.git
git clone git://git.kali.org/packages/0trace.git
git clone git://git.kali.org/packages/xplico.git
git clone git://git.kali.org/packages/volatility.git
git clone git://git.kali.org/packages/wifite.git
git clone git://git.kali.org/packages/reaver.git
git clone git://git.kali.org/packages/ndpi.git
git clone git://git.kali.org/packages/ntop.git
git clone git://git.kali.org/packages/openvas.git
git clone git://git.kali.org/packages/netcfg.git
git clone git://git.kali.org/packages/debian-installer.git
git clone git://git.kali.org/packages/maltego.git
git clone git://git.kali.org/packages/maltego-teeth.git
git clone git://git.kali.org/packages/debootstrap.git
git clone git://git.kali.org/packages/live-build-config.git
git clone git://git.kali.org/packages/peepdf.git
git clone git://git.kali.org/packages/wkhtmltopdf.git
git clone git://git.kali.org/packages/arachni.git
git clone git://git.kali.org/packages/vega.git
git clone git://git.kali.org/packages/nfspy.git
git clone git://git.kali.org/packages/binwalk.git
git clone git://git.kali.org/packages/passing-the-hash.git
git clone git://git.kali.org/packages/wordlists.git
git clone git://git.kali.org/packages/exploitdb.git
git clone git://git.kali.org/packages/firmware-mod-kit.git
git clone git://git.kali.org/packages/winexe.git
git clone git://git.kali.org/packages/unicornscan.git
git clone git://git.kali.org/packages/wpscan.git
git clone git://git.kali.org/packages/ruby-ethon.git
git clone git://git.kali.org/packages/ruby-ruby-progressbar.git
git clone git://git.kali.org/packages/wmi.git
git clone git://git.kali.org/packages/nipper-ng.git
git clone git://git.kali.org/packages/android-sdk.git
git clone git://git.kali.org/packages/jsql.git
git clone git://git.kali.org/packages/oclgausscrack.git
git clone git://git.kali.org/packages/fern-wifi-cracker.git
git clone git://git.kali.org/packages/rfcat.git
git clone git://git.kali.org/packages/yara-python.git
git clone git://git.kali.org/packages/yara.git
git clone git://git.kali.org/packages/ghost-phisher.git
git clone git://git.kali.org/packages/powersploit.git
git clone git://git.kali.org/packages/beef-xss.git
git clone git://git.kali.org/packages/sslsplit.git
git clone git://git.kali.org/packages/dumpzilla.git
git clone git://git.kali.org/packages/owasp-mantra-ff.git
git clone git://git.kali.org/packages/wce.git
git clone git://git.kali.org/packages/linux-kali.git
git clone git://git.kali.org/packages/aircrack-ng.git
git clone git://git.kali.org/packages/dbd.git
git clone git://git.kali.org/packages/gsd.git
git clone git://git.kali.org/packages/windows-binaries.git
git clone git://git.kali.org/packages/openvas-cli.git
git clone git://git.kali.org/packages/greenbone-security-assistant.git
git clone git://git.kali.org/packages/openvas-administrator.git
git clone git://git.kali.org/packages/openvas-manager.git
git clone git://git.kali.org/packages/openvas-scanner.git
git clone git://git.kali.org/packages/libopenvas.git
git clone git://git.kali.org/packages/ruby-typhoeus.git
git clone git://git.kali.org/packages/ruby-progressbar.git
git clone git://git.kali.org/packages/ruby-terminal-table.git
git clone git://git.kali.org/packages/kali-meta.git
git clone git://git.kali.org/packages/mimikatz.git
git clone git://git.kali.org/packages/smali.git
git clone git://git.kali.org/packages/zaproxy.git
git clone git://git.kali.org/packages/enum4linux.git
git clone git://git.kali.org/packages/polenum.git
git clone git://git.kali.org/packages/http-tunnel.git
git clone git://git.kali.org/packages/libcrypt-mcrypt-perl.git
git clone git://git.kali.org/packages/freeradius-wpe.git
git clone git://git.kali.org/packages/wmis.git
git clone git://git.kali.org/packages/ridenum.git
git clone git://git.kali.org/packages/crunch.git
git clone git://git.kali.org/packages/gpp-decrypt.git
git clone git://git.kali.org/packages/davtest.git
git clone git://git.kali.org/packages/bed.git
git clone git://git.kali.org/packages/armitage.git
git clone git://git.kali.org/packages/gnome-screensaver.git
git clone git://git.kali.org/packages/regripper.git
git clone git://git.kali.org/packages/ncat-w32.git
git clone git://git.kali.org/packages/wifitap.git
git clone git://git.kali.org/packages/grabber.git
git clone git://git.kali.org/packages/edb-debugger.git
git clone git://git.kali.org/packages/distorm3.git
git clone git://git.kali.org/packages/jd-gui.git
git clone git://git.kali.org/packages/w3af.git
git clone git://git.kali.org/packages/florence.git
git clone git://git.kali.org/packages/arduino.git
git clone git://git.kali.org/packages/thc-ipv6.git
git clone git://git.kali.org/packages/john.git
git clone git://git.kali.org/packages/ferret-sidejack.git
git clone git://git.kali.org/packages/fimap.git
git clone git://git.kali.org/packages/johnny.git
git clone git://git.kali.org/packages/hashcat.git
git clone git://git.kali.org/packages/oclhashcat-lite.git
git clone git://git.kali.org/packages/oclhashcat-plus.git
git clone git://git.kali.org/packages/bully.git
git clone git://git.kali.org/packages/libfreefare.git
git clone git://git.kali.org/packages/dnsrecon.git
git clone git://git.kali.org/packages/ubertooth-host.git
git clone git://git.kali.org/packages/libbtbb.git
git clone git://git.kali.org/packages/lbd.git
git clone git://git.kali.org/packages/uniscan.git
git clone git://git.kali.org/packages/python-usb.git
git clone git://git.kali.org/packages/base-files.git
git clone git://git.kali.org/packages/automater.git
git clone git://git.kali.org/packages/snmpcheck.git
git clone git://git.kali.org/packages/inguma.git
git clone git://git.kali.org/packages/kali-defaults.git
git clone git://git.kali.org/packages/joomscan.git
git clone git://git.kali.org/packages/wireshark.git
git clone git://git.kali.org/packages/tasksel.git
git clone git://git.kali.org/packages/maskprocessor.git
git clone git://git.kali.org/packages/apktool.git
git clone git://git.kali.org/packages/ikat.git
git clone git://git.kali.org/packages/inundator.git
git clone git://git.kali.org/packages/live-build.git
git clone git://git.kali.org/packages/desktop-base.git
git clone git://git.kali.org/packages/kali-root-login.git
git clone git://git.kali.org/packages/bluemaho.git
git clone git://git.kali.org/packages/hashcat-utils.git
git clone git://git.kali.org/packages/rootskel-gtk.git
git clone git://git.kali.org/packages/apt-setup.git
git clone git://git.kali.org/packages/paros.git
git clone git://git.kali.org/packages/framework2.git
git clone git://git.kali.org/packages/statsprocessor.git
git clone git://git.kali.org/packages/vlc.git
git clone git://git.kali.org/packages/rfidiot.git
git clone git://git.kali.org/packages/kismet.git
git clone git://git.kali.org/packages/vboot-utils.git
git clone git://git.kali.org/packages/responder.git
git clone git://git.kali.org/packages/dradis.git
git clone git://git.kali.org/packages/tftpd32.git
git clone git://git.kali.org/packages/windows-privesc-check.git
git clone git://git.kali.org/packages/sqldict.git
git clone git://git.kali.org/packages/metagoofil.git
git clone git://git.kali.org/packages/hexorbase.git
git clone git://git.kali.org/packages/keimpx.git
git clone git://git.kali.org/packages/python-impacket.git
git clone git://git.kali.org/packages/theharvester.git
git clone git://git.kali.org/packages/recstudio.git
git clone git://git.kali.org/packages/sctpscan.git
git clone git://git.kali.org/packages/siparmyknife.git
git clone git://git.kali.org/packages/smtp-user-enum.git
git clone git://git.kali.org/packages/ftester.git
git clone git://git.kali.org/packages/raspberry-pi-installer.git
git clone git://git.kali.org/packages/xspy.git
git clone git://git.kali.org/packages/truecrypt.git
git clone git://git.kali.org/packages/dff.git
git clone git://git.kali.org/packages/eresi.git
git clone git://git.kali.org/packages/sniffjoke.git
git clone git://git.kali.org/packages/oscanner.git
git clone git://git.kali.org/packages/blindelephant.git
git clone git://git.kali.org/packages/killerbee.git
git clone git://git.kali.org/packages/dbpwaudit.git
git clone git://git.kali.org/packages/protos-sip.git
git clone git://git.kali.org/packages/padbuster.git
git clone git://git.kali.org/packages/webscarab.git
git clone git://git.kali.org/packages/urlcrazy.git
git clone git://git.kali.org/packages/webshells.git
git clone git://git.kali.org/packages/ace-voip.git
git clone git://git.kali.org/packages/pjproject.git
git clone git://git.kali.org/packages/pyusb.git
git clone git://git.kali.org/packages/scim-pinyin.git
git clone git://git.kali.org/packages/u3-pwn.git
git clone git://git.kali.org/packages/rainbowcrack.git
git clone git://git.kali.org/packages/raspberry-pi-modules.git
git clone git://git.kali.org/packages/raspberry-pi-firmware.git
git clone git://git.kali.org/packages/net-retriever.git
git clone git://git.kali.org/packages/kali-archive-keyring.git
git clone git://git.kali.org/packages/jboss-autopwn.git
git clone git://git.kali.org/packages/javasnoop.git
git clone git://git.kali.org/packages/isr-evilgrade.git
git clone git://git.kali.org/packages/inviteflood.git
git clone git://git.kali.org/packages/cryptcat.git
git clone git://git.kali.org/packages/hping3.git
git clone git://git.kali.org/packages/hotpatch.git
git clone git://git.kali.org/packages/mdk3.git
git clone git://git.kali.org/packages/iw.git
git clone git://git.kali.org/packages/libstree.git
git clone git://git.kali.org/packages/enumiax.git
git clone git://git.kali.org/packages/cymothoa.git
git clone git://git.kali.org/packages/bluelog.git
git clone git://git.kali.org/packages/linux-latest.git
git clone git://git.kali.org/packages/bluepot.git
git clone git://git.kali.org/packages/casefile.git
git clone git://git.kali.org/packages/linux-tools-kali.git
git clone git://git.kali.org/packages/laudanum.git
git clone git://git.kali.org/packages/libcrafter.git
git clone git://git.kali.org/packages/magictree.git
git clone git://git.kali.org/packages/miranda.git
git clone git://git.kali.org/packages/multiforcer.git
git clone git://git.kali.org/packages/multimac.git
git clone git://git.kali.org/packages/ncrack.git
git clone git://git.kali.org/packages/ollydbg.git
git clone git://git.kali.org/packages/ohrwurm.git
git clone git://git.kali.org/packages/pack.git
git clone git://git.kali.org/packages/patator.git
git clone git://git.kali.org/packages/pdf-parser.git
git clone git://git.kali.org/packages/pdfid.git
git clone git://git.kali.org/packages/pdgmail.git
git clone git://git.kali.org/packages/phrasendrescher.git
git clone git://git.kali.org/packages/pipal.git
git clone git://git.kali.org/packages/plecost.git
git clone git://git.kali.org/packages/powerfuzzer.git
git clone git://git.kali.org/packages/proxystrike.git
git clone git://git.kali.org/packages/pwnat.git
git clone git://git.kali.org/packages/rcracki-mt.git
git clone git://git.kali.org/packages/rebind.git
git clone git://git.kali.org/packages/redfang.git
git clone git://git.kali.org/packages/rsmangler.git
git clone git://git.kali.org/packages/rtpbreak.git
git clone git://git.kali.org/packages/rtpflood.git
git clone git://git.kali.org/packages/rtpinsertsound.git
git clone git://git.kali.org/packages/rtpmixsound.git
git clone git://git.kali.org/packages/libfindrtp.git
git clone git://git.kali.org/packages/spike.git
git clone git://git.kali.org/packages/sakis3g.git
git clone git://git.kali.org/packages/sfuzz.git
git clone git://git.kali.org/packages/sidguesser.git
git clone git://git.kali.org/packages/sipp.git
git clone git://git.kali.org/packages/sipvicious.git
git clone git://git.kali.org/packages/spooftooph.git
git clone git://git.kali.org/packages/sqlninja.git
git clone git://git.kali.org/packages/cisco-ocs.git
git clone git://git.kali.org/packages/sqlsus.git
git clone git://git.kali.org/packages/t50.git
git clone git://git.kali.org/packages/sslcaudit.git
git clone git://git.kali.org/packages/sslyze.git
git clone git://git.kali.org/packages/termineter.git
git clone git://git.kali.org/packages/thc-ssl-dos.git
git clone git://git.kali.org/packages/tlssled.git
git clone git://git.kali.org/packages/tnscmd10g.git
git clone git://git.kali.org/packages/twofi.git
git clone git://git.kali.org/packages/ua-tester.git
git clone git://git.kali.org/packages/unix-privesc-check.git
git clone git://git.kali.org/packages/voiphopper.git
git clone git://git.kali.org/packages/webshag.git
git clone git://git.kali.org/packages/fragrouter.git
git clone git://git.kali.org/packages/fragroute.git
git clone git://git.kali.org/packages/ruby-webmock.git
git clone git://git.kali.org/packages/ruby-simplecov.git
git clone git://git.kali.org/packages/ruby-simplecov-html.git
git clone git://git.kali.org/packages/ruby-diff-lcs.git
git clone git://git.kali.org/packages/ruby-crack.git
git clone git://git.kali.org/packages/ruby-spider.git
git clone git://git.kali.org/packages/ruby-mini-exiftool.git
git clone git://git.kali.org/packages/ruby-mime-types.git
git clone git://git.kali.org/packages/ruby-http-configuration.git
git clone git://git.kali.org/packages/hamster-sidejack.git
git clone git://git.kali.org/packages/hash-identifier.git
git clone git://git.kali.org/packages/hexinject.git
git clone git://git.kali.org/packages/iaxflood.git
git clone git://git.kali.org/packages/intersect.git
git clone git://git.kali.org/packages/intrace.git
git clone git://git.kali.org/packages/irpas.git
git clone git://git.kali.org/packages/jad.git
git clone git://git.kali.org/packages/jigsaw.git
git clone git://git.kali.org/packages/keepnote.git
git clone git://git.kali.org/packages/goofile.git
git clone git://git.kali.org/packages/sbd.git
git clone git://git.kali.org/packages/sslstrip.git
git clone git://git.kali.org/packages/thc-pptp-bruter.git
git clone git://git.kali.org/packages/golismero.git
git clone git://git.kali.org/packages/webslayer.git
git clone git://git.kali.org/packages/weevely.git
git clone git://git.kali.org/packages/wfuzz.git
git clone git://git.kali.org/packages/wifi-honey.git
git clone git://git.kali.org/packages/giskismet.git
git clone git://git.kali.org/packages/galleta.git
git clone git://git.kali.org/packages/wol-e.git
git clone git://git.kali.org/packages/xsser.git
git clone git://git.kali.org/packages/foremost.git
git clone git://git.kali.org/packages/findmyhash.git
git clone git://git.kali.org/packages/fiked.git
git clone git://git.kali.org/packages/fierce.git
git clone git://git.kali.org/packages/extundelete.git
git clone git://git.kali.org/packages/ettercap.git
git clone git://git.kali.org/packages/eapmd5pass.git
git clone git://git.kali.org/packages/dos2unix.git
git clone git://git.kali.org/packages/dnswalk.git
git clone git://git.kali.org/packages/dnstracer.git
git clone git://git.kali.org/packages/dnsmap.git
git clone git://git.kali.org/packages/dnsenum.git
git clone git://git.kali.org/packages/dnschef.git
git clone git://git.kali.org/packages/dns2tcp.git
git clone git://git.kali.org/packages/dnmap.git
git clone git://git.kali.org/packages/dmitry.git
git clone git://git.kali.org/packages/dirbuster.git
git clone git://git.kali.org/packages/dirb.git
git clone git://git.kali.org/packages/dhcpig.git
git clone git://git.kali.org/packages/dex2jar.git
git clone git://git.kali.org/packages/deblaze.git
git clone git://git.kali.org/packages/ddrescue.git
git clone git://git.kali.org/packages/dc3dd.git
git clone git://git.kali.org/packages/cutycapt.git
git clone git://git.kali.org/packages/creddump.git
git clone git://git.kali.org/packages/copy-router-config.git
git clone git://git.kali.org/packages/cmospwd.git
git clone git://git.kali.org/packages/cisco-torch.git
git clone git://git.kali.org/packages/cisco-global-exploiter.git
git clone git://git.kali.org/packages/cisco-auditing-tool.git
git clone git://git.kali.org/packages/chntpw.git
git clone git://git.kali.org/packages/cdpsnarf.git
git clone git://git.kali.org/packages/burpsuite.git
git clone git://git.kali.org/packages/bulk-extractor.git
git clone git://git.kali.org/packages/braa.git
git clone git://git.kali.org/packages/blueranger.git
git clone git://git.kali.org/packages/bbqsql.git
git clone git://git.kali.org/packages/asleap.git
git clone git://git.kali.org/packages/acccheck.git
git clone git://git.kali.org/packages/amap.git
git clone git://git.kali.org/packages/apache-users.git
git clone git://git.kali.org/packages/libmicrohttpd.git
git clone git://git.kali.org/packages/kali-debtags.git
git clone git://git.kali.org/packages/funkload.git
git clone git://git.kali.org/packages/perl-cisco-copyconfig.git
git clone git://git.kali.org/packages/linux-kali-old.git
z = dict(x.items() + y.items())
References :
syntax - How can I merge (union) two Python dictionaries in a single expression? - Stack Overflow
return json.dumps([{}])
import logging
filename = '/'.join((os.path.dirname(os.path.realpath(__file__)), 'log/debug.log'))
format = "% (asctime)s - %(name)s - %(levelname)s - %(message)s"
logging.basicConfig(filename=filename, format=format, level=5)
handler = logging.getLogger('myproject')
app.logger.addHandler(handler)
Rotating log example :
Flask logging exampleDATE_FORMAT(
FROM_UNIXTIME(
created
)
, '%d/%m/%Y') DATE(
FROM_UNIXTIME(
created)
)
result = SomeModel.query.with_entities(SomeModel.col1, SomeModel.col2)
> python
>>> import sys
>>> reload(sys)
>>> sys.setdefaultencoding('big5')
import sys
sys.setdefaultencoding('big5')
> python ez_setup.py
> easy_install pip
# apt-get install python-setuptools
# easy_install pip
# cd /var/www
# git clone https://github.com/salimane/flask-mvc.git
# cd flask-mvc
# pip install -r requirements.txt
# vi application.wsgi
import sys# apt-get install libapache2-mod-wsgi
sys.path.insert(0,'/var/www/flask-mvc')
from project import app as application
# vi /etc/apache2/sites-enabled/000-default.conf
WSGIDaemonProcess flaskapp user=www-data group=www-data threads=5# /etc/init.d/apache2 restart
WSGIScriptAlias /flask-mvc /var/www/flask-mvc/application.wsgi
WSGIProcessGroup flaskapp
WSGIApplicationGroup %{GLOBAL}
Order deny,allow
Allow from all
http://0.0.0.0/flask-mvc
# yum install python-setuptools
# easy_install pip
# cd /var/www/html
# git clone https://github.com/salimane/flask-mvc.git
# cd flask-mvc
# pip install -r requirements.txt
# vi application.wsgi
import sys# yum install mod_wsgi
sys.path.insert(0,'/var/www/html/flask-mvc')
from project import app as application
# vi /etc/httpd/conf/httpd.conf
WSGIDaemonProcess flaskapp user=www-data group=www-data threads=5
WSGISocketPrefix run/wsgi
WSGIScriptAlias /flask-mvc /var/www/html/flask-mvc/application.wsgi
WSGIProcessGroup flaskapp
WSGIApplicationGroup %{GLOBAL}
Order deny,allow
Allow from all
# /etc/init.d/httpd restart
# apt-get install libsnmp-mib-compiler-perl
$ wget http://nmap.org/dist/nmap-6.40.tar.bz2
$ bzip2 -cd nmap-6.40.tar.bz2 | tar xvf -
$ cd nmap-6.40
$ ./configure
( ) /\ _ (
\ | ( \ ( \.( ) _____
\ \ \ ` ` ) \ ( ___ / _ \
(_` \+ . x ( .\ \/ \____-----------/ (o) \_
- .- \+ ; ( O \____
(__ +- .( -'.- <. \_____________ ` \ /
(_____ ._._: <_ -="" _-="" _="" br="" nbsp="" v="" vv=""> . /./.+- . .- / +-- - . (--_AAAAAAA__A_/ |
(__ ' /x / x _/ ( \______________//_ \_______
, x / ( ' . / . / \___' \ /
/ / _/ / + | \ /
' (__/ / \/
/ \
NMAP IS A POWERFUL TOOL -- USE CAREFULLY AND RESPONSIBLY
Configuration complete. Type make (or gmake on some *BSD machines) to compile.
$ make
# make install
http://blog.cloudflare.com/deep-inside-a-dns-amplification-ddos-attack |
攻擊:
$ dig +bufsize=4096 +dnssec any net.tw @DNS_SERVER預防:
1. 關閉 Open resolvers
2.實作 BCP-38
攻擊:
# nmap -sU -pU:123 -Pn -n --script=ntp-monlist TIME_SERVER攻擊包:
from scapy.all import *預防:
hexdump(NTP(version=2, mode=7, stratum=0, poll=3, precision=42))
1. 升級 NTP Server 到 4.2.7,移除了 monlist 命令
2. 在舊版的話,啓用 noquery。禁止模式 6,7 的查詢 (包括 monlist (mode 7))
$ cd /usr/share/nmap/scripts
# wget http://nmap.org/svn/scripts/ntp-monlist.nse
# nmap --script-updatedb
# nmap -Pn -p80 --script ip-geolocation-* 8.8.8.8
# pip install scapy
Downloading/unpacking scapy# pip install hg+http://hg.secdev.org/scapy
Could not find a version that satisfies the requirement scapy (from versions: 2.2.0-dev.linux-x86_64, 2.2.0-dev, 2.2.0-dev)
# apt-get install python-scapy
# 42 行,更改 VIRTUAL_ENV 至新的路徑名稱$ mv {ENV} {NEW_ENV}
VIRTUAL_ENV="{NEW_ENV}"
$ wget https://raw.github.com/hydruid/zenoss/master/core-autodeploy/4.2.4/zenoss-4.2.4_ubuntu-amd64.sh$ sudo chmod +x zenoss-4.2.4_ubuntu-amd64.sh
$ sudo ./zenoss-4.2.4_ubuntu-amd64.sh 2>&1 | tee script-log.txt
$ su rootCentOS :
# wget --no-check-certificate https://raw.github.com/hydruid/zenoss/master/core-autodeploy/4.2.4/zenoss-4.2.4_ubuntu-amd64.sh# chmod +x zenoss-4.2.4_ubuntu-amd64.sh
# ./zenoss-4.2.4_ubuntu-amd64.sh 2>&1 | tee script-log.txt
# wget --no-check-certificate https://github.com/zenoss/core-autodeploy/tarball/4.2.4 -O auto.tar.gz
# tar xvf auto.tar.gz
# cd zenoss-core-autodeploy-*
# ./core-autodeploy.sh
pysnmp : getCmd, setCmd, nextCmdsnmp <---> get-request, set-request, get-next-request
# pip install pysnmp
from pysnmp.entity.rfc3413.oneliner import cmdgen
errorIndication, errorStatus, errorIndex, varBinds = cmdgen.CommandGenerator().getCmd(
cmdgen.CommunityData('my-agent', 'public', 0),
cmdgen.UdpTransportTarget(('192.168.1.8', 161)),
'iso.3.6.1.2.1.1.1.0'
)
print varBinds
# apt-get install python-netsnmp
import netsnmp
session = netsnmp.Session(DestHost='192.168.1.8', Version=1 , Community='public')
vars = netsnmp.VarList(netsnmp.Varbind('iso.3.6.1.2.1.1.1.0'))
print(session.get(vars))
# apt-get install snmp
$ snmpwalk -v1 -c public 192.168.1.4
$ snmpwalk -v1 -c public 192.168.1.4 iso.3.6.1.2.1.1.1.0
syslog_program:sshd AND message:"Failed password"
AND, OR, NOTFuzzy :
roam~Wildcard :
te?t, test*
http://192.168.1.1/ 更多設定選項要透過 telnet://192.168.1.1
北:cht / chtnadsl
中:cht / chtcadsl
南:cht / chtsadsl
D-Link DSL-6641KPVC 0/16
http://192.168.1.1
北:cht / chtnvdsl
中:cht / chtcvdsl
南:cht / chtsvdsl
> gpupdate /force
$ vi logstash.conf
$ java -Xmx256m -jar logstash-1.3.3-flatjar.jar agent --config logstash.conf --log logstash.log
> net start nxlog
// download Kibana
$ cd /var/www
$ wget http://download.elasticsearch.org/kibana/kibana/kibana-latest.zip
$ unzip kibana-latest.zip
// setting
$ mv kibana-latest kibana
$ cd kibana
$ vi config.js
// Set the elasticsearch parameter to the fully qualified hostname of your Elasticsearch server
# cd /usr/share/elasticsearch
# bin/plugin -url http://download.elasticsearch.org/kibana/kibana/kibana-latest.zip -install elasticsearch/kibana3
# cd /usr/share/elasticsearch
# bin/plugin --remove elasticsearch/kibana4
$ wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.90.11.deb
# dpkg -i elasticsearch-0.90.11.deb
$ wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.90.11.noarch.rpm
$ rpm -i elasticsearch-0.90.11.noarch.rpm
install path :
/usr/share/elasticsearch/bin
$ pip freeze > requirements.txt $ pip install -r requirements.txt
References :
Cookbook — pip 1.5.2 documentation
.pypirc
configuration file[distutils] # this tells distutils what package indexes you can push toindex-servers =PyPI # the live PyPIPyPI-test # test PyPI[PyPI] # authentication details for live PyPIrepository: https://PyPI.python.org/PyPIusername: {{your_username}}password: {{your_password}}[PyPI-test] # authentication details for test PyPIrepository: https://testPyPI.python.org/PyPIusername: {{your_username}}
root-dir/ # arbitrary working directory namesetup.pysetup.cfgLICENSE.txtREADME.mdmypackage/__init__.pyfoo.pybar.pybaz.py
from distutils.core import setupsetup(name = 'mypackage',packages = ['mypackage'], # this must be the same as the name aboveversion = '0.1',description = 'A random test lib',author = 'Ajay',author_email = 'aj@gmail.com',url = 'https://github.com/ajkumar25/mypackage', # use the URL to the github repodownload_url = 'https://github.com/ajkumar25/mypackage/tarball/0.1', # I'll explain this in a secondkeywords = ['testing', 'logging', 'example'], # arbitrary keywordsclassifiers = [],)
[metadata]description-file = README.md
$ python setup.py register -r PyPI-test
$ python setup.py sdist upload -r PyPI-test
$ python setup.py register -r PyPI
$ python setup.py sdist upload -r PyPI
SELECT *FROM the_tableINTO OUTFILE '/tmp/the_table.csv'FIELDS TERMINATED BY ','ENCLOSED BY '"'LINES TERMINATED BY '\n';
# apt-get install python3-docutils python3-markdown retext
# apt-get install python3-docutils python3-markdown