├── Syngress.Violent.Python.a.Cookbook.for.Hackers.2013.pdf
├── pysqrl
└── .idea
│ ├── pysqrl.iml
│ ├── scopes
│ └── scope_settings.xml
│ └── workspace.xml
└── violent_python
├── .idea
├── .name
├── dictionaries
│ └── root.xml
├── encodings.xml
├── inspectionProfiles
│ ├── Project_Default.xml
│ └── profiles_settings.xml
├── misc.xml
├── modules.xml
├── scopes
│ └── scope_settings.xml
├── vcs.xml
├── violent_python.iml
└── workspace.xml
├── Introduction
├── iteration.py
├── socket_test.py
└── socket_test.pyc
├── Port_Scanner.py
├── network_analysis
└── printGeo.py
├── sniff
├── google-searches.py
└── test-sniff.py
├── sqlite3
└── printProfile.py
└── ssh_botnet
└── sshConnect.py
/Syngress.Violent.Python.a.Cookbook.for.Hackers.2013.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/reconSF/python/1fea830fcf7b849b0c1545383e4a9b6e08172890/Syngress.Violent.Python.a.Cookbook.for.Hackers.2013.pdf
--------------------------------------------------------------------------------
/pysqrl/.idea/pysqrl.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/pysqrl/.idea/scopes/scope_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/pysqrl/.idea/workspace.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
229 |
230 |
231 |
232 |
233 |
234 |
235 |
236 |
237 |
238 |
239 |
240 |
241 |
242 |
243 |
244 |
245 |
246 |
247 |
248 |
249 |
250 |
251 |
252 |
253 |
254 |
255 |
256 |
257 |
258 |
259 |
260 | 1385365180351
261 | 1385365180351
262 |
263 |
264 |
265 |
266 |
267 |
268 |
269 |
270 |
271 |
272 |
273 |
274 |
275 |
276 |
277 |
278 |
279 |
280 |
281 |
282 |
283 |
284 |
285 |
286 |
287 |
288 |
289 |
290 |
291 |
292 |
293 |
294 |
295 |
296 |
297 |
298 |
299 |
300 |
301 |
302 |
303 |
--------------------------------------------------------------------------------
/violent_python/.idea/.name:
--------------------------------------------------------------------------------
1 | violent_python
--------------------------------------------------------------------------------
/violent_python/.idea/dictionaries/root.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/violent_python/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/violent_python/.idea/inspectionProfiles/Project_Default.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/violent_python/.idea/inspectionProfiles/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/violent_python/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/violent_python/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/violent_python/.idea/scopes/scope_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/violent_python/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/violent_python/.idea/violent_python.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/violent_python/.idea/workspace.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 | Assignment issuesJavaScript
144 |
145 |
146 | CSS
147 |
148 |
149 | Code style issuesJavaScript
150 |
151 |
152 | CoffeeScript
153 |
154 |
155 | Control flow issuesJavaScript
156 |
157 |
158 | Data flow issuesJavaScript
159 |
160 |
161 | GeneralCoffeeScript
162 |
163 |
164 | GeneralJavaScript
165 |
166 |
167 | Invalid elementsCSS
168 |
169 |
170 | JavaScript
171 |
172 |
173 | JavaScript function metricsJavaScript
174 |
175 |
176 | JavaScript validity issuesJavaScript
177 |
178 |
179 | Naming conventionsJavaScript
180 |
181 |
182 | Potentially confusing code constructsJavaScript
183 |
184 |
185 | Probable bugsJavaScript
186 |
187 |
188 | Python
189 |
190 |
191 | SASS/SCSS
192 |
193 |
194 | SQL
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
229 |
230 |
231 |
232 |
233 |
234 |
235 |
236 |
237 |
238 |
239 |
240 |
241 |
242 |
243 |
244 |
245 |
246 |
247 |
248 |
249 |
250 |
251 |
252 |
253 |
254 |
255 |
256 |
257 |
258 |
259 |
260 |
261 |
262 |
263 |
264 |
265 |
266 |
267 |
268 |
269 |
270 |
271 |
272 |
273 |
274 |
275 |
276 |
277 |
278 |
279 |
280 |
281 |
282 |
283 |
284 |
285 |
286 |
287 |
288 |
289 |
290 |
291 |
292 |
293 |
294 |
295 |
296 |
297 |
298 |
299 |
300 |
301 |
302 |
303 |
304 |
305 |
306 |
307 |
308 |
309 |
310 |
311 |
312 |
313 |
314 |
315 |
316 |
317 |
318 |
319 |
320 |
321 |
322 |
323 |
324 |
325 |
326 |
327 |
328 |
329 |
330 |
331 |
332 |
333 |
334 |
335 |
336 |
337 |
338 |
339 |
340 |
341 |
342 |
343 |
344 |
345 |
346 |
347 |
348 |
349 |
350 |
351 |
352 |
353 |
354 |
355 |
356 |
357 |
358 |
359 |
360 |
361 |
362 |
363 |
364 |
365 |
366 |
367 |
368 |
369 |
370 |
371 |
372 |
373 |
374 |
375 |
376 |
377 |
378 |
379 |
380 |
381 |
382 |
383 |
384 |
385 |
386 |
387 |
388 |
389 |
390 |
391 |
392 |
393 |
394 |
395 |
396 |
397 |
398 |
399 |
400 |
401 |
402 |
403 |
404 |
405 |
406 |
407 |
408 |
409 |
410 |
411 |
412 |
413 |
414 |
415 |
416 |
417 |
418 |
419 |
420 |
421 |
422 |
423 |
424 |
425 |
426 |
427 |
428 |
429 |
430 |
431 |
432 |
433 |
434 |
435 |
436 |
437 |
438 |
439 |
440 |
441 |
442 |
443 |
444 |
445 |
446 |
447 |
448 |
449 |
450 |
451 |
452 |
453 |
454 |
455 |
456 |
457 |
458 |
459 |
460 |
461 |
462 |
463 |
464 |
465 |
466 |
467 |
468 |
469 |
470 |
471 |
472 |
473 |
474 |
475 |
476 |
477 |
478 |
479 |
480 |
481 |
482 |
483 |
484 |
485 |
486 |
487 |
488 |
489 |
490 |
491 |
492 |
493 |
494 |
495 |
496 |
497 |
498 |
499 |
500 |
501 |
502 |
503 |
504 |
505 |
506 |
507 |
508 |
509 |
510 |
511 |
512 |
513 |
514 |
515 |
516 |
517 |
518 |
519 |
520 |
521 |
522 |
523 |
524 |
525 |
526 |
527 |
528 |
529 |
530 |
531 |
532 |
533 |
534 |
535 |
536 |
537 |
538 |
539 |
540 | false
541 |
542 |
543 |
544 |
545 | 1385026781412
546 | 1385026781412
547 |
548 |
549 |
550 |
551 |
552 |
553 |
554 |
555 |
556 |
557 |
558 |
559 |
560 |
561 |
562 |
563 |
564 |
565 |
566 |
567 |
568 |
569 |
570 |
571 |
572 |
573 |
574 |
575 |
576 |
577 |
578 |
579 |
580 |
581 |
582 |
583 |
584 |
585 |
586 |
587 |
588 |
589 |
590 |
591 |
592 |
593 |
594 |
595 |
596 |
597 |
598 |
599 |
600 |
601 |
602 |
603 |
604 |
605 |
606 |
607 |
608 |
609 |
610 |
611 |
612 |
613 |
614 |
615 |
616 |
617 |
618 |
619 |
620 |
621 |
622 |
623 |
624 |
625 |
626 |
627 |
628 |
629 |
630 |
631 |
632 |
633 |
634 |
635 |
636 |
637 |
638 |
639 |
640 |
641 |
642 |
643 |
644 |
645 |
646 |
647 |
648 |
649 |
650 |
651 |
652 |
653 |
654 |
655 |
656 |
657 |
658 |
659 |
660 |
661 |
662 |
663 |
664 |
665 |
666 |
667 |
668 |
669 |
670 |
671 |
672 |
673 |
674 |
675 |
676 |
677 |
678 |
679 |
680 |
681 |
682 |
683 |
684 |
685 |
686 |
687 |
688 |
689 |
690 |
691 |
692 |
693 |
694 |
695 |
696 |
697 |
698 |
699 |
700 |
701 |
702 |
703 |
704 |
705 |
706 |
707 |
708 |
709 |
710 |
711 |
712 |
713 |
714 |
715 |
716 |
717 |
718 |
719 |
720 |
--------------------------------------------------------------------------------
/violent_python/Introduction/iteration.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/reconSF/python/1fea830fcf7b849b0c1545383e4a9b6e08172890/violent_python/Introduction/iteration.py
--------------------------------------------------------------------------------
/violent_python/Introduction/socket_test.py:
--------------------------------------------------------------------------------
1 | import socket
2 |
3 |
4 | socket.setdefaulttimeout(2)
5 | s = socket.socket()
6 | s.connect(("192.168.95.148", 21))
7 | ans = s.recv(1024)
8 | print ans
--------------------------------------------------------------------------------
/violent_python/Introduction/socket_test.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/reconSF/python/1fea830fcf7b849b0c1545383e4a9b6e08172890/violent_python/Introduction/socket_test.pyc
--------------------------------------------------------------------------------
/violent_python/Port_Scanner.py:
--------------------------------------------------------------------------------
1 | import nmap
2 | import optparse
3 |
4 | def nmapScan(tgtHost, tgtPort):
5 | nmScan = nmap.PortScanner()
6 | nmScan.scan(tgtHost, tgtPort)
7 | state = nmScan[tgtHost]['tcp'][int(tgtPort)]['state']
8 | print " [+] " + tgtHost + " tcp/" + tgtPort + " " + state
9 |
10 | def main():
11 | parser = optparse.OptionParser('usage%prog ' + \
12 | '-H -p ')
13 | parser.add_option('-H', dest='tgtHost', type='string', \
14 | help='specify target host')
15 | parser.add_option('-p', dest='tgtPort', type='string', \
16 | help='specify target port')
17 | help = 'specify target port[s] seperated by /'
18 | (options, args) = parser.parse_args()
19 | tgtHost = options.tgtHost
20 | tgtPorts = str(options.tgtPort).split("/")
21 |
22 | if (tgtHost == None) | (tgtPorts[0] == None):
23 | print parser.usage
24 | exit(0)
25 | for tgtPort in tgtPorts:
26 | nmapScan(tgtHost, tgtPort)
27 |
28 | if __name__ == '__main__':
29 | main()
--------------------------------------------------------------------------------
/violent_python/network_analysis/printGeo.py:
--------------------------------------------------------------------------------
1 | import pygeoip
2 |
3 | gi = pygeoip.GeoIP('/opt/GeoIP/Geo.dat')
4 | def printRecord(tgt):
5 | rec = gi.record_by_name(tgt)
6 | city = rec['city']
7 | region = rec['region_name']
8 | country = rec['country_name']
9 | long = rec['longitude']
10 | lat = rec['latitude']
11 | print '[*] Target: ' + tgt + ' Geo-located. '
12 | print '[+] ' + str(city) + ', ' + str(region) + ', ' + str(country)
13 | print '[+] Latitude: ' + str(lat) + ', Longitude: ' + str(long)
14 |
15 | tgt = '173.255.226.98'
16 | printRecord(tgt)
--------------------------------------------------------------------------------
/violent_python/sniff/google-searches.py:
--------------------------------------------------------------------------------
1 | import optparse
2 | from scapy.all import *
3 |
4 | def findGoogle(pkt):
5 | if pkt.haslayer(Raw):
6 | payload = pkt.getlayer(Raw).load
7 | if 'GET' in payload:
8 | if 'google' in payload:
9 | r = re.findall(r'(?i)\&q=(.*?)\&', payload)
10 | if r:
11 | search = r[0].split('&')[0]
12 | search = search.replace('q=', '').\
13 | replace('+', ' ').replace('%20', ' ')
14 | print '[+] Searched For: ' + search
15 |
16 |
17 | def main():
18 | parser = optparse.OptionParser('usage %prog -i '+\
19 | '')
20 | parser.add_option('-i', dest='interface', \
21 | type='string', help='specify interface to listen on')
22 | (options, args) = parser.parse_args()
23 | if options.interface == None:
24 | print parser.usage
25 | exit(0)
26 | else:
27 | try:
28 | conf.iface = options.interface
29 | print '[*] Starting Google Sniffer.'
30 | sniff(filter='tcp port 80', prn=findGoogle)
31 | except KeyboardInterrupt:
32 | exit(0)
33 |
34 |
35 | if __name__ == '__main__':
36 | main()
--------------------------------------------------------------------------------
/violent_python/sniff/test-sniff.py:
--------------------------------------------------------------------------------
1 | from scapy.all import *
2 |
3 | def pktPrint(pkt):
4 | if pkt.haslayer(Dot11Beacon):
5 | print '[+] Detected 802.11 Beacon Frame'
6 | elif pkt.haslayer(Dot11ProbeReq):
7 | print '[+] Detected 802.11 Probe Request Frame'
8 | elif pkt.haslayer(TCP):
9 | print '[+] Detected a TCP Packet'
10 | elif pkt.haslayer(DNS):
11 | print '[+] Detected a DNS Packet'
12 |
13 | conf.iface = 'mon0'
14 | sniff(prn=pktPrint)
--------------------------------------------------------------------------------
/violent_python/sqlite3/printProfile.py:
--------------------------------------------------------------------------------
1 | import sqlite3
2 |
3 | def printProfile(lmbcDB):
4 | conn = sqlite3.connect(lmbcDB)
5 | c = conn.cursor()
6 | c.execute("SELECT fname, lname, username, mID FROM User;")
7 | for row in c:
8 | print '[*] -- User Found --'
9 | print '[+] User: ' + str(row[0]) + " " + str(row[1])
10 | print '[+] Username: ' + str(row[2])
11 | print '[+] mID: ' + str(row[3])
12 | print ''
13 | def main():
14 | lmbcDB = '/root/Code/flasklm/app.db'
15 | printProfile(lmbcDB)
16 |
17 | if __name__ == '__main__':
18 | main()
--------------------------------------------------------------------------------
/violent_python/ssh_botnet/sshConnect.py:
--------------------------------------------------------------------------------
1 | import pexpect
2 |
3 | PROMPT = ['# ', '>>> ', '> ', '. ', '\$ ']
4 |
5 | def send_command(child, cmd):
6 | child.sendline(cmd)
7 | child.expect(PROMPT)
8 | print child.before
9 |
10 | def connect(user, host, password):
11 | ssh_newkey = 'Are you sure you want to continue before connecting?'
12 | connStr = 'ssh ' + user + '@' + host
13 | child = pexpect.spawn(connStr)
14 | ret = child.expect([pexpect.TIMEOUT, ssh_newkey, \
15 | '[P|p]assword:'])
16 | if ret == 0:
17 | print '[-] Error Connecting'
18 | return
19 | if ret == 1:
20 | child.sendline('yes')
21 | ret = child.expect([pexpect.TIMEOUT, \
22 | '[P|p]assword:'])
23 | if ret == 0:
24 | print '[-] Error Connecting'
25 | return
26 | child.sendline(password)
27 | child.expect(PROMPT)
28 | return child
29 |
30 | def main():
31 | host = 'localhost'
32 | user = 'root'
33 | password = 'T1ger5..,.'
34 | child = connect(user, host, password)
35 | send_command(child, 'cat /etc/shadow | grep root')
36 |
37 | if __name__ == '__main__':
38 | main()
--------------------------------------------------------------------------------