This gist was built by the community of the researchers and was scribed by Kir and Igor from the QIWI/Vulners. We are grateful for the help of all those who sent us the data, links and information. Together we can make this world a better place!
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
Output of executed https://github.com/lab2023/builder/blob/develop/linux.sh on Terminal | |
OS: Linux Mint Debian Edition 17 Cinnamon (*Debian Jessie Distro Based) | |
------------------------------------------------------------- | |
Updating system packages ... | |
Using aptitude ... | |
Ign http://dl.google.com stable InRelease |
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 bs4 import BeautifulSoup | |
# remove all attributes | |
def _remove_all_attrs(soup): | |
for tag in soup.find_all(True): | |
tag.attrs = {} | |
return soup | |
# remove all attributes except some tags | |
def _remove_all_attrs_except(soup): |
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 java.util.regex.Matcher; | |
import java.util.regex.Pattern; | |
public class AnchorTagValidator{ | |
private Pattern pattern; | |
private Matcher matcher; | |
private static final String HTML_TAG_PATTERN = "<a(?=\s|>)(?!(?:[^>=]|=(['"])(?:(?!\1).)*\1)*?\shref=['"])[^>]*>.*?<\/a>"; |
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
/*** | |
First Option: | |
-------------- | |
***/ | |
public static void main(String[] args) { | |
try{ | |
String test = "http://netsparker.com"; | |
System.out.println(test.matches("^(http|https)://.*$")); | |
} finally{ |
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
In Python 3 you can't call encode() on 8-bit strings anymore, so the hex codec became pointless and was removed. | |
Although you theoretically could have a hex codec and use it like this: | |
>>> import codecs | |
>>> hexlify = codecs.getencoder('hex') | |
>>> hexlify(b'Blaah')[0] | |
b'426c616168' | |
Using binascii is easier and nicer: |
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
public static String hexEncode(String input) { | |
String out = ""; | |
for (char c : input.toCharArray()) { | |
out += "\\x" + String.format("%x", new BigInteger(1, input.getBytes(/YOUR_CHARSET?/))); | |
} | |
return out; | |
} |
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 | |
#Regex Example: | |
import re | |
def cleanhtml(raw_html): | |
cleanr = re.compile('<.*?>') | |
cleantext = re.sub(cleanr, '', raw_html) | |
return cleantext |