This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<get xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> | |
<filter> | |
<interfaces xmlns="http://openconfig.net/yang/interfaces"> | |
<interface> | |
<config> | |
</config> | |
<name/> | |
</interface> | |
</interfaces> | |
</filter> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3.6 | |
from ipaddress import IPv4Network | |
list_a = [ | |
'10.0.0.0/8', | |
'172.16.0.0/12', | |
'192.168.0.0/16' | |
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# (c) 2019, Clay Curtis <[email protected]> | |
# | |
# This file is part of Ansible | |
# | |
# Ansible is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import (absolute_import, division, print_function) | |
__metaclass__ = type | |
from ansible.errors import AnsibleError | |
from ansible.module_utils._text import to_bytes, to_native, to_text | |
from ansible.utils.display import Display | |
display = Display() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
root@local-dev-box:/usr/share/kibana# bin/logstash --modules netflow --setup --log.level=debug | |
-bash: bin/logstash: No such file or directory | |
root@local-dev-box:/usr/share/kibana# cd .. | |
root@local-dev-box:/usr/share# cd logstash/ | |
root@local-dev-box:/usr/share/logstash# bin/logstash --modules netflow --setup --log.level=debug | |
WARNING: Could not find logstash.yml which is typically located in $LS_HOME/config or /etc/logstash. You can specify the path using --path.settings. Continuing using the defaults | |
Could not find log4j2 configuration at path /usr/share/logstash/config/log4j2.properties. Using default config which logs errors to the console | |
[DEBUG] 2018-10-09 10:28:34.440 [main] scaffold - Found module {:module_name=>"fb_apache", :directory=>"/usr/share/logstash/modules/fb_apache/configuration"} | |
[DEBUG] 2018-10-09 10:28:34.446 [main] registry - Adding plugin to the registry {:name=>"fb_apache", :type=>:modules, :class=>#<LogStash::Modules::Scaffold:0x95d80b1 @directory="/usr/share/logstash/modules/fb_apache/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
when HTTP_REQUEST { | |
if {[string tolower [HTTP::host]] starts_with "acme.com" && [string tolower[HTTP::path]] eq "/foo"} { | |
HTTP::header replace Host "newhost.acme.com" | |
HTTP::uri "/bar" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
when HTTP_REQUEST { | |
# case sensitive | |
if { [HTTP::uri] contains "foo" } { | |
HTTP::respond 301 Location "https://[HTTP::host]/whatever" | |
} | |
# case insensitive | |
if { [string tolower [HTTP::uri]] contains "bar" } { | |
HTTP::respond 302 Location "https://[HTTP::host]/whatever" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import jxmlease | |
with open('vuln.xml') as xml: | |
root = jxmlease.parse(xml) | |
root.prettyprint() | |
for item in root['solution']['ContainerBlockElement']['UnorderedList']['ListItem']: | |
print 'URL Link: {}'.format(item['Paragraph']['URLLink'].get_xml_attr('LinkURL')) | |
print 'URL Title: {}'.format(item['Paragraph']['URLLink'].get_xml_attr('LinkTitle')) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import mechanize | |
def main(): | |
br = mechanize.Browser() | |
br.addheaders = [('User-agent', 'Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.0.6')] | |
br.open("http://www.cisco.com/c/login/index.html?referer=/c/en/us/index.html") | |
br.select_form(name="login-form") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"template" : "logstash-*", | |
"settings" : { | |
"index.refresh_interval" : "5s" | |
}, | |
"mappings" : { | |
"_default_" : { | |
"_all" : {"enabled" : true}, | |
"dynamic_templates" : [ { | |
"message_field" : { |