Skip to content

Instantly share code, notes, and snippets.

@jershmagersh
jershmagersh / admin_dlink.html
Created October 14, 2013 06:19
Authenticated D-Link code.
@jershmagersh
jershmagersh / gist:6749314
Created September 29, 2013 04:20
Wordpress spider output
Here's the first few lines found:
Josh:vulnSpider jr$ ruby vulnSpider.rb
Would you like to search for plugins?
y
Getting most popular tags...
Starting with the most popular: widget
Grabbing links...
Plugin: Image Store
void DB::search(string &currLine)
{
smatch result;
ofstream outfile;
regex_search(currLine, result, *globalMatchBlock);
for(int i = 0; i < result.size(); i++){
if(result[i].length() > 2 && i != 0) {
outfile << "Match: " << (*rulesVec)[i-1].alert << endl; //Access alert in vector at that index, since that's the one that matched...
outfile << "From: " << result[0] << endl << endl;
@jershmagersh
jershmagersh / regex_contruct_ex.cpp
Last active December 23, 2015 10:09
Search regex construction
if(this->rules->size() > 0) {
string searchBlock = "";
for(rulesIter = this->rules->begin(); rulesIter != this->rules->end(); rulesIter++) {
if(rulesIter == this->rules->begin()) //Construct a big fat regex from all of the rules.
searchBlock += ".*(" + rulesIter->first + ").*";
else searchBlock += "|.*(" + rulesIter->first + ").*";
}
this->globalMatchBlock = new regex(searchBlock);
@jershmagersh
jershmagersh / gist:6619245
Created September 19, 2013 04:50
Example regex order match.
.*(match).*|.*(me).*|.*(please).*
@jershmagersh
jershmagersh / gist:6446066
Created September 5, 2013 04:22
What is?
rwshGMhfsfcC+kEuO48kBQxrYtX7lww8HNfBjS2q5X7byqrqKZ0scXi/DuG+O3/sZ4VyL9z5aP/0EDv63uEcO1Qjm9Fu8uAoj+x3BXFzHl1fpMudw6tpb82/Nt/VVP/f+tt7v1nw9v60nen34Dn5BawQ6WFojf1LbA+/RL8ypZ3X3AWAuF31+Tv1APDX/3VO8HItr12f6cubfVe+NCRz1gr43RtS77An0BHoCPYGewMVPIP0lsYtvoyv2BHoCPYGeQE+gJ+AT6Be0T6P1nkBPoCfQE+gJnMkE+gV9Jhei2+gJ9AR6Aj2BnoBPYOivWWW/xJP9Ikz0VfboL5iQ73g1n/Xjm1qrU4e8aONfkjHPbem+2IP73YfuOc7n/svW2YP3jI/ePCaf78V18IfIiif6sZGjtSp89Ge2avgMhGG5H18myXE8PuHdn+XLN4dXbIQDbrhGcsAqF3zmgzuTjicuruh3fnTwyCqHeJSOd84Rv7iyPvFntbyG4qoTfTHP7RG8907umhrktDztBG7v6O/67C7crB3xspUzl+exSo+84JDEo43/UBn5oj3KG/OiDU/0L9lVHv7LlLH3rJclzFI848x8FU/0YyMzrsxX4eX3WKXD6XH5og3OZYaJvmh7flYn4qMd890+BksuMuvNa6E7Hl+WCw7p2ExfwsU4NhLOaFf+Clfh8W8tYx/R3rpe8939nh2Zx+ofce8u4v5Pc5Is6XN/8pqLK8+5Rjkdp3w+8kc+t8G5D64oIwYbCX7JBneIjNxwuN91xbGRVY7iGQa/x9yH3yU6tSrpPBFDDH/kxHYcPnIkPS7bz5hi8axGvHOM8AufraxWhnMfvXhddGKORwcj2/XMJifOAb9LajonOjHHH6rHa+Q81HPfqXT2dEjNkXku9a26zlP1437v1f3UIk4Mv9fB1/K8JlD+iLtqk4vKRRcOX5Yj3Fw8y8l8Wb3I7ZiKw3uJ+TFHWDDIiDmlXdWs/KO9xHxsJDyytSq/z4ecJcn84QbvNVwnHqXXdny