Skip to content

Instantly share code, notes, and snippets.

View nuryslyrt's full-sized avatar
🌟
Discover Stars!

Nur Gucu nuryslyrt

🌟
Discover Stars!
View GitHub Profile
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

#petya #petrWrap #notPetya

Win32/Diskcoder.Petya.C

Ransomware attack.

About

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!

Gist updates

#petya #petrWrap #notPetya

Win32/Diskcoder.Petya.C

Ransomware attack.

About

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!

Gist updates

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):
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>";
@nuryslyrt
nuryslyrt / urlValidator.java
Created July 19, 2017 14:02
Two options for url validating
/***
First Option:
--------------
***/
public static void main(String[] args) {
try{
String test = "http://netsparker.com";
System.out.println(test.matches("^(http|https)://.*$"));
} finally{
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:
@nuryslyrt
nuryslyrt / hexEncoder.java
Created July 19, 2017 14:25
Hex Encoding for String in \x format
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;
}
#!/usr/bin/env python
#Regex Example:
import re
def cleanhtml(raw_html):
cleanr = re.compile('<.*?>')
cleantext = re.sub(cleanr, '', raw_html)
return cleantext
@nuryslyrt
nuryslyrt / iterm2-solarized.md
Created October 4, 2017 11:51 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Meslo powerline font + [Powerlevel9k] - (macOS)

Default

Default

Powerlevel9k

Powerlevel9k